Skip to content

[Elasticsearch] Exclude cold and frozen tiers from the index_pivot transform - #21232

Open
3kt wants to merge 4 commits into
elastic:mainfrom
3kt:fix/es-transform-exclude-frozen-tier
Open

3kt wants to merge 4 commits into
elastic:mainfrom
3kt:fix/es-transform-exclude-frozen-tier

Conversation

@3kt

@3kt 3kt commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Problem

The index_pivot transform reads from .monitoring-es-*, metrics-elasticsearch.stack_monitoring.index* and metricbeat-*. On deployments that extend the monitoring ILM policy (e.g. hot for 7 days, then frozen until deletion at 90 days), those indices age onto searchable snapshots and the transform gets stuck: it does not error, it just stops advancing its checkpoint, and stays stuck indefinitely.

It never needs that data anyway: 10-minute buckets with a 60s sync delay, so anything aged out of hot/warm was already processed.

Change

must_not:
  - terms:
      _tier: ["data_cold", "data_frozen"]

Same clause every other _tier-filtering transform in this repo uses (30 of them across 24 packages, e.g. wiz, crowdstrike, beaconing, cloud_security_posture, aws).

fleet_transform_version 0.3.0 -> 0.4.0 so Fleet reinstalls the transform; package patch bump to 1.22.1.

Users who want the older data in monitoring-indices can clone the transform, drop this clause and run it as a batch transform.

Testing

Self-monitored 9.4.1 stack (Elasticsearch, Kibana, Fleet Server, Elastic Agent) via elastic-package, this build installed through Fleet, integration pointed at the cluster itself. Workload: 6 indices + 3 data streams, ~50k docs and continuous search traffic over 25 minutes.

  • Fleet created only logs-elasticsearch.index_pivot-default-0.4.0, with the _tier clause present in the deployed query.
  • 4 checkpoints, advancing every 10 minutes, health: green, 6650 docs processed, 156 indexed, 0 search/index failures.
  • monitoring-indices filled for all demo indices and data stream backing indices, with populated deltas, tier, creation_date and age; system-index exclusions unchanged.
  • Old (0.3.0) and new queries return an identical hit count against the same live monitoring data, so the clause is a no-op without cold/frozen data.
  • _validate/query returns valid: true; counter-test on the tier the test index actually lives on drops hits to 0, confirming the filter is applied.
  • elastic-package lint passes.

The `index_pivot` transform reads from `.monitoring-es-*` and
`metrics-elasticsearch.stack_monitoring.index*`. On deployments that
extend the monitoring ILM policy beyond the default retention, those
indices eventually age into the frozen tier, where they are backed by
partially mounted searchable snapshots. The transform then stalls: it
keeps running without erroring but stops advancing its checkpoint.

Add a `must_not` clause on the `_tier` metadata field so the transform
only reads data that is still on local storage. Users who want to
backfill older monitoring data can still do so with a manual copy of the
transform that drops this clause.

Bumps `fleet_transform_version` to 0.4.0 so Fleet reinstalls the
transform.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ Elastic Docs Style Checker (Vale)

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.

3kt and others added 2 commits September 14, 2026 10:36
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Every other transform in this repository that filters on `_tier` excludes
both `data_cold` and `data_frozen`. The cold tier is also backed by
searchable snapshots, and this transform never legitimately needs data
that old: it builds 10-minute buckets with a 60s sync delay, so anything
that has aged out of hot/warm was already processed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@3kt 3kt changed the title [Elasticsearch] Exclude frozen tier from the index_pivot transform [Elasticsearch] Exclude cold and frozen tiers from the index_pivot transform Sep 14, 2026
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@3kt
3kt marked this pull request as ready for review September 14, 2026 10:14
@3kt
3kt requested a review from a team as a code owner September 14, 2026 10:14
Copilot AI lite review requested due to automatic review settings September 14, 2026 10:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The remaining documentation update is a minor, non-blocking nit.

Pull request overview

Updates Elasticsearch’s index_pivot transform to exclude cold and frozen tiers, preventing checkpoint stalls.

Changes:

  • Excludes data_cold and data_frozen documents.
  • Bumps transform version to 0.4.0.
  • Bumps package version to 1.22.1 and adds a bugfix changelog entry.
File summaries
File Description
packages/elasticsearch/manifest.yml Bumps package version.
packages/elasticsearch/elasticsearch/transform/index_pivot/transform.yml Adds tier exclusions and updates the transform version.
packages/elasticsearch/changelog.yml Documents the fix.
Review details

Suppressed comments (1)

packages/elasticsearch/elasticsearch/transform/index_pivot/transform.yml:44

  • This changes the transform's historical coverage, but the user-facing documentation still says the job "will process all compatible historical data" (_dev/build/docs/README.md:201, rendered in docs/README.md:2932). With this must_not, cold/frozen monitoring documents are intentionally skipped, so update the documentation (and regenerate the rendered README) to describe the hot/warm-only behavior and the manual backfill option.
      must_not:
        - terms:
            _tier: ["data_cold", "data_frozen"]
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 14, 2026 10:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Update the public documentation to describe the new retention boundary and manual backfill path.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +42 to +44
must_not:
- terms:
_tier: ["data_cold", "data_frozen"]
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@consulthys consulthys left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGT Stack Monitoring

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@mergify

mergify Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

3 participants