The goal of this stack is to provide data sources for Prometheus and then expose a single Prometheus endpoint per device to then be organized later by a single Grafana instance, as well as a Glances instance to get at a glance system stats.
- Prometheus - Time series database
- cAdvisor - Docker container monitoring
- nodeExporter - System resource monitoring
- Glances - At a glance system monitoring web interface
- Watchtower - Automated container image updates
Variable | Description |
---|---|
CONFIG_DIR | Root directory where service configuration files will live |
WATCHTOWER_NOTIFICATION_PROVIDER | Shoutrrr notification provider |
WATCHTOWER_NOTIFICATION_URL | Shoutrrr notification URL to get updates on Watchtower actions |
WATCHTOWER_UPDATE_INTERVAL | Value in seconds to wait between checking containers for updates |
WATCHTOWER_API_TOKEN | API Token to send with requests to metric endpoints |
- For some reason there were permission issues I could not figure out when trying to mount the Prometheus data volume from a directory. Switching to the Docker volume instead works. Seems like there's no negative impact on anything doing it this way.
- Glances can be configured as a web interface or as a data exporter for something like Prometheus
- Ports
- Web: 61208
- Prom: 19091 (or whatever you configure)
- Flags (these are mutually exclusive...swap flags to switch behavior)
- Web: -w
- Prom: --export prometheus
- Ports
You can see how to enable it here but as of 4/15/2024 Option 2 does not work.
Follow the steps for Option 1 and then use the glances-password.docker-compose.yml
file. Run the commands from the folder containing your glances.conf
file. If you have issues getting the password to work you may need to actually write out the password when prompted instead of pasting it in.
# Enter container
docker exec -it glances sh
# Generate password file for default login - add the --username password to set the username as well
glances -s --password
# Exit container (CTRL+C a few times) and then type "exit" after you confirm the password and the Announce line appears
# Create secrets directory
mkdir secrets
# Copy the password file to the host
docker cp glances:/root/.config/glances/glances.pwd ./secrets/glances_password