How to change field name for the generated field of `sum()`

If you are just trying to change the label for better display on dashboard, try using Grafana’s transform functionality:

  1. Click on Transform, and select Rename by regex.
  2. Use a regex match and replace. For example, let’s say your label is “unwanted=wanted”, you can use regex matcher {(?:.*)="(.*)"} and $1 as the replacement.