Skip to content

feat(kubernetes): track 410 gone errors with metrics - #4368

Open
shardool-patil wants to merge 2 commits into
zalando:masterfrom
shardool-patil:feat/k8s-track-gone-errors
Open

shardool-patil wants to merge 2 commits into
zalando:masterfrom
shardool-patil:feat/k8s-track-gone-errors

Conversation

@shardool-patil

@shardool-patil shardool-patil commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

When querying the Kubernetes API server with pagination chunking enabled, requests can fail with HTTP status 410 Gone if etcd compacts the resource version or the continue token expires mid-stream. Adding metric tracking for 410 Gone provides immediate visibility into pagination expiration and compaction issues.
Posted as comment

Summary

  • Defined errResourceGone sentinel error in dataclients/kubernetes/clusterclient.go.
  • Added Metrics field to kubernetes.Options with graceful fallback to metrics.Default and metrics.Void.
  • Wired Metrics in KubernetesDataClientOptions() from Skipper's root options.
  • Intercepted 410 Gone responses in clusterClient.getJSON and incremented counter metric k8s.gone.
  • Added unit tests in dataclients/kubernetes/clusterclient_test.go using metricstest.MockMetrics.

Related Issues

Signed-off-by: Shardool Patil <shardoolpatil999@gmail.com>
@szuecs

szuecs commented Oct 24, 2026

Copy link
Copy Markdown
Member

Can you add documentation in docs/ please for the new metric?
Either somewhere in docs/kubernetes or in docs/operations

Comment thread dataclients/kubernetes/clusterclient.go Resolved
Signed-off-by: Shardool Patil <shardoolpatil999@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants