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

Open
rafal-dudek opened this issue Oct 31, 2024 · 2 comments · May be fixed by #229
Open

Spring 6 labels not translated correctly in SpanTranslator #228

rafal-dudek opened this issue Oct 31, 2024 · 2 comments · May be 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.

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