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

return 429 error if ES api key auth returned 429 #3278

Merged
merged 9 commits into from
Feb 22, 2024

Conversation

juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Feb 14, 2024

What is the problem this PR solves?

Misleading 401 unauthorized response when ES API key auth returns 429 error.

How does this PR solve the problem?

Return 429 from Fleet Server API if the root cause is ES auth 429 error.

How to test this PR locally

Tested by running a scale test with a custom image with changes from this pr: https://buildkite.com/elastic/observability-perf/builds/2421#018da31f-8f18-43c5-aac0-5d559f0152cb

Errors show up as 429:
image

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

@juliaElastic juliaElastic added the enhancement New feature or request label Feb 14, 2024
@juliaElastic juliaElastic self-assigned this Feb 14, 2024
@juliaElastic juliaElastic marked this pull request as ready for review February 14, 2024 09:42
@juliaElastic juliaElastic requested a review from a team as a code owner February 14, 2024 09:42
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested myself, but change makes sense, thanks!

Would it be possible to add a test for this?

@juliaElastic
Copy link
Contributor Author

Would it be possible to add a test for this?

I didn't see existing unit tests on this, I'll try to add.

@juliaElastic juliaElastic requested a review from a team February 15, 2024 08:59
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding tests 👍

@juliaElastic
Copy link
Contributor Author

buildkite test this

@juliaElastic
Copy link
Contributor Author

buildkite, test this

@juliaElastic
Copy link
Contributor Author

buildkite test this

@michel-laterman
Copy link
Contributor

@juliaElastic, Should we backport this to 8.13?

Copy link

@juliaElastic juliaElastic merged commit 5c244b3 into elastic:main Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants