Should node-exporter run from host or container?
Asked Answered
H

1

8

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!

Hypsometry answered 30/10, 2018 at 9:24 Comment(5)
Have you checked this: github.com/prometheus/node_exporter#using-docker?Metaplasm
Yes, they write It's not recommended to deploy it as a Docker container because it requires access to the host system but after that they explain how to run it from inside a container... so I'm a little bit confused! Is best from outside container or not ? What is the difference ?Hypsometry
Just a side note: a container is nothing more than a process with a chroot. Both run on "the host".Boucher
Ummm speaking about where the process is running ok but there are some differences when you attempt to use system calls and other platform specific functionality... I don't think that you can monitor completely the system from inside a container in the same manner as you were directly on the host (but this my guess)Hypsometry
Interesting read: github.com/prometheus/node_exporter/pull/672.Metaplasm
P
5

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.

Pamilapammi answered 17/6, 2021 at 19:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.