Skip to content

Extract span tags from triggering event #101

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

Merged
merged 26 commits into from
Jan 26, 2021
Merged

Conversation

DylanLovesCoffee
Copy link
Contributor

@DylanLovesCoffee DylanLovesCoffee commented Dec 8, 2020

What does this PR do?

Parses the event invoking the function for tags to be added to the span. Currently only adds the following services to be detected: API Gateway, ALB, SQS, SNS, DynamoDB, Kinesis, Cloudfront, CW Logs, CW Events. API Gateway and ALB trigger events will also add the HTTP url, method, path, referer and status code response if available.

For the case of X-Ray <> Datadog hybrid tracing, we create an additional dummy Datadog subsegment for the trigger tags.

Motivation

SLS-790 - To give information on what triggered the function execution in one's traces.

Testing Guidelines

New unit test and edited an existing one. Updated snapshots.

Additional Notes

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)

@DylanLovesCoffee DylanLovesCoffee requested a review from a team as a code owner December 8, 2020 23:10
@agocs agocs changed the base branch from master to main December 17, 2020 02:16
# Extract trigger tags and add them to a subsegment if found
trigger_tags = extract_trigger_tags(event, context)
if trigger_tags:
create_dd_root_span_metadata_subsegment(trigger_tags)
Copy link
Collaborator

Choose a reason for hiding this comment

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

BTW, just a reminder, i recall you would have to duplicate the root span tags to the aws.lambda.function span as well, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct 👍

Copy link
Collaborator

@tianchu tianchu left a comment

Choose a reason for hiding this comment

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

👍

@DylanLovesCoffee DylanLovesCoffee merged commit 65aa35c into main Jan 26, 2021
@DylanLovesCoffee DylanLovesCoffee deleted the dylan/trigger-tags branch January 26, 2021 22: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