Question on transformation (Grouping to matrix)

  • What Grafana version and what operating system are you using?
    Grafana v10.4.7 (ac358f3e56), Windows OS

  • What are you trying to achieve?
    I have following columns that I got after applying few transformation.Region can have values UK,US, AUS)
    Region, Service Display Name, unique Id, Service Unique Name, Service Level, Availability
    US
    UK
    AUS

Essentially, a service can in different region showing its availability. We have some 4 region value and would like to convert the value to its own column like
Service Display Name, unique Id, Service Unique Name, Service Level, Availability, UK US AUS

I tried checking Grouping to matrix transformation but that only allows limits the output to two columns only and other columns are getting filtered.

  • How are you trying to achieve it?

  • What happened?
    Unable to use any transformation to solve my usecase

  • What did you expect to happen?
    Need this transformation to better show the result

  • Can you copy/paste the configuration(s) that you are having problems with?
    NA

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No

  • Did you follow any online instructions? If so, what is the URL?
    I checked the forum but couldnt find the solution yet.

Can you provide some sample data that you have in table view, as well as desired result that you want to obtain after transformation?


Take a look at the screen shot. First one is how the data I have. and second one is how I want to show the data after applying some transformation

I believe that after Grouping by matrix you can’t keep other columns.

What is your datasource, may be required transformations can be done by its means?

I’m not sure this is the best solution but you could try:

  1. Using Partition by values transformation and partition it by Region field.
  2. Join by Service Display Name in OUTER (Time Series) mode.
  3. Organize fields by name to prettify the data.

These steps work for the example data you’ve passed but test it further, as I’m not sure it would work for every case (it’s better than nothing I think :smile:).

3 Likes

Cheers, this worked … thanks

1 Like

Grafana V11.2
Hi, I have similar use case. Data which I have after applying Series to rows, Extract fields, group by transforms

And after applying Partition by values, Join by field


It looks like this
image

What I’m trying achieve is
image

Any lead will be appreciated

what is your datasource and what does the raw data look like before any transformation is applied to it? please post sample not as image but text

col1,col2,col3
foo,33.3, 2025-02-18
1 Like

Sure, I’m GCP as datasource.

Raw data:

{http_code="200", name="app1", project_id="testproject", status="UP", store="1234", type="endpoint"}

{http_code="200", name="app2", project_id="testproject", status="UP", store="1234", type="endpoint"}

{http_code="200", name="app3", project_id="testproject", status="UP", store="1234", type="endpoint"}