Closed mocdaniel closed 2 years ago
Usually a cube shows single-value dimensions, this was the case with the initial version and the IDO and is still the case with non-array variables and Icinga DB.
With Icinga DB are also dictionaries available now. But with their keys and sub-keys offered individually. I don't see why we should change anything here, as each key still refers to a single value. (unless it's an array of course)
Arrays on the other hand are slightly different. They define multiple values for a single dimension on the same object. (host, service) The indices of these values are most of the time not of interest. Icinga DB Web also allows to search for host.vars.fruits[*]=apple
to find results where apple
is inside the array, no matter where.
In my opinion this is the best solution on how the Cube should handle arrays as well: A dimension can now have multiple values on a single object.
This means, an object can appear multiple times in different cubes on the same pane:
Here are only two hosts involved: (the example in the OP)
This is what I'd implement. Please comment if that suits your requirements.
👍
This is what I'd implement. Please comment if that suits your requirements
This is exactly what I imagined. I also share your perspective regarding dictionary entries.
Is your feature request related to a problem? Please describe.
When combining the cube module with IcingaDB as a backend it is now possible to operate on array/dictionary entries. But, counterintuitively, these operations happen "in place". Consider the following array variable on two hosts:
Based on the four different entries for this variable across all hosts, Cube/IcingaDB will offer entries
fruit[0-4]
in Cube's dimension dropdown. Two problems arise:fruit[2]
is not good enough a denominator for the actual entry at this place of the array. Remembering different arrays for 1000+ hosts is not feasible.fruit[2]
will be a different item, depending on the actual array configured for affected hosts.For above example, only one cube (
fruit[2]
) would contain both hosts, as item and position match. I'd expect three cubes to contain both hosts, as they got three array items in common.Describe the solution you'd like
Preferred solution:
In the dropdown menu, offer
fruit
as a dimension. The operation for arrays would be to slice twice then:fruit
vs those which don'tFallback solution:
If the method above is not feasible/doable, seeing the actual items in the dropdown and matching them in arbitrary positions of arrays would help, too. I.e. being offered
fruit.apple
,fruit.banana
,fruit.orange
etc. instead offruit[0-4]
.Describe alternatives you've considered
We had a close look at using dictionaries instead of arrays, but continue with arrays and Cube behaviour as described above is the preferred and more intuitive/ergonomic solution.