Skip to content

fix: always set ReportFullState flag in OpAMP responses#6831

Merged
michel-laterman merged 9 commits intoelastic:mainfrom
michel-laterman:fix/opamp-full-status-flag
Apr 16, 2026
Merged

fix: always set ReportFullState flag in OpAMP responses#6831
michel-laterman merged 9 commits intoelastic:mainfrom
michel-laterman:fix/opamp-full-status-flag

Conversation

@michel-laterman
Copy link
Copy Markdown
Contributor

@michel-laterman michel-laterman commented Apr 13, 2026

What is the problem this PR solves?

Fleet-server does not use the OpAMP spec's ServerToAgent.flags.ReportFullState flag. Fleet-server will now always set the flag.

How does this PR solve the problem?

Flag is set for every response, seq no drift is detected and logged as a warning.

Design Checklist

  • I have ensured my design is stateless and will work when multiple fleet-server instances are behind a load balancer.
  • I have or intend to scale test my changes, ensuring it will work reliably with 100K+ agents connected.
  • I have included fail safe mechanisms to limit the load on fleet-server: rate limiting, circuit breakers, caching, load shedding, etc.

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool

Related issues

@michel-laterman michel-laterman added bug Something isn't working backport-9.4 Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Apr 13, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 13, 2026

This pull request is now in conflicts. Could you fix it @michel-laterman? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b fix/opamp-full-status-flag upstream/fix/opamp-full-status-flag
git merge upstream/main
git push upstream fix/opamp-full-status-flag

@michel-laterman michel-laterman force-pushed the fix/opamp-full-status-flag branch 3 times, most recently from 7651ecf to 8ae429d Compare April 14, 2026 17:32
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

🔍 Preview links for changed docs

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

✅ Vale Linting Results

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.

@michel-laterman michel-laterman force-pushed the fix/opamp-full-status-flag branch from 8ae429d to 532715f Compare April 14, 2026 17:48
Fleet-server now sets the ReportFullState flag in ServerToAgent responses
when it detects sequence number gaps, new enrollments without full status,
or reconnects from disconnected agents that don't report full state.
The full status check is capability-aware per the OpAMP spec.

Closes elastic#6783

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@michel-laterman michel-laterman force-pushed the fix/opamp-full-status-flag branch from 532715f to 893a5aa Compare April 14, 2026 17:59
@michel-laterman michel-laterman marked this pull request as ready for review April 14, 2026 18:49
@michel-laterman michel-laterman requested a review from a team as a code owner April 14, 2026 18:49
Comment thread internal/pkg/api/handleOpAMP.go Outdated
@michel-laterman michel-laterman changed the title fix: set ReportFullState flag in OpAMP responses on drift detection fix: always set ReportFullState flag in OpAMP responses Apr 14, 2026
Comment thread internal/pkg/api/handleOpAMP.go Outdated
cmacknz
cmacknz previously approved these changes Apr 14, 2026
Comment thread docs/opamp.md Outdated
Comment thread docs/opamp.md Outdated
Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
@michel-laterman michel-laterman enabled auto-merge (squash) April 14, 2026 23:34
@michel-laterman michel-laterman merged commit f84d259 into elastic:main Apr 16, 2026
10 checks passed
mergify bot pushed a commit that referenced this pull request Apr 16, 2026
* fix: set ReportFullState flag in OpAMP responses on drift detection

Fleet-server now sets the ReportFullState flag in ServerToAgent responses
when it detects sequence number gaps, new enrollments without full status,
or reconnects from disconnected agents that don't report full state.
The full status check is capability-aware per the OpAMP spec.

Closes #6783

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Always send full status report flag

* Update CHANGELOG

* Change log to debug, silence linter

* Fix linter test warnings

* Add rational to opamp.md

* Update docs/opamp.md

Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
(cherry picked from commit f84d259)
michel-laterman added a commit that referenced this pull request Apr 16, 2026
* fix: set ReportFullState flag in OpAMP responses on drift detection

Fleet-server now sets the ReportFullState flag in ServerToAgent responses
when it detects sequence number gaps, new enrollments without full status,
or reconnects from disconnected agents that don't report full state.
The full status check is capability-aware per the OpAMP spec.

Closes #6783



* Always send full status report flag

* Update CHANGELOG

* Change log to debug, silence linter

* Fix linter test warnings

* Add rational to opamp.md

* Update docs/opamp.md



---------



(cherry picked from commit f84d259)

Co-authored-by: Michel Laterman <82832767+michel-laterman@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Shaunak Kashyap <ycombinator@gmail.com>
@michel-laterman michel-laterman deleted the fix/opamp-full-status-flag branch April 16, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-9.4 bug Something isn't working 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.

[OpAMP] fleet-server should request a status report if drift is detected

4 participants