# How to rename a metric?

**URL:** https://community.influxdata.com/t/how-to-rename-a-metric/30837
**Category:** Fluxlang
**Created:** [July 23, 2023, 10:39am UTC](https://community.influxdata.com/t/how-to-rename-a-metric/30837 "2023-07-23T10:39:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![github-ps1304](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/github-ps1304/32/12726_2.png) [@github-ps1304](https://community.influxdata.com/u/github-ps1304)
#### Post date: [July 23, 2023, 10:39am UTC](https://community.influxdata.com/t/how-to-rename-a-metric/30837/1 "2023-07-23T10:39:42Z")

</div>

Hi Community, I am trying to use Flux with Grafana (a custom plugin called Flowchart) where the mapping of values is using the metric name - working fine with Influx 1.8 /InfluxSQL whre you rename the metric or Query - but how can I rename a metric in Flux?  
Query:

> Blockquote  
> from(bucket: “solaranzeige”)  
> |\> range(start: v.timeRangeStart, stop: v.timeRangeStop)  
> |\> filter(fn: (r) =\> r[“\_measurement”] == “e3dc-rscp.0.EMS.POWER\_HOME”)  
> |\> filter(fn: (r) =\> r[“\_field”] == “value”)  
> |\> aggregateWindow(every: 30m, fn: last, createEmpty: false)  
> |\> yield(name: “last”)  
> the mapping of the plugin is using the metric name:  
> ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/6/6ceb0acbb503af16e30cd00bdfdeba15e909de4f.png)
