-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kube_endpoint_address duplicates with Prometheus 2.52 #2408
Comments
I noticed the same, we are having
I do not know if this is related but in our case the endpoint is having this IP twice with different ports. in my case IP 10.25.119.228 listens to port 9094 and 9093. |
@eimarfandino Yes, different ports but same issue. |
I'm writing to confirm that I'm seeing this on GKE as well. Services with multiple ports bound to the same IP lead to duplicate metrics being exported by kube-state-metrics. For example (IP addresses masked):
|
/assign |
The The other option is to ensure the IPs are unique when generating these metrics. There are a few concerns I have regarding this approach.
If we were to consider adding the port to the |
@Serializator That means the clean way would be the prometheus operator not to use the same address for different instances ? |
Hi @gdlx! The Prometheus Operator is not doing anything it shouldn't be doing so I think it's on KSM to support this unforeseen circumstance. The Prometheus Operator is unfortunately the one which brings this problem to light. If it wasn't for the Prometheus Operator it would've been something else. |
The bug lies in the fact that we don't distinguish between endpoint subsets. The metric was written in a way where we assumed that addresses and ports would always be unique for a single endpoint and never duplicated between subsets. I looked a bit at Kubernetes' validation for Endpoints and it allows for duplicates ip/port pairs between subsets: I think that the only option we have here is to add a |
We could also add port field to the kube_endpoint_address and mark the port one as deprecated. |
Hi there! |
It sounds like this issue may have been brought to light by prometheus/prometheus#12933 |
Have now also come across this issue. Also interested in a fix / workaround. |
same |
This marks kube_endpoints_ports as deprecated Fixes kubernetes#2408
This marks kube_endpoint_ports as deprecated Fixes kubernetes#2408
This marks kube_endpoint_ports as deprecated Fixes kubernetes#2408
This marks kube_endpoint_ports as deprecated Fixes kubernetes#2408
After upgrading to Prometheus 2.52, we had some alerts about dropped duplicates samples.
The prometheus log shown the following warning:
Setting the log level to debug shown the concerned series:
Checking the indicated series indeed shown the following duplicates:
The
prometheus-operated
endpoint has the following subsets:We can see the 2 entries on the same IP (
100.91.68.8
) but on different ports.Grpc is enabled only by the Thanos sidecar container, and it's enabled only on one Prometheus instance.
I think there wouldn't have been duplicates if both instances had the same config (there would only have been one subset with both addresses and ports).
The only way I see to fix this would be to add a
port
label on thekube_endpoint_address
metric.Is there something else I can do or would this be considered as a bug ?
Thanks !
Environment:
2.12.0
1.28
The text was updated successfully, but these errors were encountered: