RHINENG-26549: log kessel errors to external service metric#2262
Merged
dominikvagner merged 1 commit intoJul 8, 2026
Merged
Conversation
There is a PatchmanAlertExternalService alert that check if the count of these external service errors is increasing. It used to be tracked for RBAC calls, but not for Kessel. This adds the prometheus counter increments back.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds Prometheus external-service error metric logging for Kessel RBAC permission checks by incrementing the shared serviceErrorCnt counter on internal server error paths. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- You duplicate the
serviceErrorCnt.WithLabelValues("kessel", strconv.Itoa(http.StatusInternalServerError)).Inc()call in both error paths; consider extracting a small helper (e.g.,incKesselServiceError(statusCode int)) to keep the labels consistent and make future changes less error-prone. - Since we now depend on
strconvonly to stringify the status code for metrics, you might want to align with any existing pattern in the codebase (e.g., a shared helper or a predefinedstatusCodeLabel), so metric labels are produced in a uniform way across services.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- You duplicate the `serviceErrorCnt.WithLabelValues("kessel", strconv.Itoa(http.StatusInternalServerError)).Inc()` call in both error paths; consider extracting a small helper (e.g., `incKesselServiceError(statusCode int)`) to keep the labels consistent and make future changes less error-prone.
- Since we now depend on `strconv` only to stringify the status code for metrics, you might want to align with any existing pattern in the codebase (e.g., a shared helper or a predefined `statusCodeLabel`), so metric labels are produced in a uniform way across services.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2262 +/- ##
==========================================
- Coverage 59.03% 59.02% -0.02%
==========================================
Files 144 144
Lines 9194 9196 +2
==========================================
Hits 5428 5428
- Misses 3194 3196 +2
Partials 572 572
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
MichaelMraka
approved these changes
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
There is a PatchmanAlertExternalService alert that check if the count of these external service errors is increasing. It used to be tracked for RBAC calls, but not for Kessel. This adds the prometheus counter increments back.
Associated ticket: [RHINENG-26549]