From 6e49f92c55f76386fafd86835839eea0546a41e3 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Mon, 12 May 2025 11:13:47 +0200 Subject: [PATCH 1/2] chore: Emite less atrributes in tracing, to make logs easier readable --- trino-lb/src/http_server/v1/statement.rs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/trino-lb/src/http_server/v1/statement.rs b/trino-lb/src/http_server/v1/statement.rs index ef62ff2..049f5c0 100644 --- a/trino-lb/src/http_server/v1/statement.rs +++ b/trino-lb/src/http_server/v1/statement.rs @@ -136,11 +136,7 @@ impl IntoResponse for Error { } /// This function gets a new query and decided wether to queue it or to send it to a Trino cluster directly. -#[instrument( - name = "POST /v1/statement", - skip(state), - fields(headers = ?headers.sanitize()), -)] +#[instrument(name = "POST /v1/statement", skip(state, headers))] pub async fn post_statement( headers: HeaderMap, State(state): State>, @@ -167,7 +163,7 @@ pub async fn post_statement( /// It either replies with "please hold the line" or forwards the query to an Trino cluster. #[instrument( name = "GET /v1/statement/queued_in_trino_lb/{queryId}/{sequenceNumber}", - skip(state) + skip(state, sequence_number) )] pub async fn get_trino_lb_statement( State(state): State>, @@ -195,8 +191,7 @@ pub async fn get_trino_lb_statement( /// In case the nextUri is null, the query will be stopped and removed from trino-lb. #[instrument( name = "GET /v1/statement/queued/{queryId}/{slug}/{token}", - skip(state), - fields(headers = ?headers.sanitize()), + skip(state, headers) )] pub async fn get_trino_queued_statement( headers: HeaderMap, @@ -218,8 +213,7 @@ pub async fn get_trino_queued_statement( /// In case the nextUri is null, the query will be stopped and removed from trino-lb. #[instrument( name = "GET /v1/statement/executing/{queryId}/{slug}/{token}", - skip(state), - fields(headers = ?headers.sanitize()), + skip(state, headers) )] pub async fn get_trino_executing_statement( headers: HeaderMap, @@ -235,7 +229,12 @@ pub async fn get_trino_executing_statement( handle_query_running_on_trino(&state, headers, query_id, uri.path()).await } -#[instrument(skip(state, queued_query))] +#[instrument(skip( + state, + queued_query, + queued_query_already_stored_in_persistence, + current_sequence_number +))] async fn queue_or_hand_over_query( state: &Arc, queued_query: QueuedQuery, From 68b1aa56285914be348991e3463b848fce30bfc6 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Mon, 12 May 2025 11:15:43 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e81ef40..ecd5690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,14 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Changed + - The Stackable scaler now ensures that a `TrinoCluster` has changed to `ready` more than 5 seconds ago before marking it as `ready` ([#68]). +- Emit less attributes in tracing to make logs easier readable ([#86]). [#68]: https://github.com/stackabletech/trino-lb/pull/68 +[#86]: https://github.com/stackabletech/trino-lb/pull/86 ## [0.5.0] - 2025-03-14