Should node-exporter run from host or container?

Viewed 2298

there is a very simple question: What is best place from where run node-exporter? Directly inside the host or from a container?

What is the pros and cons of both solutions? What is the best practice from the developers? From the usage guidelines is not clear for me!

1 Answers

I would definitely say on the host. This is the recommended way, because node exporter needs access to certain metrics which are not available within the container. It's true that you still have access to various host metrics even when running in a container if you expose /proc and /sys, but you run the risk of scraping the container-related metrics instead of the host nonetheless.

One example are the network-related metrics. By default containers run in their own network namespace (and this is how you'd want them to run under normal circumstances), so given this default, you're going to scrape information related only to that container instead of that of host, despite the fact that you're exposing the aforementioned pseudo-filesystems.

Related