Hello! First Post!
I have a question regarding the reported service name as seen in the metrics. For example:
My question is as follows: Is there a way to have it show the actual service name the router is forwarding to instead of this generated name?
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 noticed this open PR if merged, it can resolved the issue.
Awesome thanks for that! I will keep an eye out on that PR.
It doesn't look like the PR is solving the problem as I still see this happening in v2.1.2, or am I missing something?
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.
Are you able to tell us in this thread what you should be changing in the configs to be able to see the correct service names in the metrics ?
Im useing kubernetes and traefik and are having trouble using the metrics for anything at the moment.
@larsbloch I have not tried it but it looks like property
name of kind TrafeikService is what you need to set.
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
mirroring -> naming scheme
- at least one service of type loadbalancer -> naming scheme
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.
To have some example code:
name: grafana # -> results in namespace-grafana-http-grafana-HASHHASHHASHHASH@kubernetescrd
- port: 3000
name: grafana # -> results in namespace-grafana@kubernetescrd service
- name: grafana # -> results in namespace-grafana-3000@kubernetescrd service
- match: Host(`somedomain.xyz`)
- name: grafana