01What is Prometheus Metrics Parser?
Prometheus Metrics Parser reads the text that an exporter or app serves on /metrics and turns it into a list of metric families. A raw scrape is easy to produce and hard to review. Format slips only show up when Prometheus refuses the scrape, and a bad label only shows up when your series count jumps. For each family you see its type, its HELP text, how many series it has, and every label name with its number of distinct values and a few examples. A problems list shows format errors and cardinality warnings with line numbers. The parser follows the Prometheus text exposition format as documented on prometheus.io. Lines starting with # are comments unless the next token is HELP or TYPE. TYPE must be counter, gauge, histogram, summary or untyped, and a family without TYPE is untyped. The tool reports a second HELP or TYPE line, a TYPE line after the first sample, one metric split into separate groups, duplicate series, and a missing final line feed. Sample lines follow the documented grammar. That covers escaped label values, quoted UTF-8 metric names inside the braces, quoted label names, trailing commas, NaN, +Inf, -Inf and integer millisecond timestamps. Values are checked the way Go's ParseFloat accepts them. Histogram and summary samples are grouped under their base name, so x_bucket, x_sum and x_count count as one family. The documented rules are checked: buckets in increasing le order, a required le="+Inf" bucket, and x_count equal to that bucket. Summary quantiles must also increase. Cardinality leaves out le on buckets and quantile on summaries, so one histogram series counts once. The Prometheus docs warn against labels with many values, such as user IDs or email addresses. They also suggest keeping most metrics below 10 series and looking at anything over 100. So the default warning fires above 100 series, and you can change it. A label is also flagged when its name looks like an ID, email, IP or URL, or its values look like UUIDs, IP addresses or paths with IDs. A worked example: the "Format errors" sample declares a histogram with buckets le="1" then le="0.5" and no +Inf bucket. The tool reports the missing +Inf bucket on line 2, the out-of-order le on line 3, and a non-cumulative count. It then flags the late TYPE for jobs, the repeated pool label, and the value "oops". Limits: a single scrape only shows what one target exposes right now. Real cardinality also grows with the number of targets and over time. OpenMetrics and protobuf formats are not parsed.
SREs, platform engineers and developers who write exporters or instrument services and want a scrape to be valid and cheap to store. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Prometheus Metrics Parser
- Run curl against your target's /metrics endpoint and copy the output
- Paste it into the input box
- Read the summary counts and the problems list, which shows line numbers
- Look at the families, sorted by series count, and their label tables
- Adjust the series warning threshold or filter by name if the scrape is large
- Copy the report to share it in an issue or review
03Worked examples
- Input:
# HELP http_requests_total The total number of HTTP requests. # TYPE http_requests_total counter http_requests_total{method="post",code="200"} 1027 1395066363000 http_requests_total{method="post",code="400"} 3 1395066363000 (plus the http_request_duration_seconds histogram from the docs) - Result:
http_requests_total: counter, 2 series, labels code (2), method (1) http_request_duration_seconds: histogram, 1 series 7 samples, no problems - Lines from the example in the Prometheus docs.
- Input:
# TYPE api_requests_total counter api_requests_total{user_id="u1",path="/orders/1001"} 4 (three more lines for u2 to u4 and /orders/1002 to /orders/1004) - Result:
line 2 [warning] Label "user_id" on "api_requests_total" (4 values): name suggests unbounded values (IDs, emails, IPs, URLs). line 2 [warning] Label "path" on "api_requests_total" (4 values): values look like paths with IDs in them. - Input:
# TYPE queue_wait_seconds histogram queue_wait_seconds_bucket{le="1"} 5 queue_wait_seconds_bucket{le="0.5"} 3 queue_wait_seconds_count 9 jobs 1 # TYPE jobs gauge workers{pool="a",pool="b"} 2 cache_hits oops - Result:
line 2 [error] Histogram "queue_wait_seconds" is missing the required {le="+Inf"} bucket. line 3 [error] Buckets of "queue_wait_seconds" must be in increasing le order. line 3 [warning] Bucket counts of "queue_wait_seconds" should be cumulative, but this one is lower than the previous bucket. line 6 [error] TYPE for "jobs" comes after its first sample; it must come before. line 7 [error] Label "pool" appears twice on one line. line 8 [error] Value "oops" is not a valid float. - Input:
# TYPE rpc_duration_seconds summary with quantiles 0.5, 0.9, 0.99 (value NaN), _sum 1.77e+03 and _count 2693; # TYPE "http.server.active_requests" gauge with {"http.server.active_requests",method="GET"} 3; build_info with an escaped \n in a label - Result:
rpc_duration_seconds: summary, 1 series http.server.active_requests: gauge, 1 series, labels method (1) build_info: untyped, 1 series, labels version (1), note (1) 7 samples, no problems - NaN, exponent notation and a quoted UTF-8 name are all valid.
- Input:
# TYPE jobs_seconds histogram jobs_seconds_bucket{le="1"} 2 jobs_seconds_bucket{le="+Inf"} 5 jobs_seconds_count 6 jobs_seconds_sum 7.5 (no newline at the end) - Result:
line 4 [error] jobs_seconds_count (6) must equal the +Inf bucket (5). line 5 [warning] The last line must end with a line feed character.
04Common use cases
- Checking a new exporter's /metrics output for format errors before Prometheus scrapes it
- Finding which metric family and label is driving a jump in time series count
- Reviewing a pull request that adds metrics, to catch user IDs or raw URL paths in labels
- Confirming that histogram buckets are ordered and include the +Inf bucket
- Checking that a hand-written histogram's _count matches its +Inf bucket
- Testing quoted UTF-8 metric names before rolling them out to older scrapers
- Getting a quick list of every metric name, type and HELP text an app exposes
05Tips
- Replace raw URL paths with route templates like /orders/:id before using them as label values
- Counter names should end in _total; the tool notes counters that do not
- Colons in metric names are reserved for recording rules, so exporters should not use them
- Label names starting with two underscores are reserved for Prometheus itself
- Lower the series threshold to 10 when reviewing a single new metric, to match the docs' guideline
06Related concepts
Prometheus exposition format, /metrics endpoint, label cardinality, histogram buckets, metric families, time series.
Frequently Asked Questions
What is Prometheus Metrics Parser?
Prometheus Metrics Parser is a free, browser-based developer tool on AIDToolStack. Paste a Prometheus /metrics scrape to list metric families, TYPE and HELP, series counts and label cardinality, and find format errors. Runs in-browser. It requires no installation or sign-up and works entirely in your browser.
Is Prometheus Metrics Parser free to use?
Yes. No sign-up, no fees and no usage cap.
Does Prometheus Metrics Parser store my data?
No. It runs in your browser; nothing is uploaded.