• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 32205375602
70%

Build:
DEFAULT BRANCH: main
Ran 19 Aug 2026 01:41AM UTC
Jobs 1
Files 878
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Aug 2026 01:33AM UTC coverage: 70.432% (-0.03%) from 70.458%
32205375602

push

github

web-flow
Serve Prometheus metrics on a separate diagnostics listener (#6296)

* Serve Prometheus metrics on a separate listener

Go's ServeMux resolves the most specific registered pattern first, so the
explicitly registered /metrics always outranked the "/" catch-all that
carries the proxy middleware chain. The endpoint was therefore reachable
without authentication, body limits, rate limiting, or audit even on a
fully OIDC-configured deployment. In Kubernetes it was also internet-
reachable: the operator binds the proxy to 0.0.0.0 and the Service maps
the proxy port.

Bind metrics to a dedicated diagnostics listener instead. The runner no
longer hands the Prometheus handler to the transport, which is what keeps
the proxies from mounting /metrics on the application mux at all; they now
return 404 there, mirroring how /health already guards itself. /health
stays on the application listener because Kubernetes probes target it and
it exposes no build information.

The listener defaults to port 9464, the OpenTelemetry specification's
Prometheus exporter default, and falls back to an available port when that
one is taken. This matches the pattern the ToolHive operator already uses
for its own metrics endpoint (--metrics-bind-address), as do etcd
(--listen-metrics-urls) and controller-runtime.

Part of #6271

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Harden diagnostics listener lifecycle and timeouts

Release the listener on every exit from Runner.Run. Cleanup runs only via
stopMCPServer, which the early error returns skip, as does the graceful
container-exit branch that returns nil after the transport has stopped.
Leaking there stranded a goroutine and a bound port; under the restart
loop in workloads.Manager each attempt would strand another and push the
next onto a different port, silently breaking the stable scrape target
this change exists to provide.

Set ReadTimeout, WriteTimeout, and MaxHeaderBytes to match the proxy and
vMCP lis... (continued)

146 of 179 new or added lines in 9 files covered. (81.56%)

79 existing lines in 5 files now uncovered.

85595 of 121529 relevant lines covered (70.43%)

99.22 hits per line

Uncovered Changes

Lines Coverage ∆ File
19
82.73
pkg/diagnostics/server.go
8
42.73
0.23% pkg/runner/runner.go
6
81.25
pkg/runner/diagnostics.go

Coverage Regressions

Lines Coverage ∆ File
59
61.91
-4.47% pkg/workloads/manager.go
10
32.73
-3.6% pkg/transport/types/mocks/mock_transport.go
5
0.0
-100.0% pkg/workloads/sysproc_unix.go
3
71.85
-1.11% pkg/ignore/processor.go
2
94.77
-1.31% pkg/vmcp/composer/dag_executor.go
Jobs
ID Job ID Ran Files Coverage
1 32205375602.1 19 Aug 2026 01:41AM UTC 878
70.43
GitHub Action Run
Source Files on build 32205375602
  • Tree
  • List 878
  • Changed 18
  • Source Changed 8
  • Coverage Changed 17
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #32205375602
  • 7b72d4b6 on github
  • Prev Build on main (#32176488063)
  • Next Build on main (#32225508257)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc