Additionally, I’ve noticed that when the metric port is not declared in the Service manifest where the Prometheus annotations are placed, this duplication of scraping (both IPv4 and IPv6 targets) from the Endpointslice role does not occur.
Does this mean that explicitly specifying the metric port in the Service manifests influences how Endpointslice targets are discovered and scraped?
Any further clarification on how the metric port declaration interacts with dual-stack service discovery in Prometheus would be highly appreciated.
Do you have any suggestions on how to prevent duplicate scraping when using the endpointslice role in this scenario? Could this be resolved with a relabeling rule?
For your reference, I’ve opened an issue on the Prometheus GitHub repository: https://github.com/prometheus/prometheus/issues/17193