prometheus/node_exporter ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Go service that runs on a Linux or Unix machine and exposes the host’s hardware and operating system metrics in a format Prometheus can scrape.

It should read from the local system, like CPU, memory, disk, filesystem, network, load, and other machine stats, then serve them over HTTP on port 9100 with a /metrics endpoint. I want it to be easy to turn individual collectors on and off with command line flags, and I’d like a way to disable the default set and only enable the ones I need. Some collectors should also support include and exclude filters for things like devices, mount points, or units.

Make it work well both as a normal binary and in Docker, with a host monitoring setup that can point at the real root filesystem instead of the container’s own view. Please include a clean README with basic install and usage examples, plus a simple Docker example. If you need to check current best practices or docs, look them up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab