traefikConfigProvider returns incomplete service names? Service name in prometheus is always 1-service, 2-service etc #774

Closed
opened 2026-04-05 17:40:13 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @eugeniumegherea on 10/15/2025

Describe the Bug

First of all, amazing project! I am not sure if this is a valid bug so please correct me

I have an issue where prometheus doesn't see the service names correctly. I've enabled prometheus endpoint in traefik and added them to the default traefik dashboard. I wanted to understand how can we see the resources names in there but I am struggling so far. I have added 6 services so far

Image

I was digging into the code and found the traefik provider that exposes the targets and it seems that that service name is set from the api itself.
3b8ba47377/server/lib/traefik/getTraefikConfig.ts (L199)
But what is confusing to me, if resource.name would have been empty, service name would be ${key}--service (double dashes in case name is empty). So I don't yet understand where the service names like <number>-service is coming from. Maybe there is some sanitization further down the line that I don't know.

and then here it creates a named config for all resources and matching rules etc that it then returns back to traefik 3b8ba47377/server/lib/traefik/getTraefikConfig.ts (L421)

Surely I miss something but cannot understand what, I'll appreciate any help on this

Environment

  • OS Type & Version: (e.g., Ubuntu 22.04) debian 12
  • Pangolin Version: 1.10.3
  • Gerbil Version: -
  • Traefik Version: 3.5
  • Newt Version: -
  • Olm Version: (if applicable) -

I only run pangolin and traefik in docker compose. I don't need tunneling so far.

docker config:

name: pangolin
services:
  pangolin:
    image: docker.io/fosrl/pangolin:1.10.3
    container_name: pangolin
    restart: unless-stopped
    volumes:
      - ./config:/app/config
      - pangolin-data:/var/certificates
      - pangolin-data:/var/dynamic
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3001/api/v1/"]
      interval: "10s"
      timeout: "10s"
      retries: 15

  traefik:
    image: docker.io/traefik:v3.5
    container_name: traefik
    restart: unless-stopped

    ports:
      - 443:443
      - 80:80
      - 853:853 # dns over tls with custom traefik config, not relevant to this issue I think
      - 8082:8082

    depends_on:
      pangolin:
        condition: service_healthy
    command:
      - --configFile=/etc/traefik/traefik_config.yml
    volumes:
      - ./config/traefik:/etc/traefik:ro # Volume to store the Traefik configuration
      - ./config/letsencrypt:/letsencrypt # Volume to store the Let's Encrypt certificates
      - ./config/traefik/logs:/var/log/traefik # Volume to store Traefik logs
      # Shared volume for certificates and dynamic config in file mode
      - pangolin-data:/var/certificates:ro
      - pangolin-data:/var/dynamic:ro


  whoami:
    image: "traefik/whoami"
    restart: unless-stopped
    ports:
      - 8080:80

networks:
  default:
    driver: bridge
    name: pangolin


volumes:
  pangolin-data:

I am running prometheus and grafana in a separate proxmox container which I am not sure if this is revelant, they are not custom in any way.

To Reproduce

Create a simple proxy service, run a few requests through it and then access grafana and check the reported service names

Expected Behavior

Prometheus should have a human friendly service names, ideally the names of the resources from the pangolin UI

*Originally created by @eugeniumegherea on 10/15/2025* ### Describe the Bug First of all, amazing project! I am not sure if this is a valid bug so please correct me I have an issue where prometheus doesn't see the service names correctly. I've enabled prometheus endpoint in traefik and added them to the default traefik dashboard. I wanted to understand how can we see the resources names in there but I am struggling so far. I have added 6 services so far <img width="378" height="260" alt="Image" src="https://github.com/user-attachments/assets/e598b0ba-feed-4916-b38d-3711ecfd3cdb" /> I was digging into the code and found the traefik provider that exposes the targets and it seems that that service name is set from the api itself. https://github.com/fosrl/pangolin/blob/3b8ba4737709e2d8b45760a44ebc096b6e57b4e2/server/lib/traefik/getTraefikConfig.ts#L199 But what is confusing to me, if `resource.name` would have been empty, service name would be `${key}--service` (double dashes in case name is empty). So I don't yet understand where the service names like `<number>-service` is coming from. Maybe there is some sanitization further down the line that I don't know. and then here it creates a named config for all resources and matching rules etc that it then returns back to traefik https://github.com/fosrl/pangolin/blob/3b8ba4737709e2d8b45760a44ebc096b6e57b4e2/server/lib/traefik/getTraefikConfig.ts#L421 Surely I miss something but cannot understand what, I'll appreciate any help on this ### Environment - OS Type & Version: (e.g., Ubuntu 22.04) debian 12 - Pangolin Version: 1.10.3 - Gerbil Version: - - Traefik Version: 3.5 - Newt Version: - - Olm Version: (if applicable) - I only run pangolin and traefik in docker compose. I don't need tunneling so far. docker config: ``` name: pangolin services: pangolin: image: docker.io/fosrl/pangolin:1.10.3 container_name: pangolin restart: unless-stopped volumes: - ./config:/app/config - pangolin-data:/var/certificates - pangolin-data:/var/dynamic healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3001/api/v1/"] interval: "10s" timeout: "10s" retries: 15 traefik: image: docker.io/traefik:v3.5 container_name: traefik restart: unless-stopped ports: - 443:443 - 80:80 - 853:853 # dns over tls with custom traefik config, not relevant to this issue I think - 8082:8082 depends_on: pangolin: condition: service_healthy command: - --configFile=/etc/traefik/traefik_config.yml volumes: - ./config/traefik:/etc/traefik:ro # Volume to store the Traefik configuration - ./config/letsencrypt:/letsencrypt # Volume to store the Let's Encrypt certificates - ./config/traefik/logs:/var/log/traefik # Volume to store Traefik logs # Shared volume for certificates and dynamic config in file mode - pangolin-data:/var/certificates:ro - pangolin-data:/var/dynamic:ro whoami: image: "traefik/whoami" restart: unless-stopped ports: - 8080:80 networks: default: driver: bridge name: pangolin volumes: pangolin-data: ``` I am running prometheus and grafana in a separate proxmox container which I am not sure if this is revelant, they are not custom in any way. ### To Reproduce Create a simple proxy service, run a few requests through it and then access grafana and check the reported service names ### Expected Behavior Prometheus should have a human friendly service names, ideally the names of the resources from the pangolin UI
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#774