fix: use DD_SERVICE for inferred spans when integration service names are removed#834
Draft
zarirhamza wants to merge 6 commits into
Draft
fix: use DD_SERVICE for inferred spans when integration service names are removed#834zarirhamza wants to merge 6 commits into
zarirhamza wants to merge 6 commits into
Conversation
When DD_SERVICE (config.service) is set, use it as the service for inferred (synthetic) spans, taking precedence over DD_SERVICE_MAPPING and the AWS service representation. When DD_SERVICE is unset, the existing resolution logic is preserved.
|
The inferred-span and service-mapping tests assert the AWS service representation, which only applies when DD_SERVICE is unset. CI sets DD_SERVICE, so pin config.service to None to keep them deterministic.
Verify create_inferred_span uses DD_SERVICE as the service (over an explicit service mapping) when DD_SERVICE is set.
Inferred (synthetic) spans now use DD_SERVICE (integration-tests-python) as their service instead of the AWS service representation, so the redundant _dd.base_service tag is dropped on those spans. Regenerated via UPDATE_SNAPSHOTS for all Python versions.
1 task
…moved Gate the DD_SERVICE inferred-span service resolution behind DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED: when enabled (and DD_SERVICE is set), inferred (synthetic) spans use the base service name instead of the AWS resource/instance representation. Default behavior (flag off) is unchanged, so integration snapshots match main. Reverts the earlier unconditional DD_SERVICE-first and experimental peer.service / span.kind changes.
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.
Summary
DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED=trueandDD_SERVICEis set, inferred (synthetic) spans use the base service name (DD_SERVICE) instead of the AWS resource/instance representation.DD_SERVICE_MAPPINGentry still takes precedence overDD_SERVICE.config.aws_service_representation_enabled(DD_TRACE_AWS_SERVICE_REPRESENTATION_ENABLED, default true) andconfig.remove_integration_service_names_enabled(DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED, default false).Resolution order in
determine_service_nameDD_SERVICE_MAPPING(specific key, then generic key)DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLEDandDD_SERVICEset →DD_SERVICEMotivation
Part of the Serverless Service Representation (SSR) work. The flag lets inferred spans collapse onto the function's base service when integration-specific service names are turned off, while keeping the resource-name behavior by default.
Test plan
tests/test_tracing.py(TestServiceMapping + inferred-span tests) pass with and withoutDD_SERVICE/ the flag