Customizing service trace colors

Seq uses the OpenTelemetry service.name attribute, or Serilog-style Application property, to determine which color should be used for the spans belonging to a service.

This sometimes works brilliantly - we put some effort into the palette! - but it can also fall short, if you happen to be unlucky and hit collisions.

Take for example the colours for the two services in this trace:

The birthday paradox takes no prisoners: the names "weather" and "Example.WeatherService" end up hashing (mod the array length) to adjacent indices in the color array, and both look roughly the same shade of purple.

Perhaps you're not even dealing with a conflict, but already have colors that make sense for your particular services, or just like some other colors better?

Seq helpfully sets a CSS class derived from the service name on each colored UI element. For "weather", the CSS class is service-name-weather, and for "Example.WeatherService" it's service-name-example-weatherservice.

Setting your own service colors is as simple as adding a rule to your instance's custom CSS, in Settings > Instance:

These ones are a closer match for the scheme used by the .NET Aspire dashboard and Jaeger:

It's a small thing, but a worthwhile quality-of-life improvement if you look at the same services every day! ☺️

Nicholas Blumhardt

Read more posts by this author.