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

Add prometheus metric endpoint (prometheus client) #2853

Open
mblaschke opened this issue Oct 20, 2024 · 2 comments
Open

Add prometheus metric endpoint (prometheus client) #2853

mblaschke opened this issue Oct 20, 2024 · 2 comments

Comments

@mblaschke
Copy link

Component

Backend

Description

Provide an /metrics endpoint for Prometheus scraping using the prometheus client to collect OpenEMS metrics with a single endpoint.

@Sn0w3y
Copy link
Contributor

Sn0w3y commented Oct 25, 2024

Thank you for your contribution and for sharing your ideas.

However, it appears that your request is more of a feature suggestion rather than a bug report. Since you have a "grown" GitHub account, it would be fantastic if you could implement this functionality in a pull request yourself. If you need any assistance with the implementation or have any questions, feel free to reach out.

Additionally, I have a question regarding scalability: How feasible is it in a production environment if more than 100 people are simultaneously scraping the database using Prometheus? Are there any considerations or best practices we should take into account to ensure optimal performance and stability?

I look forward to your feedback and potential collaboration on this feature.

@mblaschke
Copy link
Author

It is a feature request, yes. Unfortunately i'm not a java guy :(

A prometheus metrics endpoint provides metrics normally on a different port with the endpoint (default) /metrics. A prometheus server is configured to scrape this endpoint in regular intervals, normally 30s but could also be 10s.
Prometheus is storing these metrics in it's time series database where it can be used for Grafana.

The only traffic to the service is coming in regular intervals from the Prometheus server.

The Prometheus client provides common metrics (eg. java memory and cpu stats) and all components must send their values with labels to the client which holds the values in memory and publishes them on the metrics endpoint. So even the scraping from the Prometheus server is more a less a "memory dump".

Prometheus supports metric types like gauges, counters and histrograms.

I wrote the fenecon-exporter which actually is generate too much load to fetch all the data. With the prometheus endpoint everything could be solved with a single and easy request and I would retire the fenecon-exporter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants