Prometheus.exporter.cadvisor for all container

Bonjour, :wave:

I have the same problem, but, I not sure of your advice @jakubzukal, or I simply don’t understand, sorry… :worried:

This is a part of my docker compose:

alloy:
    image: grafana/alloy:latest
    container_name: alloy
    restart: "always"
    command:
      - run
      - /etc/alloy/
      - --storage.path=/var/lib/alloy/data
      - --server.http.listen-addr=0.0.0.0:12345
      - --stability.level=experimental
    ports:
      - 12345:12345
      - 9001:9001
      - 9002:9002
      - 4318:4318
      - 4317:4317
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "/var/log:/host-var-log"
      - "/proc:/host-proc"
      - "/sys:/host-sys"
      - "/:/host-root"
      - "/run/udev/data:/host-udev"
      - "/data/etc/alloy:/etc/alloy"
      - "/data/var/lib/alloy/data:/var/lib/alloy/data"
    labels:
      - "traefik.enable=false"
    cap_add:
      - SYS_PTRACE
      - SYS_TIME
    privileged: true

  cadvisor:
    image: gcr.io/cadvisor/cadvisor:latest
    container_name: cadvisor
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:rw
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro

If I have already mount in my alloy configuration /, sys to be used with prometheus.exporter.unix . How I can use it for cAdvisor?

Thanks!