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

[Serverless] support lambda direct invocation trace propagation #11624

Conversation

thedavlee
Copy link

@thedavlee thedavlee commented Apr 11, 2022

What does this PR do?

Adds support for recieving lambda direct invocation trace context for trace propagation and merging, as a part of universal instrumentation

Motivation

Step towards universal instrumentation. Coupled with this dotnet tracer PR, we will support trace propagation/merging when an instrumented python/node lambda directly invokes a dotnet lambda synchronously using the AWS SDK

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

Tested manually using the lambda-extension-dotnet lambda stack within the cloud-integrations repo, including testing with void, one param, two param, and invalid three param dotnet lambdas. Also tested changes with the current dotnet tracer version that doesnt support this feature.

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Use the major_change label if your change either has a major impact on the code base, is impacting multiple teams or is changing important well-established internals of the Agent. This label will be use during QA to make sure each team pay extra attention to the changed behavior. For any customer facing change use a releasenote.
  • A release note has been added or the changelog/no-changelog label has been applied.
  • Changed code has automated tests for its functionality.
  • Adequate QA/testing plan information is provided if the qa/skip-qa label is not applied.
  • At least one team/.. label has been applied, indicating the team(s) that should QA this change.
  • If applicable, docs team has been notified or an issue has been opened on the documentation repo.
  • If applicable, the need-change/operator and need-change/helm labels have been applied.
  • If applicable, the config template has been updated.

@thedavlee thedavlee added this to the Triage milestone Apr 11, 2022
@thedavlee thedavlee force-pushed the david.lee/lambda-extension-direct-invoke-trace-support branch from 1b5cfb1 to 6b5b50e Compare April 13, 2022 00:27
@thedavlee thedavlee changed the base branch from main to sls-wip-apr-22 April 14, 2022 18:31
@thedavlee thedavlee force-pushed the david.lee/lambda-extension-direct-invoke-trace-support branch from 6b5b50e to a58333a Compare April 14, 2022 18:45
@thedavlee thedavlee changed the title [Serverless] WIP support lambda direct invocation trace propagation [Serverless] support lambda direct invocation trace propagation Apr 14, 2022
@thedavlee thedavlee added the [deprecated] qa/skip-qa - use other qa/ labels [DEPRECATED] Please use qa/done or qa/no-code-change to skip creating a QA card label Apr 14, 2022
@thedavlee thedavlee marked this pull request as ready for review April 15, 2022 17:07
@thedavlee thedavlee requested a review from a team as a code owner April 15, 2022 17:07
@thedavlee
Copy link
Author

thedavlee commented Apr 15, 2022

The associated change in dd-trace-dotnet has been approved and ready to be merged has been merged, and eta for the next dotnet tracer release is about a week (from now). When using the current version of the dotnet tracer without the trace propagation changes, everything works as expected (just without the traces to be merged).

var traceID, parentID uint64
var e1, e2 error

if payload.Headers != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is checked twice, maybe you could find a way to refactor?

Copy link
Author

Choose a reason for hiding this comment

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

I refactored this bit of code, let me know if it looks good!

Copy link
Contributor

@maxday maxday left a comment

Choose a reason for hiding this comment

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

LGTM!

@thedavlee thedavlee merged commit 8da0bce into sls-wip-apr-22 Apr 19, 2022
@thedavlee thedavlee deleted the david.lee/lambda-extension-direct-invoke-trace-support branch April 19, 2022 16:21
maxday added a commit that referenced this pull request Apr 27, 2022
* [serverless] Share snapshots between integration tests (#11630)

* [Serverless] added capture lambda payloads (#11484)

Added the capture lambda payloads feature for universal instrumentation

* [Serverless] support lambda direct invocation trace propagation (#11624)

* support receiving directly invoked lambda trace context (universal instrumentation)

Co-authored-by: Nicolas Hinsch <nick.hinsch@datadoghq.com>
Co-authored-by: David Lee <david.lee@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog [deprecated] qa/skip-qa - use other qa/ labels [DEPRECATED] Please use qa/done or qa/no-code-change to skip creating a QA card team/serverless
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants