Skip to content
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

S3 Downstream Span Pointers #503

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

Conversation

nhulston
Copy link
Contributor

@nhulston nhulston commented Dec 26, 2024

What does this PR do?

Adds span pointers to spans for Lambdas triggered by S3 putObject, copyObject, and completeMultipartUpload events. This change will affect the downstream case for Universal Instrumentation Lambda runtimes (Java, .NET, Golang).

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.

When the calculated hashes for the upstream and downstream lambdas match, the Datadog backend will automatically link the two traces together.

IMAGES WILL GO HERE
When clicking on the linked span, a new tab opens linking to the downstream Lambda function that was triggered by this S3 object update.

Describe how you validated your changes

Mostly manual testing, but I also added unit tests.

To verify my changes, there are two ways.

Easy: Checkout this span.

More thorough: Run this Lambda function (only on the serverless AWS account) with the event payload

{
  "shouldPutObject": false,
  "shouldCopyObject": false,
  "shouldMultipartUpload": false
}

and change one of the bools to true. Check Datadog to ensure that the spans are properly linked.

I also added unit tests:

cargo test test_generate_span_pointer_hash
cargo test test_get_span_pointers
cargo test test_span_pointer_processing

Additional Notes

  • This handles the 'downstream' case, for Lambdas that are triggered S3 requests. I will have another PR in each tracer to handle the 'upstream' case. Java PR here
  • S3 and Dynamo are supported in Python+Node. I will soon open another PR in this tracer to add support for Dynamo.

@nhulston nhulston force-pushed the nicholas.hulston/s3-downstream-span-pointers branch 2 times, most recently from f1aef49 to d8bb715 Compare December 26, 2024 21:32
@nhulston nhulston force-pushed the nicholas.hulston/s3-downstream-span-pointers branch from d8bb715 to ce96e8a Compare December 26, 2024 22:30
@nhulston nhulston force-pushed the nicholas.hulston/s3-downstream-span-pointers branch from ce96e8a to 1553895 Compare December 26, 2024 22:33
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.

1 participant