-
Notifications
You must be signed in to change notification settings - Fork 380
Open
Description
label_replace函数,输入:瞬时向量,输出:key: value = 度量指标: 值(要替换的内容:首先 ,针对src_label标签,对该标签值进行regex正则表达式匹配。如果不能匹配的度量指标,则不发生任何改变;否则,如果匹配,则把dst_label标签的标签纸替换为replacement
例子:度量指标样本数据:http_requests_total{code="400",handler="query",instance="120.77.65.193:9090",job="prometheus",method="get"} 9
label_replace函数执行
label_replace(http_requests_total{code="400",handler="query",instance="120.77.65.193:9090",job="prometheus",method="get"}, "instance", "hello,world", "method", "ge.*")
显示结果:
http_requests_total{code="400",handler="query",instance="hello,world",job="prometheus",method="get"} 9
wkjun and dengxiafubi
Metadata
Metadata
Assignees
Labels
No labels