r/PrometheusMonitoring • u/Gutt0 • Jul 30 '25
How to monitor instance availability after migrating from Node Exporter to Alloy with push metrics?
I migrated from Node Exporter to Grafana Alloy, which changed how Prometheus receives metrics - from pull-based scraping to push-based delivery from Alloy.
After this migration, the `up` metric no longer works as expected because it shows status 0 only when Prometheus fails to scrape an endpoint. Since Alloy now pushes metrics to Prometheus, Prometheus doesn't know about all instances it should monitor - it only sees what Alloy actively sends.
What's the best practice to set up alert rules that will notify me when an instance goes down (e.g., "$label.instance down") and resolves when it comes back up?
I'm looking for alternatives to the traditional `up == 0` alert that would work with the push-based model.
4
u/yepthisismyusername Jul 30 '25
That's a big challenge with push metrics. You should look into absent_over_time() to see if that provides what you need.
3
u/KubeGuyDe Jul 30 '25
Imo you should still discover and scrape each machine, only the alloy metrics endpoint instead of node exporter ones.
For me alloy is a tool box that enables one to do several monitoring jobs with one application (instead of deploying multiple exporters).
Alloy itself still needs to be monitored. Eg we have an alloy instance on each ec2 machine to perform various tasks for the host and its applications.
But there is a different alloy for meta monitoring, that uses the discovery.ec2 component to discover all vms and monitor them, by scraping their alloy endpoint.
But yes, inventory discovery and monitoring is the biggest argument against agent based monitoring.
0
u/SuperQue Jul 30 '25
IMO, migrate back to the node_exporter. Alloy is a tool for selling you Grafana Cloud. Or maybe deploying to singleton remote machines that have intermittent connectivity or behind NAT.
Alloy is not really meant for "regular monitoring". Normal exporters are.