sendDistributionMetricWithDate ignores date when using statsd
Nevon opened this issue · comments
Expected Behavior
Calling sendDistributionMetricWithDate
with a date should result in skipping client side aggregation and instead submit a metric for the past.
Actual Behavior
When the metric is submitted via statsd, the timestamp argument is ignored and not included in the statsd datagram, making the metric be submitted for the current timestamp instead.
datadog-lambda-js/src/metrics/listener.ts
Lines 129 to 139 in 364d862
The distribution stat function from hot-shots does not accept a timestamp, which I'm guessing is why this wasn't implemented in datadog-lambda-js in the first place. I have reported this here. I'm not sure if it would work to manually construct the datagram rather than using the distribution
stats function, but it might be a possible workaround.
Steps to Reproduce the Problem
- Use the Datadog lambda extension
- Call
sendDistributionMetricWithDate
with a timestamp in the past - See that the metric is recorded with the current timestamp
@Nevon you were correct, historically dogstatsd protocol didn't have a field for timestamp. Do you mind filing a format FR to Datadog support with some business context? Now it's technically feasible, it's essentially a priority question for us.
Closing due to lack of activities. For anyone else running into the similar need, feel free to reopen or submit a FR through the Datadog Support.