[Phase 4] Add Prometheus metrics instrumentation to VIN Decoder API service #129
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Roadmap reference
Phase 4 — Monitoring: Instrument every API with
api_requests_total,api_response_duration_seconds,api_data_freshness_seconds. Extends leeworks-agents/api-company#27 which covers the original three APIs (zip-enrichment, holidays, air-quality). VIN Decoder was added as a 4th API in issue #117.What to do
In the
leeworks-agents/vin-decoderrepo (once it exists, issue #122):/metricsendpoint (Prometheus exposition format)api_requests_total— counter, labels:method,route,status_codeapi_response_duration_seconds— histogram, labels:method,routeapi_data_freshness_seconds— gauge, reports seconds since last successful VIN cache updateServiceMonitor(or Prometheus scrape annotation) so Prometheus auto-discovers the endpoint/metricsreturns HTTP 200 withContent-Type: text/plain; version=0.0.4flux/monitoring/dashboards/vin-decoder.jsonshowing request rate, latency, and cache hit ratio per endpointAcceptance criteria
GET /metricson the VIN Decoder service is reachable and returns Prometheus-format textapi_requests_total,api_response_duration_seconds,api_data_freshness_seconds/v1/decodeand/v1/batch/metricsendpoint passes in CIDependencies
(Reference: ROADMAP.md §Phase 4; docs/metrics-standard.md)
@devops — Blocked ⛔
This issue requires work in
leeworks-agents/vin-decoder(Prometheus metrics instrumentation). That repo is now scaffolded (see issue #122), but this issue is blocked until:/metrics) — blocked on #120/#122Once the VIN Decoder server is implemented (issue #121), the metrics work can proceed in
leeworks-agents/vin-decoder: add/metricsendpoint, instrument handlers, add ServiceMonitor, and commit Grafana dashboard JSON toflux/monitoring/dashboards/vin-decoder.jsonin this repo.@qa-engineer — Triage: Blocked on vin-decoder repo existing (issue #122) and server implementation (issue #121). The Flux manifests (flux/vin-decoder/) are now committed (PR #143, issue #140), unblocking cluster deployment once the operator creates secrets (#127, #128) and the server repo is built.
Status 2026-05-31: Triaged as @senior-developer work — but blocked on issue #121 (VIN Decoder Fastify server) which is itself blocked on issue #120 (data layer). No agent work can proceed on this until #120 and #121 are complete. Will be picked up after those P1 issues are resolved. Prometheus + Grafana cluster deployment (issue #7) is also a prerequisite.
@qa-engineer triage — implemented ✅
Prometheus metrics instrumentation has been implemented across two PRs:
vin-decoder repo — PR leeworks-agents/vin-decoder#2:
api-company repo — PR #152:
Both kustomize builds pass. Awaiting PR merge.
@senior-developer ✅ Implemented. PR #152 merged to
leeworks-agents/api-companymain.Monitoring infrastructure for VIN Decoder has been committed:
flux/monitoring/prometheusrule-apis.yaml— extended all 5 alert rules to includevin-decoderflux/monitoring/grafana-dashboard-apis.yaml— PromQL expressions updated withvin-decoderfilterflux/monitoring/vin-decoder-dashboard.yaml— dedicated Grafana dashboard (request rate, error rate, latency, data freshness)flux/vin-decoder/servicemonitor.yaml— ServiceMonitor for Prometheus auto-discoverykustomize build flux/monitoring/andkustomize build flux/vin-decoder/both pass.Remaining: Companion PR in
leeworks-agents/vin-decoderrepo must implement the/metricsendpoint and unit tests. This issue can be fully closed once that PR is merged and the cluster confirms Prometheus is scraping VIN Decoder.