Skip to content

[Metricbeat][Redis] Add the Valkey keys_with_volatile_items keyspace field#52181

Open
aglowienka wants to merge 2 commits into
elastic:mainfrom
aglowienka:feat/redis-keyspace-keys-with-volatile-items
Open

[Metricbeat][Redis] Add the Valkey keys_with_volatile_items keyspace field#52181
aglowienka wants to merge 2 commits into
elastic:mainfrom
aglowienka:feat/redis-keyspace-keys-with-volatile-items

Conversation

@aglowienka

@aglowienka aglowienka commented Jul 22, 2026

Copy link
Copy Markdown

Proposed commit message

Valkey ≥ 9.0 reports a per-database keys_with_volatile_items counter in INFO keyspace that the
redis.keyspace metricset did not collect. This adds redis.keyspace.keys_with_volatile_items,
following the same pattern as the Redis 7.4 subexpiry field (added in #47971): it is added to the
schema and defaulted to 0 when the engine does not report it, so behavior is unchanged on Redis
and older Valkey.

Generated assets (metricbeat/module/redis/fields.go and
docs/reference/metricbeat/exported-fields-redis.md) were regenerated with mage fields /
mage fieldsDocs.

Relates to #52179.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (n/a)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool

Disruptive User Impact

None. Adds one new keyspace field; it defaults to 0 when the engine does not report it.

How to test this PR locally

go test ./metricbeat/module/redis/keyspace/...

TestParseKeyspaceStats now covers a db line that reports keys_with_volatile_items (asserting it
is captured) and the default-0 behavior when it is absent.

Note on the sample event

metricbeat/module/redis/keyspace/_meta/data.json (the generated sample event) is produced by the
integration test against a live Redis/Valkey and is not regenerated by mage update. It will pick up
the new field the next time the keyspace integration golden is regenerated; leaving it untouched here
keeps mage check green.

Related

Companion to #52180 (parser robustness fix). On main the parser already accepts the 4-field Valkey
line, so this change is purely additive.

…etricset

Valkey >= 9.0 reports a per-database keys_with_volatile_items counter in
INFO keyspace. Collect it as redis.keyspace.keys_with_volatile_items,
following the same pattern as the Redis 7.4 subexpiry field: added to the
schema and defaulted to 0 when the engine does not report it.

Relates to elastic#52179

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 22, 2026
@botelastic

botelastic Bot commented Jul 22, 2026

Copy link
Copy Markdown

This pull request doesn't have a Team:<team> label.

@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@mergify

mergify Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @aglowienka? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

Ran `mage fields` and `mage fieldsDocs` to regenerate the generated assets for
the new redis.keyspace.keys_with_volatile_items field.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@aglowienka
aglowienka marked this pull request as ready for review July 22, 2026 09:00
@aglowienka
aglowienka requested review from a team as code owners July 22, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants