Conversation
There was a problem hiding this comment.
Pull request overview
Removes the legacy ?response=prometheus query parameter behavior from the admin JSON endpoints now that Prometheus metrics are consolidated under /prometheus/metrics, and simplifies host-stats Prometheus marshalling to avoid wrapper types.
Changes:
- Replace
writeResponse(..., resp)usage with directjc.Encode(...)across admin endpoints (removing per-endpoint Prometheus formatting). - Remove the
HostStatswrapper type and makeHostStatsResponsedirectly a[]hosts.HostStats, updating Prometheus marshalling accordingly. - Add a knope changeset documenting the user-facing change.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| api/admin/types.go | Removes the HostStats wrapper and updates HostStatsResponse to use hosts.HostStats directly. |
| api/admin/prometheus.go | Refactors host stats Prometheus metric generation to work directly with hosts.HostStats. |
| api/admin/admin.go | Removes writeResponse and switches handlers to always return JSON via jc.Encode; updates /prometheus/metrics to wrap host stats correctly. |
| .changeset/remove_prometheus_response_format_from_stats_endpoints.md | Adds release-note entry for the removed query parameter behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
ChrisSchinnerl
left a comment
There was a problem hiding this comment.
Looking good but before we merge this we should update the deploy repo to pull in the stats from the new route.
n8mgr
left a comment
There was a problem hiding this comment.
Why are you removing the response format from the other endpoints?
e019ec4 to
7cad772
Compare
Closes #940