Back to guidesGuide

Enrich Prometheus metrics with info() without triggering cardinality spikes

Use useful metadata in PromQL and recording rules without pushing volatile labels into the hot path.

A practical guide to testing Prometheus’ experimental info() function, building a metadata allowlist, measuring series impact, and proving alerts and SLOs still work.

Created: June 22, 2026

Published: June 22, 2026

Estimated time40 min
LevelIntermediate
Before you startPrometheus 3.x or a test environment where info() is available/enabled.
PlatformsLinux / Docker
WhatsAppXLinkedIn

Linux

Audit labels, create enriched info() rules, run promtool tests, and deploy as a canary first.

curljqpromtoolPrometheus access
Measure active series before the change
curl -s http://prometheus:9090/api/v1/status/tsdb | jq '.data.headStats'
Validate rules and tests
promtool check rules rules/metadata-enrichment.yml && promtool test rules tests/metadata-enrichment.test.yml

Content locked

This guide requires both steps before full content is available.

  • Click “Like” on this guide.
  • Share on WhatsApp, X, LinkedIn, or copy the link.

Access is automatically unlocked as soon as both steps are completed.