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 Exporter: Duplicate HELP-Line when using multiple caches #700
Comments
Note: I think the same applies for tomcat connectors exported. I've just one connector ( When fixing the PrometheusController I'm not sure whether we should go for iterating over caches and tomcat informations for each metric or whether reorganizing values in a map is worth the extra effort. We've got 6 caches in use at the moment and I don't know any setup with more than 3 tomcat connectors. If this is a "usual" setup I guess iterating per metric might be faster than reorganizing the information first. What do you think @evernat? |
That requirement is frustrating for the javamelody code. So yes, I think that we can iterate over caches and tomcat informations for each metric. (I don't see well what you mean by reorganizing values in a map.) |
I'm not sure whether I'll find some time next week to implement the change but we'll see. If someone else has time to jump in that will be fine. By reorganizing I meant (in pseudo code)
Given |
…nnectors - Reorganize output to match Prometheus requirements on help lines and statistics output - Optimized sanitation by extracting patterns into constants - Optimized/cleaned up controller methods
I've added a first draft for the solution. Maybe you'll have a look at it and tell me what needs to be changed for the change to get accepted. I hadn't had the time to test the solution, thus it's only a draft right now. I'll check whether the commit really solves the problem by the end of the week. I had to go with the "reorganize first than output" solution because the code would become clumsy otherwise having lots of repetitions. If you don't like the multiple String-Arrays created I can join the |
…nnectors - Reorganize output to match Prometheus requirements on help lines and statistics output - Optimized sanitation by extracting patterns into constants - Optimized/cleaned up controller methods
I've tested the changes and prometheus can read the output now. I've also cleaned up and reverted the line-ending change I've introduced in the first place. See #709 - I'm happy if you review the code and tell me what to change. |
This issue is fixed by 6f06e46 which is merged and ready for the next release (1.71). |
When scraping my applications statistics using the brand new prometheus exporter (thanks for this cool feature @evernat & @slynn1324 ) I'm getting the error:
text format parsing error in line 121: second HELP line for metric name "javamelody_cache_in_memory_count"
After reading the prometheus docs on HELP format I think there may be just one HELP line and TYPE per metric name. Using labels (e.g. cache_name="...") produces no separate metric.
According to the format documentation
I also think that those metrics must be reordered mixing the different caches but having each metric in one uninterrupted group.
Here are the relevant lines. I've inserted to blank lines before the mentioned "line 121"
I think required order/format would be:
The text was updated successfully, but these errors were encountered: