DataDog / datadog-lambda-python

The Datadog AWS Lambda Layer for Python
https://docs.datadoghq.com/integrations/amazon_lambda/#installing-and-using-the-datadog-layer
Apache License 2.0
84 stars 45 forks source link

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

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-07-02 at 3 55 16 PM

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

Motivation

https://github.com/DataDog/datadog-lambda-js/issues/545

Testing Guidelines

Added tests and manually tested with local builds of the library.

Additional Notes

Types of Changes

Check all that apply

DylanLovesCoffee commented 2 months ago

/merge

dd-devflow[bot] commented 2 months ago

:steam_locomotive: MergeQueue: pull request added to the queue

The median merge time in main is 0s.

Use /merge -c to cancel this operation!