fix(extract): correct /metrics endpoint check and include TYPE headers - #20
Open
belowzeroff wants to merge 2 commits into
Open
fix(extract): correct /metrics endpoint check and include TYPE headers#20belowzeroff wants to merge 2 commits into
belowzeroff wants to merge 2 commits into
Conversation
Collaborator
|
this pr includes a change to install.sh, some of #22 appears to have been committed on this one by accident. |
The ph handler checked but msg 0 is the request URI which starts with . For , msg 0 is , so the check never matched. The metrics extraction code path was dead, making the exporter non-functional for Prometheus scraping. Fix: match against prefix using .
extractmetric used `first[d`hdr]` which only took the HELP line,
dropping the TYPE line. The hdr field is a 2-element list:
("# HELP ..."; "# TYPE ..."). Dropping TYPE violates the Prometheus
exposition format specification and causes metric type misclassification.
Fix: use `d[\`hdr]` instead of `first[d\`hdr]` to emit both headers.
belowzeroff
force-pushed
the
fix/f001-f002
branch
from
July 29, 2026 13:13
9768f85 to
fb6903c
Compare
Contributor
Author
|
This should now be fixed: the current PR diff only contains q/extract.q changes, and install.sh is no longer part of this PR. |
Collaborator
|
May have broken things. in fresh checkout, in q dir running with change, visiting url shows |
sshanks-kx
requested changes
Jul 30, 2026
sshanks-kx
left a comment
Collaborator
There was a problem hiding this comment.
See previous comment. Thanks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug 1: /metrics endpoint check (fix/f001-metrics-endpoint-check)
The HTTP endpoint check used
"metrics"~msg 0but should be"/metrics"~8#msg 0. The original check did not account for the leading/in the path.Bug 2: Missing TYPE headers in Prometheus output (fix/f002-type-headers)
extractmetricvalusedfirst[dhdr]instead ofd[hdr], which only returned the first header line instead of all TYPE/HELP headers. This caused Prometheus to reject the output due to missing type information.