-
-
Notifications
You must be signed in to change notification settings - Fork 885
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
Add Prometheus endpoint and metrics #3456
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
57fa92d
to
b2a1780
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you provide some instructions with how to run this? Possibly including it in the docker-compose.yml
?
People did the same for otel, and still haven't provided any instructions on how to use them.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Generally looks good. Would be best if you can already write instructions for this in lemmy-docs, so we can review it together with the code before merging both. |
Add a server for serving Prometheus metrics. Include a configuration block in the config file. Provide HTTP metrics on the API, along with process-level metrics and DB pool metrics.
Added documentation in the above PR. |
Thanks! |
can this serve any metrics? https://docs.rs/tokio-metrics/latest/tokio_metrics/ would be very interesting. https://github.com/Hanaasagi/tokio-metrics-collector |
Yes it can serve any metrics and will do so for metrics added to the default registry. Glancing at those links, I think the task metrics seem easy enough but the runtime ones require tokio unstable so probably not viable for quite some time. |
It doesn't look like the official images are compiling with this enabled. At least not as far as I can see in Woodpecker. Am I mistaken, or is this a "compile only" feature for now? |
This is compile-only for now. I didn't want to introduce any potential bugs and performance problems to existing users since I expect that the number of people who want this feature is rather small. If it gets some uptake maybe we can talk with the maintainers about making it part of the default build. If you are interested in building Lemmy with this feature enabled, the details are in the documentation here. |
Discussed a bit in #3294.
prom
feature flag.Follow-up Ideas
Example Metrics
The
lemmy_api_*
metrics will populate as requests come in to different endpoints. This is showing that only one request has come in so far and it was on the "/" endpoint.