From dd2e666a8d6b42426822b3eff667d252983875f8 Mon Sep 17 00:00:00 2001 From: akatsadimas Date: Thu, 7 Oct 2021 00:01:46 +0300 Subject: [PATCH] discovery/kubernetes: Warn user in case of endpoint over-capacity Signed-off-by: akatsadimas --- discovery/kubernetes/endpointslice.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/discovery/kubernetes/endpointslice.go b/discovery/kubernetes/endpointslice.go index 71d4e3776..4c5db2df2 100644 --- a/discovery/kubernetes/endpointslice.go +++ b/discovery/kubernetes/endpointslice.go @@ -322,6 +322,14 @@ func (e *EndpointSlice) buildEndpointSlice(eps *disv1beta1.EndpointSlice) *targe } } + v := eps.Labels[apiv1.EndpointsOverCapacity] + if v == "truncated" { + level.Warn(e.logger).Log("msg", "Number of endpoints in one Endpoints object truncated to 1000", "endpoint", eps.Name) + } + if v == "warning" { + level.Warn(e.logger).Log("msg", "Number of endpoints in one Endpoints object exceeds 1000", "endpoint", eps.Name) + } + // For all seen pods, check all container ports. If they were not covered // by one of the service endpoints, generate targets for them. for _, pe := range seenPods {