-
Notifications
You must be signed in to change notification settings - Fork 989
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
How to flush data to Datadog on AWS Lambda function completing #5460
Comments
See #1156. The problem last I looked into it is that there is no way to get a callback that the process is being suspended. If the process is being shutdown, you can use a shutdown hook to close the registry which will flush metrics. I would have to check on the latest to see if there is any more we can do around flushing on suspension. |
Since you are using the Statsd registry, you could try setting the |
Hi,
I'm not sure if this is an issue with Micrometer, Datadog or my usage.
I have custom metrics I'd like to see published to Datadog from my AWS Lambda function.
The metric is a count.
The Lambda function returns quickly, but may be invoked sporadically.
My expectation is that whenever the Lambda function completes, any metric data should be flushed to Datadog.
My findings are that that the data is not always flushed on the Lamdba function completing.
Example:
It appears that the data from previous invocations are flushed once the Lamdba function is unfrozen, which could mean after quite some delay (if it does eventually happen).
These delayed reportings further have the downside in that the timestamp shown in Datadog is at the time they are eventually flushed, rather than within the period in which they were logged.
I don't see a
flush()
method on theStatsdMeterRegistry
. Invokingclose()
is not really acceptable as that would presumably require re-instantiating the meter registry for every single invocation.My Lambda function:
My Lambda function is provisioned with the Datadog Serverless macro using AWS Cloudformation:
If you could please advise how to achieve reliable sending of metrics from AWS Lambdas, or whether I'm misunderstanding something. Thanks!
The text was updated successfully, but these errors were encountered: