mirror of
https://github.com/neondatabase/neon.git
synced 2026-10-26 05:26:42 +00:00
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:
@@ -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,
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user