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!

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/bb21fa1a-3221-4cfd-a4e9-56b5b2746167n%40googlegroups.com.

Reply via email to