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

feature: add distributed tracing (inferred spans) [SVLS-3154] #80

Merged
merged 52 commits into from
Oct 3, 2023

Conversation

duncanista
Copy link
Contributor

@duncanista duncanista commented Jun 26, 2023

What does this PR do?

Infer spans through the Datadog Lambda Extension.

The inferred services are:

  • API Gateway
Screenshot 2023-10-03 at 1 39 14 PM
  • Lambda URL (not working due to Extension serialization issue)
  • SQS
Screenshot 2023-10-03 at 1 38 36 PM
  • SNS
Screenshot 2023-10-03 at 1 44 13 PM
  • Kinesis
Screenshot 2023-10-03 at 1 39 34 PM
  • EventBridge (not working due to Extension serialization issue)
  • S3
Screenshot 2023-10-03 at 1 40 01 PM
  • DynamoDB
Screenshot 2023-10-03 at 1 40 14 PM
  • SNS-SQS
Screenshot 2023-10-03 at 1 38 00 PM

HTTP Propagation:
Screenshot 2023-10-03 at 1 37 00 PM

Motivation

Ruby is the only language where we don't have support for this (yet).

Testing Guidelines

  • Added unit tests for some methods, since most of the span generation is done through the extension.
  • Tested manually to see infer span generation.

Additional Notes

  • Trace propagation needs to be done at the Tracer level.
  • There are multiple issues in the Datadog Extension around serialization, which affect: Lambda URL, EventBridge, and Trace parenting.
  • Datadog Extension is not parenting properly due to how ruby sends the trace headers. This will be addressed in the Extension.
  • Also upgraded dd-trace-rb to v1.14.0 to be able to get an internal constant defined on latest versions.
  • SVLS-3959

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

Processed APIGateway request
Processed SNS request
Processed SQS request
START
START
START
W, [XXXX] WARN XXXX[ddtrace] Unable to patch Datadog::Tracing::Contrib::Aws::Integration (Available?: false, Loaded? false, Compatible? false, Patchable? false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue where AWS Lambda + Layer can't find AWS SDK gems.

Support case with AWS is in progress.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will have to stay for now.

lib/datadog/lambda.rb Outdated Show resolved Hide resolved
because if this is changed, there is no way for us to know
needed for the dependency to skip tracing an http request with metadata tag
Copy link
Contributor

@astuyve astuyve left a comment

Choose a reason for hiding this comment

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

one note, rubocop shouldn't be an issue anymore. Otherwise LGTM!

lib/datadog/lambda/trace/listener.rb Show resolved Hide resolved
@duncanista duncanista merged commit b351224 into main Oct 3, 2023
15 checks passed
@duncanista duncanista deleted the jordan.gonzalez/support-inferred-spans branch October 3, 2023 18:21
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.

None yet

4 participants