https://github.com/jmb12686/node-exporter
Containerized, multiarch version of node-exporter, used for Prometheus monitoring.
https://github.com/jmb12686/node-exporter
docker docker-swarm monitoring multi-arch-images multiarch prometheus
Last synced: 7 months ago
JSON representation
Containerized, multiarch version of node-exporter, used for Prometheus monitoring.
- Host: GitHub
- URL: https://github.com/jmb12686/node-exporter
- Owner: jmb12686
- Created: 2019-10-18T19:39:27.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-20T18:54:37.000Z (over 4 years ago)
- Last Synced: 2025-02-28T12:33:47.933Z (8 months ago)
- Topics: docker, docker-swarm, monitoring, multi-arch-images, multiarch, prometheus
- Language: Dockerfile
- Size: 18.6 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-exporter
Containerized, multiarch version of node-exporter, used for [Prometheus](https://prometheus.io/) monitoring. Multi-stage build is used to build from official [node-exporter source code](https://github.com/prometheus/node_exporter). Designed to be usable within x86-64, arm64, armv6, and armv7 based Docker Swarm clusters. Added support for correct reporting of the underlying node hostname
## Automated Build and Deploy
This repository utilizes GitHub Actions to automatically build and deploy multiarch images to DockerHub when a new tag is pushed.## Build and Deploy multiarch image locally
Setup local environment to support Docker experimental feature for building multi architecture images, [buildx](https://docs.docker.com/buildx/working-with-buildx/). Follow instructions [here](https://engineering.docker.com/2019/04/multi-arch-images/)
Clone repo:
```bash
$ git clone https://github.com/jmb12686/node-exporter
$ cd node-exporter
```Build multiarch image:
```bash
$ docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v6 -t jmb12686/node-exporter:latest --push .
```## Usage
Use in docker-compose swarm stack similar to base image for `prom/node-exporter`, but added:
* `NODE_ID` as environment variable
* mount `/etc/hostname` of underlying host to `/etc/nodename` in the container.
* Entrypoint script within container will use `/etc/nodename` and `NODE_ID` to create custom data attributes and put config in `/etc/node-exporter`.
* `node-name` and `node-id` attributes are exposed in node-exporter```yaml
services:
.....
node-exporter:
image: jmb12686/node-exporter:latest
networks:
- net
environment:
- NODE_ID={{.Node.ID}}
ports:
- 9100:9100
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- /etc/hostname:/etc/nodename:ro
command:
- '--path.sysfs=/host/sys'
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--collector.textfile.directory=/etc/node-exporter/'
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
- '--no-collector.ipvs'
deploy:
mode: global
resources:
limits:
memory: 32M
```