[SVLS-4999] Add Lambda tags to metrics sent via the API #501
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.
What does this PR do?
When the Extension is present, the Lambda library will use the DD API to send distribution metrics with timestamps instead of the Extension, since the Extension does not support historical distribution metrics. Metrics sent via the API currently do not get tagged with Lambda tags.
This adds some essential tags like those added via
![Screenshot 2024-07-02 at 3 55 16 PM](https://private-user-images.githubusercontent.com/25290232/345182869-fc9dd43a-7b69-4b63-8de1-2e52df851350.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODYwODIsIm5iZiI6MTczOTE4NTc4MiwicGF0aCI6Ii8yNTI5MDIzMi8zNDUxODI4NjktZmM5ZGQ0M2EtN2I2OS00YjYzLThkZTEtMmU1MmRmODUxMzUwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDExMDk0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY0Mzk1Y2I0MWQ5M2ZjN2VmMGFlZjk4ZDUyOGYxMWEwZDMxZGNhNGM2YmZjNzczNzZhMDk3MWE0ZTc1M2Y0NzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.bxNoMWOrl5M7sEMyvllf8WvbsTPdNJYpSoFtAXiFT1Q)
DD_TAGS
and thefunction_arn
. With thefunction_arn
tag available, custom metrics will be enriched with other tags collected by the metadata crawler if the AWS integration is enabled:Also added a warning log for historical distribution metrics that are sent to the API with an unsupported timestamp (>=4hrs).
Motivation
DataDog/datadog-lambda-js#545
Testing Guidelines
Added tests and manually tested with local builds of the library.
Additional Notes
Types of Changes
Check all that apply