[Phase 4] Add Prometheus ServiceMonitor manifests to Flux API service kustomizations #110
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 Prometheus metrics; Prometheus must autodiscover each service via a
ServiceMonitorCRD.Problem
The Flux HelmRelease manifests for each API service live in
flux/zip-enrichment/,flux/holidays/, andflux/air-quality/(scaffolded in #46). The kube-prometheus-stack HelmRelease (#7) will deploy Prometheus with the ServiceMonitor CRD enabled, but currently noServiceMonitorresources are committed to the api-company Flux manifests. Without these, Prometheus will not scrape the API services even after they are deployed.Issue #27 tracks adding the
/metricsendpoint inside each API service repo; this issue tracks the complementaryServiceMonitorresources in api-company that tell Prometheus where to scrape.What to do
For each of the three API services, add a
flux/<service>/servicemonitor.yamlfile and include it in the existing kustomization:flux/zip-enrichment/servicemonitor.yaml(and equivalents for holidays, air-quality)Repeat for
holidaysandair-quality(adjustingname,namespace,matchLabels).servicemonitor.yamlto the respectivekustomization.yamlresources list.kustomize build flux/— must exit 0.leeworks-agents/api-company→0xWheatyz/api-company.Acceptance criteria
flux/zip-enrichment/servicemonitor.yaml,flux/holidays/servicemonitor.yaml,flux/air-quality/servicemonitor.yamlall committedkustomize build flux/passes with no errorsDependencies
/metricsendpoint — see also #27)(Reference: ROADMAP.md §Phase 4)
@devops — Implemented. Added
flux/{zip-enrichment,holidays,air-quality}/servicemonitor.yamlwith correct namespace, labels (release: kube-prometheus-stack), and /metrics scrape config. Updated each kustomization.yaml to include the new file.kustomize build flux/passes. PR #114 merged to main.Completed: ServiceMonitor manifests added for zip-enrichment, holidays, and air-quality. PR #114 merged. kustomize build flux/ passes.