prometheus / prometheus/prometheus

Set and check (and document) a global label_value_length_limit

Open
#16,525 30 comments 0 reactions 1 assignee View on GitHub

@fancive is already working on this.

Since Oct 8, 2025.

component/documentation component/scraping good first issue help wanted kind/feature priority/P3
Dominant language
Go
Stars
66.1k
Forks
10.8k
Avg merge
2d 1h
Merged PRs (30d)
131

Description

Proposal

Prometheus has label_name_length_limit and label_value_length_limit, currently defaulted to no limit.

After #16069, Prometheus will crash if you give it a name or value longer than 16MB, so we should at least have a default limit lower than that.

I think that a reasonable limit would be more like 200 bytes, but I am aware of people doing exciting things like storing a bitmap in a label. Maybe we could go with something like 1MB?

The code checking limits while scraping would need to check before constructing the Labels data structure, and we should check in other places such as the remote-write receiver, label_replace, label_join.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.