test-token-service: turn on TOKEN_SERVICE_METRICS_PORT and scrape it (#409) #263
No reviewers
Labels
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
sophie/homelab!263
Loading…
Reference in a new issue
No description provided.
Delete branch "pixel/409-test-token-service-turn-on-token-service"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pixel task #409. Turns on the metrics listener that test-token-service got in sophie/test-token-service#12 and lets vmagent find it.
In
argo/scout/test-token-service/deployment.yaml:TOKEN_SERVICE_METRICS_PORT=9090containerPort9090 namedmetrics. It is not in the Service and has no route: only vmagent, on the pod IP, reaches it.prometheus.io/scrape: "true",prometheus.io/port: "9090",prometheus.io/path: /metricssha256:f2e91867…(built from93644d6, no metrics) tosha256:80d06b9a…, which the registry gives for bothmainandsha-7c0dac9, the merge commit of that pull request.docs/monitoring.md, "Scraped services": the scout row now says 9090 andkubernetes-pods, and the row in "Apps' built-in metrics" says what is scraped.Restart on merge
One replica, rolling update: the new pod is ready before the old one stops. The service keeps its signing keys in memory, so tokens issued before the restart no longer verify, as on every restart.
Checked before the merge
kubectl apply --dry-run=serveron scout: accepted.TOKEN_SERVICE_METRICS_PORT=9090: logsmetrics server started addr=:9090 path=/metrics;:9090/metricshas 56 series, all 12test_token_service_*series at 0 (bothalg, the 8reason);/metricson 8080 is404 page not found.https://test-token-service.m.ac.nz/metricsanswers 404 with404 page not foundtoday.To check after the merge
job="kubernetes-pods", namespacetest-token-service.test_token_service_tokens_issued_totalhas bothalgseries.https://test-token-service.m.ac.nz/metricsis still404 page not found, and the service answers.🤖 Generated with Claude Code
The change does what #409 asks. I read the diff and the code it depends on, and found nothing that must change.
argo/scout/test-token-service/deployment.yamlsets envTOKEN_SERVICE_METRICS_PORT=9090. That is not 8080, the main port (TOKEN_SERVICE_PORTis not set, so it defaults to 8080). It also addscontainerPort9090 namedmetrics, left out ofservice.yamland the route. The pod-template annotations name the same port, which is whatkubernetes-pods'skeep_if_equalneeds (docs/monitoring.md, "Opting an app in to scraping").sha256:80d06b9a…is what the registry returns today for bothmainandsha-7c0dac9. 7c0dac9 is the merge commit of test-token-service PR 12 (merged 2026-11-30). In that source,config/config.goreadsTOKEN_SERVICE_METRICS_PORT(default 0, off) andmain.goserves/metrics, so the annotations match the app.assetstransporter-svcrows (listener of its own, in no Service). The version column (main, 7c0dac9) matches the image.Still open, and only checkable after the merge, as the author says: the target is up under
job=\"kubernetes-pods\", bothalgseries show up, and the public/metricsreturns 404.Review by pixel: task #453, round 1 of 3, commit
d168666853.Checked after the merge (scout, 2026-11-30 about 11:25 UTC):
scout-test-token-serviceis Synced and Healthy; the new pod runs digestsha256:80d06b9a…, ready, 0 restarts, and logsmetrics server started addr=:9090 path=/metrics.http://<pod IP>:9090/metricsis up underjob="kubernetes-pods", namespacetest-token-service;upis 1 in VictoriaMetrics.test_token_service_tokens_issued_totalhas both series,alg="RS256"andalg="ES384", at 0. All 4test_token_service_*names are there; the target gives 63 series with the scrape's own.https://test-token-service.m.ac.nz/metricsis still 404404 page not found;/.well-known/openid-configurationanswers 200.