Reputation: 85
I am running a server with several docker (unfortunately I cannot use podman
because it is mailcow
and this does not fully support podman
yet) in one docker-compose
file.
I have added cadvisor
to the docker-compose.yaml
:
cadvisor:
image: gcr.io/cadvisor/cadvisor
ports:
- target: 8080
published: 8080
mode: host
volumes:
- /:/rootfs:ro
- /var/run:/var/run:ro
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
- /dev/disk/:/dev/disk:ro
deploy:
resources:
limits:
cpus: '1'
memory: 1G
reservations:
cpus: '0.25'
memory: 512M
and start the container. On the same machine there is also directly (= not in a container) running prometheus exporter
(on a different port).
On another machine (monitor
) am running Prometheus
(directly), Grafana
(directly) and Alertmanager
(podman).
In Grafana
I can see the metrics of all individual containers of the docker-compose.yaml`. (Of curse I could also create alerting rules there.)
In the prometheus.yaml
(of 'monitor` machine) I have:
- job_name: 'docker-mailcow'
static_configs:
- targets:
- 10.x.x.x:8080
and I the Prometheus
GUI under "targets"
I can see the target under docker-mailcow
with state "up"
.
In the Alertmanager
settings I have a general alert for all targets which are not "up". Because I want to include the state of each container from the docker-compose.yaml
I need to have the state of each individual container in the Prometheus
target
view. Is this possible / how to do this?
Do I need to add to the client or the Monitor
machine?
Upvotes: 0
Views: 113