Skip to content

Prometheus Relabel Tester · Observability

Prometheus relabel tester — see what your rules do before they drop your metrics.

This Prometheus relabel tester lets you paste a relabel_configs list and some sample labels, then watch which labels survive, get rewritten, or cause a target to be dropped — with the same anchored-regex, $1-expansion, and MD5 hashmod semantics Prometheus uses. Test Prometheus relabel rules instantly, in your browser. No install, no signup.

Runs in your browser — nothing you paste leaves this page. How we prove that

Runs in your browser No signup Matches Prometheus semantics Updated Jul 29, 2026

Prometheus relabeling playground — relabel_configs tester online

relabel_configs
label sets

Runs entirely in your browser — nothing is uploaded. One label set per block; separate sets with a blank line. Press Esc to release focus from an editor.

Results

Load an example or paste relabel rules and label sets, then run to see which labels survive, change, or get dropped.

The Gap

Relabeling fails silently.

A wrong relabel_config does not error — it just quietly drops the metrics you expected, or keeps the ones you meant to silence. The rules look simple, but the semantics are full of sharp edges: the regex is fully anchored, a replace with an empty value deletes the label, and hashmod depends on an exact MD5-based hash.

The only way to be sure is to run the rules — but iterating against a live Prometheus is slow, and reading the configuration reference rarely tells you what your labels will become. Use this relabel_configs simulator to test Prometheus relabel rules against sample labels online and confirm the outcome in seconds — see the life of a label for the why. It doubles as a Prometheus relabel debugger when a regex is not matching the way you expect.

This free Prometheus relabeling tester runs entirely in the browser and models every action — replace, keep, drop, labelmap, hashmod and more — with nothing to install and nothing uploaded. It covers both relabel_configs and metric_relabel_configs, so it works as a keep/drop tester, a replace tester, and a metric_relabel_configs tester all at once.

See every action in the actions reference, or try the live playground above.

The Pipeline

How to test Prometheus relabel rules.

Five deterministic steps run end-to-end on every label set — all inside your browser tab — so you can simulate Prometheus relabel rules before applying them to a live scrape config.

  1. Parse the rules.

    Your relabel_configs YAML is parsed into a list of rules, each field defaulted exactly as Prometheus does — separator ";", regex "(.*)", replacement "$1", action "replace".

  2. Read the labels.

    Each block of key=value lines becomes one label set. Quoted values keep their commas and spaces; blank lines separate targets.

  3. Join and anchor.

    For every rule, the source_labels values are joined with the separator, and the regex is anchored as ^(?:regex)$ before matching — the way the real engine does.

  4. Apply in order.

    Rules run top to bottom; each sees the output of the previous one. replace expands $1/${1}, hashmod uses MD5, and keep/drop can remove the whole target.

  5. Show the diff.

    For each set you get the final labels with added/changed tags, a list of removed labels, and a clear flag when a target was dropped — and by which rule.

Actions Reference

Every relabel action, modeled.

The tester implements the full set of relabel_config actions with Prometheus-exact behaviour. Here is what each one does.

  • replace

    Join source_labels with the separator; if the anchored regex matches, expand $1/${1} in replacement and set target_label. An empty expansion DELETES the label.

  • keep / drop

    keep removes the whole target unless the joined source matches the regex; drop removes it when it does match. Both decide whether the series is scraped or stored at all.

  • keepequal / dropequal

    No regex. Compare the joined source value to the current target_label value; keepequal keeps only on equality, dropequal drops on equality.

  • hashmod

    Set target_label to md5(joined source) % modulus — the last 8 MD5 bytes read as a big-endian uint64. Uses the same MD5 recipe as Prometheus, for stable horizontal sharding.

  • labelmap

    For every label whose NAME matches the regex, set a new label named by the expanded replacement to that label's value — e.g. __meta_kubernetes_pod_label_(.+) → $1.

  • labeldrop / labelkeep

    labeldrop removes every label whose NAME matches the regex; labelkeep removes every label whose NAME does NOT match. Used to prune discovery metadata.

  • lowercase / uppercase

    Set target_label to the lower- or upper-cased joined source value. Handy for normalising case-inconsistent discovery labels.

Example rules

relabel_configs
# Promote a Kubernetes pod label, then drop a noisy metric.
- action: labelmap
  regex: __meta_kubernetes_pod_label_(.+)

- source_labels: [__name__]
  action: drop
  regex: go_gc_.*

Defaults match Prometheus: source_labels: [], separator: ";", regex: "(.*)", replacement: "$1", action: replace. See the relabeling guide for context.

The same engine powers this metric_relabel_configs tester and the relabel_configs path — Prometheus applies identical relabeling semantics to each, so the metric_relabel_configs vs relabel_configs difference is only where in the pipeline the rules run, not how. The default separator is ";", so test how multiple source_labels join before you write a regex — especially for Kubernetes __meta_kubernetes discovery labels.

Next Step

Got the labels right? Now check the queries and the routing.

Relabeling shapes the series; what you do next is query and alert on them. Break down a query with the PromQL explainer, or confirm an alert lands in the right place with the Alertmanager route tester — both run entirely in your browser, just like this one.

pipeline
# shape → query → alert
relabel_configs:   # ← from this tester
  - source_labels: [__name__]
    action: keep
    regex: http_requests_total
# then: explain the PromQL, test the route

FAQ

Questions, answered.

Tap a question to expand the answer.

Both apply the exact same relabeling actions and semantics — the difference is only where they run in the pipeline. relabel_configs runs before a scrape, on the target labels coming from service discovery, and can keep or drop whole targets. metric_relabel_configs runs after a scrape, on every sample's label set, and is used to drop or rewrite individual time series. This tester handles both, so you can use it as a metric_relabel_configs tester or a relabel_configs tester interchangeably.

Paste a YAML list of relabel_configs in one pane and one or more sample label sets in the other, then hit Run. The relabel_configs simulator applies your rules exactly the way Prometheus does and shows the resulting labels, which were added, changed, or removed, and whether the target was dropped. It is the fastest way to test relabel_configs against sample labels online and confirm a rule behaves the way you think before you ship it to a live scrape config.

Almost always because the regex did not match — and the regex is fully anchored. Prometheus wraps every relabel regex as ^(?:your-regex)$, so the pattern must match the entire joined source value, not just part of it. A regex of api will NOT match a value of api-server. With a keep action, anything that fails to match is dropped, so the target silently disappears. Use this Prometheus relabel debugger to see exactly which value was joined and why the regex is not matching — then widen it with (.*) or explicit capture groups.

keep removes the target (or series) unless the joined source value matches the regex; drop removes it when it does match. They are mirror images — keep is an allow-list gate, drop is a deny-list gate. Both decide whether the series is scraped or stored at all, rather than rewriting a label. This Prometheus relabel keep/drop tester marks any dropped target with the rule and action responsible, so you can see which rule removed a series.

The default separator is a single semicolon (";"). When a rule lists more than one entry in source_labels, Prometheus joins their values with that separator before matching the regex — so source_labels: [job, instance] on job="api", instance="10.0.0.1:9090" produces api;10.0.0.1:9090. The tester uses the same default, so you can verify how multiple labels join (and write a regex that accounts for the ";") before applying it.

hashmod joins the source labels, takes the MD5 of the result (the same md5.Sum Prometheus uses), reads the last 8 bytes of that digest as a big-endian 64-bit integer, and stores hash % modulus in the target label. This Prometheus relabel hashmod tester reproduces that exact recipe, so the shard values it produces match Prometheus byte-for-byte. That lets you verify a horizontal-sharding setup — hashmod into a temporary label, then keep on the shard you own — before deploying it.

labelmap operates on label NAMES, not values. For every label whose name matches the regex, it copies that label's value into a new label named by the expanded replacement — the classic __meta_kubernetes_pod_label_(.+) to $1 move that promotes Kubernetes pod labels to plain labels. The Prometheus labelmap relabel tester runs it against the actual label names in your set, and also models labeldrop and labelkeep, which remove labels whose names match (or do not match) the regex.

No. This is an online Prometheus relabel_config tester with no install and no signup, and it runs 100% client-side. Your relabel rules and label sets are parsed and evaluated inside your browser tab — nothing is uploaded to a server. You can safely paste internal scrape configs, including private target metadata and label names. This tool is independent and not affiliated with, endorsed by, or sponsored by the Prometheus project or the Cloud Native Computing Foundation.

More free, private DevOps tools.

The Prometheus Relabel Tester is one tool in OpsCanopy — a growing canopy of browser-based validators, converters and testers that never touch a server.

New to Kubernetes?  Read the Kubernetes guide →

39 free tools, every one offline-capable — opscanopy.com works with no signup and nothing uploaded.

Related tools: the PromQL explainer and the Alertmanager route tester. Browse the full tools directory.

Not affiliated with, endorsed by, or sponsored by the Prometheus project or the Cloud Native Computing Foundation. Prometheus is used here only descriptively to identify the relabel_configs format this tool models.