Skip to content
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

Prometheus monitoring integration #113

Open
panzerdev opened this issue Jan 3, 2017 · 3 comments · May be fixed by #429
Open

Prometheus monitoring integration #113

panzerdev opened this issue Jan 3, 2017 · 3 comments · May be fixed by #429
Labels

Comments

@panzerdev
Copy link

For monitoring the performance in a Prometheus monitored environment the code needs to be instrumented.

What would you think about adding this? I'd like to contribute to this as well.

@h2non h2non added the question label Jan 3, 2017
@h2non
Copy link
Owner

h2non commented Jan 3, 2017

That would depend on what kind of monitoring you require. You can achieve this at multiple level, but basically programmatically or via standard HTTP logging already provided by imaginary.

The first one you would need to instrument Go code with Prometheus API client. I did a similar thing in the past for several metrics engines, such as InfluxDB. My approach was to write a custom http.Handler as a generic middleware that inspects and tracks incoming/outgoing HTTP traffic.
If you require more low-level details, you can apply the same strategy at image processing engine level, just around bimg API calls.

This approach would require you to fork the project and maintain your own project. I don't have plans to overload imaginary with that functionality since imaginary was designed to be used a black-box service with minimal setup overhead and providing a simple ABI (instead of a programmatic API, which typically encourages more hackability).

Alternatively, the standard logging output approach would be the most convenient if you want to rely on the standard imaginary project without maintaining your own fork and without hacking it. That would be for sure less versatile and would only monitor basic HTTP scope data. The current logging implements the Apache log format, which includes typical data about each HTTP transaction, including response time, which I guess would be the most sensitive from a performance perspective.

@marcfrederick
Copy link

marcfrederick commented Feb 24, 2021

In case someone else is interested in this, I've written a simple prometheus exporter for imaginary. It only includes the metrics already available under /health, but converts them to a format prometheus can understand. You could also use something more generic such as this project for the conversion.

@vaibsharma
Copy link
Contributor

vaibsharma commented Jun 8, 2023

Hey @h2non,
Do we have any plans for setting up the basic metrics(prometheus or something else) for imaginary that could include HTTP requests, response P99, Transformation count etc
Let it me know if this is already a plan, I can quickly setup the basic setup for the prometheus metrics for the same.

@wrenix wrenix linked a pull request Sep 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants