-
Notifications
You must be signed in to change notification settings - Fork 13
fix(apm): Enhance Synthetic Span Service Representation #751
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances synthetic span service representation to improve Serverless Service Map functionality by aligning with tracer behavior. It implements a configurable service naming strategy that defaults to using instance-specific names instead of generic AWS service names, while maintaining backwards compatibility through an environment variable.
Key Changes:
- Modify service naming to use instance names (e.g., lambda function name, S3 bucket name) as service names instead of generic AWS service names
- Add environment variable
DD_TRACE_AWS_SERVICE_REPRESENTATION_ENABLED
to control this behavior (opt-out when set to "false") - Add
span.kind:server
tag to synthetic spans and remove_dd.base_service
tags to prevent unintentional service overrides
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
bottlecap/src/lifecycle/invocation/triggers/mod.rs | Add service name resolution logic with environment variable support and instance name fallback |
bottlecap/src/lifecycle/invocation/processor.rs | Update main processor to use new service naming strategy and add span.kind tag |
bottlecap/src/lifecycle/invocation/span_inferrer.rs | Add span.kind:server tag to inferred spans |
bottlecap/src/traces/trace_processor.rs | Remove _dd.base_service tag from spans to prevent service override |
bottlecap/tests/service_naming_test.rs | Add comprehensive tests for new service naming behavior |
Various trigger event files | Update all trigger implementations to use new service resolution signature |
bottlecap/tests/payloads/eventbridge_span.json | Update test payload to reflect new service naming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM – just left a comment!
What does this PR do?
Rollout of span naming changes to align serverless product with tracer to create streamlined Service Representation for Serverless
Key Changes:
Change service name to match instance name for all managed services (aws.lambda -> lambda name, etc) (breaking)
Opt out via
DD_TRACE_AWS_SERVICE_REPRESENTATION_ENABLED
Add
span.kind:server
on synthetic spans made via span-inferrer, cold start and lambda invocation spansRemove
_dd.base_service
tags on synthetic spans to avoid unintentional service overrideMotivation
Improve Service Map for Serverless. This allows for synthetic spans to have their own service on the map which connects with the inferred spans from the tracer side.