Skip to content
Novus Examples
prom681 B

Prometheus Exposition — Label Value Escaping Edge Cases (prom)

Ten series whose label values contain the characters that break naive line splitting — escaped quotes and backslashes, an escaped newline, non-ASCII text, braces, commas, equals signs, a leading hash and significant whitespace. The exposition format defines exactly three escapes and this file uses all of them.

Preview — first 15 linesprom
# HELP tricky_label_values Label values exercising every escape the format allows.
# TYPE tricky_label_values gauge
tricky_label_values{quote="he said \"deploy it\""} 1
tricky_label_values{backslash="C:\\logs\\app"} 2
tricky_label_values{newline="line one\nline two"} 3
tricky_label_values{unicode="café — ünïcödé ✅"} 4
tricky_label_values{empty=""} 5
tricky_label_values{braces="{not a label set}"} 6
tricky_label_values{comma="a,b,c",equals="k=v"} 7
tricky_label_values{hash="# not a comment"} 8
tricky_label_values{spaces="  padded  "} 9
# HELP help_with_escapes Help text may escape backslash \\ and newline \n only.
# TYPE help_with_escapes gauge
help_with_escapes 1

Specifications

Series
10
Escape Sequences
3
Includes Unicode
true
Includes Embedded Comma
true
Includes Hash In Value
true
Rule
only \\, \" and \n are escapes

Testing contract

Expected to pass
Scenario
Parse the file with a regex-free exposition parser and read back each label value.
Expected result
The comma and equals values stay inside their single label rather than splitting into more, the hash value is not treated as a comment, and \n unescapes to one real newline.

What is a .prom file?

A .prom file holds metrics in the Prometheus text exposition format, the same body a `/metrics` endpoint returns. Each metric family is introduced by `# HELP` and `# TYPE` comments and followed by one sample per line: a metric name, an optional brace-delimited label set, a value, and an optional millisecond timestamp. Counters, gauges, histograms (with `_bucket`, `_sum`, `_count` series and a `+Inf` bucket), and summaries with quantile labels all use this one grammar.

How to use this file

Use an example .prom file to test exposition-format parsers, scrapers, and the node_exporter textfile collector — checking label escaping, histogram bucket ordering and cumulative counts, and the handling of `NaN` and `+Inf` values.

How to use this file for testing

“Prometheus Exposition — Label Value Escaping Edge Cases (prom)” is a deterministic Novus Examples fixture for Observability, Encoding detection, Config parsing. Structured and plain-text telemetry with known timestamps, levels, request identifiers, and error states for testing log ingestion, correlation, dashboards, and alert pipelines.

Documented properties for this file: PROM · 681 bytes. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Telemetry fixtures use fixed trace IDs, span IDs, and timestamps so ingestion is reproducible run to run. Point your collector, parser, or query layer at the file and assert the documented span tree, metric families, or severity mix; service and host names are invented.

Generated by generation/observability.py. Free for any use, no attribution required — license.