We use Traefik in Kubernetes, and we use the IngressRoute resource to do the routing.
When we enabled Prometheus metrics, we started to see metrics like these:
traefik_service_requests_total{code="302",method="GET",protocol="http",service="argocd-argocd-server-e27b6cb3151f593ea06d@kubernetescrd"} 1
traefik_service_requests_total{code="303",method="GET",protocol="http",service="argocd-argocd-server-e27b6cb3151f593ea06d@kubernetescrd"} 3
traefik_service_requests_total{code="303",method="POST",protocol="http",service="argocd-argocd-server-e27b6cb3151f593ea06d@kubernetescrd"} 1
traefik_service_requests_total{code="401",method="GET",protocol="http",service="argocd-argocd-server-e27b6cb3151f593ea06d@kubernetescrd"} 1
traefik_service_requests_total{code="404",method="GET",protocol="http",service="argocd-argocd-server-e27b6cb3151f593ea06d@kubernetescrd"} 1
Notice how the service label seems generated. Is there a way to avoid that?
Our IngressRoute looks as follow:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: argocd-server
namespace: argocd
spec:
entryPoints:
- web
routes:
- kind: Rule
match: Host(`REDACTED`)
priority: 10
services:
- name: argocd-server # [1]
port: 80
I would have expected the service label to be argocd-server as set in [1]