quarkus: Trailing comma is lost from prometheus metrics

Describe the bug

In all released versions (including 2.15.3.Final), prometheus metrics (accessible at ‘q/metrics’) has format of json object with a trailing comma. In the current main branch (tested on dc85cd0d16c44a264507529c9ee26e26c7ffe175) the format is changed, and the comma was lost. Is this an expected change? Prometheus format allows[1] for both options, but that change may broke parsing of logs and therefore it would be nice to have it documented

[1] https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators

Expected behavior

Example: http_server_requests_seconds_count{method="GET",outcome="SUCCESS",status="200",uri="/hello",} 1.0

Actual behavior

http_server_requests_seconds_count{method="GET",outcome="SUCCESS",status="200",uri="/hello"} 6.0

How to Reproduce?

  1. mvn io.quarkus.platform:quarkus-maven-plugin:2.15.3.Final:create -DprojectGroupId=org.acme -DprojectArtifactId=micrometer-quickstart -Dextensions='resteasy-reactive,micrometer-registry-prometheus'
  2. cd micrometer-quickstart
  3. mvn quarkus:dev -Dquarkus.platform.version=999-SNAPSHOT
  4. curl http://localhost:8080/hello/
  5. curl http://localhost:8080/q/metrics | grep http_server_requests_seconds_count # example, many (all?) other metrics also changed

for comparision, replace step 3 with mvn quarkus:dev -Dquarkus.platform.version=2.15.3.Final

Output of uname -a or ver

6.0.18-300.fc37.x86_64

Output of java -version

17.0.4, vendor: GraalVM Community

GraalVM version (if different from Java)

No response

Quarkus version or git rev

dc85cd0d16c44a264507529c9ee26e26c7ffe175

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (14 by maintainers)

Commits related to this issue

Most upvoted comments