From 6c79f002be82426b88821ff7cb21d69d8df292fc Mon Sep 17 00:00:00 2001 From: Mari Date: Wed, 19 Feb 2025 15:46:58 +0100 Subject: [PATCH] limit spans returned by traces list endpoint --- otel-worker-core/Cargo.toml | 1 + otel-worker-core/src/data/models.rs | 2 +- otel-worker/src/data.rs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/otel-worker-core/Cargo.toml b/otel-worker-core/Cargo.toml index c51dbdc..b9e577c 100644 --- a/otel-worker-core/Cargo.toml +++ b/otel-worker-core/Cargo.toml @@ -18,6 +18,7 @@ async-trait = { version = "0.1", default-features = false } axum = { workspace = true, default-features = false, features = [ "json", "matched-path", + "query" ] } bytes = { version = "1.0", default-features = false } otel-worker-macros = { version = "0.1.0", path = "../otel-worker-macros" } diff --git a/otel-worker-core/src/data/models.rs b/otel-worker-core/src/data/models.rs index cbb1d0e..bc5b44e 100644 --- a/otel-worker-core/src/data/models.rs +++ b/otel-worker-core/src/data/models.rs @@ -72,7 +72,7 @@ impl From for Span { #[derive(Deserialize)] pub struct QueryParams { - limit: Option, + pub limit: Option, } #[derive(Clone, Debug, Serialize, PartialEq)] diff --git a/otel-worker/src/data.rs b/otel-worker/src/data.rs index f63eee6..3688ff3 100644 --- a/otel-worker/src/data.rs +++ b/otel-worker/src/data.rs @@ -103,7 +103,7 @@ impl Store for D1Store { trace_id: &HexEncodedId, ) -> Result> { SendFuture::new(async { - self.fetch_all(self.sql_builder.span_list_by_trace(), &[trace_id.into()]) + self.fetch_all(self.sql_builder.span_list_by_trace(None), &[trace_id.into()]) .await }) .await