Allow selectively exporting all Go runtime metrics (#7990)

Signed-off-by: Ryan Brewster <rpb@anthropic.com>
This commit is contained in:
rpb-ant
2026-04-08 14:38:19 -04:00
committed by GitHub
parent a33c8058be
commit 010dc1e2b7
3 changed files with 37 additions and 2 deletions

View File

@@ -15,8 +15,17 @@ func TestPrometheusParse(t *testing.T) {
// oks
{`prometheus`, false, "localhost:9153"},
{`prometheus localhost:53`, false, "localhost:53"},
{`prometheus {
runtime_metrics
}`, false, "localhost:9153"},
{`prometheus localhost:53 {
runtime_metrics
}`, false, "localhost:53"},
// fails
{`prometheus {}`, true, ""},
{`prometheus {
runtime_metrics extra_arg
}`, true, ""},
{`prometheus /foo`, true, ""},
{`prometheus a b c`, true, ""},
}