Transform: added merge transform that will merge multiple series/tables into one table (#25490)

* wip: added draft of series to rows.

* wip: building dataFrame structure first and then adding data.

* wip: added some refactorings of the seriesToRows transformer.

* did some refactorings to make the code easier to follow.

* added an editor for the transform.

* renamed some of the test data.

* added docs.

* fixed according to feedback.

* renamved files.

* fixed docs according to feedback.

* fixed so we don't keep labels or config values from.

* removed unused field.

* fixed spelling errors.

* fixed docs according to feedback.
This commit is contained in:
Marcus Andersson
2020-06-15 15:03:13 +02:00
committed by GitHub
parent 66f6b05d5e
commit 093383eb83
13 changed files with 805 additions and 23 deletions

View File

@@ -67,6 +67,7 @@ Grafana comes with the following transformations:
- [Apply a transformation](#apply-a-transformation)
- [Transformation types and options](#transformation-types-and-options)
- [Reduce](#reduce)
- [Merge](#merge)
- [Filter by name](#filter-by-name)
- [Filter data by query](#filter-data-by-query)
- [Organize fields](#organize-fields)
@@ -93,6 +94,28 @@ After I apply the transformation, there is no time value and each column has bee
{{< docs-imagebox img="/img/docs/transformations/reduce-after-7-0.png" class="docs-image--no-shadow" max-width= "1100px" >}}
### Merge
Use this transformation to combine the result from multiple queries into one single result based on the time field. This is helpful when using the table panel visualization.
In the example below, we are visualizing multiple queries returning table data before applying the transformation.
{{< docs-imagebox img="/img/docs/transformations/table-data-before-merge-7-1.png" class="docs-image--no-shadow" max-width= "1100px" >}}
Here is the same example after applying the merge transformation.
{{< docs-imagebox img="/img/docs/transformations/table-data-after-merge-7-1.png" class="docs-image--no-shadow" max-width= "1100px" >}}
If any of the queries return time series data, then a `Metric` column containing the name of the query is added. You can be customized this value by defining `Label` on the source query.
In the example below, we are visualizing multiple queries returning time series data before applying the transformation.
{{< docs-imagebox img="/img/docs/transformations/time-series-before-merge-7-1.png" class="docs-image--no-shadow" max-width= "1100px" >}}
Here is the same example after applying the merge transformation.
{{< docs-imagebox img="/img/docs/transformations/time-series-after-merge-7-1.png" class="docs-image--no-shadow" max-width= "1100px" >}}
### Filter by name
Use this transformation to remove portions of the query results.