metrics: Prometheus/OpenMetrics exposition for /metrics #49
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?
Problem
/metricstoday is Prometheus-ish: plainname valuelines and a few{service=…}labels viaWriteText, but it is missing# HELP/# TYPE, the standard Prometheus/OpenMetricsContent-Type, and may fail strict scrapers (Prometheus, Grafana Alloy, etc.).Why it matters
Jerry is standing up lab Prometheus + Grafana to scrape
steamcache.lab.rrd/metrics. Custom Grafana panels are fine; the scrape format needs to be clean so dashboards work without brittle parsers.Goal
Make
/metricsOpenMetrics / Prometheus text-format compatible for Prometheus scrape + Grafana dashboards.Scope
# HELP,# TYPE, correct types (counter/gauge/histogram as applicable), stable metric names, and labels.Content-Type(Prometheus text 0.0.4 or OpenMetrics)./lancache-heartbeatas-is for health (do not change that endpoint for this issue).Acceptance
/metricswithout parse errors.# HELPand# TYPE(or OpenMetrics equivalents).Content-Typematches the chosen exposition format./lancache-heartbeatunchanged.Out of scope
FYI from lab scrape (Jerry Prom/Grafana live) — do not block on this:
# HELP/# TYPEtoday; Prometheus still scrapes OK.servicelabel collides with Prometheus reserved/exported naming → Prom renames toexported_service. Prefer a non-colliding label (e.g.job/instanceelsewhere, or rename our label) when polishing exposition.Dashboard (lab): http://dockge.lab.rrd:3000/d/steamcache2-lab/steamcache2