Skip to content

feat(xds): add xdsNACKTotal metric - #9205

Merged
arkodg merged 7 commits into
envoyproxy:mainfrom
QuantumEnigmaa:feat-add-xdsnacktotal-metric
Jun 15, 2026
Merged

feat(xds): add xdsNACKTotal metric#9205
arkodg merged 7 commits into
envoyproxy:mainfrom
QuantumEnigmaa:feat-add-xdsnacktotal-metric

Conversation

@QuantumEnigmaa

Copy link
Copy Markdown
Contributor

What type of PR is this?

feat(xds): this PR adds the xdsNACKTotal metric which was written as a TODO in a comment along the relevant test.

What this PR does / why we need it:

As described in the issue below, currently NACK isn't propagated to the EnvoyProxy or Gateway statuses which make the pods silently fail. This PR is a first step towards the proper handling of NACK by exposing the total number of xds NACKs as a counter type metric. This will at least allow users to create alerts based on it to know when a config is broken.

Which issue(s) this PR fixes:

Fixes (partly): #9198

I'll open (a) follow-up PR(s) to further address the above issue.

Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>
@QuantumEnigmaa
QuantumEnigmaa requested a review from a team as a code owner June 10, 2026 12:12
@netlify

netlify Bot commented Jun 10, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 63d4dee
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a2fcf1afa47ee0008a97b01
😎 Deploy Preview https://deploy-preview-9205--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f538a4671c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread internal/xds/cache/metrics.go
Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.05%. Comparing base (332081c) to head (63d4dee).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9205      +/-   ##
==========================================
+ Coverage   74.90%   75.05%   +0.14%     
==========================================
  Files         252      252              
  Lines       40815    40819       +4     
==========================================
+ Hits        30574    30638      +64     
+ Misses       8158     8091      -67     
- Partials     2083     2090       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>
Comment thread internal/xds/cache/snapshotcache.go Outdated
@@ -258,6 +258,7 @@ func (s *snapshotCache) OnStreamRequest(streamID int64, req *discoveryv3.Discove
// TODO(youngnick): Handle NACK properly

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the TODO now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you prefer, I let it there as I didn't consider that handling NACKs only through exposing those as a metric was enough to consider that they're now handled properly. Especially since I'm planning on opening follow-up PRs to actually do that.

But if you think that it's ok to remove it, I can just do that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok nvm, after reading arkdog's comment, I just updated the comment so that it's the same as with OnStreamDeltaRequest

@arkodg arkodg added this to the v1.9.0-rc.1 Release milestone Jun 11, 2026
if status := req.ErrorDetail; status != nil {
// if Envoy rejected the last update log the details here.
// TODO(youngnick): Handle NACK properly
// Envoy rejected (NACKed) the last update. It keeps serving its last known

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also add this to OnStreamRequest (in case we ever flip to SoTW)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already have the metric added to OnStreamRequest but I just added the same explanatory comment there. Is that what you were suggesting ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, thanks

zirain
zirain previously approved these changes Jun 12, 2026

@arkodg arkodg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks

@arkodg
arkodg merged commit 00320fb into envoyproxy:main Jun 15, 2026
64 of 68 checks passed
cleman95 pushed a commit to cleman95/gateway that referenced this pull request Jun 25, 2026
* feat(xds): add xdsNACKTotal metric

Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>

* add release-note

Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>
zac-nixon pushed a commit to zac-nixon/gateway that referenced this pull request Jun 29, 2026
* feat(xds): add xdsNACKTotal metric

Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>

* add release-note

Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>
guydc pushed a commit to guydc/gateway that referenced this pull request Jun 30, 2026
* feat(xds): add xdsNACKTotal metric

Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>

* add release-note

Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>
abe-servescale pushed a commit to abe-servescale/gateway that referenced this pull request Jul 11, 2026
* feat(xds): add xdsNACKTotal metric

Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>

* add release-note

Signed-off-by: QuantumEnigmaa <thibaud@giantswarm.io>
Signed-off-by: Andrea Abellonio <andrea.abellonio@servescale.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants