Browser suite: every service's /metrics, scraped as Prometheus does

Nothing in the browser suite asked ipx, the directory or ipx-play for
their metrics, though production's Prometheus scrapes all three every
15 s and the dashboard and alerts go blank if one stops answering. The
suite's servers get metrics ports (8799, 8797, 8790) and one test reads
each gzipped, checks every sample line is one Prometheus can parse, and
looks for the series that show it works: ipx's request histogram with
the route just asked for, the directory's snapshot from ipx, ipx-play's
build. ipx's metrics.rs went from 9% to 86% of lines run by the suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 03:58:55 +00:00
parent 373f862588
commit 61c38bacc1
2 changed files with 36 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ token = "${TOKEN}"
trusted_header = "X-Test-User"
trusted_proxies = ["127.0.0.1"]
sign_out_url = "/signed-out-by-the-proxy"
# What Prometheus scrapes in production (#194), read by a test once the others have made requests.
metrics_bind = "127.0.0.1:8799"
[feeds.test-show]
url = "http://127.0.0.1:8792/show.xml"
@@ -82,6 +84,7 @@ auto_download = false
`);
fs.writeFileSync(path.join(root, 'directory.toml'), `
bind = "127.0.0.1:8795"
metrics_bind = "127.0.0.1:8797"
database_url_env = "DIRECTORY_DATABASE_URL"
# The fixture feeds are on loopback, which the refresher refuses otherwise (#329).
fetch_internal = ["127.0.0.1"]
@@ -93,6 +96,7 @@ token_sha256 = "${crypto.createHash('sha256').update(DIRECTORY_TOKEN).digest('he
`);
fs.writeFileSync(path.join(root, 'play.toml'), `
bind = "127.0.0.1:8798"
metrics_bind = "127.0.0.1:8790"
public_url = "${PLAY}"
[[tokens]]