Table columns merge / Different replicas metrics under same column

  • What Grafana version and what operating system are you using?
    Grafana v11.3.0+security-01 (5ddc329279) / Ubuntu Linux

  • What are you trying to achieve?
    Merge same columns

  • How are you trying to achieve it?
    Tried different transformations

  • What happened?
    Didn’t get desired result

  • What did you expect to happen?
    Expect to have columns with same name merged.

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

  • 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?

Hi, i have a metric of following type: worker{metric="metric_name", replica="replica_id"}.
Querying different values of metric label will result in different metrics of some worker. As u can see on screenshot 1, currently my table has duplicated columns with same purpose. They are separated because of 2 different replicas of my service, and i want to get these 2 merged under single column, mb it could have separate column with replica_id.

Currently it has these transformations applied

Also i’m not sure how to get rid of duplicate rows, i thought about grouping by scheduled_start, but it means that 2 different replica entries will be grouped too?

Hi,

Can you also share a screenshot of your query editor?
Some things you could use:

  • aggregation with grouping by some labels (e.g sum(worker) by (<list of labels you'd like>)) instead of making multiple queries (if that’s what you’ve been doing).
  • duplicate rows might be coming from different timestamps, using Instant query might help that
  • you could try using Table format, not Time Series format in your query options.

Also, could you do a sample table you’d like to achieve in excel or something like that, so I could better understand what it is you need?


Query editor


Here is what i have now


And this is what i want to achieve. Basically instead of having 2 identic tables for 2 different replicas like on first screenshot (or 1 table with duplicate columns), i want to have a single table that has rows from different replicas.

Sample table:

I’ve solved duplicate rows by changing interval in query options

I’ve managed to achieve what i need this way


Thank u for your time!