I’m using the new Transformations in Grafana 7 to build a table composed of many queries from data in Prometheus. This is working really well, using a single Outer Join transformation to link the various series.
I want to link a number of other columns, with a second Outer Join transformation on a different column, and while I can add an additional Outer Join transformation it doesn’t seem to work? Do multiple outer join transformations work?
For example if I have two queries which share a single column: {A, B} and {A, C} then an outer join on A results in a table of {A, B, C}. I also have some other series which do not share A, but do share B: {B, D} and {B, E}. These are actually a 1:1 mapping to A, but don’t have the column in the source data. I want to join on A, and then on B, giving me a table containing {A, B, C, D, E}. Is this possible?
Details:
I currently have 12 queries, and have been able to tweak the data so that these have a common column (a deployment name in kubernetes). I can use a few transforms and field overrides to make a really useful data set:
- outer join transform on a
deployment
field - add field from calculation transform
- add field from calculation transform
- organise fields to hide and rename various
I then have 9 field overrides (Matcher > Filter by field) with various settings for units, decimals, cell display mode (color text background), thresholds, etc.
I’m using Prometheus as the data source, and 4 of these queries do not have the deployment label to join on, but have another label that is a 1:1 mapping. I do have a query which returns this mapping of deployment to label X, which I want to perform a second outer join based on. When I do this I just get multiple series in the table which I can select from the drop down, the join doesn’t seem to work, so I’m having to hack around this by joining in the PromQL on each query (with an on
and group_left
and some other cruft!). Is there a better way?