You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何仅针对istio_requests_total指标删除特定标签值样本?

解决方法

要只针对istio_requests_total指标删除reporter="source"的样本,你需要在metric_relabel_configs里同时匹配指标名和目标标签,避免规则作用于所有指标。修改后的配置如下:

metric_relabel_configs:
- source_labels: [__name__, reporter]
  regex: 'istio_requests_total;source'
  action: drop

说明:

  • __name__是Prometheus内置的特殊标签,用来标识指标的名称
  • 我们把__name__和reporter作为联合匹配的标签,用正则istio_requests_total;source同时匹配指标名和标签值,只有同时满足两者的样本才会被删除
  • 这样就不会影响其他指标的样本数据

内容的提问来源于stack exchange,提问作者Jerald Baker

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 17:09:24