metrics: Prometheus text exposition for /metrics #51
No reviewers
Labels
No labels
blocked
bug
draft
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
s1d3sw1ped/steamcache2!51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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.