普罗米修斯操作员掌舵图:重新标记指标



在我的v33 Helm图表中,为了减少TSDB的大小,我需要删除ID标签。根据这篇文章,这可以通过度量重新标记来完成。因此,在值文件的所有相关部分中,我有以下内容:

metricRelabelings:
- sourceLabels: [id]
action: "drop"

在我可以在9090端口的web GUI中看到的Prometheus配置中,它被翻译如下(再次在所有相关部分中(:

metric_relabel_configs:
- source_labels: [id]
separator: ;
regex: (.*)
replacement: $1
action: drop

然而,在GUI中的TSDB状态中;id";标签仍然存在,具有与尝试删除它之前相同的基数。

我错过了什么?

我在Prometheus运算符图表中的values.yaml中尝试了这个用于下降度量的正则表达式。这是有效的。

kube-state-metrics:
namespaceOverride: ""
rbac:
create: true
releaseLabel: true
prometheus:
monitor:
enabled: true
## Scrape interval. If not set, the Prometheus default scrape interval is used.
##
interval: ""
## Scrape Timeout. If not set, the Prometheus default scrape timeout is used.
##
scrapeTimeout: ""
## proxyUrl: URL of a proxy that should be used for scraping.
##
proxyUrl: ""
# Keep labels from scraped data, overriding server-side labels
##
honorLabels: true
## MetricRelabelConfigs to apply to samples after scraping, but before ingestion.
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#relabelconfig
##
metricRelabelings:
- action: drop
regex: '(default|test2|test1)'
sourceLabels: [namespace]

最新更新