-
-
Notifications
You must be signed in to change notification settings - Fork 607
Support Prometheus via plugin #1320
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
Comments
Thank you, I'll look into it :) |
Hi there! I'd like to try to fix this, if you don't mind. which is the best approach? Perhaps to give support on core to store metrics, so plugins can send their own metrics there and be served from the prometheus plugin? |
@magmax Thank you, that would be great and much appreciated. Indeed giving support directly in the core would be the best way to implement it. I think
|
Nice, @abhinavsingh ! I still have some problems with this XD First of all, Prometheus works on "pull" method instead of "push". That means that each resource won't send data to the server; it is the Prometheus server which will ask for data whenever it wants. That means the prometheus plugin will require to add an endpoint to the webserver. So... This is the plan:
I've thought in avoiding to depend on prometheus-client library on core, what means I will require to duplicate part of its functionality: creating some types of metrics to allow communication between emitter, core and prometheus-plugin. |
@magmax Whoops, correct. Subscriber can simply accumulate and store metrics, while an endpoint indeed will be necessary from where prometheus can pull the data. While onto it, you can define an abstract class (to write/read metrics and associated basic types) and write a single implementation of your choice :)
Indeed. We can start with adding a couple of metric types. Flow wise, event emitters will emit these types, subscribers will accumulate these types and store. You can tie all this functionality under 2 flags:
And 1), 2) can both be provided independently. E.g even if PS: While I do understand the concept, I have not used prometheus as much as I would have liked, so I'll have to bank upon yours and community expertise for final integration here :) |
I almost have the implementation. Just fighting against processes and threads. Anyway, I have the solution in the top of my head, and just need time to implement it. Probably It will be out today or tomorrow. |
Few things that crossed my mind and may help:
|
@magmax Thank you for the PR and apologies for being away for so long. I need prometheus integration in one of the projects based on |
@alexey-pelykh @magmax PR #1447 ships prometheus support. Please give it a try when you can. Thank you for reference links and PRs. |
Sending stats and access logs to https://prometheus.io/ would be a great addition. For inspiration, there's https://github.com/gmm42/tinyproxy_exporter/blob/master/tinyproxy_exporter
The text was updated successfully, but these errors were encountered: