Hi all,

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 found here 
<https://istio.io/latest/docs/ops/best-practices/observability/#optimizing-metrics-collection-with-recording-rules>.
 
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.

My ServiceMonitor:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: istio-federation
namespace: prometheus-system
labels:
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 or pointers in this case would be super appreciated

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/10f936c4-69aa-407c-9f4d-05653d17ad4cn%40googlegroups.com.

Reply via email to