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

[Infra] Investigate API Endpoints improvements and replacing POST with GET #189170

Open
jennypavlova opened this issue Jul 25, 2024 · 3 comments
Open
Labels
needs-refinement A reason and acceptance criteria need to be defined for this issue Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team technical debt Improvement of the software architecture and operational architecture

Comments

@jennypavlova
Copy link
Member

jennypavlova commented Jul 25, 2024

We want to improve the infra APIs and investigate different ways to do that.
One thing we want to change is to convert all POST endpoints that are used to fetch data to GET.

Benefits are:

  • RESTful API conventions: Elasticsearch follows the RESTful API conventions, which typically use GET requests for queries. Deviating from these conventions may make your API less intuitive and harder to understand for other developers who are familiar with RESTful APIs.
  • Caching and performance: GET requests in Elasticsearch are often cached by proxies, which can improve performance. In contrast, POST requests are typically not cached, which may impact performance if the same query is executed frequently.

Concerns:
If we use GET request the limit we have in the length is 2,048 characters. Moving the properties we have in the request body to the URL can exceed this limit in case of a long list of filters so we need to be careful.

AC:

  • Investigate if we can covert API endpoint from POST to GET
  • Test with different params and a long list of filters
  • When/If possible covert API endpoint from POST to GET
  • Get our APIs closer to our guidelines recommendations.
@jennypavlova jennypavlova added the Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team label Jul 25, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

@crespocarlos
Copy link
Contributor

This would also get our APIs closer to our guidelines recommendations.

@crespocarlos crespocarlos added needs-refinement A reason and acceptance criteria need to be defined for this issue enhancement New value added to drive a business result labels Jul 25, 2024
@jennypavlova
Copy link
Member Author

This would also get our APIs closer to our guidelines recommendations.

Thanks @crespocarlos I added that to the AC

@smith smith added technical debt Improvement of the software architecture and operational architecture and removed enhancement New value added to drive a business result labels Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-refinement A reason and acceptance criteria need to be defined for this issue Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

No branches or pull requests

4 participants