Skip to content

Commit afebd62

Browse files
committed
revert
1 parent fc68134 commit afebd62

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

instrumentation-api-incubator/src/main/java/io/opentelemetry/instrumentation/api/incubator/semconv/messaging/CapturedMessageHeadersUtil.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,31 @@
55

66
package io.opentelemetry.instrumentation.api.incubator.semconv.messaging;
77

8+
import static java.util.Collections.unmodifiableList;
9+
810
import io.opentelemetry.api.common.AttributeKey;
911
import java.util.List;
12+
import java.util.Locale;
1013
import java.util.concurrent.ConcurrentHashMap;
1114
import java.util.concurrent.ConcurrentMap;
15+
import java.util.stream.Collectors;
1216

1317
final class CapturedMessageHeadersUtil {
1418

1519
private static final ConcurrentMap<String, AttributeKey<List<String>>> attributeKeysCache =
1620
new ConcurrentHashMap<>();
1721

22+
static List<String> lowercase(List<String> names) {
23+
return unmodifiableList(
24+
names.stream().map(s -> s.toLowerCase(Locale.ROOT)).collect(Collectors.toList()));
25+
}
26+
1827
static AttributeKey<List<String>> attributeKey(String headerName) {
1928
return attributeKeysCache.computeIfAbsent(headerName, n -> createKey(n));
2029
}
2130

2231
private static AttributeKey<List<String>> createKey(String headerName) {
32+
// headerName is always lowercase, see MessagingAttributesExtractor
2333
String key = "messaging.header." + headerName.replace('-', '_');
2434
return AttributeKey.stringArrayKey(key);
2535
}

0 commit comments

Comments
 (0)