[英]finding timeseries in prometheus that have the most labels
Prometheus recommends not using too many labels for timeseries and VictoriaMetrics is even dropping labels if you have more than 30. Prometheus 建议不要为时间序列使用太多标签,如果您有超过 30 个标签,VictoriaMetrics 甚至会丢弃标签。
But how can I find timeseries that have too many / more than a certain amount of labels?但是我怎样才能找到标签太多/超过一定数量的时间序列? Is that even possible with PromQL? PromQL 甚至可以做到这一点吗?
AFAIK there is no way to measure the number of labels in metrics. AFAIK 无法衡量指标中的标签数量。
The issue is not the number of labels but the cardinality of the metric .问题不在于标签的数量,而是指标的基数。 Even if you have 10 labels and 3 of them are constant ( __name__
, job
, instance
) and if the 7 others have 2 values each, you reach a cardinality of 128 for a single metric which is already the limit as rule of thumb.即使您有 10 个标签并且其中 3 个是常量( __name__
、 job
、 instance
),并且如果另外 7 个标签各有 2 个值,那么单个指标的基数也会达到 128,这已经是经验法则的限制。
Therefore, it is not something decided a posteriori or monitored but rather decided at design time: the right number of labels is as few as possible.因此,这不是事后决定或监控的,而是在设计时决定的:正确的标签数量越少越好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.