为source_label添加多个替换标签

时间:2020-08-12 01:51:49

标签: prometheus

我要转换以下指标

time__2xx_count{instance="localhost:9991",job="finagle_exporter",original_key="time/2XX.count"}

time__2xx_count{instance="localhost:9991",job="finagle_exporter",status="2XX",type="count"}

我想从original_key source_label中提取状态和指标类型。我尝试了以下操作,但不起作用

relabel_configs:
  - source_labels: [original_key]
    regex: 'time\/(.*)\.(.*)'
    replacement: '$1'
    target_label: status

  - source_labels: [original_key]
    regex: 'time\/(.*)\.(.*)'
    replacement: '$2'
    target_label: type

1 个答案:

答案 0 :(得分:0)

我会尝试以下操作:

finish()