Zero Signup ToolsFree browser tools

Developer Tools

Prometheus Metrics Parser

Parse Prometheus and OpenMetrics text into families with types, labels, and values, then flag mistakes and export JSON or NDJSON. Or build a metric. No signup.

Prometheus metrics parser and builder

Prometheus text exposition format
404 chars

Quick samples

Paste the body of a /metrics endpoint, an exporter file, or any Prometheus text exposition block. Histogram and summary buckets are grouped under their base metric.

Summary

Families

2

Samples

4

Errors

0

Notes

0

Types

counter1gauge1

Metric families

2 families
http_requests_totalcounter

Total number of HTTP requests served.

3 series
SeriesValueType
http_requests_total{method="get",code="200"}10294integer
http_requests_total{method="post",code="200"}1843integer
http_requests_total{method="get",code="404"}17integer
process_resident_memory_bytesgauge

Resident memory size in bytes.

1 series
SeriesValueType
process_resident_memory_bytes5.1283968e+07integer

Export

One flat object per sample. NaN and Inf are kept as strings.

JSON

[
  {
    "metric": "http_requests_total",
    "type": "counter",
    "help": "Total number of HTTP requests served.",
    "name": "http_requests_total",
    "labels": {
      "method": "get",
      "code": "200"
    },
    "value": 10294,
    "timestamp": null
  },
  {
    "metric": "http_requests_total",
    "type": "counter",
    "help": "Total number of HTTP requests served.",
    "name": "http_requests_total",
    "labels": {
      "method": "post",
      "code": "200"
    },
    "value": 1843,
    "timestamp": null
  },
  {
    "metric": "http_requests_total",
    "type": "counter",
    "help": "Total number of HTTP requests served.",
    "name": "http_requests_total",
    "labels": {
      "method": "get",
      "code": "404"
    },
    "value": 17,
    "timestamp": null
  },
  {
    "metric": "process_resident_memory_bytes",
    "type": "gauge",
    "help": "Resident memory size in bytes.",
    "name": "process_resident_memory_bytes",
    "labels": {},
    "value": 51283968,
    "timestamp": null
  }
]

NDJSON

{"metric":"http_requests_total","type":"counter","help":"Total number of HTTP requests served.","name":"http_requests_total","labels":{"method":"get","code":"200"},"value":10294,"timestamp":null}
{"metric":"http_requests_total","type":"counter","help":"Total number of HTTP requests served.","name":"http_requests_total","labels":{"method":"post","code":"200"},"value":1843,"timestamp":null}
{"metric":"http_requests_total","type":"counter","help":"Total number of HTTP requests served.","name":"http_requests_total","labels":{"method":"get","code":"404"},"value":17,"timestamp":null}
{"metric":"process_resident_memory_bytes","type":"gauge","help":"Resident memory size in bytes.","name":"process_resident_memory_bytes","labels":{},"value":51283968,"timestamp":null}

Exposition format reference

The grammar a /metrics endpoint follows, summarized in one place. This tool parses and writes the same rules.

Metadata lines

  • # HELP name text describes a family.
  • # TYPE name kind sets counter, gauge, histogram, summary, or untyped.
  • Any other # line is a free comment.

Sample lines

  • name{label="v"} value [ts]
  • The label set and the timestamp are optional.
  • The timestamp is integer milliseconds since the epoch.

Values and escaping

  • Values are Go floats: 1.5e7, NaN, +Inf, -Inf.
  • In label values, \\, \", and \n are escapes.
  • In help text, only \\ and \n are escapes.

Histograms and summaries

  • Histograms add _bucket{le}, _sum, _count and require le="+Inf".
  • Summaries add {quantile}, _sum, _count.
  • Counters should end in _total.

How to use

  1. Choose a mode: Parse metrics to read an existing exposition block, or Build a metric to write a new one.
  2. To parse, paste the body of a /metrics endpoint or an exporter file into the box, or click a quick sample such as Counter + gauge, Histogram, or node_exporter snippet.
  3. Read the metric families: each shows its type badge, help text, and a table of series with labels, values, and the value kind (float, integer, NaN, +Inf, -Inf).
  4. Check the Errors and Notes panels for problems tied to a line number, such as a missing value, an unquoted label, a duplicate series, or a counter that is missing its _total suffix.
  5. Use Copy JSON or Copy NDJSON to export every sample as a flat object for a script, a test, or a spreadsheet.
  6. To build, enter a metric name, pick a type, add a help string and label rows, set a value, then copy the generated exposition block.

About this tool

Prometheus Metrics Parser reads the text exposition format that a /metrics endpoint returns, the format spoken by node_exporter, cAdvisor, kube-state-metrics, the Pushgateway, and every Prometheus client library, and turns it into something you can actually inspect. The same base grammar underlies OpenMetrics. The format looks trivial, lines of name value pairs, but the details are easy to get wrong, and this tool implements the rules the reference parser follows so you can trust what it shows. Paste the body of a /metrics response or an exporter file into the Parse view and the tool groups the samples into metric families. Each family shows its declared type (counter, gauge, histogram, summary, or untyped from a # TYPE line), its description from a # HELP line, and a table of every series with its labels, value, and an optional timestamp. The histogram and summary members are folded under their base metric: when a metric is declared a histogram or summary, its _bucket, _sum, and _count series sit with it instead of floating off as separate families, which is how Prometheus itself groups them. Values are parsed as Go doubles, so scientific notation like 5.1283968e+07 is read correctly and the special tokens NaN, +Inf, and -Inf are preserved and labeled rather than turned into zero or dropped. Labels are parsed with the real escaping rules, where a backslash, a double quote, and a newline are the only escapes inside a label value, and the help text uses its own narrower set where only backslash and newline are escaped. The tool is a linter as much as a reader. It reports the mistakes that break a scrape or violate convention: a sample with no value, an unterminated label set, a label value that is not quoted, a # TYPE that is not one of the five valid kinds, a duplicate series that Prometheus would reject, a counter whose name does not end in _total, a metric with samples but no # TYPE or no # HELP, a histogram missing its required le="+Inf" bucket, and a summary with no quantile series. Errors are tied to the exact line number and notes explain the convention so you can fix the exporter. When the input is clean, the whole result exports two ways: pretty JSON and NDJSON, each as one flat object per sample carrying the metric name, type, help, the full label set, the value, and the timestamp, so you can pipe scraped metrics into a script, a test assertion, or a spreadsheet. Because NaN and Infinity cannot appear in JSON, they are emitted as the strings Prometheus writes. The second mode goes the other way: a small Build view takes a metric name, a type, a help string, label rows, and a value, and writes a valid exposition block with the # HELP and # TYPE headers and correct escaping, ready to paste into an exporter, a fixture, or a Pushgateway push, with a reminder that a real histogram or summary also needs its companion _bucket, _sum, and _count series. One honest limit: this is a parser, a linter, and a writer for the text exposition format, not a Prometheus server. It does not scrape a target, evaluate PromQL, compute rates over time, or render graphs; it works on the metrics text you give it. Everything runs locally in your browser, so the metrics you paste or build are never uploaded, fetched, or logged.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools