prometheus/prometheus

Set and check (and document) a global label_value_length_limit

開放

#16,525 建立於 2025年4月30日

 (30 則留言) (0 個反應) (1 位負責人)Go (10,408 個分叉)batch import
component/documentationcomponent/scrapinggood first issuehelp wantedkind/featurepriority/P3

倉庫指標

星標
 (64,042 顆星)
PR 合併指標
 (平均合併 11天 5小時) (30 天內合併 118 個 PR)

描述

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.

貢獻者指南