53 lines
2.6 KiB
Markdown
53 lines
2.6 KiB
Markdown
# docker-observation
|
|
|
|
Various tools to monitor Docker containers
|
|
|
|
| Service | Name | Image |
|
|
|-----------------|-----------------|-------------------------|
|
|
| portainer-agent | portainer_agent | [portainer/agent] |
|
|
| telegraf-docker | telegraf-docker | [telegraf] |
|
|
| promtail | promtail | [grafana/promtail] |
|
|
| watchtower | watchtower | [containrrr/watchtower] |
|
|
|
|
[portainer/agent]: https://hub.docker.com/r/portainer/agent
|
|
[telegraf]: https://hub.docker.com/_/telegraf
|
|
[grafana/promtail]: https://hub.docker.com/r/grafana/promtail
|
|
[containrrr/watchtower]: https://hub.docker.com/r/containrrr/watchtower
|
|
|
|
## Services
|
|
|
|
### [Telegraf](https://www.influxdata.com/time-series-platform/telegraf/) - [Docker plugin](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/docker/README.md)
|
|
|
|
> Telegraf is the open source server agent to help you collect metrics from your stacks, sensors, and systems.
|
|
|
|
### Grafana [Promtail](https://grafana.com/docs/loki/latest/send-data/promtail/)
|
|
|
|
> Promtail is an agent which ships the contents of local logs to a private Grafana Loki instance or Grafana Cloud. It is usually deployed to every machine that runs applications which need to be monitored.
|
|
|
|
#### Pipline Stages
|
|
|
|
- zigbee2mqtt
|
|
- labels `MQTT publish` - `device` and `payload`
|
|
- categorizes `occupancy` or `contact`
|
|
|
|
### [Watchtower](https://containrrr.dev/watchtower/)
|
|
|
|
> With watchtower you can update the running version of your containerized app simply by pushing a new image to the Docker Hub or your own image registry. Watchtower will pull down your new image, gracefully shut down your existing container and restart it with the same options that were used when it was deployed initially.
|
|
|
|
## Environment Variables
|
|
|
|
| Environment Variable | Description |
|
|
| -------------------------- | ----------------------------------------------- |
|
|
| `DOCKER_GUID` | Group ID number for the `docker` user group |
|
|
| `DOCKER_INFLUXDB_INIT_ORG` | Organization name for InfluxDB |
|
|
| `INFLUX_WRITE_TOKEN` | InfluxDB write token |
|
|
| `INFLUX_HOST` | Hostname or IP address of the InfluxDB instance |
|
|
| `LOKI_HOST` | Hostname or IP address of the Loki instance |
|
|
|
|
## Setup
|
|
|
|
Set the `DOCKER_GUID` so the container has permission to access the socket. This ensures that the telegraf container will have read access on the Docker socket.
|
|
|
|
```shell
|
|
export DOCKER_GUID=$(getent group docker | awk -F ':' '{print $3}')
|
|
``` |