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

MP metrics endpoint provides JSON output by default, Prometheus format should be the default #127

Closed
rsvoboda opened this issue Oct 24, 2018 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@rsvoboda
Copy link

MP metrics endpoint provides JSON output by default, Prometheus format should be the default

Using Helidon MP Example from https://helidon.io/docs/latest/#/getting-started/02_base-example

curl http://localhost:8080/metrics returns JSON, I had to call curl -H "Accept: text/plain" http://localhost:8080/metrics to get Prometheus format

MP Metrics 1.1 spec says Prometheus text format - default response format when the HTTP Accept header does not match any more specific media type like application/json.
Se section 2.3. Exposing metrics via REST API of the spec

  • Helidon Version: 0.10.4
  • Helidon MP
  • JDK version: 1.8.0_171
  • OS: macOS Mojave
$ curl -v http://localhost:8080/metrics
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8080 (#0)
> GET /metrics HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Wed, 24 Oct 2018 10:11:38 +0200
< transfer-encoding: chunked
< connection: keep-alive
<
* Connection #0 to host localhost left intact
{"base":{"classloader.totalLoadedClass.count":6248,"cpu.systemLoadAverage":2.7119140625,"thread.count":19,"classloader.currentLoadedClass.count":6246,"jvm.uptime":75082,"gc.PS MarkSweep.count":1,"memory.committedHeap":211812352,"thread.max.count":26,"gc.PS Scavenge.count":4,"cpu.availableProcessors":8,"thread.daemon.count":14,"classloader.totalUnloadedClass.count":2,"memory.maxHeap":3817865216,"memory.usedHeap":66577096,"gc.PS MarkSweep.time":25,"gc.PS Scavenge.time":52},"vendor":{"requests.count":3,"requests.meter":{"count":3,"meanRate":0.0405695117705537,"oneMinRate":0.020664007757838578,"fiveMinRate":0.006037556417397182,"fifteenMinRate":0.0021495791878664424}}}
@romain-grecourt romain-grecourt added the bug Something isn't working label Oct 24, 2018
@romain-grecourt
Copy link
Contributor

Thanks for reporting this issue, we need to fix this.
See also eclipse/microprofile-metrics#291

@barchetta barchetta self-assigned this Nov 5, 2018
@barchetta
Copy link
Member

Fixed by pr #158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants