louislam / uptime-kuma

A fancy self-hosted monitoring tool
https://uptime.kuma.pet
MIT License
60.55k stars 5.41k forks source link

Monitoring Cloudflare Tunnel #3875

Open romainl63 opened 1 year ago

romainl63 commented 1 year ago

⚠️ Please verify that this feature request has NOT been suggested before.

🏷️ Feature Request Type

Other

🔖 Feature description

The cloudflare tunnel can be monitored with Grafana and Prometheus. Didn't find out how to do it with docker-compose for the tunnel directly present in Uptime-Kuma. See my configuration file below, I tested several options but it doesn't work. It's mainly to fix the port, which is random each time the container is started up. Basically it's the "metrics" option explained in the following page : https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/monitor-tunnels/grafana/

version: 3.3

services:
    uptime-kuma:
      image: louislam/uptime-kuma
      container_name: uptime-kuma

    environment:
      - UPTIME_KUMA_CLOUDFLARED_TOKEN=xxxx
      - UPTIME_KUMA_CLOUDFLARED_METRICS=127.0.0.1:12345  # << One of the options I tested #

    labels:
      - com.centurylinklabs.watchtower.monitor-only=true

    volumes:
      - /xxx/uptime-kuma-data:/app/data
      - /var/run/docker.sock:/var/run/docker.sock:ro

    #ports:
      #- 3002:3001  # <Host Port>:<Container Port>
    network_mode: bridge
    restart: unless-stopped

✔️ Solution

Monitoring Cloudflare Tunnel with Grafana or Prometheus

❓ Alternatives

No response

📝 Additional Context

No response

CommanderStorm commented 9 months ago

Related #3373