Files
vectorize-io__hindsight/scripts/dev/monitoring/prometheus.yml
MΞTΔ a6f99c995c feat(helm): add Prometheus operator ServiceMonitor support (#3847)
* feat(helm): add Prometheus operator ServiceMonitor support

The api (port 8888) and worker (port 8889) containers expose Prometheus
format metrics at /metrics (verified against app source); the chart had
no wiring for them — the worker's scrape annotations are gated behind
the unrelated podAnnotations value and the api service had nothing.

Add a gated metrics.serviceMonitor block that emits per-component
ServiceMonitor resources (api always when enabled, worker only when
worker.enabled). Selection labels are configurable for the Prometheus
operator's serviceMonitorSelector (e.g. release: kube-prometheus-stack).
Also scrape the dedicated worker in the dev LGTM compose stack, which
previously only scraped the api on :8888.

Verified end-to-end on k3d + kube-prometheus-stack: all three targets
(api + 2 worker pods via headless endpoints) discovered and up=1.

* fix(helm): address ServiceMonitor review
2026-08-31 11:09:15 +02:00

37 lines
998 B
YAML

# Prometheus configuration for Grafana LGTM with Hindsight API scraping
---
global:
scrape_interval: 5s
evaluation_interval: 5s
scrape_native_histograms: true
# OTLP receiver configuration (from LGTM default)
otlp:
keep_identifying_resource_attributes: true
promote_resource_attributes:
- service.instance.id
- service.name
- service.namespace
- service.version
- deployment.environment
- deployment.environment.name
- host.name
storage:
tsdb:
out_of_order_time_window: 10m
# Scrape configs for pulling metrics from Hindsight API
scrape_configs:
- job_name: 'hindsight-api'
static_configs:
- targets: ['host.docker.internal:8888']
metrics_path: '/metrics'
scrape_interval: 5s
- job_name: 'hindsight-worker'
static_configs:
# Dedicated workers (helm: worker.enabled, port 8889). Harmless 404-less
# no-op when no worker runs on the host.
- targets: ['host.docker.internal:8889']
metrics_path: '/metrics'