Skip to content

Comments

Fix /metrics page displays true, false instead of 0, 1#617

Merged
davidv1992 merged 1 commit intopendulum-project:mainfrom
pohlm01:fix-metrics-bool
Feb 27, 2025
Merged

Fix /metrics page displays true, false instead of 0, 1#617
davidv1992 merged 1 commit intopendulum-project:mainfrom
pohlm01:fix-metrics-bool

Conversation

@pohlm01
Copy link
Member

@pohlm01 pohlm01 commented Feb 21, 2025

According to the OpenMetrics specification, boolean values must be encoded as 0 and 1.
I encontered this bug while using Prometheus to scrape the metrics, which produced the following error line and resulted in no values being reported for any metric.

ts=2025-02-21T09:55:03.007Z caller=scrape.go:1307 level=debug component="scrape manager" scrape_pool=local_ptp target=http://localhost:1337/metrics msg="Append failed" err="strconv.ParseFloat: parsing \"false\": invalid syntax"

@davidv1992 davidv1992 enabled auto-merge February 27, 2025 07:31
@codecov
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 61.58%. Comparing base (758aa8b) to head (e3ec31d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
statime-linux/src/metrics/format.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #617   +/-   ##
=======================================
  Coverage   61.58%   61.58%           
=======================================
  Files          62       62           
  Lines        8415     8414    -1     
=======================================
  Hits         5182     5182           
+ Misses       3233     3232    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@davidv1992 davidv1992 added this pull request to the merge queue Feb 27, 2025
Merged via the queue into pendulum-project:main with commit e518a7c Feb 27, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants