I’m testing Prometheus service discovery on a dual-stack Kubernetes cluster 
where the service has ipFamilyPolicy set to PreferDualStack. When using the 
deprecated endpoints scraping role, Prometheus discovers targets only with 
the IPv4 address.

However, when switching to the endpointslice scraping role with the same 
relabeling rules, Prometheus discovers targets with both IPv4 and IPv6 
addresses for the same service.

```
up{instance="ipv4:9089", job="endpointslice-role", namespace="test-ns", 
pod_name="testapp-5f58b46757-nq7hx", 
service_name="testapp-prefer-dualstack"} 1
up{instance="ipv6:9089", job="endpointslice-role", namespace="test-ns", 
pod_name="testapp-5f58b46757-nq7hx", 
service_name="testapp-prefer-dualstack"} 1
up{instance="ipv4:9089", job="endpoints-role", namespace="test-ns", 
pod_name="testapp-5f58b46757-nq7hx", 
service_name="testapp-prefer-dualstack"} 1
```

Is this behavior expected? Should Prometheus handle dual-stack targets 
differently when scraping endpointslice vs endpoints? Are there any best 
practices or configuration nuances to be aware of when migrating from 
endpoints to endpointslice in a dual-stack environment?

Thanks in advance for any insights!

Best Regards, Vu

-- 
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 visit 
https://groups.google.com/d/msgid/prometheus-users/5fca68ec-98b6-4a2a-9a79-3699aeb0a14fn%40googlegroups.com.

Reply via email to