-
Notifications
You must be signed in to change notification settings - Fork 873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kafka Client: traceparent not detected / not correctly propagated #4854
Comments
i guess this is a bug with io.opentelemetry.kafka-clients-0.11 |
Hey @leewoobin789 ,
|
Suppressing a specific type of spans is not unfortunately desired at all in our case.
and also the traceparent header received by payment-service was correct as expected but not the traceId in the log output
|
Okay, there is a span link in the CUSTOMER process span emitted by the paymentService:
This means that the context was propagated correctly. The instrumentation purposefully did not use it as the parent of the CONSUMER span, but instead attached it as a link; that is because OTel semantic conventions recommend using span links when you have separate CONSUMER spans for receiving and processing the message. |
ok i will try that out! :) |
yeah perfect! it works!!! |
Good question 😄 |
@mateuszrzeszutek |
Describe the bug
For the sake of demo, i have created 3 services that are communication to each other over kafka.
A NodeJs service ("orderService") sends a kafka message ("order"), which is consumed by both Vertx-Java-Application ("reportingService") and Sprint-Application ("paymentService")
What i found out in this case is that the instrumentation for kafka client with vertx was perfectly done with the same traceId but in the other consumer of spring application, i se basically another traceId beding generated. it indicates that the traceparent header of kafka message is not being detected in spring-application, where i used KafkaListener.
orderService =order topic=> reportingService(perfect) & reportingService(defect)
Steps to reproduce
- orderService [NodeJs]
InstrumentationLibrary opentelemetry-instrumentation-kafkajs 0.26.1
Span #0
Trace ID : 1ee56906e5b2bde4368e859b18050996
Parent ID : 94e75fb3091d0010
ID : 4ac7496ef8c3a2c7
Name : order
Kind : SPAN_KIND_PRODUCER
Start time : 2021-12-09 13:35:56.95997824 +0000 UTC
End time : 2021-12-09 13:35:56.963647232 +0000 UTC
Status code : STATUS_CODE_UNSET
Status message :
Attributes:
-> messaging.system: STRING(kafka)
-> messaging.destination: STRING(order)
-> messaging.destination_kind: STRING(topic)
- reportingService [Vertx Java]
SpanLink #0
-> Trace ID: 1ee56906e5b2bde4368e859b18050996
-> ID: 4ac7496ef8c3a2c7
-> TraceState:
-> DroppedAttributesCount: 0
InstrumentationLibrarySpans #1
InstrumentationLibrary io.vertx
Span #0
Trace ID : 1ee56906e5b2bde4368e859b18050996
Parent ID : 7440fb0a7651441f
ID : 7e16eb5654698647
Name : send
Kind : SPAN_KIND_CLIENT
Start time : 2021-12-09 13:35:56.965394055 +0000 UTC
End time : 2021-12-09 13:35:56.965542188 +0000 UTC
Status code : STATUS_CODE_UNSET
Status message :
Attributes:
-> thread.name: STRING(vert.x-eventloop-thread-0)
-> thread.id: INT(22)
-> message_bus.destination: STRING(reporting.vertx.first.worloads.addr)
Span #1
Trace ID : 1ee56906e5b2bde4368e859b18050996
Parent ID : 7440fb0a7651441f
ID : 5445462bbc1f12e4
Name : send
Kind : SPAN_KIND_CLIENT
Start time : 2021-12-09 13:35:56.965582978 +0000 UTC
End time : 2021-12-09 13:35:56.965667008 +0000 UTC
Status code : STATUS_CODE_UNSET
Status message :
Attributes:
-> thread.name: STRING(vert.x-eventloop-thread-0)
-> thread.id: INT(22)
-> message_bus.destination: STRING(reporting.vertx.second.worloads.addr)
Span #2
Trace ID : 1ee56906e5b2bde4368e859b18050996
Parent ID : 4ac7496ef8c3a2c7
ID : 7440fb0a7651441f
Name : kafka_receive
Kind : SPAN_KIND_CONSUMER
Start time : 2021-12-09 13:35:56.964979 +0000 UTC
End time : 2021-12-09 13:35:56.965681383 +0000 UTC
Status code : STATUS_CODE_UNSET
Status message :
Attributes:
-> thread.name: STRING(vert.x-eventloop-thread-0)
-> peer.port: STRING(9092)
-> peer.address: STRING(demo-kafka-cp-kafka:9092)
-> peer.hostname: STRING(demo-kafka-cp-kafka)
-> peer.service: STRING(kafka)
-> thread.id: INT(22)
-> message_bus.destination: STRING(order)
Span #3
Trace ID : 1ee56906e5b2bde4368e859b18050996
Parent ID : 5445462bbc1f12e4
ID : 473de02c726afe63
Name : send
Kind : SPAN_KIND_SERVER
Start time : 2021-12-09 13:35:56.96578 +0000 UTC
End time : 2021-12-09 13:35:57.967911815 +0000 UTC
Status code : STATUS_CODE_UNSET
Status message :
Attributes:
-> thread.name: STRING(vert.x-eventloop-thread-1)
-> thread.id: INT(24)
-> message_bus.destination: STRING(reporting.vertx.second.worloads.addr)
Span #4
Trace ID : 1ee56906e5b2bde4368e859b18050996
Parent ID : 7e16eb5654698647
ID : 76a5d851cc9ded97
Name : send
Kind : SPAN_KIND_SERVER
Start time : 2021-12-09 13:35:56.965809 +0000 UTC
End time : 2021-12-09 13:35:57.968290501 +0000 UTC
Status code : STATUS_CODE_UNSET
Status message :
Attributes:
-> thread.name: STRING(vert.x-eventloop-thread-0)
-> thread.id: INT(22)
-> message_bus.destination: STRING(reporting.vertx.first.worloads.addr)
- paymentService[Spring Java]
InstrumentationLibrary io.opentelemetry.kafka-clients-0.11 1.7.2
Span #0
Trace ID : 352e1e2dbda022838fcd7df0e57366bd
Parent ID :
ID : 3dab64a6cc1fde2d
Name : order receive
Kind : SPAN_KIND_CONSUMER
Start time : 2021-12-09 13:35:54.319613 +0000 UTC
End time : 2021-12-09 13:35:56.964710077 +0000 UTC
Status code : STATUS_CODE_UNSET
Status message :
Attributes:
-> thread.name: STRING(payment-service-0-C-1)
-> messaging.operation: STRING(receive)
-> messaging.destination: STRING(order)
-> thread.id: INT(20)
-> messaging.system: STRING(kafka)
-> messaging.destination_kind: STRING(topic)
Span #1
Trace ID : 352e1e2dbda022838fcd7df0e57366bd
Parent ID : 3dab64a6cc1fde2d
ID : ceda32efd081b027
Name : order process
Kind : SPAN_KIND_CONSUMER
Start time : 2021-12-09 13:35:56.964873 +0000 UTC
End time : 2021-12-09 13:35:57.967409404 +0000 UTC
Status code : STATUS_CODE_UNSET
Status message :
Attributes:
-> thread.name: STRING(payment-service-0-C-1)
-> messaging.operation: STRING(process)
-> messaging.destination: STRING(order)
-> messaging.message_payload_size_bytes: INT(58)
-> thread.id: INT(20)
-> messaging.system: STRING(kafka)
-> messaging.destination_kind: STRING(topic)
-> messaging.kafka.partition: INT(0)
What did you expect to see?
Same TraceId, sothat the end-to-end correlation is visible.
What did you see instead?
Different TraceId in Spring application. it was also same case in kafka connect.
What version are you using?
v1.7.2
Environment
Compiler: OpenJDK11
OS: Ubuntu 20.04
Runtime (if different from JDK above): openjdk:11-jdk
OS (if different from OS compiled on): Kubernetes (Kind)
Additional context
Nothing more
The text was updated successfully, but these errors were encountered: