title: Issue with overriding labels in prometheus
body: <p>I installed stable/prometheus from helm. By default the job_name <code>kubernetes-service-endpoints</code> contains <code>node-exporter</code> and <code>kube-state-metrics</code> as component label. I added the below configuration in prometheus.yml to include namespace, pod and node labels.</p>
  
  <pre><code>      - source_labels: [__meta_kubernetes_namespace]
          separator: ;
          regex: (.*)
          target_label: namespace
          replacement: $1
          action: replace
        - source_labels: [__meta_kubernetes_pod_name]
          separator: ;
          regex: (.*)
          target_label: pod
          replacement: $1
          action: replace
        - source_labels: [__meta_kubernetes_pod_node_name]
          separator: ;
          regex: (.*)
          target_label: node
          replacement: $1
          action: replace
  </code></pre>
  
  <p><code>kube_pod_info{component="kube-state-metrics"}</code> already had namespace, pod and node labels and hence exported_labels were generated. And the metric <code>node_cpu_seconds_total{component="node-exporter"}</code> now correctly has labels namespace, pod and node. </p>
  
  <p>To have these labels correctly, I need to have these 3 labels present in both the above metric names. To achieve that I can override value of exported_labels. I tried adding the below config but to no avail.</p>
  
  <pre><code>      - source_labels: [__name__, exported_pod]
          regex: "kube_pod_info;(.+)"
          target_label: pod
        - source_labels: [__name__, exported_namespace]
          regex: "kube_pod_info;(.+)"
          target_label: namespace
        - source_labels: [__name__, exported_node]
          regex: "kube_pod_info;(.+)"
          target_label: node
  </code></pre>
  
  <p>Similar approach was mentioned <a href="https://stackoverflow.com/questions/54235797/how-to-rename-label-within-a-metric-in-prometheus">here</a>. I can't see the issue with my piece of code. Any directions to resolve would be very helpful.</p>
  
  <p><strong>Updated - (adding complete job)</strong> </p>
  
  <pre><code>    - job_name: kubernetes-service-endpoints
        kubernetes_sd_configs:
        - role: endpoints
  
        metric_relabel_configs:
        - source_labels: [__name__, exported_pod]
          regex: "kube_pod_info;(.+)"
          target_label: pod
        - source_labels: [__name__, exported_namespace]
          regex: "kube_pod_info;(.+)"
          target_label: namespace
        - source_labels: [__name__, exported_node]
          regex: "kube_pod_info;(.+)"
          target_label: node
  
        relabel_configs:
        - action: keep
          regex: true
          source_labels:
          - __meta_kubernetes_service_annotation_prometheus_io_scrape
        - action: replace
          regex: (https?)
          source_labels:
          - __meta_kubernetes_service_annotation_prometheus_io_scheme
          target_label: __scheme__
        - action: replace
          regex: (.+)
          source_labels:
          - __meta_kubernetes_service_annotation_prometheus_io_path
          target_label: __metrics_path__
        - action: replace
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
          source_labels:
          - __address__
          - __meta_kubernetes_service_annotation_prometheus_io_port
          target_label: __address__
        - action: labelmap
          regex: __meta_kubernetes_service_label_(.+)
        - action: replace
          source_labels:
          - __meta_kubernetes_namespace
          target_label: namespace
        - action: replace
          regex: (.*)
          replacement: $1
          separator: ;
          source_labels:
          - __meta_kubernetes_pod_name
          target_label: pod
        - action: replace
          source_labels:
          - __meta_kubernetes_pod_node_name
          target_label: node
  </code></pre>
  
  <p><strong>And the result from promql</strong></p>
  
  <p><a href="https://i.stack.imgur.com/y83a1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y83a1.png" alt="kube_pod_info results"></a></p>