fix(proxy): Add testodrome query id HTTP header (#11167)

Handle "X-Neon-Query-ID" header to glue data with testodrome queries.

Relates to the #22486
This commit is contained in:
Ivan Efremov
2025-03-11 17:17:30 +00:00
committed by GitHub
parent 7588983168
commit 011f7c21a3
4 changed files with 27 additions and 3 deletions
+9
View File
@@ -571,6 +571,11 @@ impl ConnectMechanism for TokioMechanism {
"compute_id",
tracing::field::display(&node_info.aux.compute_id),
);
if let Some(query_id) = ctx.get_testodrome_id() {
info!("latency={}, query_id={}", ctx.get_proxy_latency(), query_id);
}
Ok(poll_client(
self.pool.clone(),
ctx,
@@ -628,6 +633,10 @@ impl ConnectMechanism for HyperMechanism {
tracing::field::display(&node_info.aux.compute_id),
);
if let Some(query_id) = ctx.get_testodrome_id() {
info!("latency={}, query_id={}", ctx.get_proxy_latency(), query_id);
}
Ok(poll_http2_client(
self.pool.clone(),
ctx,
+9
View File
@@ -446,6 +446,15 @@ async fn request_handler(
.map(Into::into),
);
let testodrome_id = request
.headers()
.get("X-Neon-Query-ID")
.map(|value| value.to_str().unwrap_or_default().to_string());
if let Some(query_id) = testodrome_id {
ctx.set_testodrome_id(query_id);
}
let span = ctx.span();
info!(parent: &span, "performing websocket upgrade");