Hello!

I have pods that have annotations containing the portNames that match the 
ports Prometheus should scrape per pod. I wanted to know if it is possible 
using the Kubernetes SD to relabel configs so that  
 - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_portName]
          action: drop
          regex: __meta_kubernetes_pod_container_port_name

would only scrape the ports that have a specific portName defined in the 
annotations?
This workaround is introduced due to the condition that Prometheus creates 
a new target for each port that a container has while using the pod role in 
K8s SD whereas only one of them exposes Prometheus metrics. 

So far I have tried different ways and I haven't found good documentation 
if it is possible to use labels in regex actions. 

Thanks in advance,
Rasmus

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/b09ff2c1-ccd6-4b62-8fde-579f12c4188dn%40googlegroups.com.

Reply via email to