Skip to content

fix(yurthub): count distinct cached error keys - #2909

Open
clippytool wants to merge 1 commit into
openyurtio:masterfrom
clippytool:fix/error-key-gauge-updates
Open

clippytool wants to merge 1 commit into
openyurtio:masterfrom
clippytool:fix/error-key-gauge-updates

Conversation

@clippytool

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:

Updating the value of an existing error key increments the error_keys_count gauge again, although the map still has one key. Increment only on insertion; a repeated put followed by delete should restore the original gauge.

Which issue(s) this PR fixes:

No existing issue is linked.

Special notes for your reviewer:

Command: go test ./pkg/yurthub/cachemanager -run TestErrorKeysCountOnRepeatedPut -count=1. Passed the focused check.

Does this PR introduce a user-facing change?

Yurthub's error_keys_count metric no longer increases when an existing cached error is updated.

Signed-off-by: clippytool <vetclippy@outlook.com>
@clippytool
clippytool requested a review from a team as a code owner December 4, 2026 09:15
@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

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.

1 participant