From a5ca1521fe4713d34629329f865fe11e6dd5c703 Mon Sep 17 00:00:00 2001 From: Developer Date: Thu, 9 Jul 2026 22:07:37 +0000 Subject: [PATCH] spec(service-credential-tester): update prom test to gateway path Dependency on grafana-metric-gateway: the prometheus service now sources via Grafana /api/ds/query (no direct Prom endpoint). Test routine changes from GET /api/v1/query?query=up to POST {grafana_url}/api/ds/query with api_key + datasource_uid, expr 'up'. --- openspec/changes/service-credential-tester/proposal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openspec/changes/service-credential-tester/proposal.md b/openspec/changes/service-credential-tester/proposal.md index df1f78b..f0a2d80 100644 --- a/openspec/changes/service-credential-tester/proposal.md +++ b/openspec/changes/service-credential-tester/proposal.md @@ -38,7 +38,7 @@ The same tester is reachable from the service page as a "Re-test" action for alr - **Backend:** a new endpoint `POST /api/services/test` that accepts `{service_type, config, secrets}` (NOT a service id — the tester works on unsaved input), dispatches to a per-type test routine, and returns `{ok: bool, detail: str, evidence?: str}`. The dispatch registry is closed and compile-time (mirrors `SERVICE_DEFINITIONS`). - **Per-type test routines** (minimal, read-only): - **qbittorrent:** login via `/api/v2/auth/login`, then `GET /api/v2/sync/maindata` (or `/app/version`). Evidence: qBittorrent version. - - **prometheus:** `GET /api/v1/query?query=up` (or `/api/v1/status/buildinfo`). Evidence: Prometheus version. + - **prometheus:** `POST {grafana_url}/api/ds/query` with the configured `grafana_api_key` + `datasource_uid`, body querying `expr: "up"`. Evidence: gateway reachable + datasource responding (the `prometheus` service now sources through Grafana per the `grafana-metric-gateway` change; there is no direct Prom endpoint to test). - **alertmanager:** `GET /api/v2/alerts` (or `/api/v2/status`). Evidence: cluster version. - **jellyfin:** `GET /Users` (already exposed by `JellyfinClient.users()`). Evidence: user count + server name. - **jellyseerr:** (if still present as a distinct type) `GET /user`. Evidence: count.