metrics: Prometheus text exposition for /metrics #51
Reference in New Issue
Block a user
Delete Branch "metrics/prometheus-exposition"
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?
Why
/metricswas Prometheus-ish plainname valuetext with a custom# SteamCache2 Metricsbanner andContent-Type: text/plain. Strict scrapers (Prometheus, Grafana Alloy) can reject that. Jerry's lab Prom/Grafana scrape needs a clean exposition format without changing which metrics exist.What changed
WriteTextnow emits Prometheus text exposition format 0.0.4:# HELP name …,# TYPE name counter|gauge, then the sample line(s).service=%q./metricsContent-Typeistext/plain; version=0.0.4; charset=utf-8./lancache-heartbeatis unchanged.How tested
go test ./steamcache/metrics/ ./steamcache/ -count=1(pass)capacity_pressure_events,negative_cache_hits,disk_tier_ready,range_cache, …)# HELP/# TYPEchecks and/metricsContent-Type assertionsRisks
make validate-checkthat grepped the old banner will no longer see it (sample lines are unchanged).servicelabel is unchanged (Prometheus may still rename it toexported_service; that is issue #41, not this PR).Rollback
Revert this PR.
Closes #49
LGTM — Prometheus 0.0.4 HELP/TYPE + scrape Content-Type; /lancache-heartbeat untouched; counters cumulative; service→exported_service left to #41 as noted. CI green.