bvis / docker-node-exporter Goto Github PK
View Code? Open in Web Editor NEWNode exporter that can expose the host hostname if an specific file is mounted in the container
Node exporter that can expose the host hostname if an specific file is mounted in the container
Hi there. Thanks for this docker image.
I'm getting a crash immediately, on start, with the suggested config from the README:
node_exporter: error: unknown long flag '--collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"', try --help
.
Any ideas?
How can I get the host then as part of a summary or description in an alert?
Eg. Can I just reference $labels.host in the following or do I need to do some kind of relabel ?
ALERT service_down
IF up == 0
FOR 30s
LABELS { severity = "critical" }
ANNOTATIONS {
summary = "'{{ $labels.job }}'/'{{ $labels.host }}' Service is down",
description = "Service '{{ $labels.job }}', instance '{{ $labels.instance }}' is down.",
}
Or do I need to do something like this to get the value?
{{ printf `host{instance="%s"}` $labels.instance | query | first }}
I think it would be useful to add the "proxy service name" parameter on dashboard import. The alternative would be to use a more generic hardcoded name like "proxy".
P.S. It's a great dashboard. I'm planning to include it in https://leanpub.com/the-devops-2-1-toolkit.
Not sure what I am doing wrong or if I have to do something specifically to get the hostname within Prometheus.
Stack File:
version: "3.5"
services:
node-exporter:
image: basi/node-exporter
networks:
- monitor
environment:
- HOST_HOSTNAME=/etc/host_hostname
volumes:
- /proc:/host/proc
- /sys:/host/sys
- /:/rootfs
- /etc/hostname:/etc/host_hostname
deploy:
mode: global
labels:
- com.df.notify=true
- com.df.scrapePort=9100
- com.df.alertName.1=mem_load
- com.df.alertIf.1=@node_mem_limit:0.8
- com.df.alertFor.1=30s
- com.df.alertName.2=diskload
- com.df.alertIf.2=@node_fs_limit:0.8
- com.df.alertFor.2=30s
resources:
reservations:
memory: 20M
limits:
memory: 50M
command: '--path.procfs="/host/proc" --path.sysfs="/host/sys" --collector.filesystem.ignored-mount-points="^/(sys|proc|dev|host|etc)($$|/)" --collector.textfile.directory="/etc/node-exporter/" --collector.conntrack --collector.diskstats --collector.entropy --collector.filefd --collector.filesystem --collector.loadavg --collector.mdadm --collector.meminfo --collector.netdev --collector.netstat --collector.stat --collector.textfile --collector.time --collector.vmstat --collector.ipvs'
networks:
monitor:
external: true
proxy:
external: true
Discovered Labels:
__address__="10.0.1.14:9100" __meta_dns_name="tasks.exporter_node-exporter" __metrics_path__="/metrics" __scheme__="http" job="exporter_node-exporter"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.