How to define custom colors for span bars on traces

  • What Grafana version and what operating system are you using? Using Grafana 9.3.2.2

  • What are you trying to achieve?
    I am trying to implement traces and define custom colors for the span bars. Grafana normally does it by service, but instead I would like to do it by request type. Thus far I have not been able to find a way of doing this.

I get all the trace data to show properly and the UI to show the trace as I expect it. Does anyone know if there is a field or something of that sort that allows me to configure the color with which trace spans show?

Note that this is not something I want to configure in the UI, but rather in the backend. Any pointers would be appreciated.

1 Like

Sadly no answer yet…

But here is a hack: You can add spaces to the service name, to get different colors.
E.g. in my case I am using "POST " to get a blue span. - Not sure how deterministic this is…?
If you just want to have different colors for things of one service, you need to group the things into virtual services with different amount of spaces added at value of service.name