louislam / uptime-kuma

A fancy self-hosted monitoring tool

Home Page:https://uptime.kuma.pet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker API labels Swarm context and regular for service discovery.

Leopere opened this issue Β· comments

πŸ“‘ I have found these related issues/pull requests

n/a

🏷️ Feature Request Type

API / automation options

πŸ”– Feature description

When it comes to deploying stuff into docker and docker swarm it helps to be able to have apps that hook into the docker socket to look for labels that might say please pay attention to me for X reason... For example you can set Traefik settings on a per microservice basis using docker labels.

For example this set of labels has declarations for gethomepage/homepage and traefik 2.x

      labels:
        homepage.group: Uptime Kuma
        homepage.name: Uptime
        homepage.href: https://uptime.example.com/status/internal-services
        homepage.description:
        us.nixc.autodeploy: "true"
        traefik.enable: "true"
        traefik.http.routers.production_uptime-kuma_uptime.tls: "true"
        traefik.http.services.production_uptime-kuma_uptime.loadbalancer.server.port: 3001
        traefik.http.routers.production_uptime-kuma_uptime.rule: Host(`uptime.example.com`)
        traefik.http.routers.production_uptime-kuma_uptime.entrypoints: websecure
        traefik.http.routers.production_uptime-kuma_uptime.tls.certresolver: letsencryptresolver
        traefik.http.routers.production_uptime-kuma_uptime.service: production_uptime-kuma_uptime
        traefik.docker.network: traefik

βœ”οΈ Solution

Write one or two standard labels to tell uptime kuma to monitor a service within swarm or via a specified path such as perhaps the following.

      labels:
        uptimekuma.monitor: "true"
        uptimekuma.monitor.url: https://uptime.example.com
        uptimekuma.monitor.retry: 60
the options could be endless but keep it simple at first.

❓ Alternatives

No response

πŸ“ Additional Context

Currently the docker stuff is baked in a way that you have to rely on static container names for UptimeKuma to look for and that's fine and all but its usefulness is limited whereas offering deeper docker API integration would be supremely helpful there is also a way to define the docker API endpoint through http/s and the socket so you're not stuck putting the monitor on a swarm manager node for example.

I think this is better tracked in #4233, as docker-compose and docker swarm are likely not as different.
=> merging these issuses via closing this one as a duplicate.

Tip

If you have a look at the dependency linked in #957, @BigBoot has shared https://github.com/BigBoot/AutoKuma, which claims to solve this usecase.
We have not tested if it works as advertised, nor audited said software.

So basically it has to be a sidecar process to get API supported a bit better :/ thanks.

Also super happy with Uptime Kuma I just wish I could export things to it from other services like Uptime Robot.

just wish I could export things to it from other services like Uptime Robot

This is tracked in #1190
Currently, nobody has found the time to look at their shema and integrate it.