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

/metrics - invalid prometheus format (TYPE duplicates) /APPSERV-59 #4579

Closed
xadmi opened this issue Mar 18, 2020 · 2 comments
Closed

/metrics - invalid prometheus format (TYPE duplicates) /APPSERV-59 #4579

xadmi opened this issue Mar 18, 2020 · 2 comments
Assignees
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev

Comments

@xadmi
Copy link

xadmi commented Mar 18, 2020

The default /metrics endpoint returns duplicated TYPE entries which does not comply with Prometheus text-based exposition format.
The specification under https://prometheus.io/docs/instrumenting/exposition_formats/#text-format-details says:

Only one TYPE line may exist for a given metric name.


This makes Prometheus Input Plugin for Telegraf to fail:

2020-03-18T14:05:30Z E! [inputs.prometheus] Error in plugin: error reading metrics for http://172.17.0.1:8080/metrics: reading text format failed: text format parsing error in line 40: second TYPE line for metric name "base_gc_time_total", or TYPE reported after samples

Expected Outcome

unique # TYPE lines under /metrics

Current Outcome

# TYPE base_gc_time_total counter
# HELP base_gc_time_total Displays the approximate accumulated collection elapsed time in milliseconds. This attribute displays -1 if the collection elapsed time is undefined for this collector. The JVM implementation may use a high resolution timer to measure the elapsed time. This attribute may display the same value even if the collection count has been incremented if the collection elapsed time is very short.
base_gc_time_total{name="G1 Young Generation"} 1319
# TYPE base_gc_time_total counter
# HELP base_gc_time_total Displays the approximate accumulated collection elapsed time in milliseconds. This attribute displays -1 if the collection elapsed time is undefined for this collector. The JVM implementation may use a high resolution timer to measure the elapsed time. This attribute may display the same value even if the collection count has been incremented if the collection elapsed time is very short.
base_gc_time_total{name="G1 Old Generation"} 0
# TYPE base_gc_total_total counter
# HELP base_gc_total_total Displays the total number of collections that have occurred. This attribute lists -1 if the collection count is undefined for this collector.
base_gc_total_total{name="G1 Young Generation"} 26
# TYPE base_gc_total_total counter
# HELP base_gc_total_total Displays the total number of collections that have occurred. This attribute lists -1 if the collection count is undefined for this collector.
base_gc_total_total{name="G1 Old Generation"} 0

Environment

  • Payara Version: 5.201 (official payara/server-full docker image)
  • Edition: Full
@fturizo fturizo self-assigned this Mar 18, 2020
@fturizo
Copy link
Contributor

fturizo commented Mar 19, 2020

@xadmi, thanks for reporting this issue. Our engieneers have already identified this issue which will be fixed with the upgrade to the next version of Eclipse MicroProfile Metrics (2.3). We have an internal issue to track this upgrade: APPSERV-59. Keep attention to the next public release to check if this new version of the library has been included.

@fturizo fturizo changed the title /metrics - invalid prometheus format (TYPE duplicates) /metrics - invalid prometheus format (TYPE duplicates) /APPSERV-59 Mar 19, 2020
@fturizo fturizo added the Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev label Mar 19, 2020
@smillidge
Copy link
Contributor

Fixed by #4582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev
Projects
None yet
Development

No branches or pull requests

3 participants