On Wednesday, February 19, 2020 at 2:24:32 PM UTC-6, Kevin Kruppa wrote:
>
> I have been trying to get metric_relabel_configs to work but have not been 
> successful so far.
>
> I have tried to break it down by going very basic to what I need.  I 
> cannot even get the basic relabel to work.
>
> I had this config set up
>
>   metric_relabel_configs:
>   - source_labels: [POD_NAME]
>     separator: ;
>     regex: (.*)
>     target_label: prd_pod
>     replacement: $1
>     action: replace
>
>
> Even though the action clearly states replace, it added prd_pod to the end 
> of the metric and did not replace POD_NAME with prd_pod:
>
> saas_health:memory_avail_pct{*POD_NAME="otmgtm-dev5"*
> ,VM_SHAPE="VM.Standard2.4",instance="a-10041",*prd_pod="otmgtm-dev5"*}
>
> Ultimately, I would like to get this down to only changing POD_NAME to 
> prd_pod for those metrics that begin with saas_health:.  When I add the 
> regex value below, nothing changes, not even the adding of prd_prod to the 
> end of the metric.
>
> prometheus.yml has the following
>
>    metric_relabel_configs:
>     - source_labels: [__name__, POD_NAME]
>       regex: '^saas_health:;(.*)'
>       replacement: '${1}'
>       target_label: 'prd_pod'
>
> which Prometheus converts to
>
>
>   metric_relabel_configs:
>   - source_labels: [__name__, POD_NAME]
>     separator: ;
>     regex: ^saas_health:;(.*)
>     target_label: prd_pod
>     replacement: ${1}
>     action: replace
>
> What am I not getting/seeing in each of the configs that I do not get the 
> results expected?
>
> Thanks,
> Kevin
>
>
>
>
>

-- 
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/2057a885-f623-4f1f-80c1-dd586e7ee3ff%40googlegroups.com.

Reply via email to