Group by doesn't work after value mapping

  • What Grafana version and what operating system are you using?
    9.0.2, Mac

  • What are you trying to achieve?
    Format the data in a column using valuemap then use groupBy transformation for the pie chart

  • How are you trying to achieve it?
    I applied two value mappings for the exceptionMessage column. Then, I added 2 transformations. Add Field From Calculation transformation to add the count field and Group by transformation to group by the exceptionMessage.

  • What happened?
    For some reason, the same value doesn’t get merged.

  • What did you expect to happen?
    I expect the same value gets merged and shows the proper accumulated count

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

  • Did you follow any online instructions? If so, what is the URL?

1 Like

For some reason my rename by regex did not work but value mapping worked. Now the issue that I am having is that I cannot group by a value mapping. Any suggestions?

Same issue here, looks like ‘value mapping’ is being done after ‘group by’. Any updates on that?

Value mapping is allways the last step. so you cant group it.
Are you not able to group it before the value mapping in the query?

1 Like

I am not able to group it before as I want to modify field’s values before doing it. Basically I have http request paths in the metric which inludes ids of some entities and I would like to map it using regex before grouping it.

ex.
/api/device/123456/wahtever => /api/device/id/wahtever
/api/device/555555/wahtever => /api/device/id/wahtever

By doing it they present same value and can be grouped together, for now they are treated as different values. Of course I can just send metrics without those information, but I would like to keep those ids for another dashboard to display entity specific path usage (by specific id).

Please tell me, what are available options for such a case?

That would be nice, next to the values ‘filtering’ option, to have regex mapper which would apply changes in transformation pipeline.Another solution would be to add custom column with values mapped from another one.

Facing same issue. Is there a way to GroupBy after Value Mapping?
Currently only Value Mappings support regex, I couldn’t find any data transformations supporting regex.

Value mapping is more cosmetic

What is your datasource. Best to do things at datasource then value mapping for touch up