Skip to content

Enhance Synthetic Span Service Representation #655

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

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

zarirhamza
Copy link

@zarirhamza zarirhamza commented May 21, 2025

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)
  • Add span.kind:server on synthetic spans made via span-inferrer

Motivation

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.

Testing Guidelines

Unit and Integration tests updated accordingly.

Note that any span w/span.kind tags are automatically measured
Matching the service name to the instance name essentially removes the need for a base_service tag in some instances due to essentially removing service overrides

Additional Notes

These changes should be synchronized with tracer changes (TBD)

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)

@zarirhamza zarirhamza marked this pull request as ready for review June 30, 2025 16:17
@zarirhamza zarirhamza requested review from a team as code owners June 30, 2025 16:17
@zarirhamza zarirhamza changed the title Enhance Synthetic Span Service Representation feat: fix service naming for serverless Jun 30, 2025
@zarirhamza zarirhamza changed the title feat: fix service naming for serverless feat: service naming for serverless Jun 30, 2025
@zarirhamza zarirhamza changed the title feat: service naming for serverless Enhance Synthetic Span Service Representation Jun 30, 2025
@@ -102,7 +103,7 @@ START
"start":XXXX,
"duration":XXXX,
"links": [],
"service": "aws.lambda",
"service": "integration-tests-js-XXXX-process-input-traced_node18",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good news. I'm fairly certain this change will not impact billing. Check out this method in dd-go https://github.com/DataDog/dd-go/blob/ba9638063271fa8bec5ce732d88ed0244795cca9/trace/apps/trace-spans-meta-extractor/usage_points.go. We look for a spans with name "aws.lambda" (not service or operation name) and create a billing metric point for each. I was worried this change in the service would impact that, but it looks like it won't.

Just to be sure, if you haven't already, check to make sure the datadog.serverless.traced_invocations metric is still created for each invocation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is span.name and operation.name not the same thing? As long as operation.name is unchanged, it should be fine as long as I'm understanding the code, the same way you are.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's my understanding as well. Still worth double checking by testing these changes in the wild though.

@zarirhamza zarirhamza marked this pull request as draft July 2, 2025 16:01
@zarirhamza zarirhamza marked this pull request as ready for review July 2, 2025 16:01
@zarirhamza
Copy link
Author

Going to wait for dd-trace-js version update to merge this changes with it and update the tracer dependency

@zarirhamza zarirhamza marked this pull request as draft July 2, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants