Skip to content

chore(deps): update module github.com/elastic/go-elasticsearch/v8 to v9 (9.5) - #7659

Open
elastic-renovate-prod[bot] wants to merge 2 commits into
9.5from
renovate/9.5-golang/major-elastic
Open

chore(deps): update module github.com/elastic/go-elasticsearch/v8 to v9 (9.5)#7659
elastic-renovate-prod[bot] wants to merge 2 commits into
9.5from
renovate/9.5-golang/major-elastic

Conversation

@elastic-renovate-prod

@elastic-renovate-prod elastic-renovate-prod Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
github.com/elastic/go-elasticsearch/v8 require major v8.19.6v9.5.1

Release Notes

elastic/go-elasticsearch (github.com/elastic/go-elasticsearch/v8)

v9.5.1

Compare Source

Features

v9.5.0

Compare Source

Features

v9.4.3

Compare Source

Features

v9.4.2

Compare Source

Bug Fixes
  • esutil: Omit empty routing query param in BulkIndexer (#​1515) (3845bb1)

v9.4.1

Compare Source

⚠ BREAKING CHANGES
  • client: (*elasticsearch.Client).ToTyped() is removed. Use elasticsearch.NewTypedFrom(c) instead.
Bug Fixes
  • client: Remove (*Client).ToTyped() to fix binary-size regression (#​1480) (86e8f65)

v9.4.0

Compare Source

⚠ BREAKING CHANGES
  • esutil: default Client to elasticsearch.NewBase in NewBulkIndexer
  • esapi: params previously typed *int on ~25 esapi endpoints are now *int64 to match the spec long type. Call sites passing untyped integer literals keep compiling; call sites passing a typed int variable need an int64(...) cast.
Features
Bug Fixes

v9.3.6

Compare Source

Features

v9.3.5

Compare Source

Bug Fixes
  • esutil: Omit empty routing query param in BulkIndexer (#​1514) (f9640f0)

v9.3.4

Compare Source

⚠ BREAKING CHANGES
  • client: (*elasticsearch.Client).ToTyped() is removed. Use elasticsearch.NewTypedFrom(c) instead.
Bug Fixes
  • client: Remove (*Client).ToTyped() to fix binary-size regression (#​1479) (7d5b37e)

v9.3.3

Compare Source

⚠ BREAKING CHANGES
  • esapi: params previously typed *int on ~20 esapi endpoints are now *int64 to match the spec long type. Call sites passing untyped integer literals keep compiling; call sites passing a typed int variable need an int64(...) cast.
Features
Bug Fixes

v9.3.2

Compare Source

⚠ BREAKING CHANGES
  • Typed API: update client from spec df81426
Features
Bug Fixes
  • esapi: Document Response.Body must be closed; fix leaks in examples (#​1313) (3b3dd1e)
  • esutil: Deterministic context check in BulkIndexer.Close (#​1340) (a02272b)
  • esutil: Propagate caller context through BulkIndexer item callbacks (#​1316) (d28cd9d)
  • Typed API: Context variable shadowing in TypedAPI Perform causing otel attributes to leak to parent span (#​1331) (f37f7d1)

v9.3.1

Compare Source

Bug Fixes
  • bulk_indexer: Enable instrumentation support in bulk index requests (#​1243) (3300e5d)
  • esutil: Avoid duplicate bulk indexer OnError callbacks (#​1251) (9255720)
  • esutil: Propagate context timeout while closing bulk indexer (#​1254) (6a0b973)
  • Prevent BulkIndexer from silently dropping items on flush failure (#​1241) (0215eec)
  • Typed API: Add field-level nil checks during deserialisation (#​1225) (fc22640)
  • Typed API: Add missing custom UnmarshalJSON methods for types with additional properties (fc22640)

v9.3.0

Compare Source

⚠ BREAKING CHANGES
  • Upgrade Go version from 1.23 to 1.24 (#​1137)
  • API: API methods and request fields that previously accepted a single string for resource identifiers (e.g., indices, names, IDs, routing, features) now require []string. Corresponding WithX helpers now accept variadic arguments (...string).
  • API: All ExpandWildcards request fields were changed from string to []string, and WithExpandWildcards helpers now accept variadic arguments (...string).
  • API: Routing parameters across document, search, and multi-document APIs were changed from string to []string, and related WithRouting helpers now accept variadic arguments (...string).
  • API: Duration-based parameters previously expressed as string now use time.Duration (e.g., KeepAlive, Interval, BucketSpan). Call sites must pass time.Duration values.
  • API: ML APIs using interface{} for start/end time parameters now require string values, removing support for arbitrary types.
  • API: Several top-level API methods now require []string instead of string for path parameters that support multiple resources (e.g., indices, templates, data streams, transforms, repositories, privileges).
  • API: MonitoringBulk was refactored: DocumentType support was removed, Interval is now time.Duration, and required parameters were added explicitly to the method signature.
  • API: Some WithX functional options changed between single-value and variadic forms to match API behaviour. Existing option usage may require updates.
  • API: Request struct fields were updated to reflect REST API semantics, including changes from string to []string and removal of deprecated fields. Direct struct initialization may require changes.
Features
  • API: Introduce strong typing for duration values (3c657da)
  • API: Support multi-value resource parameters (3c657da)
  • API: Support multiple resources per request (3c657da)
  • API: Update APIs to 9.3.0 (3c657da)
  • Expose FlushedMs metric in BulkIndexer (#​1191) (d67d0be)
  • Typed API: Add DenseVectorF32 and DenseVectorBytes types, improving indexing performance of dense vectors by up to 3x when used instead of a float32 array (f543b82)
  • Typed API: Update TypedAPI to latest elasticsearch-specification 9.3.0 (f543b82)
  • Upgrade Go version from 1.23 to 1.24 (#​1137) (05f15eb)
Bug Fixes
  • API: Align request structs with Elasticsearch REST spec (3c657da)
  • API: Align routing parameters with REST API (3c657da)
  • API: Correct functional option cardinality (3c657da)
  • API: Modernize MonitoringBulk API (3c657da)
  • API: Normalize expand_wildcards handling (3c657da)
  • API: Simplify ML time range parameters (3c657da)
  • esutil: Handle error from Seek in BulkIndexer.writeBody (#​1162) (ab7b3bb)
  • Typed API: Marshal Additional Properties into json.RawMessage instead of any to avoid loss of precision (#​1147) (e3e61d6)

v9.2.6

Compare Source

⚠ BREAKING CHANGES
  • client: (*elasticsearch.Client).ToTyped() is removed. Use elasticsearch.NewTypedFrom(c) instead.
Bug Fixes
  • client: Remove (*Client).ToTyped() to fix binary-size regression (#​1478) (e328483)

v9.2.5

Compare Source

⚠ BREAKING CHANGES
  • esapi: params previously typed *int on ~20 esapi endpoints are now *int64 to match the spec long type. Call sites passing untyped integer literals keep compiling; call sites passing a typed int variable need an int64(...) cast.
Features
Bug Fixes
  • esapi: Regenerate esapi with *int64 for long-typed params (#​1421) (e30cdb6)
  • gen: Map spec long to *int64 for esapi params (#​1392) (ef6e458)
  • gen: Normalize date URL part and param types to string (#​1415) (a029ed0)
  • gen: Pass []string to DeleteIndexTemplate in test boilerplate (#​1423) (af25eed)
  • gen: Pass []string to DeletePrivileges in xpack test boilerplate (#​1424) (d603097)
  • gen: Support *int64 fields in gen-tests output (#​1418) (3a61210)

v9.2.4

Compare Source

⚠ BREAKING CHANGES
  • Typed API: update client from spec 49022a2
Features
Bug Fixes
  • esapi: Document Response.Body must be closed; fix leaks in examples (#​1312) (c680847)
  • esutil: Deterministic context check in BulkIndexer.Close (#​1339) (0b34e21)
  • esutil: Propagate caller context through BulkIndexer item callbacks (#​1315) (cf70e22)
  • Typed API: Context variable shadowing in TypedAPI Perform causing otel attributes to leak to parent span (#​1330) (f52219c)

v9.2.3

Compare Source

Bug Fixes
  • bulk_indexer: Enable instrumentation support in bulk index requests (#​1242) (71b0b0d)
  • esutil: Avoid duplicate bulk indexer OnError callbacks (#​1250) (8537e89)
  • esutil: Propagate context timeout while closing bulk indexer (#​1253) (405af64)
  • Prevent BulkIndexer from silently dropping items on flush failure (#​1240) (755a9d3)
  • Typed API: Add field-level nil checks during deserialisation (#​1224) (59f268f)
  • Typed API: Add missing custom UnmarshalJSON methods for types with additional properties (59f268f)

v9.2.2

Compare Source

Features
Bug Fixes
  • esutil: Handle error from Seek in BulkIndexer.writeBody (#​1161) (5394405)
  • Typed API: Marshal Additional Properties into json.RawMessage instead of any to avoid loss of precision (#​1201) (b5ceeee)

v9.2.1

Compare Source

Features
Bug Fixes

v9.2.0: 9.2.0

Compare Source

API

  • Updated APIs to 9.2.0

Typed API

v9.1.2

Compare Source

Features
Bug Fixes
  • Typed API: Marshal Additional Properties into json.RawMessage instead of any to avoid loss of precision (#​1200) (f32bfca)

v9.1.1

Compare Source

Features
Bug Fixes

v9.1.0: 9.1.0

Compare Source

API

  • Updated APIs to 9.1.0

Typed API

  • Update TypedAPI to latest elasticsearch-specification 9.1
  • This release introduces a new MethodAPI used by the TypedClient which makes the client friendlier for dead code elimination.
    Reducing the size of the client when only a subset of the APIs are used. The old API structure remains available for backward compatibility, but it is now deprecated.

v9.0.1: 9.0.1

Compare Source

API

  • Updated APIs to 9.0.4

Typed API

v9.0.0: 9.0.0

Compare Source

  • The client now requires Go 1.23 or later.

New

  • This release introduces an optional package for the TypedAPI named esdsl.
    It provides a domain-specific language (DSL) for building Elasticsearch queries in Go.
    The DSL is designed to simplify query construction, making it easier to build complex queries without writing raw JSON.
// create index
{
    // delete index if exists
    if existsRes, err := es.Indices.Exists("test").IsSuccess(context.Background()); err != nil {
        log.Println(err)
        return
    } else if existsRes {
        if ok, _ := es.Indices.Delete("test").IsSuccess(context.Background()); !ok {
            log.Fatalf("Error deleting index: %v\n", err)
        }
        log.Println("Index deleted:", "test")
    } else {
        log.Println("Index does not exist:", "test")
    }

    mappings := esdsl.NewTypeMapping().
        AddProperty("name", esdsl.NewTextProperty()).
        AddProperty("age", esdsl.NewIntegerNumberProperty())

    createRes, err := es.Indices.Create("test").Mappings(mappings).Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }

    log.Printf("Index created: %#v\n", createRes)
}

// index document
{
    documents := []Document{
        {"Alice", 30},
        {"Bob", 25},
        {"Charlie", 35},
    }

    bulk := es.Bulk().Index("test")
    for _, document := range documents {
        err := bulk.IndexOp(types.IndexOperation{}, document)
        if err != nil {
            log.Println("Error indexing document:", err)
        }
    }
    bulkRes, err := bulk.Refresh(refresh.Waitfor).Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }
    if bulkRes.Errors {
        log.Println("Some documents failed to index")
        for _, item := range bulkRes.Items {
            for operationType, responseItem := range item {
                if responseItem.Error != nil {
                    log.Println("Operation:", operationType)
                    log.Println("Response:", responseItem)
                }
            }
        }
    }
    indexedDocs := 0
    for _, item := range bulkRes.Items {
        for _, responseItem := range item {
            if responseItem.Error == nil {
                indexedDocs++
            }
        }
    }

    log.Println("Documents indexed:", indexedDocs)
}

// calculate median age
{
    searchRes, err := es.Search().
        Index("test").
        Size(0).
        AddAggregation("median_age", esdsl.NewPercentilesAggregation().Field("age").Percents(50)).
        Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }

    if agg, ok := searchRes.Aggregations["median_age"].(*types.TDigestPercentilesAggregate); ok {
        if val, ok := agg.Values.(map[string]interface{})["50.0"]; ok {
            log.Println("Median age:", val)
        }
    }
}

// search documents
{
    matchRes, err := es.Search().
        Index("test").
        Query(esdsl.NewBoolQuery().
            Must(esdsl.NewMatchQuery("name", "Alice")).
            Filter(esdsl.NewNumberRangeQuery("age").Gte(20).Lte(40))).
        Sort(esdsl.NewSortOptions().AddSortOption("age", esdsl.NewFieldSort(sortorder.Asc))).
        Size(10).
        Do(context.Background())
    if err != nil {
        log.Println(err)
        return
    }
    if matchRes.Hits.Total.Value > 0 {
        for _, hit := range matchRes.Hits.Hits {
            doc := Document{}
            err := json.Unmarshal(hit.Source_, &doc)
            if err != nil {
                log.Println("Error unmarshalling document:", err)
                continue
            }
            log.Printf("Document ID: %s, Name: %s, Age: %d\n", *hit.Id_, doc.Name, doc.Age)
        }
    } else {
        log.Println("No documents found")
    }
}

API

  • Updated APIs to 9.0.0

Typed API

v8.19.7

Compare Source

Features

Configuration

📅 Schedule: Branch creation - "on monday" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@elastic-renovate-prod
elastic-renovate-prod Bot requested a review from a team as a code owner August 17, 2026 22:41
@elastic-renovate-prod elastic-renovate-prod Bot added backport-skip Skip notification from the automated backport with mergify dependency labels Aug 17, 2026
@elastic-renovate-prod elastic-renovate-prod Bot added skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Aug 17, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@elastic-renovate-prod
elastic-renovate-prod Bot force-pushed the renovate/9.5-golang/major-elastic branch 2 times, most recently from 8e30049 to 9709f26 Compare August 25, 2026 13:40
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

This Buildkite run is failing for two independent reasons after the go-elasticsearch v9 bump: v8-style request call patterns still exist in monitor.go/ilm.go, and testing/go.mod now requires pkg/api/v9/fleet-server/v9 without corresponding dependency resolution (testing/go.sum), which breaks Run check-ci.

Remediation

  • Update remaining v8-style API calls to v9 signatures:
    • internal/pkg/monitor/monitor.go:419-423 (FleetSearch)
    • internal/pkg/testing/esutil/ilm.go:153-156 (ILM.PutLifecycle)
  • Fix testing module dependency wiring:
    • In testing/go.mod:11-18, avoid unresolved remote pkg/api/v9/fleet-server/v9 requirements for this repo layout (restore local replace workflow or otherwise ensure module paths/versions are resolvable), then regenerate testing/go.sum.
  • Re-run Run check-ci and package matrix (x86_64, x86_64 FIPS, aarch64, aarch64 FIPS).
Investigation details

Root Cause

  1. Code bug (API migration mismatch):

    • internal/pkg/monitor/monitor.go:419-423 still uses WithBody(...) option style; v9 expects positional body argument.
    • internal/pkg/testing/esutil/ilm.go:153-156 has the same v8-style WithBody(...) pattern.
  2. Dependency/module issue (testing module):

    • PR diff updates testing/go.mod require entries from local pseudo-versions to:
      • github.com/elastic/fleet-server/pkg/api/v9 v9.5.2
      • github.com/elastic/fleet-server/v9 v9.5.2
    • Run check-ci then fails with missing testing/go.sum entries for github.com/elastic/fleet-server/pkg/api/v9.

Evidence

  • Build: https://buildkite.com/elastic/fleet-server/builds/16459
  • Failed job logs:
    • /tmp/gh-aw/buildkite-logs/fleet-server-white_check_mark-run-check-ci.txt
    • /tmp/gh-aw/buildkite-logs/fleet-server-package-x86_64.txt
    • /tmp/gh-aw/buildkite-logs/fleet-server-package-x86_64-fips.txt
    • /tmp/gh-aw/buildkite-logs/fleet-server-package-aarch64.txt
    • /tmp/gh-aw/buildkite-logs/fleet-server-package-aarch64-fips.txt
  • Key excerpts:
    • internal/pkg/monitor/monitor.go:422:23: m.esCli.FleetSearch.WithBody undefined
    • internal/pkg/testing/esutil/ilm.go:154:24: cli.ILM.PutLifecycle.WithBody undefined
    • e2e/api_version/client_api_current.go:39:2: github.com/elastic/fleet-server/pkg/api/v9@v9.5.2: missing go.sum entry for go.mod file

Verification

  • Not run locally in this detective workflow (read-only analysis from Buildkite logs + PR diff).

Follow-up

  • I checked for related flaky-test labeled issues for these failures and found none; this looks deterministic, not flake-driven.

What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@elastic-renovate-prod
elastic-renovate-prod Bot force-pushed the renovate/9.5-golang/major-elastic branch 2 times, most recently from 5f1e6ed to a1b2edb Compare August 27, 2026 11:12
@github-actions github-actions Bot mentioned this pull request Aug 27, 2026
@elastic-renovate-prod
elastic-renovate-prod Bot force-pushed the renovate/9.5-golang/major-elastic branch from a1b2edb to 93620cc Compare August 27, 2026 15:08
@elastic-renovate-prod elastic-renovate-prod Bot changed the title chore(deps): update elastic to v9 (9.5) (major) chore(deps): update module github.com/elastic/go-elasticsearch/v8 to v9 (9.5) Aug 27, 2026
@elastic-renovate-prod
elastic-renovate-prod Bot force-pushed the renovate/9.5-golang/major-elastic branch from f5747ba to 465418d Compare August 27, 2026 15:15
@elastic-renovate-prod

Copy link
Copy Markdown
Contributor Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation backport-skip Skip notification from the automated backport with mergify dependency skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants