Skip to content

Commit 7b03c8a

Browse files
committed
Fix the problem
1 parent 257c435 commit 7b03c8a

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

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

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

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

8-
import static java.util.Collections.unmodifiableList;
9-
108
import io.opentelemetry.api.common.AttributeKey;
119
import java.util.List;
12-
import java.util.Locale;
1310
import java.util.concurrent.ConcurrentHashMap;
1411
import java.util.concurrent.ConcurrentMap;
15-
import java.util.stream.Collectors;
1612

1713
final class CapturedMessageHeadersUtil {
1814

1915
private static final ConcurrentMap<String, AttributeKey<List<String>>> attributeKeysCache =
2016
new ConcurrentHashMap<>();
2117

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-
2718
static AttributeKey<List<String>> attributeKey(String headerName) {
2819
return attributeKeysCache.computeIfAbsent(headerName, n -> createKey(n));
2920
}
3021

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

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
1414
import io.opentelemetry.instrumentation.api.internal.SpanKey;
1515
import io.opentelemetry.instrumentation.api.internal.SpanKeyProvider;
16+
import java.util.ArrayList;
1617
import java.util.List;
1718
import javax.annotation.Nullable;
1819

@@ -85,7 +86,7 @@ public static <REQUEST, RESPONSE> MessagingAttributesExtractorBuilder<REQUEST, R
8586
List<String> capturedHeaders) {
8687
this.getter = getter;
8788
this.operation = operation;
88-
this.capturedHeaders = CapturedMessageHeadersUtil.lowercase(capturedHeaders);
89+
this.capturedHeaders = new ArrayList<>(capturedHeaders);
8990
}
9091

9192
@Override

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public final class MessagingAttributesExtractorBuilder<REQUEST, RESPONSE> {
3030
* Configures the messaging headers that will be captured as span attributes.
3131
*
3232
* <p>The messaging header values will be captured under the {@code messaging.header.<name>}
33-
* attribute key. The {@code <name>} part in the attribute key is the normalized header name:
34-
* lowercase, with dashes replaced by underscores.
33+
* attribute key. The {@code <name>} part in the attribute key is the header name with dashes
34+
* replaced by underscores.
3535
*
3636
* @param capturedHeaders A list of messaging header names.
3737
*/

0 commit comments

Comments
 (0)