variablesprometheusprometheus-operatorgrafana-dashboard

Grafana Prometheus extract label value


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):

enter image description here

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,


Solution

  • You can use prometheus' sum() method, in your case, like this: sum(pv_total{job="$job"}).