为source_label添加多个替换标签

问题描述

我要转换以下指标

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

time__2xx_count{instance="localhost:9991",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

解决方法

我会尝试以下操作:

finish()