[Metricbeat][Redis] Do not drop keyspace metrics when INFO keyspace reports extra fields#52180
Open
aglowienka wants to merge 1 commit into
Open
[Metricbeat][Redis] Do not drop keyspace metrics when INFO keyspace reports extra fields#52180aglowienka wants to merge 1 commit into
aglowienka wants to merge 1 commit into
Conversation
…ields parseKeyspaceStats only mapped a database line when INFO keyspace split into exactly 3 or 4 comma-separated fields. Redis 7.4 (subexpiry) and Valkey 9.0 (keys_with_volatile_items) append extra fields, and any further field makes the guard fail; when it does the line is silently skipped with nothing logged, so redis.keyspace stops producing data while redis.info keeps working. Accept any line with at least 3 fields. The parser is name-based and the schema only extracts the fields it knows, so extra fields are ignored safely. Relates to elastic#52178 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This pull request doesn't have a |
|
💚 CLA has been signed |
Contributor
🤖 GitHub commentsJust comment with:
|
Contributor
|
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
Author
|
CLA signed. |
5 tasks
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.
Proposed commit message
parseKeyspaceStats(metricbeat/module/redis/keyspace/data.go) only mapped a database line whenINFO keyspacesplit into exactly 3 or 4 comma-separated fields. Redis 7.4 addedsubexpiryandValkey 9.0 added
keys_with_volatile_items; any further field makes the guard fail. When it failsthe line is silently skipped — no event, no error logged — so
redis.keyspacestops producing dataentirely while
redis.infokeeps working.This changes the guard to accept any line with at least 3 fields (
>= 3). The parser is name-basedand the schema only extracts the fields it knows, so extra/unknown keyspace fields are ignored
safely and won't silently break collection again the next time a field is added.
Relates to #52178.
Checklist
[ ] I have made corresponding changes to the documentation(no user-facing fields change)[ ] I have made corresponding change to the default configuration files(n/a)./changelog/fragmentsusing the changelog toolDisruptive User Impact
None. The only behavior change is that keyspace lines carrying extra fields are no longer dropped.
How to test this PR locally
TestParseKeyspaceStatsnow includes adbline with extra fields and asserts it is still parsed.Backport
The same bug affects the 8.19.x and 9.0–9.3 lines (see #52178), where
redis.keyspaceislost entirely on Valkey ≥ 9.0 / Redis ≥ 7.4. #47971 relaxed the guard to
== 3 || == 4onmain(9.4+) but was not backported; this change supersedes it with the more robust
>= 3. Pleasebackport to 8.19 (and 9.0–9.3 if still applicable).