How to Monitor Open Connections Per Service in Traefik 3 Using Prometheus?

Hello everyone!

I'm using Traefik 3 and manage several URLs, such as www.joao.com, www.pedro.com, and www.mike.com, with each having its own service configured in Traefik.

I would like to know how I can monitor the number of open connections for each of these domains. I have already set up Prometheus to collect metrics, but I haven't found a metric that filters directly by service. The only metric I’ve found is traefik_open_connections, but it doesn’t seem to filter by service.

My goal is to find out how many connections are actively open for each service, which is tied to a specific URL, such as www.joao.com.

My configuration is similar to this

HTTP Router: www.joao.com ( web, websecure) > HTTP Service: appjoao
HTTP Router: www.mike.com ( web, websecure) > HTTP Service: appmike
HTTP Router: www.pedro.com ( web, websecure) > HTTP Service: apppedro

From what I checked, it seems that this metric existed in Traefik 2(traefik_service_open_connections) and it was possible to do this through the service but it does not exist in Traefik 3

Any suggestions on how to achieve this?

Thanks in advance!

1 Like