Repository navigation
[9.6] (backport #22422) fix: bump beats and drop elastic-agent-libs usage - #22558
mergify[bot] wants to merge 3 commits into
Conversation
* fix: bump beats and resolve compile errors * lint: make notice * Update beat_test.go * lint: drop elastic-agent-libs * Update keystore_nofips_test.go (cherry picked from commit f77f498) # Conflicts: # NOTICE-fips.txt # NOTICE.txt # go.mod # go.sum # internal/beatcmd/keystore_nofips_test.go
|
Cherry-pick of f77f498 has failed: 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 |
🤖 GitHub commentsJust comment with:
|
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved conflicts in go.mod and go.sum block module loading, while undefined helpers in the new non-FIPS tests prevent the beatcmd test package from compiling.
2 open issues
What changed in this PR
Backports #22422 to 9.6, migrating APM Server from elastic-agent-libs to the corresponding Beats packages.
Changes:
- Updates Beats and related dependencies, checksums, and license notices.
- Migrates production and test imports, adapts the management API, and modernizes several Go constructs.
- Adds non-FIPS keystore tests covering directory imports and command behavior.
| File | Description |
|---|---|
| x-pack/apm-server/sampling/pubsub/pubsub.go | Migrates logging to Beats. |
| x-pack/apm-server/sampling/pubsub/pubsub_test.go | Migrates test logging imports. |
| x-pack/apm-server/sampling/pubsub/pubsub_integration_test.go | Migrates integration-test logging. |
| x-pack/apm-server/sampling/pubsub/config.go | Migrates logger configuration type. |
| x-pack/apm-server/sampling/processor.go | Migrates sampling logging. |
| x-pack/apm-server/sampling/processor_test.go | Migrates test logging imports. |
| x-pack/apm-server/sampling/processor_bench_test.go | Migrates benchmark logging. |
| x-pack/apm-server/sampling/eventstorage/storage_manager.go | Migrates storage-manager logging. |
| x-pack/apm-server/sampling/eventstorage/storage_manager_test.go | Migrates test logging imports. |
| x-pack/apm-server/sampling/eventstorage/storage_manager_bench_test.go | Migrates benchmark logging. |
| x-pack/apm-server/sampling/eventstorage/storage_bench_test.go | Migrates storage benchmark logging. |
| x-pack/apm-server/sampling/eventstorage/prefix_test.go | Migrates test logging helper. |
| x-pack/apm-server/sampling/eventstorage/pebble.go | Migrates Pebble logging. |
| x-pack/apm-server/sampling/config_test.go | Migrates test logging helper. |
| x-pack/apm-server/main.go | Migrates configuration, logging, and paths. |
| x-pack/apm-server/main_test.go | Migrates logging and paths imports. |
| x-pack/apm-server/aggregation/lsm.go | Migrates aggregation logging. |
| NOTICE.txt | Updates normal-build dependency notices. |
| NOTICE-fips.txt | Updates FIPS dependency notices. |
| internal/sourcemap/sourcemap_fetcher.go | Migrates fetcher logging. |
| internal/sourcemap/sourcemap_fetcher_test.go | Migrates test logging helper. |
| internal/sourcemap/processor.go | Migrates logging and reverse iteration. |
| internal/sourcemap/processor_test.go | Migrates test logging helper. |
| internal/sourcemap/metadata_fetcher.go | Migrates metadata-fetcher logging. |
| internal/sourcemap/metadata_fetcher_test.go | Migrates test logging helper. |
| internal/sourcemap/kibana.go | Migrates Kibana-fetcher logging. |
| internal/sourcemap/kibana_test.go | Migrates Kibana and logging imports. |
| internal/sourcemap/elasticsearch.go | Migrates logging and error matching. |
| internal/sourcemap/elasticsearch_test.go | Migrates test logging helper. |
| internal/sourcemap/chained.go | Migrates chained-fetcher logging. |
| internal/sourcemap/body_caching.go | Migrates cache logging. |
| internal/sourcemap/body_caching_test.go | Migrates test logging helper. |
| internal/publish/pub_test.go | Migrates configuration, logging, and map imports. |
| internal/publish/acker.go | Uses typed atomic counters. |
| internal/logs/ratelimit.go | Migrates logging integration to Beats. |
| internal/logs/ratelimit_test.go | Migrates test logging helper. |
| internal/kibana/send_config.go | Migrates map utilities. |
| internal/kibana/send_config_test.go | Migrates test configuration import. |
| internal/kibana/client.go | Migrates Kibana client dependency. |
| internal/kibana/client_test.go | Migrates test client dependency. |
| internal/elasticsearch/security_api_test.go | Migrates test logging helper. |
| internal/elasticsearch/config.go | Migrates logging and transport configuration. |
| internal/elasticsearch/client.go | Migrates client logging. |
| internal/elasticsearch/client_test.go | Migrates test logging helper. |
| internal/beater/waitready.go | Migrates logging and error matching. |
| internal/beater/tracing.go | Migrates logging and monitoring. |
| internal/beater/tracing_test.go | Migrates test configuration import. |
| internal/beater/telemetry.go | Migrates monitoring registry dependency. |
| internal/beater/telemetry_test.go | Migrates test monitoring import. |
| internal/beater/server.go | Migrates logging and paths. |
| internal/beater/server_test.go | Migrates test configuration import. |
| internal/beater/request/context.go | Migrates request logging. |
| internal/beater/request/context_test.go | Migrates test logging helper. |
| internal/beater/otlp/http_test.go | Migrates logging and monitoring imports. |
| internal/beater/otlp/http_internal_test.go | Migrates test logging helper. |
| internal/beater/otlp/grpc_test.go | Migrates test logging helper. |
| internal/beater/middleware/middleware.go | Uses reverse slice iteration. |
| internal/beater/middleware/log_middleware.go | Migrates middleware logging. |
| internal/beater/middleware/log_middleware_test.go | Migrates logging and map imports. |
| internal/beater/memlimit_cgroup_test.go | Migrates optional-value dependency. |
| internal/beater/interceptors/metrics.go | Migrates interceptor logging. |
| internal/beater/interceptors/metrics_test.go | Migrates test logging helper. |
| internal/beater/interceptors/logging.go | Migrates gRPC logging. |
| internal/beater/interceptors/logging_test.go | Migrates test logging helper. |
| internal/beater/interceptors/auth_test.go | Migrates test logging helper. |
| internal/beater/http.go | Migrates logging and TLS configuration. |
| internal/beater/config/sampling.go | Migrates configuration and logging. |
| internal/beater/config/sampling_test.go | Migrates configuration and logging helpers. |
| internal/beater/config/rum.go | Migrates configuration and logging. |
| internal/beater/config/rum_test.go | Migrates configuration and logging helpers. |
| internal/beater/config/kibana.go | Migrates configuration and Kibana dependencies. |
| internal/beater/config/config.go | Migrates configuration, logging, and TLS imports. |
| internal/beater/config/config_test.go | Migrates test imports and updates a comment. |
| internal/beater/config/auth.go | Migrates configuration and logging. |
| internal/beater/config/auth_test.go | Migrates configuration and logging helpers. |
| internal/beater/config/aggregation_test.go | Migrates configuration and logging helpers. |
| internal/beater/config/agentconfig.go | Migrates configuration and logging. |
| internal/beater/config/agentconfig_test.go | Migrates configuration and logging helpers. |
| internal/beater/beatertest/server.go | Migrates server-test support dependencies. |
| internal/beater/beatertest/output.go | Migrates test configuration import. |
| internal/beater/beater.go | Migrates configuration, logging, monitoring, and paths. |
| internal/beater/beater_test.go | Migrates test support imports. |
| internal/beater/auth/authenticator.go | Migrates authentication logging. |
| internal/beater/auth/authenticator_test.go | Migrates test logging helper. |
| internal/beater/auth/apikey_test.go | Migrates test logging helper. |
| internal/beater/auth/anonymous_test.go | Migrates test logging helper. |
| internal/beater/api/root/handler.go | Migrates response map dependency. |
| internal/beater/api/mux.go | Migrates logging and monitoring. |
| internal/beater/api/mux_test.go | Migrates logging and monitoring imports. |
| internal/beater/api/mux_intake_rum_test.go | Migrates test logging helper. |
| internal/beater/api/intake/handler.go | Uses typed error matching. |
| internal/beater/api/expvar.go | Migrates monitoring dependency. |
| internal/beater/api/config/agent/handler_test.go | Migrates test logging helper. |
| internal/beatcmd/testcmd.go | Migrates configuration, logging, and testing utilities. |
| internal/beatcmd/run.go | Migrates service dependency. |
| internal/beatcmd/reloader.go | Migrates configuration and logging. |
| internal/beatcmd/reloader_test.go | Migrates configuration and logging helpers. |
| internal/beatcmd/logging.go | Migrates logging and paths. |
| internal/beatcmd/logging_test.go | Migrates logging configuration dependencies. |
| internal/beatcmd/locker.go | Migrates paths dependency. |
| internal/beatcmd/keystore_nofips.go | Migrates keystore dependency. |
| internal/beatcmd/keystore_nofips_test.go | Adds directory-import and keystore-command tests. |
| internal/beatcmd/config.go | Migrates configuration, keystore, and paths. |
| internal/beatcmd/config_test.go | Migrates test configuration import. |
| internal/beatcmd/config_nofips.go | Migrates non-FIPS configuration dependencies. |
| internal/beatcmd/config_nofips_test.go | Migrates test keystore import. |
| internal/beatcmd/config_fips.go | Migrates FIPS configuration dependencies. |
| internal/beatcmd/cmd.go | Migrates command logging. |
| internal/beatcmd/beat.go | Migrates shared utilities and management API calls. |
| internal/beatcmd/beat_test.go | Migrates imports and updates manager mock. |
| internal/agentcfg/reporter.go | Migrates reporter logging. |
| internal/agentcfg/reporter_test.go | Migrates test logging helper. |
| internal/agentcfg/kibana.go | Migrates Kibana configuration logging. |
| internal/agentcfg/kibana_test.go | Migrates test logging helper. |
| internal/agentcfg/elasticsearch.go | Migrates configuration-fetcher logging. |
| internal/agentcfg/elasticsearch_test.go | Migrates test logging helper. |
| internal/agentcfg/cache.go | Migrates cache logging. |
| internal/agentcfg/cache_test.go | Migrates test logging imports. |
| go.sum | Updates dependency checksums. |
| go.mod | Updates Beats and related dependency requirements. |
Review effort: Balanced
| github.com/cockroachdb/pebble/v2 v2.1.7 | ||
| github.com/dustin/go-humanize v1.1.0 | ||
| github.com/elastic/apm-aggregation v1.5.1 | ||
| <<<<<<< HEAD |
Dependency Update AnalysisSummary: This PR contains a Go dependency bump set (notably Go modules (multiple): selected direct bumps
Ecosystem: Go
Changelog highlights (old → new)
Usage in this repository
Compatibility assessment
Labels AppliedNo labels applied (overall risk is high due malformed What is this? | From workflow: Observability Agentic Workflow — Pull Request Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
TL;DRBuildkite packaging failed because PR commit Remediation
Investigation detailsRoot CauseThis is a configuration/backport conflict resolution issue (not infra flake): unresolved merge markers were committed in
These exact markers match the parser errors in failing jobs. Evidence
Verification
Follow-up
What is this? | From workflow: Observability Agentic Workflow — Status Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
Merge current 9.6 and keep go 1.26.11. Pin beats to v7.0.0-alpha2.0.20261125131719-2864d938c1c2 so the elastic-agent-libs move uses this branch's updatecli revision, which already exposes Manager.ConfigFromControlProtocol. Drop keystore_nofips_test.go; its helpers are not on 9.6. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
🟡 Changes recommended
The generated notice headers contain a temporary macOS sandbox path instead of $GOMODCACHE, making regeneration environment-dependent and potentially causing make check-full to fail on tracked-file changes.
2 open issues
1 resolved since last review
Review effort: Balanced
| -------------------------------------------------------------------------------- | ||
|
|
||
| Contents of probable licence file $GOMODCACHE/github.com/!kim!machine!gun/automemlimit@v1.0.0/LICENSE: | ||
| Contents of probable licence file /var/folders/t6/f676yv596gj2h72lwcw3y2940000gn/T/cursor-sandbox-cache/4a42307367094a8fda6e60746f035625/go-mod/github.com/!kim!machine!gun/automemlimit@v1.0.0/LICENSE: |
Dependency Update AnalysisSummary: This PR updates Go dependencies (primarily Dependency 1:
|
| Check | Result |
|---|---|
| Breaking changes | ✅ None found in consumed imports/usages |
| Testable in PR | ✅ Yes |
Changelog highlights (old → new)
No exact release tag exists for these pseudo-versions. From commit metadata available for the new SHA, changes are mainly in Heartbeat secret-scrubbing behavior and related docs/tests; no APM Server-specific API break was identified.
Usage in this repository
Extensive usage across runtime paths, including internal/beatcmd/*, internal/beater/*, internal/agentcfg/*, internal/sourcemap/*, and x-pack/apm-server/* (logging, config, management, monitoring, outputs).
Compatibility assessment
The PR updates code to remove direct elastic-agent-libs usage and compiles against the newer beats revision; no import-path major-version change occurred. Risk is mostly behavioral drift from upstream beats internals, not API breakage in current imports.
Dependency 2: github.com/elastic/elastic-agent-client/v7 v7.18.1 → v7.20.0
Ecosystem: Go
| Check | Result |
|---|---|
| Breaking changes | ✅ None found |
| Testable in PR | ✅ Yes |
Changelog highlights (v7.18.1 → v7.20.0)
Release notes for v7.20.0 indicate a focused change: closing the gRPC connection when the client stops. No breaking API removal noted.
Usage in this repository
Used in x-pack/apm-server/main.go (pkg/client, pkg/proto) and related tests.
Compatibility assessment
Current usage is limited and compatible with the published change; likely improvement in connection lifecycle cleanup.
Dependency 3: github.com/elastic/go-docappender/v2 v2.14.1 → v2.15.0
Ecosystem: Go
| Check | Result |
|---|---|
| Breaking changes | ✅ None found |
| Testable in PR | ✅ Yes |
Changelog highlights (v2.14.1 → v2.15.0)
v2.15.0 notes primarily dependency maintenance plus doc-count metrics added to response stats.
Usage in this repository
Used in internal/beater/beater.go, internal/beater/processors.go, and sampling pubsub paths under x-pack/apm-server/sampling/pubsub/*.
Compatibility assessment
No consumed API removals identified; update appears backward-compatible for current usage.
Dependency 4: OpenTelemetry collector module family (go.opentelemetry.io/collector/*) including pdata v1.69.0 → v1.71.0
Ecosystem: Go
| Check | Result |
|---|---|
| Breaking changes | ✅ None found for repo usage |
| Testable in PR | ✅ Yes |
Changelog highlights (module family update)
Mapped to collector release notes (v1.71.0/v0.165.0):
- Breaking change in
pkg/confighttpremoves deprecated idle-connection fields. - Security-relevant fixes include bounded zstd decoder windows and recursion-depth limits in pdata unmarshalling (hardening against malicious payload/resource exhaustion).
- Additional performance/telemetry improvements in pdata/processor paths.
Usage in this repository
Direct pdata OTLP usage in internal/beater/otlp/{grpc,http}.go and related tests; system OTLP tests under systemtest/otlp_test.go.
Compatibility assessment
No confighttp/configgrpc package usage found in this repo, so noted upstream breaking change does not impact current code. Security hardening changes reduce risk for OTLP parsing/transport paths.
Dependency 5: networking/runtime libs (google.golang.org/grpc v1.84.0 → v1.85.0, golang.org/x/net v0.61.0 → v0.62.0)
Ecosystem: Go
| Check | Result |
|---|---|
| Breaking changes | ✅ None found |
| Testable in PR | ✅ Yes |
Changelog highlights
grpc-go v1.85.0: bug fixes around transport/control buffering, stream handling, authority handling, and RFC conformance; plus minor new features.golang.org/x/net v0.62.0: upstream GitHub release body was unavailable from releases endpoints; assessed via local usage and semver-minor bump context.
Usage in this repository
grpc is used broadly in internal/beater/interceptors/*, internal/beater/otlp/*, internal/beater/server.go, and system tests. x/net appears in HTTP2 tests and netutil usage.
Compatibility assessment
No major-version jumps or import-path changes; usage patterns are standard and unaffected by noted upstream changes.
Labels Applied
oblt-aw/ai/merge-ready— applied (overall risk within policy ceiling, and no breaking changes affecting this repository’s usage).
What is this? | From workflow: Observability Agentic Workflow — Pull Request
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
Automerge skippedAutomerge skipped this pull request because the To allow automerge for this kind of update, enable the matching collection under Automerge on the Control Plane Dashboard (the See Opt in or opt out for how to enable or disable Automerge collections on the Control Plane Dashboard. Collections currently enabled for automerge: Changed files considered:
|
Run the updatecli go get for beats@9.6. That tip requires go 1.27.4. Co-authored-by: Cursor <cursoragent@cursor.com>
| github.com/elastic/beats/v7 v7.0.0-alpha2.0.20261019215014-1f94b9713b9c | ||
| github.com/elastic/elastic-agent-client/v7 v7.18.1 | ||
| github.com/elastic/elastic-agent-libs v0.47.0 | ||
| github.com/elastic/beats/v7 v7.0.0-alpha2.0.20261126112622-f95e86812e12 |
There was a problem hiding this comment.
[For reviewers] Beats version is updated as per https://github.com/elastic/apm-server/pull/22193/changes
💚 Build Succeeded
History
cc @kruskall |
|
Caution agentic threat detected DetailsPotential security threats were detected in the agent output. Detected threat types: prompt injection. Review the workflow run logs for details. Dependency Update AnalysisSummary: This PR is a Go ecosystem dependency refresh centered on Go dependency set (notable:
|
| Check | Result |
|---|---|
| Breaking changes | ✅ None found in this repo’s consumed imports/interfaces |
| Testable in PR | ✅ Yes — ci.yml runs on pull_request |
Changelog highlights (vOLD → vNEW)
beatsexact release notes for the pseudo-version were not available via MCP releases/tags; local metadata confirms this update includes the 9.6 branch tip and Go 1.27.4 adoption in Beats.elastic-agent-clientv7.18.1 → v7.20.0: upstream notes indicate gRPC connection close on client stop.go-docappenderv2.14.1 → v2.15.0: upstream notes indicate doc count stats enhancement plus dependency/workflow bumps.grpc-gov1.84.0 → v1.85.0: upstream notes include HTTP/2 transport robustness and protocol-handling fixes.- No explicit CVE/GHSA IDs were found in fetched notes. Security-impacting items are mostly hardening/robustness (risk-reducing), with no new privileged surface introduced in this repo’s usage.
Usage in this repository
github.com/elastic/beats/v7: imported broadly (~122 Go files), includingpkg/logp,pkg/paths, libbeat management/status APIs.github.com/elastic/elastic-agent-client/v7: used inx-pack/apm-server/main.goandinternal/beatcmd/beat_test.go.github.com/elastic/go-docappender/v2: used in beater/sampling and tests.go.opentelemetry.io/collector/pdata,google.golang.org/grpc,golang.org/x/net: used in OTLP ingest/server paths and tests.- Direct
github.com/elastic/elastic-agent-libsimports are removed (now routed via Beats packages); module remains indirect.
Compatibility assessment
- No Go major-version import-path break (no
v1→v2style module path transition) in directly consumed modules. - Code updates in this PR migrate imports from
elastic-agent-libstobeats/v7/pkg/*, matching the updated dependency topology. - Go toolchain line moved
1.26.11 → 1.27.4; this is a platform/toolchain compatibility change rather than an app API break. - Validation run:
go test ./internal/beater/auth ./internal/beatcmd -count=1(partially completed;internal/beater/authpassed), plus focusedgo test ./internal/beatcmd -run TestLocker -count=1(passed).
Labels Applied
oblt-aw/ai/merge-ready— overall risk is within policy ceiling (low-to-moderate) and no repo-breaking dependency change was identified.
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
testing.invalid
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
network:
allowed:
- defaults
- "testing.invalid"See Network Configuration for more information.
What is this? | From workflow: Observability Agentic Workflow — Pull Request
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
| module github.com/elastic/apm-server | ||
|
|
||
| go 1.26.11 | ||
| go 1.27.4 |

Motivation/summary
bump beats and update code to drop elastic-agent-libs usage
Checklist
For functional changes, consider:
How to test these changes
Related issues
This is an automatic backport of pull request #22422 done by [Mergify](https://mergify.com).