英文:
Grafana Prometheus extract label value
问题
label: pv_total{app="example"}
Current Grafana dashboard: image
The day in my data is redundant, I want to display without it in the data.
I hope my dashboard is like this (last 7 days, just one line): enter image description here
I don't know how to write a query metrics expression to remove the "day" field from the value.
I have tried using the expression label_replace(), but it didn't work.
英文:
label: pv_total{app="example",day="2023_03_15",} 123.0
Current Grafana dashboard:image
The day in my data is redundant, I want to display without it in the data
i hope my dashboard is this(last 7 days, just one line):
i don't know how to write query metrics expression to delete the day filed of value
i hava try expression label_replace(), but it's not work,
答案1
得分: -1
你可以使用Prometheus的sum()
方法,在你的情况下,像这样:sum(pv_total{job="$job"})
。
英文:
You can use prometheus' sum()
method, in your case, like this: sum(pv_total{job="$job"})
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论