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

Translate Spring 6 HTTP spans to Stackdriver convention #229

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shakuzen
Copy link
Member

From Spring Cloud Sleuth to Spring Framework 6, the tags on HTTP spans produced changed. This updates the SpanTranslator to handle the Spring 6 tags.

Resolves #228

From Spring Cloud Sleuth to Spring Framework 6, the tags on HTTP spans changed. This updates the SpanTranslator to handle the Spring 6 tags.
Comment on lines +96 to +101
braveSpan.tags().forEach((key, value) -> {
if (SPRING6_RENAMED_HTTP_LABELS.containsKey(key)) {
spanBuilder.getAttributesBuilder()
.putAttributeMap(SPRING6_RENAMED_HTTP_LABELS.get(key), toAttributeValue(value));
}
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would just do a for loop here instead of the .stream().forEach(...) shortcut.
If you want to keep the Stream API, I think it would be a bit more natural to move the check to a .filter(...).

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

Successfully merging this pull request may close these issues.

Spring 6 labels not translated correctly in SpanTranslator
2 participants