Open shyamvalsan opened 1 year ago
@novykh yesterday you were speaking about the logic on how colors are assigned to dimensions.
I believe you mentioned these were set by context depending on the order you received the values from the collectors but on apps.plugin
I remember we discussing that different charts (I think with different contexts) were able to share the same color definition. is it true?
Yes and no, yes the netdata
dimension will have the same on every chart under apps
for example, but it doesn't guarantee consistency between reloads and revisits to the same charts in the future. The apps contexts do not have a consistent sorting (agent side) this means there is no way to assign same values for same names every time you present a chart.
@hugovalente-pm @shyamvalsan this is not straightforward to be tackled, since more info is needed on the /data
in order to do some other grouping/caching for the colors.
Today we use the first part of the context
to cache the colors, in my mind maybe we need the family
as well, but we don't have it on the /data
and I'm not sure if this will suffice.
We have users in the past that asked for this, since they were getting different colors for same dimensions in the same view. This was really visible when the dimensions were used in summary charts.
cc @ilyam8
I'm not sure how frequent this is happening, this report on discord is the only I'm aware of and it is one chart on one node that the user is experiencing this
@ilyam8 showed me another case, and he had the same thing in his mind, that first part of context level is not a good grouping for caching colors. I feel like we can leave it as is, and pass to the /data
another key. Maybe collector_id
or something like that, and we can use this on the caching. So everything coming from this collector would have the same coloring for same dimensions. Or we can pass an arbitrary group
key, where even inside the same collector we can group metrics' dimensions. Whatever we decide, the fallback always will be the approach we have today.
Maybe collector_id or something like that, and we can use this on the caching. So everything coming from this collector would have the same coloring for same dimensions. Or we can pass an arbitrary group key, where even inside the same collector we can group metrics' dimensions
I'm not into the technical complication details, in terms of flexibility the addition of group key
seems to provide more flexibility but I can image the overhead to add it to each and every collector, so if collector_id
does the trick we could go with that
Bug description
Color selection for dimensions should be per collector instead of per context as it is currently.
Without this we have inconsistent summary dashboards with same dimension showing up in different colors which is confusing.
Expected behavior
Same dimension should always use same color scheme within the same summary dashboard section.
Steps to reproduce
Screenshots
See how the dbs
postgres
andworking
swap color in different bar charts.Error Logs
N/A
Desktop
N/A
Additional context
No response