-
Notifications
You must be signed in to change notification settings - Fork 48
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
PostgresSubscribableChannel - traceId and spanId are not added to log #612
Comments
This might be caused by the instrumentation in Spring Integration. Could you please open an issue against that repo? .handle(message -> {
//traceId and spanId is not added to this log
log.info("Event received: {}", message.getPayload());
processMessage(message);
}) You try to get the current observation from the |
/cc @artembilan |
Let’s see if |
Well, after looking into the code this morning, I realize that
This way an observation is going to be restored from those headers before your code is called. Please, raise an issue in https://github.com/spring-projects/spring-integration, so we will look into a proper propagation via that (and similar persistent) message channel. Thanks |
Thank you for your answers. @jonatan-ivanov when I added @artembilan I followed your advice but unfortunately it didn't work, traceId and spanId still are not logged. I will raise an issue as you suggested and create a reproducer. |
Apparently the problem is not so simple, so created a respective issue for propagation revisiting: spring-projects/spring-integration#9001. For now it should work as:
|
So, apparently there is some race condition with Java DSL and management configurer bean post-processor (I'll investigate that separately). It sounds like we just need to mention in Spring Integration docs how to propagate an observation (tracing, essentially) over this kind of persistent channel. |
OK. Figured out what is going on with Java DSL. I know: this feels like issue hijacking, but I wanted to close all the gaps before we move on 😄 |
@artembilan thank you for solving this issue and sending a working example. I tested it in my app. After sending the message to the messageChannel it was stored to postgres then the new handler was notified about the message. It works as expected the traceId and spanId are propagated and restored in log. Thanks :)👍 |
I have an application that uses
PostgresSubscribableChannel
to receive notifications from postgresql.When a new message is received it contains traceId and spanId in
message.getHeaders()
, but are not visible in log message. What am I missing in my configuration?Versions I am working with:
Configuration
Message listener
The text was updated successfully, but these errors were encountered: