-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Add local and tag correlation fields #37435
Add local and tag correlation fields #37435
Conversation
@adispezo Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@adispezo Thank you for signing the Contributor License Agreement! |
...main/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfiguration.java
Outdated
Show resolved
Hide resolved
...main/java/org/springframework/boot/actuate/autoconfigure/tracing/BraveAutoConfiguration.java
Outdated
Show resolved
Hide resolved
Hello, thanks for the PR! I've added some comments. |
Hey @adispezo , thanks for the changes! I'll get some feedback from the observability team on the local field change in Brave and then come back to you. |
Looks good, thank you! Note to the boot team: when merging, we need something like this for OpenTelemetry, too. |
There's no way to do it easily with OTel. What currently is being done is that all baggage gets extracted / injected (e.g.https://github.com/open-telemetry/opentelemetry-java/blob/main/api/all/src/main/java/io/opentelemetry/api/baggage/propagation/W3CBaggagePropagator.java#L50). We would need to wrap their baggage propagation mechanism into our one that would modify the current baggage not to contain local keys and then delegate to their code. |
Hm :( In this case, we won't support local fields when using OpenTelemetry. We could issue a log WARN statement if local fields are configured and OTel is used. |
I have some polished changes and tagged fields for Otel here: https://github.com/mhalbritter/spring-boot/tree/pr/37435 |
Before merging this, #38724 needs to be considered. |
Local fields only work in Brave and not with OpenTelemetry. Tagged fields work both with Brave and with OpenTelemetry. See gh-37435
Merged, thank you. To accommodate the changes from #38724, i had to refactor a bit. |
Hi |
Yes, this should work. If it doesn't, please open a new issue with a small reproducer. Thanks! |
Thanks @mhalbritter ! |
Works with both tracers. See the Otel configuration here. |
Currently with the following config example it's not possible to use BaggageField.getByName, BaggageField.updateValue for example.
Only the "some_remote_field" can be retrieved and updated.
With the code proposed also the "local" correlation fields will be accessible.