fix: problem getting the sampling priority#205
Merged
Conversation
duncanista
approved these changes
Jul 31, 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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TICKET: https://datadoghq.atlassian.net/browse/APMSVLS-135
Background/Motivation
datadog-lambda-go uses dd-trace-go as a dependency. In the release we set dependency dd-trace-go version as 1.72.1 but customers can freely use 1.73.x or 1.74.x etc.
In dd-trace-go 1.74.x, it acts as a shim wrapper to use dd-trace-go v2. And the SpanContext is actually stored in the adapter.
datadog-lambda-go by default uses a feature called
Universal Instrumentation. In short, at the beginning of a lambda invocation, it sends the event payload to the agent (extension) and let the agent create the root span. At the end of the invocation, it sends another request with the data about the span created using dd-trace-go back to the agent.Among the data is the
Sampling Priority, which is not accessible directly if the customer uses v1.74.x because it need to get the adapter first.What does this PR do?
SamplingPriority()failed, try get the sampling priority from the adapter.Testing Guidelines
Additional Notes
Types of changes
Checklist