Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 10 additions & 11 deletions trino-lb/src/http_server/v1/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Arc<AppState>>,
Expand All @@ -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<Arc<AppState>>,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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<AppState>,
queued_query: QueuedQuery,
Expand Down
Loading