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
88 stars 46 forks source link

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

Closed DylanLovesCoffee closed 4 months ago

DylanLovesCoffee commented 5 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 4 months ago

/merge

dd-devflow[bot] commented 4 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!