DataDog / datadog-lambda-js

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

[SVLS-4422] Support metrics with timestamps when the Extension is running #522

Closed DylanLovesCoffee closed 8 months ago

DylanLovesCoffee commented 8 months ago

What does this PR do?

Allows sendDistributionMetricWithDate to submit a metric with a timestamp when the Extension is running. Neither hot-shots nor Dogstatsd supports historical distribution metrics (more on the latter here and here).

The ability to send metrics with timestamps already existed but did not work when using the Extension.

Motivation

Testing Guidelines

Unit test + manual tests. Example of one invocation using the following:

const MS_PER_MINUTE = 60000;
const timestamp = new Date(Date.now() - MS_PER_MINUTE);
sendDistributionMetricWithDate("dylan.test.past", 1, timestamp);
sendDistributionMetric("dylan.test.present", 1); // tracer.dogstatsd.distribution("dylan.test.present", 1) also works

Screenshot 2024-03-20 at 12 34 36 PM

Additional Notes

Types of Changes

Check all that apply

duncanista commented 8 months ago

Do not merge before #519

DylanLovesCoffee commented 8 months ago

Do not merge before #519

should I just change the base to jordan.gonzalez/lazy-load-fallback-processor?