Skip to content

[9.3](backport #49237) ES index mode & codec in metricbeat#49318

Merged
consulthys merged 1 commit into9.3from
mergify/bp/9.3/pr-49237
Mar 10, 2026
Merged

[9.3](backport #49237) ES index mode & codec in metricbeat#49318
consulthys merged 1 commit into9.3from
mergify/bp/9.3/pr-49237

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Mar 6, 2026

Type of change: Enhancement

Proposed commit message

Add mode and codec fields to the elasticsearch.index metricset

WHAT:

  • Add two optional fields to the Metricbeat Elasticsearch index metricset: elasticsearch.index.mode (e.g. time_series) and elasticsearch.index.codec (e.g. default, best_compression, none), sourced from the index /_settings API.
  • Extend the existing index-settings flow (GetIndexSettings + addIndexSettings) with filter_path entries for *.settings.index.mode and *.settings.index.codec, and populate the new fields in addIndexSettings only when present.
  • Add mode and codec to the Index struct (omitempty), to the index metricset fields.yml (keyword), to the sample data.json, and to CHANGELOG.asciidoc.

WHY:

  • Enables monitoring and filtering of index mode (e.g. time-series vs standard) and compression codec from Metricbeat, reusing the same _settings-based scaffolding used for tier_preference, creation_date, and version (PR Additional stats fields for Elasticsearch #41944). Both fields are optional so missing settings do not break event collection.

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
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Disruptive User Impact

None. The change only adds optional fields. Existing dashboards and queries are unchanged; new fields appear in events when the Elasticsearch index exposes index.mode or index.codec in /_settings.

Author's Checklist

  • Verified new fields are populated when index has mode/codec in _settings
  • Verified behaviour unchanged when mode/codec are missing (fields omitted, no error)
  • Regenerate field docs with mage FieldsDocs (or make update) if required by project workflow

How to test this PR locally

  1. Build and run Metricbeat with the Elasticsearch module and index metricset enabled against a cluster that has indices (some with index.mode or index.codec set if possible).
  2. Ingest events and confirm elasticsearch.index.mode and/or elasticsearch.index.codec appear when the index settings are present.
  3. Confirm events for indices without these settings still publish and do not include the new fields (or include them empty/omitted).

Related issues

Use cases

  • As an operator, I can filter or aggregate Metricbeat index metrics by index mode (e.g. time_series) or codec (e.g. best_compression) in Kibana or downstream systems.
  • As an operator, I can see index mode and codec in the same index metricset events as tier_preference, creation_date, and version, without changing existing behaviour when those settings are absent.

Screenshots

N/A

Logs

N/A


This is an automatic backport of pull request #49237 done by Mergify.

* Add `mode` and `codec` fields to the `elasticsearch.index` metricset in Metricbeat. Update index settings retrieval and mapping to include these new fields.

* Add new exported fields for Elasticsearch in Metricbeat documentation

* Make update

* Added fragment

(cherry picked from commit 7dc72ea)

# Conflicts:
#	CHANGELOG.asciidoc
@mergify mergify bot requested a review from a team as a code owner March 6, 2026 14:21
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Mar 6, 2026
@mergify mergify bot requested a review from a team as a code owner March 6, 2026 14:21
@mergify mergify bot assigned 3kt Mar 6, 2026
@mergify
Copy link
Copy Markdown
Contributor Author

mergify bot commented Mar 6, 2026

Cherry-pick of 7dc72ea has failed:

On branch mergify/bp/9.3/pr-49237
Your branch is up to date with 'origin/9.3'.

You are currently cherry-picking commit 7dc72eae2.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   changelog/fragments/1772635870-es-index-mode-&-codec-in-metricbeat.yaml
	modified:   docs/reference/metricbeat/exported-fields-elasticsearch.md
	modified:   docs/reference/metricbeat/metricbeat-metricset-elasticsearch-index.md
	modified:   metricbeat/module/elasticsearch/fields.go
	modified:   metricbeat/module/elasticsearch/index/_meta/data.json
	modified:   metricbeat/module/elasticsearch/index/_meta/fields.yml
	modified:   metricbeat/module/elasticsearch/index/data.go

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   CHANGELOG.asciidoc

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Mar 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 2026

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Mar 6, 2026
@mergify mergify bot mentioned this pull request Mar 6, 2026
9 tasks
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 2026

✅ Vale Linting Results

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 6, 2026

@mergify
Copy link
Copy Markdown
Contributor Author

mergify bot commented Mar 9, 2026

This pull request has not been merged yet. Could you please review and merge it @3kt? 🙏

Copy link
Copy Markdown
Contributor

@consulthys consulthys left a comment

Choose a reason for hiding this comment

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

LGT Stack Monitoring

@consulthys consulthys merged commit 0a2349a into 9.3 Mar 10, 2026
51 checks passed
@consulthys consulthys deleted the mergify/bp/9.3/pr-49237 branch March 10, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport conflicts There is a conflict in the backported pull request Feature:Stack Monitoring Team:Monitoring Stack Monitoring team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants