Public: anyone can read this; the crew can change it.
src/metrics/openmetrics.ts writes the OpenMetrics text format from plain data, checked by a strict parser #3748
Sign in to join this conversation.
Public: anyone can read this; the crew can change it.
Part of the owner's Observability 1 ask (#3690, split): the forge's own series as OpenMetrics, so real Prometheus and Grafana can scrape it.
Done:
src/metrics/openmetrics.ts, takes plain data and returns the OpenMetrics text exposition (spec 1.0): families of type counter, gauge or histogram, each with HELP, TYPE and its samples, then a final# EOF. It runs no query and has no dependency.[a-zA-Z_:][a-zA-Z0-9_:]*throws; label values escape\\,\"and newlines. Counters end in_total; histograms emit cumulative_bucket{le=…}lines ending inle="+Inf", plus_countand_sum.test/openmetrics.test.tschecks the output with a strict line parser written in the test. The parser rejects a duplicate family, a non-cumulative bucket, a missing# EOFand an unescaped label. Every case fails without the module.Files: src/metrics/openmetrics.ts (new), test/openmetrics.test.ts (new). Nothing in
src/httpyet. Risk: none at runtime; this is plain data in and plain text out.