I'm sorry, I did not look in depth at metrics, but from common sense:
Traefik service is not the same as kubernetes service
From you excerpt, it looks like what is being shown is the traefik name
It does not look like there is a way to provide the service name in the IngressRoute object for that purpose. The service name is always generated.
So as it is now, no, it is not possible
@ldez would you support it if I write a GitHub feature request for this, or do we already have anything similar? It seems a few other options are also missing on IngressRoute, e.g sans for LE certificates, service stickiness, mirroring, etc.
Thanks @zespri for your reply. It would be nice if the name can be defined. This came up when I added Traefik metrics into Prometheus. As I started looking at the data, it was hard to determine which service referred to what. It's easy to tell in the Traefik dashboard since each Traefik service prints out the configured rule, but not outsides that dashboard.
I did not have much experience with metrics, so I cannot definitely tell you if it is resolved or now, it looks like it should. Of course it goes without saying, that you have to update your configuration accordingly, ot take advantage of that PR. If you did not change anything in your configs, that I would expect no change in this behaviour either. Having said that, I have not tried that personally, so I do not have a definite answer.
Hi, I just stumbled upon this thread since I was also annoyed by the lengthy and cryptic service specifiers. So I tried the method proposed in the PR:
I added a TraefikService in addition to the kubernetes service
I referred to this service in the ingress definition
This is successful in terms that it removes the hash from the service name. But from what I see at the moment, it always results in two services shown in traefik:
a service of type weighted or mirroring -> naming scheme namespace-name
at least one service of type loadbalancer -> naming scheme namespace-name-port
So my question is: Is it possible to directly create a TraefikService of type loadbalancer? Since I run only one backend anyway I would like to skip the additional service... But I don't see anything like that in the documentation.
Just thought id add what i tried, @moritzj29 my case is a service of type nodeport not loadbalancer, but the one part you may have missed is how its defined in the router
so no hash, and the metrics are only output on namespace-grafana-3000@kubernetescrd which atleast handles the case of matching to the service easier and have no cross contamination of metrics for rollback mesurement