feat(proxy): Return prefixed errors to testodrome (#11561)

Testodrome measures uptime based on the failed requests and errors. In
case of testodrome request we send back error based on the service. This
will help us distinguish error types in testodrome and rely on the
uptime SLI.
This commit is contained in:
Ivan Efremov
2025-04-16 22:03:23 +03:00
committed by GitHub
parent cf2e695f49
commit b9b25e13a0
8 changed files with 116 additions and 51 deletions

View File

@@ -434,17 +434,6 @@ async fn request_handler(
.map(Into::into),
);
let testodrome_id = request
.headers()
.get("X-Neon-Query-ID")
.and_then(|value| value.to_str().ok())
.map(|s| s.to_string());
if let Some(query_id) = testodrome_id {
info!(parent: &ctx.span(), "testodrome query ID: {query_id}");
ctx.set_testodrome_id(query_id);
}
let span = ctx.span();
info!(parent: &span, "performing websocket upgrade");
@@ -491,7 +480,7 @@ async fn request_handler(
if let Some(query_id) = testodrome_id {
info!(parent: &ctx.span(), "testodrome query ID: {query_id}");
ctx.set_testodrome_id(query_id);
ctx.set_testodrome_id(query_id.into());
}
sql_over_http::handle(config, ctx, request, backend, http_cancellation_token)

View File

@@ -157,7 +157,6 @@ pub(crate) async fn serve_websocket(
match res {
Err(e) => {
// todo: log and push to ctx the error kind
ctx.set_error_kind(e.get_error_kind());
Err(e.into())
}