-
Notifications
You must be signed in to change notification settings - Fork 287
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
Adds recover_fn to many routes. #5006
Conversation
469acfb
to
8a398ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the following routes could have a recover_fn too:
es_compat_search_handler
es_compat_index_field_capabilities_handler
es_compat_index_search_handler
es_compat_index_count_handler
es_compat_index_multi_search_handler // also its comment uses the wrong route, should be _msearch
es_compat_scroll_handler
readiness_handler
@@ -47,6 +48,7 @@ pub(crate) fn otlp_ingest_api_handlers( | |||
.or(otlp_default_traces_handler(otlp_traces_service.clone())) | |||
.or(otlp_logs_handler(otlp_logs_service)) | |||
.or(otlp_ingest_traces_handler(otlp_traces_service)) | |||
.recover(recover_fn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to this PR: this group of routes isn't present in the openapi definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added routes to openapi..
If a route matches, we want to run its handler, and upon failure, the last thing we want is for another overlapping route to be executed as a fallback. To avoid this, we call recover on each individual routes that have no overlap with routes of lesser priority.
@@ -29,7 +29,8 @@ struct EnvFilter { | |||
filter: String, | |||
} | |||
|
|||
#[utoipa::path(get, tag = "Log level", path = "/log-level")] | |||
/// Dynamically Quickwit's log level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Dynamically Quickwit's log level | |
/// Dynamically set Quickwit's log level |
If a route matches, we want to run its handler, and upon failure, the last thing we want is for another overlapping route to be executed as a fallback.
To avoid this, we call recover on each individual routes that have no overlap with routes of lesser priority.