Closed Nevon closed 1 year ago
@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.
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.
https://github.com/DataDog/datadog-lambda-js/blob/364d862e127123f8eea177619907966ecf41f80e/src/metrics/listener.ts#L129-L139
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
sendDistributionMetricWithDate
with a timestamp in the past