-
Notifications
You must be signed in to change notification settings - Fork 909
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
Auto-Instrumentation across Message Queue (RabbitMQ): traceId lost in subsequent spans #2822
Comments
Javaagent 0.14.0 only supports OTel API & annotations 0.14.0. Can you try using javaagent with the same version as the annotations extension? |
Sorry, it's Javaagent 1.0.0, I mistyped the version. |
Can you share the code responsible for consuming the message ( |
Sorry for the late reply, here's the small app that can reproduce the issue. It's a simple sign-up/sign-in demo app. After a sign-up request succeeds, the log shows: The whole sequence of the Sign-Up request is As shown in the @Slf4j
@Configuration
public class SignUpHandler {
public static final String QUEUE = "queue";
private final RestTemplate restTemplate = new RestTemplate();
@Bean
public Queue queue() {
return new Queue(QUEUE);
}
@RabbitListener(queues = QUEUE)
public void handle(String signUpUserId) {
int id = Integer.parseInt(signUpUserId);
User user = restTemplate.getForEntity("http://localhost:8080/api/users/" + id, User.class).getBody();
log.info("Handle sign-up: {}", user);
}
} |
I see - Thanks for the example! It should make tracking this down much easier. |
Hi is there anything new/workaround to fix this issue? Thanks |
Sorry, we don't have any news on this yet 🙇♂️ |
Appreciate!! I'm just gonna demonstrate this in the next week, now the cool asynchronous trace can be shown to the people. |
Describe the bug
Say,
A
passes a message toB
via a message queue (RabbitMQ)The message's consumer
B
invokesC
and thenC
invokesD
to handle the message. (C
andD
are annotated with@WithSpan
)Then I should see the trace has
A -> B -> C -> D
, instead I only seeA -> B
(Furthermore, in
C
andD
's logs, thetrace_id
value is lost)I can confirm that I can find the
traceparent
header included as the message's header, butthe auto-instrumentation doesn't use the same
traceparent
as the traceId for the subsequent spans (C, D
)Is this a feature or a bug?
How do I have
A --(message queue)--> B -> C -> D
traced so that I can see more clearly into asynchronous flows?What version are you using?
opentelemetry-api: 1.0.0
opentelemetry-extension-annotations: 1.0.0
opentelemetry-javaagent: 1.0.0
org.springframework.boot: 2.4.3
spring-boot-starter-amqp: 2.3.2.RELEASE
Environment
Compiler/Runtime: AdoptOpenJDK 11.0.9
OS: macOS 10.15.5
The text was updated successfully, but these errors were encountered: