Use prometheus_client.Counter, Histogram, Gauge directly, or expose them through a registry the Instrumentator already scraped. Increment in your service: RETRIEVAL_HITS.labels(source="faq").inc() reads like business intent. Plot alongside HTTP metrics and act when it shifts.
Counter(“retrieval_hits_total”, “RAG retrieval cache hits”, [“source”]).inc().
Histogram(“llm_latency_seconds”, “LLM latency per call”, buckets=[.05,.1,.25,.5,1,2,5]).
Gauge(“agent_pending”, “Active agent runs”) updated by an asyncio task.
Custom metrics live in the same /metrics endpoint — Grafana picks them up.
service -> inc(retrieval_hits.labels(source="faq").inc())
Prometheus scrapes -> Grafana bar over time
Counter for “how many”, Histogram for “how long”, Gauge for “how alive”. Memorize the three.