-
Notifications
You must be signed in to change notification settings - Fork 176
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
Getting python metrics to flush in the lambda #272
Comments
I'm having the same problem, in Golang I used the HTTP exporter instead of gRPC, and as it doesn't keep a persistent connection, the flush worked. With gRPC, it sees that the connection was broken, sleeps for reconnecting, but the lambda times out. But for python the http metrics exporter isn't available yet. |
I did a quick and dirty implementation of http metrics which seems to work, but it didn't solve my problem. |
@RangelReale Thanks for looking into this. I am no expert in Lambda extensions, but I see that there should be a Though now I see that your implementation isn't an extension, its in the application layer and only can get the SIGTERM I presume you saw this: Graceful shutdown with AWS Lambda |
@rberger yes, only the extensions receives these events, not the function itself. I am doing some tests with Statsd/UDP and it looks like to be more reliable for lambdas, as metrics are sent "synchronously" via UDP, did anyone try this yet? |
I haven't tried Statsd, but thinking about Statsd is giving me flashbacks :-) |
Is it expected that there will be a |
Old issue but a |
Thanks. We pretty much abandoned OTel since we had so many issues back then with Lambdas and OTel, particularly the issue of flushing. Hope to eventually try it again someday. |
Thanks for circling back @rberger . Just realized this is in different gh group than my usual so I'm not able to close this issue. 🙂 |
Let me see if I can close it |
How does one get metrics to emit in short lived lambdas? I never see the metrics emit but I see traces.
If I don't do the force_flush I never see any metrics in the logs or in my oltp exporter destination.
The aws-otel-python-arm64-ver-1-11-1:2 will not let me force_flush the meter_provider. I get the error when I try to do a force_flush.
code:
collector config file:
I built a version of the lambda layer with the latest v1.12.0rc2 and 0.32b0 and the force_flush worked but only if I included
opentelemetry-exporter-otlp-proto-grpc
in the build which made the layer huge (200MB) but it did work with the force_flush and I got the metrics end to end.If I didn't include
opentelemetry-exporter-otlp-proto-grpc
I would get the error:And would also get the same
I presume I'm not doing something right, but I can't figure out how to make metrics work other than the v1.12.0rc2 with the
opentelemetry-exporter-otlp-proto-grpc
library, but then I can't use it as the lambda size gets to big once I add the rest of my real app and its libraries.The text was updated successfully, but these errors were encountered: