Skip to content

Commit af347db

Browse files
authored
Test mixed case header capture for kafka interceptors (#14529)
1 parent 6db0dc8 commit af347db

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ tasks {
3636
excludeTestsMatching("WrapperSuppressReceiveSpansTest")
3737
}
3838
jvmArgs("-Dotel.instrumentation.messaging.experimental.receive-telemetry.enabled=true")
39-
systemProperty("otel.instrumentation.messaging.experimental.capture-headers", "test-message-header")
39+
systemProperty("otel.instrumentation.messaging.experimental.capture-headers", "Test-Message-Header")
4040
}
4141

4242
check {

instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/java/io/opentelemetry/instrumentation/kafkaclients/v2_6/AbstractInterceptorsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void testInterceptors() throws InterruptedException {
5454
producerRecord
5555
.headers()
5656
// add header to test capturing header value as span attribute
57-
.add("test-message-header", "test".getBytes(StandardCharsets.UTF_8))
57+
.add("Test-Message-Header", "test".getBytes(StandardCharsets.UTF_8))
5858
// adding baggage header in w3c baggage format
5959
.add(
6060
"baggage",

instrumentation/kafka/kafka-clients/kafka-clients-2.6/library/src/test/java/io/opentelemetry/instrumentation/kafkaclients/v2_6/InterceptorsTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void assertTraces() {
4545
.hasParent(trace.getSpan(0))
4646
.hasAttributesSatisfyingExactly(
4747
equalTo(
48-
stringArrayKey("messaging.header.test_message_header"),
48+
stringArrayKey("messaging.header.Test_Message_Header"),
4949
singletonList("test")),
5050
equalTo(MESSAGING_SYSTEM, "kafka"),
5151
equalTo(MESSAGING_DESTINATION_NAME, SHARED_TOPIC),
@@ -70,7 +70,7 @@ void assertTraces() {
7070
.hasLinksSatisfying(links -> assertThat(links).isEmpty())
7171
.hasAttributesSatisfyingExactly(
7272
equalTo(
73-
stringArrayKey("messaging.header.test_message_header"),
73+
stringArrayKey("messaging.header.Test_Message_Header"),
7474
singletonList("test")),
7575
equalTo(MESSAGING_SYSTEM, "kafka"),
7676
equalTo(MESSAGING_DESTINATION_NAME, SHARED_TOPIC),
@@ -87,7 +87,7 @@ void assertTraces() {
8787
.hasLinks(LinkData.create(producerSpanContext.get()))
8888
.hasAttributesSatisfyingExactly(
8989
equalTo(
90-
stringArrayKey("messaging.header.test_message_header"),
90+
stringArrayKey("messaging.header.Test_Message_Header"),
9191
singletonList("test")),
9292
equalTo(MESSAGING_SYSTEM, "kafka"),
9393
equalTo(MESSAGING_DESTINATION_NAME, SHARED_TOPIC),

0 commit comments

Comments
 (0)