DataDog / datadog-lambda-js

The Datadog AWS Lambda Library for Node
Apache License 2.0
110 stars 35 forks source link

[SVLS-4999] Add Lambda tags to metrics sent via the API #559

Closed DylanLovesCoffee closed 2 months ago

DylanLovesCoffee commented 3 months ago

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 DD_TAGS and the function_arn. With the function_arn tag available, custom metrics will be enriched with other tags collected by the metadata crawler if the AWS integration is enabled:

Screenshot 2024-06-28 at 10 42 53 AM

Also added a warning log for historical distribution metrics that are sent to the API with an unsupported timestamp (>=4hrs).

Screenshot 2024-06-28 at 10 24 08 AM

Motivation

https://github.com/DataDog/datadog-lambda-python/issues/398 and #545

Testing Guidelines

Built the layer and tested manually.

Additional Notes

Types of Changes

Check all that apply