Repository navigation
[9.5](backport #8192) chore(deps): replace elastic-agent-system-metrics with beats/v7/pkg/systemmetrics - #8199
mergify[bot] wants to merge 5 commits into
Conversation
…ystemmetrics (#8192) Relates https://github.com/elastic/ingest-dev/issues/9310 (cherry picked from commit 287860c) # Conflicts: # NOTICE-fips.txt # NOTICE.txt # go.mod # go.sum # renovate.json # testing/go.mod # testing/go.sum
|
Cherry-pick of 287860c 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 |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved merge markers in dependency manifests and checksums block builds and tests, and the Beats dependency still targets main rather than the required 9.5 branch.
2 open issues
What changed in this PR
This 9.5 backport of #8192 migrates Fleet Server’s /stats metrics reporting from the archived elastic-agent-system-metrics module to the maintained Beats package.
Changes:
- Switches the metrics import to
beats/v7/pkg/systemmetrics/report. - Updates dependency requirements, checksums, and standard/FIPS notices.
- Allows the Beats dependency and disables its automated Renovate updates to support branch-specific pinning.
| File | Description |
|---|---|
testing/go.sum |
Updates testing-module dependency checksums. |
testing/go.mod |
Updates testing-module indirect requirements. |
renovate.json |
Configures dependency automation, keeping Beats updates manual. |
NOTICE.txt |
Updates standard-build dependency notices. |
NOTICE-fips.txt |
Updates FIPS-build dependency notices. |
internal/pkg/api/metrics.go |
Imports metrics reporting from Beats. |
go.sum |
Updates root dependency checksums. |
go.mod |
Replaces the archived metrics dependency with Beats. |
AGENTS.md |
Documents removal of the Beats dependency restriction. |
.golangci.yml |
Removes the Beats module block from lint rules. |
Review effort: Balanced
Dependency Update AnalysisSummary: This PR correctly switches metrics reporting from the archived
|
| Check | Result |
|---|---|
| Breaking changes | |
| Testable in PR | ✅ Yes (repo has pull_request workflows, e.g. .github/workflows/golangci-lint.yml) |
Changelog highlights (v0.14.5 → beats pseudo-version)
get_release_by_tagforelastic/beatsatv7.0.0-alpha2.0.20261104093103-ee4981601f01(and withoutv) returned 404; no exact release-note tag exists for this pseudo-version.- Using local PR metadata/diff: this is a package relocation from archived
elastic-agent-system-metricsintoelastic/beats/v7/pkg/systemmetrics/reportwith intended API parity. - No explicit CVE/GHSA entries were available from upstream release notes for this exact pseudo-version.
Usage in this repository
internal/pkg/api/metrics.go:19importsgithub.com/elastic/beats/v7/pkg/systemmetrics/report.internal/pkg/api/metrics.go:79usesreport.SetupMetricsOptions(report.MetricOptions{...})for/statsmetrics setup.- No other in-repo usages of
elastic-agent-system-metricswere found.
Compatibility assessment
- The code-path usage is narrow and appears API-compatible at the call site (
report.SetupMetricsOptions). - However, module state is currently invalid due to unresolved merge markers:
go.modcontains<<<<<<</=======/>>>>>>>blocks (e.g. lines 10, 14, 19, 64, 66, 68, 109, 111, 113).go.sum,testing/go.mod, andtesting/go.sumalso contain conflict markers.
- This prevents a trustworthy dependency resolution/validation baseline and is a hard blocker independent of the relocation itself.
Labels Applied
No labels applied (oblt-aw/ai/merge-ready withheld because overall risk is high until manifest conflicts are resolved).
What is this? | From workflow: Observability Agentic Workflow — Pull Request
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
This comment has been minimized.
This comment has been minimized.
…ats/v7 to the 9.5 branch Restored go.mod, go.sum, testing/go.mod, testing/go.sum and NOTICE files from 9.5, then ran go get github.com/elastic/beats/v7@9.5, go mod tidy in both modules and mage check:notice. Dropped renovate.json, which only exists on main. Co-authored-by: Cursor <cursoragent@cursor.com>
Dependency Update AnalysisSummary: Replaces
|
| Check | Result |
|---|---|
| Breaking changes | ✅ None found in repository usage |
| Testable in PR | ✅ Yes (go test ./internal/pkg/api/... passed) |
Changelog highlights (vOLD → vNEW)
- GitHub release notes for the pseudo-version tag were unavailable (
get_release_by_tagwith and withoutvreturned 404; no exact-equivalent tag found inlist_releases). - Local metadata available: the pinned Beats commit message references
otelconsumerretry back-off behavior; no explicit CVE/GHSA/security advisory noted in available metadata.
Usage in this repository
internal/pkg/api/metrics.go:19importsgithub.com/elastic/beats/v7/pkg/systemmetrics/report.internal/pkg/api/metrics.go:79callsreport.SetupMetricsOptions(report.MetricOptions{...}).- No other repository references to the old or new system-metrics package path were found.
Compatibility assessment
- Call-site API usage remained equivalent after import-path migration (
reportpackage +SetupMetricsOptionspattern). - No Go major-version path break was introduced for consumed imports.
- Additional transitive updates (e.g.
go-sysinfo,gopsutil,golang.org/x/net) are patch/minor/pseudo updates with no direct API consumption changes in this repo. - No newly introduced attack surface was identified from local usage evidence.
Labels Applied
oblt-aw/ai/merge-ready(applied): low-to-moderate risk, compatible usage, and PR-testable changes.
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 changed files do not match any configured dependency collection. If this update should be automerged, ask a maintainer to add or adjust a collection, or merge the pull request manually. 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:
|
TL;DRThe failed Buildkite integration step does not include the actual failing test/package output in the captured log, so the root cause cannot be verified from available evidence. Immediate next action is to re-run the job and capture the full Remediation
Investigation detailsRoot CauseI could not confirm a code-level root cause from the provided failure artifact because it only shows passing test output plus a final generic Evidence in the provided job log (
Relevant code path:
Evidence
Verification
Follow-up
What is this? | From workflow: Observability Agentic Workflow — Status Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
startTestServer now cancels the server and waits for it to exit in t.Cleanup, as on main and 9.6 (from #7770). Without this, subsystems log their exit through the finished test's zerolog TestWriter, which the race detector reports as a data race in Test_Agent_OtelPolicy_Secrets. Co-authored-by: Cursor <cursoragent@cursor.com>
Dependency Update AnalysisSummary: This PR replaces github.com/elastic/elastic-agent-system-metrics v0.14.5 → github.com/elastic/beats/v7 v7.0.0-alpha2.0.20261105162333-48d0117e5b74 (
|
| Check | Result |
|---|---|
| Breaking changes | ✅ None found in this repo’s consumed interface |
| Testable in PR | ✅ Yes — PR-triggered workflows exist (e.g. .github/workflows/golangci-lint.yml, .github/workflows/pre-commit.yml) |
Changelog highlights (vOLD → vNEW)
- No exact GitHub Release exists for the pseudo-version tag (
v7.0.0-alpha2.0.20261105162333-48d0117e5b74) after MCP release lookup retries. - Local metadata confirms intent: migrate from archived
elastic-agent-system-metricsinto Beatspkg/systemmetrics(see chore: import elastic-agent-system-metrics repository beats#52081, referenced in PR body). - CVE/security review from available notes: no explicit CVE/GHSA entries found for this bump path; change reduces maintenance risk by moving off an archived module.
Usage in this repository
internal/pkg/api/metrics.goimportsgithub.com/elastic/beats/v7/pkg/systemmetrics/report.- Consumed API is
report.SetupMetricsOptions(report.MetricOptions{...})in the same file. - No other direct imports of old/new systemmetrics package were found in repo search.
Compatibility assessment
- The call site in
internal/pkg/api/metrics.gokeeps the same usage pattern (SetupMetricsOptions+MetricOptionsfields), indicating interface compatibility at this integration point. - I ran a compile-level check for this area:
go test ./internal/pkg/api -run TestDoesNotExist -count=0✅. - Indirect module churn from
go mod tidy(e.g.gopsutil,go-sysinfo,x/net) is expected for the new source module and does not show a direct breaking surface in Fleet Server code. - Potential security regression surface appears limited to metric collection internals; no authn/authz, request parsing, or crypto handling changes were introduced in Fleet Server call sites.
Labels Applied
oblt-aw/ai/merge-ready— applied (risk low-to-moderate, no repo-usage breaking change found, ecosystem checks passed for this Go bump).
What is this? | From workflow: Observability Agentic Workflow — Pull Request
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
|
This pull request has not been merged yet. Could you please review and merge it @{{ assignee | join(', @') }}? 🙏 |
|
This pull request is now in conflicts. Could you fix it @mergify[bot]? 🙏 |
Resolved conflicts with #8213 by taking 9.5's go.mod, go.sum, testing/go.mod, testing/go.sum and NOTICE files, then re-pinning github.com/elastic/beats/v7 to the same 9.5 commit, running go mod tidy in both modules and mage check:notice. Co-authored-by: Cursor <cursoragent@cursor.com>
Dependency Update AnalysisSummary: Replaces archived Dependency 1:
|
| Check | Result |
|---|---|
| Breaking changes | ✅ None found in repository usage |
| Testable in PR | ✅ Yes — PR-triggered workflows exist (.github/workflows/golangci-lint.yml:8, .github/workflows/pre-commit.yml:4) |
Changelog highlights (v0.14.5 → new Beats pseudo-version)
- Exact release notes for the Beats pseudo-version are not published as a tagged release (MCP lookup for exact tag returned 404).
- Local metadata in this PR indicates the system-metrics code was merged into Beats (
pkg/systemmetrics) and this PR switches import path accordingly. - Prior
elastic-agent-system-metricsv0.14.5notes include maintenance + process metrics fixes, with no CVE/GHSA entries. - Security/CVE assessment: no explicit vulnerability advisories found in available notes; moving from an archived module to maintained Beats code reduces long-term stale-dependency exposure.
Usage in this repository
internal/pkg/api/metrics.go:19importsgithub.com/elastic/beats/v7/pkg/systemmetrics/report.internal/pkg/api/metrics.go:77usesreport.SetupMetricsOptions(...)for/statsprocess/system metrics reporting.- No remaining code imports of
elastic-agent-system-metricswere found.
Compatibility assessment
- The consumed API (
report.SetupMetricsOptionswithreport.MetricOptions) remains compatible with current call sites. go.mod/testing/go.modinclude tidy-driven transitive adjustments (including some indirect upgrades and a few downgrades such asgrpc/cbor); no direct call-site changes were introduced for those modules in this PR.- Overall CVE-focused risk remains contained for this repository’s current usage surface.
Labels Applied
oblt-aw/ai/merge-ready— low-to-moderate risk, no usage-breaking changes identified, and PR-testable CI coverage present.
What is this? | From workflow: Observability Agentic Workflow — Pull Request
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
golangci-lint v2.15.0 reports the staticcheck suppression as unused (nolintlint). The file is linted in full now that this PR touches it. Co-authored-by: Cursor <cursoragent@cursor.com>
Dependency Update AnalysisSummary: This PR is a Go dependency relocation from
|
| Check | Result |
|---|---|
| Breaking changes | ✅ None found in local usage |
| Testable in PR | ✅ Yes — code change is in repo code (internal/pkg/api/metrics.go) and can be validated in PR CI/local test runs |
Changelog highlights (vOLD → vNEW)
elastic-agent-system-metricsv0.14.5notes show maintenance/process changes and a Linux PID handling fix; no CVE/GHSA entries were identified in that release body.- No exact release tag exists for Beats pseudo-version
v7.0.0-alpha2.0.20261105162333-48d0117e5b74(MCPget_release_by_tagreturned 404 on both retry attempts). Using local commit metadata for this pin, the referenced Beats commit message is focused on OTel retry backoff behavior, with no explicit CVE/GHSA advisory in available metadata. - Security/CVE assessment from available sources: no explicit new vulnerability disclosure tied to this bump; moving off an archived module to actively maintained Beats reduces maintenance risk.
Usage in this repository
- Direct code usage is at
internal/pkg/api/metrics.go:19(reportimport) andinternal/pkg/api/metrics.go:78(report.SetupMetricsOptions(...)). - The PR changes only the import path (
internal/pkg/api/metrics.go), not the call pattern. grepconfirms no remainingelastic-agent-system-metricsimports in*.gofiles.
Compatibility assessment
- This is an import-path relocation to the same metrics package lineage (
pkg/systemmetrics/report); local usage (SetupMetricsOptionswithMetricOptions) remains unchanged. - No Go major-version migration issue for existing imports in this repo was introduced (the new module is added directly as
/v7and consumed in one location). - Related indirect updates in
go.mod/testing/go.mod(e.g.,gopsutil,go-sysinfo,purego,tklauser/*) appear as transitive tidy effects of the module replacement; no direct API coupling from fleet-server source to those modules was found. - No new security-sensitive configuration or authn/authz surface was introduced by this PR’s code changes.
Labels Applied
oblt-aw/ai/merge-ready— applied (risk low-to-moderate, no breaking usage changes found, ecosystem checks passed for this Go dependency update).
What is this? | From workflow: Observability Agentic Workflow — Pull Request
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.


What is the problem this PR solves?
The
github.com/elastic/elastic-agent-system-metricsrepository has been archived and its code merged back into Beats aspkg/systemmetrics(elastic/beats#52081, backported to 9.5, 9.4 and 8.19). Fleet Server still depends on the archived module, so it will no longer receive fixes or security updates for the process/system metrics it reports on the/statsendpoint.How does this PR solve the problem?
Switches Fleet Server to the Beats package, which exposes the same API. Elastic Agent made the same change in elastic/elastic-agent#17362.
internal/pkg/api/metrics.go: importgithub.com/elastic/beats/v7/pkg/systemmetrics/reportinstead ofgithub.com/elastic/elastic-agent-system-metrics/report. No other code changes.go.mod/go.sum: addgithub.com/elastic/beats/v7pinned to the current Beatsmaincommit (v7.0.0-alpha2.0.20261104093103-ee4981601f01) and dropelastic-agent-system-metrics.go mod tidyonly keeps what thereportpackage needs: one new indirect module (github.com/ebitengine/purego) and a few indirect bumps (gopsutilv4.24.7 to v4.26.9,go-sysinfo,gosigar,tklauser/*,go-winio,fatih/color,pflag,prometheus/common,genproto/googleapis/rpc). No direct dependency other than Beats changes.testing/go.mod/testing/go.sum: tidied, because this module replaces the root module with../..golangci.yml: remove thegomodguardrule that blockedgithub.com/elastic/beats/v7, sincepkg/systemmetricsis not a separate Go module and can only be consumed throughbeats/v7. Thebeats/elastic-agentandbytedance/sonicblocks stay.AGENTS.mdis updated to match.renovate.json: disable Renovate gomod updates forgithub.com/elastic/beats/v7. Beats has no release tags on its working branches, so it is pinned to a pseudo-version of the same-named Beats branch; Renovate would otherwise move release branches to Beatsmainor propose the unrelatedv7.17.xtags. Beats is updated manually per branch withgo get github.com/elastic/beats/v7@<branch>,go mod tidyandmage check:notice.NOTICE.txt/NOTICE-fips.txt: regenerated withmage check:notice.Backports
This PR is labeled
backport-active-all. The Mergify backports will cherry-pick themainBeats pin unchanged, so each backport PR (9.6, 9.5, 9.4, 8.19) needs a follow-up commit pinning Beats to the matching branch:All four Beats release branches contain
pkg/systemmetricsand use the same Go version (1.26.10) as the matching Fleet Server branches.How to test this PR locally
mage check:all mage test:unit mage build:local FIPS=true mage build:local mage check:detectFIPSCryptoImports rg elastic-agent-system-metrics # no resultsLocally
mage check:cisteps,mage test:unit, both builds and the FIPS crypto import check pass. golangci-lint v2.15.0 reports the same issue set as onmain(no new issues).Design Checklist
N/A: dependency relocation with no runtime behavior change.
Checklist
Related issues
This is an automatic backport of pull request #8192 done by [Mergify](https://mergify.com).