RUMM-2503 Support rulePsr
for APM traffic ingestion
#1028
Closed
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.
What and why?
📦 This PR sets the
rulePsr
attribute in RUM resource with the trace sample rate configured in the SDK. This is to provide users with visibility into what APM settings are configured at the SDK level and how much of the traffic is ingested.The value gets displayed on the APM Ingestion Control page:
To support passing this value from cross-platform SDKs,
_dd.rule_psr
internal attribute is implemented - as counterpart of recent Android proposal: DataDog/dd-sdk-android#1092.How?
Trace sample rate value is passed from
URLSessionInterceptor
all the way down toRUMResourceScope
. This is achieved with existingRUMSpanContext
transported in "start resource" command.Cross-platform SDKs should use
_dd.rule_psr
attribute (passed in any resource-related API, e.g. "stop resource"):🏕️ I also made small cleanup in
RUMResourceScopeTests
by removing unnecessary configuration in some of them. The new behaviour is now asserted with 2 new tests - instead of bloating configuration and assertion in previous ones.Review checklist
Custom CI job configuration (optional)