-
Notifications
You must be signed in to change notification settings - Fork 440
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
[wip] [serverless] Add S3 span pointers #3083
base: main
Are you sure you want to change the base?
Conversation
Datadog ReportBranch report: ❌ 7 Failed (0 Known Flaky), 5173 Passed, 71 Skipped, 2m 35.76s Total Time ❌ Failed Tests (7)
|
BenchmarksBenchmark execution time: 2025-01-14 20:17:40 Comparing candidate commit 02da8e3 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 1 unstable metrics. |
51071ce
to
98a1df8
Compare
span_pointers.HandleS3Operation(in, out, span) | ||
} | ||
|
||
span.Finish() |
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.
the aws span should live until we receive a response, not when the request is sent. (this is how AWS spans work in other tracers)
From my testing this has barely any actual impact on the span end time (does anyone know why? I'd expect there to be a big difference?)
Therefore, I'm moving span.Finish()
to deserialize
. I also had to do this to get unit tests to pass
682ef0f
to
9790821
Compare
What does this PR do?
Adds span pointers in S3 for
putObject
,copyObject
, andcompleteMultipartUpload
requests.Span pointers are similar to Span Links, but for cases when it is impossible to pass the Trace ID and Span ID between the spans that need to be linked.
The changes in this tracer handle the 'upstream' case, for when a Lambda/EC2 instance/anything else using the tracer makes an S3 request. The changes in this PR in the serverless agent handles the 'downstream' case, for when a Lambda is triggered by an S3 update.
Both sides calculate a unique hash for the S3 update. When the calculated hashes for the upstream and downstream sides match, the Datadog backend will automatically link the two traces together.
When clicking on the linked span, a new tab opens linking to the downstream Lambda function that was triggered by this S3 object update. When the link in the downstream Lambda is clicked, it links back to the upstream trace.
Motivation
This is a new feature the Serverless team is implementing in every Lambda runtime.
Reviewer's Checklist
v2-dev
branch and reviewed by @DataDog/apm-go.Unsure? Have a question? Request a review!