Add prometheus metics format to worker#271
Merged
Xhristin3 merged 1 commit intoJun 16, 2026
Merged
Conversation
Contributor
Author
|
@Xhristin3 please merge |
Xhristin3
approved these changes
Jun 16, 2026
Xhristin3
left a comment
Contributor
There was a problem hiding this comment.
Nice work on this one @Uche44! The content negotiation logic is clean — love how you handled the Accept header edge cases (excluding */* and text/plain from triggering JSON). The Prometheus exposition format includes proper # HELP and # TYPE comments, and the test suite covers all the endpoint permutations + 404 routing. Really thorough. Closes #226 cleanly. 🚀
Contributor
Author
|
Thank you @Xhristin3 |
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.
Successfully added Prometheus text-based exposition format support to the stream processing worker's metrics endpoint.
##Changes Made
###Stream Processing Worker (xstreamroll-processing)
Updated startMetricsServer to route metric requests to either Prometheus format or JSON based on the URL path (/metrics, /metrics/json, /metrics/prometheus) and the Accept header.
Implemented content negotiation: If the client requests /metrics with Accept: application/json (excluding standard browser wildcard accepts or text/plain), it returns JSON. Otherwise, it defaults to standard Prometheus formatting.
Added # HELP and # TYPE comments to the Prometheus exposition format output.
Added a full suite of integration tests for the metrics server.
Used port 0 for test server instantiation to dynamically allocate a free port on the host, avoiding port collisions.
Covered all permutations of request routing, content negotiation headers (Accept), and default response types.
Verification Results

Automated Tests
Ran the full test suite in xstreamroll-processing successfully: