Only root span gets AppD attributes set#2247
Merged
breedx-splk merged 4 commits intosignalfx:mainfrom Mar 25, 2025
Merged
Conversation
laurit
reviewed
Mar 24, 2025
| if (ctx.getTierId() != null) { | ||
| span.setAttribute(APPD_ATTR_TIER, ctx.getTierId()); | ||
| // Set attributes only for the root span | ||
| if (span.getParentSpanContext() == null) { |
Collaborator
There was a problem hiding this comment.
I suspect this is not what you really want. Instead of the root span you want the local root span, the first span in the trace for this service. Secondly can span.getParentSpanContext() be null at all? I'd guess that it would return an invalid span context (trace and span id are all zeros) instead. For ideas see https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/8b7e4f2bedc08cdcda2629b2b486bc9b8fd40851/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/LocalRootSpan.java#L49
Contributor
Author
There was a problem hiding this comment.
Great suggestion. Thanks!
laurit
approved these changes
Mar 25, 2025
breedx-splk
approved these changes
Mar 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As mentioned in signalfx/gdi-specification#338, 4 AppD context headers should be transferred into corresponding span attributes only for the root span.
Related to #2198