我正在尝试检索属性并将其映射到JMX导出器的每个指标上 例如,我有以下内容:
ExchangesCompleted{context="esb-demo-consumer-esb-demo-consumer-context",processor="log3",type="processor",} 0.0
ExchangesCompleted{context="esb-demo-consumer-esb-demo-consumer-context",route="JMS reader",type="route",} 0.0
StartLevel{container="cnt-01-development",name="StartLevel",type="karaf",} 100.0
我想检索容器“ cnt-01-development”,并在每个指标中将实例替换为仅在 StartLevel 行中显示的内容“ cnt-01-development”。
>它应该得到类似的东西:
ExchangesCompleted{context="esb-demo-consumer-esb-demo-consumer-context",processor="log3",type="processor",instance="cnt-01-development"} 0.0
ExchangesCompleted{context="esb-demo-consumer-esb-demo-consumer-context",route="JMS reader",type="route",instance="cnt-01-development"} 0.0
StartLevel{container="cnt-01-development",name="StartLevel",type="karaf",instance="cnt-01-development"} 100.0
我尝试了以下方法:
metric_relabel_configs:
- source_labels: ['container']
target_label: instance
replacement: $1
但它仅替换StartLevel指标