Skip to content

Support Elasticsearch 9.x as storage#13957

Merged
kezhenxu94 merged 1 commit into
apache:masterfrom
kezhenxu94:support-elasticsearch-9
Jul 24, 2026
Merged

Support Elasticsearch 9.x as storage#13957
kezhenxu94 merged 1 commit into
apache:masterfrom
kezhenxu94:support-elasticsearch-9

Conversation

@kezhenxu94

Copy link
Copy Markdown
Member

Fix the issue

Adds support for running SkyWalking OAP against Elasticsearch 9.x as storage.

Why

The in-tree ES client (library-elasticsearch-client) selects its request factory / codec per server version in ElasticSearchVersion. The ceiling was major == 8, so any server reporting major version 9 fell through to UnsupportedOperationException("Unsupported version") and OAP refused to start against an Elasticsearch 9 cluster.

ES 9 keeps the same REST surface the ES 8 path already relies on — typeless document writes (POST /{index}/_update/{id}) and composable index templates (PUT /_index_template/{name}) — so no new factory or codec is needed; the version gate just needs to admit major >= 8. This mirrors how OpenSearch is already handled version-agnostically.

What changed

  • ElasticSearchVersion: if (major == 8)if (major >= 8) for the ElasticSearch distribution (8.x, 9.x and later use the existing typeless-doc + composable-template path).
  • ElasticSearchIT: add an ElasticSearch 9.3.0 parameter (all IT methods run against a real ES 9 container).
  • CI skywalking.yaml: add a Storage ES 9.3.0 e2e case alongside the existing 8.18.8.
  • Docs: storage doc supported-versions line now lists ElasticSearch 9.x; changelog entry added.

Verified locally against a real elasticsearch:9.3.0 container: version detection, composable index template, typeless index/get/update/delete, and search all behave as expected.

The ES client version gate capped at major == 8, so a server reporting
major 9 fell through to UnsupportedOperationException and OAP refused to
start against an Elasticsearch 9 cluster. ES 9 keeps the same REST
surface the ES 8 path already uses (typeless document writes and
composable index templates), so admit major >= 8 to that path.

Add ES 9.3.0 to the module IT (ElasticSearchIT) and a new Storage ES
9.3.0 e2e case alongside the existing 8.18.8 coverage; update the storage
docs and changelog.
Copilot AI review requested due to automatic review settings July 24, 2026 03:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request extends SkyWalking OAP’s in-tree Elasticsearch client/version gating so the existing Elasticsearch 8.x request/codec path is also used for Elasticsearch 9.x, and expands CI/IT coverage plus docs/changelog accordingly.

Changes:

  • Update ElasticSearchVersion to treat Elasticsearch major versions >= 8 as supported (reusing the existing typeless-doc + composable-template request path).
  • Add an Elasticsearch 9.x integration-test parameter and a new CI e2e workflow case for Elasticsearch 9.x.
  • Document Elasticsearch 9.x support and add a changelog entry.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
oap-server/server-library/library-elasticsearch-client/src/test/java/org/apache/skywalking/library/elasticsearch/ElasticSearchIT.java Adds an Elasticsearch 9.x Testcontainers parameter to run the existing IT suite against ES 9.
oap-server/server-library/library-elasticsearch-client/src/main/java/org/apache/skywalking/library/elasticsearch/ElasticSearchVersion.java Broadens the Elasticsearch version gate to allow 9.x (and later) to use the existing 8.x request/codec implementation.
docs/en/setup/backend/storages/elasticsearch.md Updates the supported versions list to include Elasticsearch 9.x.
docs/en/changes/changes.md Adds a changelog bullet announcing Elasticsearch 9.x storage support.
.github/workflows/skywalking.yaml Adds an e2e CI matrix entry to run the ES storage case against a 9.x tag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kezhenxu94
kezhenxu94 requested a review from wu-sheng July 24, 2026 07:49
@kezhenxu94
kezhenxu94 merged commit dddc3b5 into apache:master Jul 24, 2026
444 of 447 checks passed
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