# metricRelabeling in Prometheus duplicates metrics

**URL:** <https://discuss.prometheus.io/t/metricrelabeling-in-prometheus-duplicates-metrics/1288>\
**Category:** General Help/Support\
**Created:** [November 11, 2022, 1:03am UTC](https://discuss.prometheus.io/t/metricrelabeling-in-prometheus-duplicates-metrics/1288 "2022-11-11T01:03:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![roee-landesman](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/roee-landesman/32/560_2.png) [@roee-landesman](https://discuss.prometheus.io/u/roee-landesman)\
**Post date:** [November 11, 2022, 1:03am UTC](https://discuss.prometheus.io/t/metricrelabeling-in-prometheus-duplicates-metrics/1288/1 "2022-11-11T01:03:58Z")

</div>

Hi all,

I’ve asked this in other forums before but have not been able to solve this problem so apologies for the repost. I’m attempting to do a basic metric relabeling where I replace the ` __name__ ` by removing a prefix (specifically `workload:` ). This is taken directly from the upstream istio documentation. However, I am able to create a new metric without the `workload` prefix, but am totally unable to either replace nor drop the existing `workload` metric in order to save space. This is further confirmed when looking at the TSDB status endpoint of my main prometheus.

This is my ServiceMonitor definition:

apiVersion: [monitoring.coreos.com/v1](http://monitoring.coreos.com/v1)  
kind: ServiceMonitor  
metadata:  
name: istio-federation  
namespace: prometheus-system  
labels:  
[app.kubernetes.io/name:](http://app.kubernetes.io/name:) istio-prometheus  
spec:  
namespaceSelector:  
matchNames:  
- istio-system  
selector:  
matchLabels:  
release: prometheus-istio  
endpoints:

- interval: 30s  
scrapeTimeout: 30s  
params:  
‘match’:
  - ‘{ **name** =~“workload:(.\*)”}’  
path: /federate  
targetPort: 9090  
honorLabels: true  
metricRelabelings:
  - sourceLabels: [“ **name** ”]  
regex: ‘workload:(.\*)’  
targetLabel: “ **name** ”  
action: replace

Any help would be greatly appreciated!
