Hi, hope you're doing great.
I have a counter metric like:
mercury_site_views_total{site="A",node="n2"} 14
mercury_site_views_total{site="B",node="n5"} 31
mercury_site_views_total{site="C",node="n1"} 9
Metrics are exported for multiple sites, and multiple nodes within each site. Metrics are scraped every 5 minutes. All metrics reset (blank) once a day.
Now, I'm trying to build Prometheus queries via Grafana for two things:
1) Graph showing total views for each site within the selected time range - query (in non-Instant mode) I've got seems to be fine I guess:
sum by (site) ( increase(mercury_site_views_total[6m]) > 0 or (mercury_site_views_total != 0 unless mercury_site_views_total offset $__interval) )
2) Table listing total views for each site and node combination within the selected time range - query (in Instant mode) I've got doesn't seem to be working (missing some metrics):
sum by (site, node) ( increase(mercury_site_views_total[$__range]) > 0 or (mercury_site_views_total != 0 unless mercury_site_views_total offset $__range) )
I'll really appreciate if someone can review and suggest improvements for these queries. I've been struggling with getting them right for the last two days, but without luck.
Thank you!