diff --git a/compute_tools/src/http/routes/metrics.rs b/compute_tools/src/http/routes/metrics.rs index 32c8a294a7..4957faf2d4 100644 --- a/compute_tools/src/http/routes/metrics.rs +++ b/compute_tools/src/http/routes/metrics.rs @@ -69,26 +69,12 @@ pub(in crate::http) async fn get_autoscaling_metrics( .context("fetching metrics from Postgres metrics service") .map_err(|e| JsonResponse::error(StatusCode::INTERNAL_SERVER_ERROR, format!("{e:#}")))?; - // Check response status - let status = resp.status(); - if status != StatusCode::OK { - return Err(JsonResponse::error( - status, - format!( - "Postgres metrics service returned error: {}", - status.to_string() - ), - )); - } - - // Build an OK response, with the body forwarded from the response we got. + // Build a response that just forwards the response we got. let mut response = Response::builder(); - response = response.status(StatusCode::OK); + response = response.status(resp.status()); if let Some(content_type) = resp.headers().get(CONTENT_TYPE) { response = response.header(CONTENT_TYPE, content_type); } - let body = tonic::service::AxumBody::from_stream(resp.into_body().into_data_stream()); - Ok(response.body(body).unwrap()) } diff --git a/compute_tools/src/postgres_metrics_client.rs b/compute_tools/src/postgres_metrics_client.rs index ef42a01444..c9fd346ec0 100644 --- a/compute_tools/src/postgres_metrics_client.rs +++ b/compute_tools/src/postgres_metrics_client.rs @@ -88,8 +88,8 @@ where // spawn a task to poll the connection and drive the HTTP state tokio::spawn(async move { - if let Err(e) = connection.await { - eprintln!("Error in connection: {}", e); + if let Err(err) = connection.await { + eprintln!("Error in connection: {err}"); } }); diff --git a/pgxn/neon/communicator/src/worker_process/lfc_metrics.rs b/pgxn/neon/communicator/src/worker_process/lfc_metrics.rs index cb402ddef0..fae9cc745f 100644 --- a/pgxn/neon/communicator/src/worker_process/lfc_metrics.rs +++ b/pgxn/neon/communicator/src/worker_process/lfc_metrics.rs @@ -19,7 +19,7 @@ impl LfcMetricsCollector { "lfc_approximate_working_set_size_windows", "Approximate working set size in pages of 8192 bytes", ), - &[&"duration_seconds"], + &["duration_seconds"], ) .unwrap(); diff --git a/test_runner/regress/test_lfc_working_set_approximation.py b/test_runner/regress/test_lfc_working_set_approximation.py index 9637a4b84b..dfb1db8a18 100644 --- a/test_runner/regress/test_lfc_working_set_approximation.py +++ b/test_runner/regress/test_lfc_working_set_approximation.py @@ -1,7 +1,6 @@ from __future__ import annotations import time -from logging import debug from pathlib import Path from typing import TYPE_CHECKING