Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alter checkin API to remove attributes set by audit/unenroll API #3827

Merged
merged 16 commits into from
Aug 26, 2024

Conversation

michel-laterman
Copy link
Contributor

@michel-laterman michel-laterman commented Aug 20, 2024

What is the problem this PR solves?

Follow up to #3818, alters the checkin API to remove attributes that the audit/unenroll endpoint sets

How does this PR solve the problem?

Alter the checkin wrapper's flush method to include bulk update calls to remove the attributes for agents that have a non-empty audit_unenrolled_reason.

How to test this PR locally

  1. Enroll an agent
  2. Use the audit/unenroll API to annotate the agent document.
  3. Use the checkin api to signal the agent is healthy

Agent document in Elasticsearch should no longer have the audit_unenrolled_reason or associated attributes

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 made corresponding change to the default configuration files
  • 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 enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Aug 21, 2024
@michel-laterman
Copy link
Contributor Author

buildkite test this

@michel-laterman michel-laterman marked this pull request as ready for review August 22, 2024 18:35
@michel-laterman michel-laterman requested a review from a team as a code owner August 22, 2024 18:35
internal/pkg/checkin/bulk.go Outdated Show resolved Hide resolved
internal/pkg/checkin/bulk.go Outdated Show resolved Hide resolved
@michel-laterman
Copy link
Contributor Author

buildkite run perf-tests

1 similar comment
@michel-laterman
Copy link
Contributor Author

buildkite run perf-tests

@michel-laterman
Copy link
Contributor Author

I realized that the perf-tests here don't actually use the changed endpoint; i'll work on altering them to do so in other prs

@michel-laterman michel-laterman merged commit 5470f6b into elastic:main Aug 26, 2024
9 checks passed
@michel-laterman michel-laterman deleted the audit-unenroll-checkin branch August 26, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 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.

2 participants