-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metrics sent via sendDistributionMetric delayed by several minutes #581
Comments
Hi @ribaptista thanks for reaching out! Historically the lambda extension didn't support timestamped metrics. We've actually just added this feature last week, but it'll take a bit of time before it makes it into To answer your specific question, the timestamp for metrics has historically been set to when aggregation and flushing is performed. Yes, you can specify That said, we're about to roll out a change in v73 which aggregates metrics into timestamped buckets based on when they are written to the extension (or the timestamp sent to the extension). This should fix the issue you're seeing without necessarily adjusting the flush strategy. I hope this is helpful! |
After @astuyve released extension v73, I just released plugin v5.84.0. @ribaptista did this solve the problem? |
Hi @astuyve! Thanks for the quick response.
Then I tested with Can it be the case the library only take this strategy configuration as a "hint", not following it at all times? |
Hi @lym953! |
I upgraded to v5.84.0 and tested with This is more than enough for me! I don't need realtime flushing at all times (it is ok if some values are retained until the function spindown, as long as they arrive with the correct timestamp). |
Expected Behavior
I expect the metric values sent via sendDistributionMetric to be immediately reflected in Datadog, without delays. The sum of the values should match what is sent during the Lambda invocations in real time.
Actual Behavior
The metric values are delayed in Datadog and do not appear immediately after they are sent. For example, after 100 invocations of my Lambda function, the sum should be 500 (5 per invocation). However, the sum is roughly 475, and the remaining 25 appears several minutes later in Datadog, associated with a later timestamp, not the time the metrics were actually emitted.
Is there a way to force the Lambda function to flush metrics immediately after each invocation?
Steps to Reproduce the Problem
Set up a Lambda function with serverless-plugin-datadog version 5.83.0 and configure the following environment variables:
Import datadog-lambda-js in your Lambda function and call sendDistributionMetric after each invocation.
Observe that the sum of the metrics in Datadog does not immediately match the values sent, and there is a delay in the appearance of the missing values, which appear several minutes later.
Specifications
The text was updated successfully, but these errors were encountered: