fix(target-health): omit target metrics family when unconfigured

writeTargetMetrics now returns before emitting even
llmgateway_target_healthy's own HELP/TYPE header when neither an
MCP server nor an agent is configured, mirroring
writeStoreHealthMetrics' identical behaviour when Redis is
unconfigured.

Claude-Session: https://claude.ai/code/session_01EebV5jyWvYocByNQ3oss1w
This commit is contained in:
2026-09-03 02:47:25 +01:00
parent f5d9014b13
commit 10d1825ed7
3 changed files with 63 additions and 1 deletions
+3 -1
View File
@@ -1684,7 +1684,9 @@ plugin's config.
- `llmgateway_target_healthy{kind,target}` — `1`/`0` gauge for an MCP
server or A2A agent's tracked health; `kind` is `"mcp"` or `"agent"`.
No sample at all for a target this tracker has never observed — see
[MCP and A2A](#mcp-and-a2a)'s "Target health" section.
[MCP and A2A](#mcp-and-a2a)'s "Target health" section. The whole
family, HELP and TYPE lines included, is absent entirely when no MCP
servers or agents are configured.
- `llmgateway_limit_store_up` — `1`/`0` gauge for this replica's own
connection to the configured limit store (Redis); absent entirely
when no store is configured. Every store-backed family above simply