When capturing lambda payload, always cast number into string for sec…#422
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #422 +/- ##
=======================================
Coverage 80.80% 80.80%
=======================================
Files 38 38
Lines 2001 2001
Branches 466 466
=======================================
Hits 1617 1617
Misses 323 323
Partials 61 61
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
joeyzhao2018
commented
Sep 9, 2023
| # Run the image by runtime tag, tar its generatd `node` directory to sdout, | ||
| # then extract it to a temp directory. | ||
| docker run --rm datadog-lambda-layer-node:$1 tar cf - /nodejs | tar -xf - -C $temp_dir | ||
| # Run the image by runtime tag and copy the output /nodejs to the temp dir |
Contributor
Author
There was a problem hiding this comment.
For more information, check the python PR: DataDog/datadog-lambda-python@8f2686c
11 tasks
DarcyRaynerDD
approved these changes
Sep 11, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…urity reasons.
What does this PR do?
When the env
DD_CAPTURE_LAMBDA_PAYLOADset to true, the datadog-lambda-js library can capture the lambda's request and responses by parsing them and tagging the span with the keys and values.This change is to make sure no values are tagged as number by casting them into strings.
Motivation
Treating the payloads values as string for this very payload capturing feature is expected behavior. This does't change the payload. This is strictly for the payload capturing feature and it does't imply other scenarios should follow the same pattern.
Testing Guidelines
This has been tested in our serverless sandbox us-west-2 region joey-node-hello-world lambda. For serverless teammates, feel free to check its environment setting and test
Additional Notes
Types of Changes
Check all that apply