Skip to content
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

Spring 6 labels not translated correctly in SpanTranslator #228

Closed
rafal-dudek opened this issue Oct 31, 2024 · 6 comments · Fixed by #229
Closed

Spring 6 labels not translated correctly in SpanTranslator #228

rafal-dudek opened this issue Oct 31, 2024 · 6 comments · Fixed by #229
Labels

Comments

@rafal-dudek
Copy link

Describe the Bug

Since Spring 6 (Spring Boot 3), it is using micrometer-observation and own classes for Observation (Tracing).
In those versions the names of tags are changed.

E.g. There are labels "method" and "status":
https://github.com/spring-projects/spring-framework/blob/main/spring-web/src/main/java/org/springframework/http/server/observation/ServerHttpObservationDocumentation.java#L61-L77

In Spring 5 with Sleuth/OpenTracing there were "http.method" and "http.status_code" labels:
https://github.com/opentracing/opentracing-java/blob/master/opentracing-api/src/main/java/io/opentracing/tag/Tags.java#L56-L61

Zipkin-gcp provides SpanTranslator to translate those names to GCP Tracing convention:
https://github.com/openzipkin/zipkin-gcp/blob/master/translation-stackdriver/src/main/java/zipkin2/translation/stackdriver/SpanTranslator.java#L27-L36

Unfortunately, it works correctly only with Spring 5 (Spring Boot 2.X) and does not translate new labels.

The result is that after updating to Spring 6 the status code and method are treated as custom labels and are not assigned to special fields "Status" and "Method" e.g. their values ​​are no longer visible in the summary table.

Expected Behaviour

SpanTranslator should translate new labels names from Spring 6.

@shakuzen
Copy link
Member

shakuzen commented Nov 7, 2024

Thanks for raising the issue. Since method and status are not necessarily specific to HTTP, there should probably be some additional logic to ensure the translation only happens on HTTP spans. Would anyone be willing to submit a pull request?

@shakuzen
Copy link
Member

I opened #229 for this.

@shakuzen
Copy link
Member

shakuzen commented Dec 2, 2024

@rafal-dudek with the fix now merged, would you be able to try out snapshots before we cut a release?

@rafal-dudek
Copy link
Author

@shakuzen Method and Status work correctly with the snapshot:
image
image

@shakuzen
Copy link
Member

shakuzen commented Dec 3, 2024

@rafal-dudek thanks for testing and letting us know. I'll work on a release tomorrow then.

@shakuzen
Copy link
Member

shakuzen commented Dec 5, 2024

2.2.6 is released now with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants