grafana / agent

Vendor-neutral programmable observability pipelines.
https://grafana.com/docs/agent/
Apache License 2.0
1.56k stars 479 forks source link

Increase range of colors in "by series" color scheme #6969

Open cpinflux opened 3 days ago

cpinflux commented 3 days ago

Background

By my understanding there are about 50 different colours that can be assigned when using the "Classic palette (by series name)" scheme. On my dashboards I've a few situations where the same colour is being picked for multiple series. These series are mostly hostnames, with a few hundred different clusters of 2 to 4 hosts. Clashes are likely over that range, and are happening, and I've no good way to change that whilst still using this "by series" functionality

Proposal

I've been playing around with some logic for picking HSV colours deterministically from a much larger range and converting to RGB, but don't know if there would be any potential interest in coding it up for a PR.

I believe that picking any colour with S > 0.75 & V > 0.3 gives a usable colour, and further stylistic tuning to avoid more "primary" colours on certain degrees of Hue should hopefully give many thousands of modern, appealing colours.

Of course, given how the code works, it's impossible to create a coherent colour scheme across series, but this should make clashes exceptionally unlikely.