diff --git a/quickwit/quickwit-proto/build.rs b/quickwit/quickwit-proto/build.rs index 2a93593e84c..0a7d7566a3b 100644 --- a/quickwit/quickwit-proto/build.rs +++ b/quickwit/quickwit-proto/build.rs @@ -184,7 +184,10 @@ fn main() -> Result<(), Box> { tonic_build::configure() .enum_attribute(".", "#[serde(rename_all=\"snake_case\")]") - .type_attribute(".", "#[derive(Serialize, Deserialize, utoipa::ToSchema)]") + .type_attribute( + ".", + "#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)]", + ) .type_attribute("PartialHit", "#[derive(Eq, Hash)]") .type_attribute("PartialHit.sort_value", "#[derive(Copy)]") .type_attribute("SearchRequest", "#[derive(Eq, Hash)]") @@ -214,7 +217,7 @@ fn main() -> Result<(), Box> { let protos = find_protos("protos/third-party/opentelemetry"); tonic_build::configure() - .type_attribute(".", "#[derive(Serialize, Deserialize)]") + .type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]") .type_attribute("StatusCode", r#"#[serde(rename_all = "snake_case")]"#) .type_attribute( "ExportLogsServiceResponse", diff --git a/quickwit/quickwit-proto/src/cluster/mod.rs b/quickwit/quickwit-proto/src/cluster/mod.rs index 48ee9dc0554..8edd07e83c7 100644 --- a/quickwit/quickwit-proto/src/cluster/mod.rs +++ b/quickwit/quickwit-proto/src/cluster/mod.rs @@ -19,6 +19,7 @@ use quickwit_common::rate_limited_error; use quickwit_common::tower::MakeLoadShedError; +use serde::{Deserialize, Serialize}; use thiserror; use crate::error::{ServiceError, ServiceErrorCode}; diff --git a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.logs.v1.rs b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.logs.v1.rs index 68fd0e1d329..7c35915e03c 100644 --- a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.logs.v1.rs +++ b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.logs.v1.rs @@ -1,4 +1,4 @@ -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExportLogsServiceRequest { @@ -12,7 +12,7 @@ pub struct ExportLogsServiceRequest { super::super::super::logs::v1::ResourceLogs, >, } -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[derive(utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -35,7 +35,7 @@ pub struct ExportLogsServiceResponse { #[prost(message, optional, tag = "1")] pub partial_success: ::core::option::Option, } -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExportLogsPartialSuccess { diff --git a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.metrics.v1.rs b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.metrics.v1.rs index 3751a2dd800..53bbe9793cd 100644 --- a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.metrics.v1.rs +++ b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.metrics.v1.rs @@ -1,4 +1,4 @@ -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExportMetricsServiceRequest { @@ -12,7 +12,7 @@ pub struct ExportMetricsServiceRequest { super::super::super::metrics::v1::ResourceMetrics, >, } -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExportMetricsServiceResponse { @@ -34,7 +34,7 @@ pub struct ExportMetricsServiceResponse { #[prost(message, optional, tag = "1")] pub partial_success: ::core::option::Option, } -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExportMetricsPartialSuccess { diff --git a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.trace.v1.rs b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.trace.v1.rs index 9215438d32b..b667cb51d41 100644 --- a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.trace.v1.rs +++ b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.collector.trace.v1.rs @@ -1,4 +1,4 @@ -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExportTraceServiceRequest { @@ -12,7 +12,7 @@ pub struct ExportTraceServiceRequest { super::super::super::trace::v1::ResourceSpans, >, } -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExportTraceServiceResponse { @@ -34,7 +34,7 @@ pub struct ExportTraceServiceResponse { #[prost(message, optional, tag = "1")] pub partial_success: ::core::option::Option, } -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExportTracePartialSuccess { diff --git a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.common.v1.rs b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.common.v1.rs index 721f6bad294..abc40cf30e7 100644 --- a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.common.v1.rs +++ b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.common.v1.rs @@ -1,7 +1,7 @@ /// AnyValue is used to represent any type of attribute value. AnyValue may contain a /// primitive value such as a string or integer or it may contain an arbitrary nested /// object containing arrays, key-value lists and primitives. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AnyValue { @@ -14,7 +14,7 @@ pub struct AnyValue { pub mod any_value { /// The value is one of the listed fields. It is valid for all values to be unspecified /// in which case this AnyValue is considered to be "empty". - #[derive(Serialize, Deserialize)] + #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { @@ -36,7 +36,7 @@ pub mod any_value { } /// ArrayValue is a list of AnyValue messages. We need ArrayValue as a message /// since oneof in AnyValue does not allow repeated fields. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ArrayValue { @@ -49,7 +49,7 @@ pub struct ArrayValue { /// a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to /// avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches /// are semantically equivalent. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct KeyValueList { @@ -62,7 +62,7 @@ pub struct KeyValueList { } /// KeyValue is a key-value pair that is used to store Span attributes, Link /// attributes, etc. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct KeyValue { @@ -73,7 +73,7 @@ pub struct KeyValue { } /// InstrumentationScope is a message representing the instrumentation scope information /// such as the fully qualified name and version. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InstrumentationScope { diff --git a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.logs.v1.rs b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.logs.v1.rs index 895396cf183..ba30bf10a0d 100644 --- a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.logs.v1.rs +++ b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.logs.v1.rs @@ -8,7 +8,7 @@ /// /// When new fields are added into this message, the OTLP request MUST be updated /// as well. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LogsData { @@ -21,7 +21,7 @@ pub struct LogsData { pub resource_logs: ::prost::alloc::vec::Vec, } /// A collection of ScopeLogs from a Resource. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResourceLogs { @@ -38,7 +38,7 @@ pub struct ResourceLogs { pub schema_url: ::prost::alloc::string::String, } /// A collection of Logs produced by a Scope. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScopeLogs { @@ -56,7 +56,7 @@ pub struct ScopeLogs { } /// A log record according to OpenTelemetry Log Data Model: /// -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LogRecord { @@ -123,7 +123,7 @@ pub struct LogRecord { pub span_id: ::prost::alloc::vec::Vec, } /// Possible values for LogRecord.SeverityNumber. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum SeverityNumber { @@ -221,7 +221,7 @@ impl SeverityNumber { } } /// Masks for LogRecord.flags field. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum LogRecordFlags { diff --git a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.metrics.v1.rs b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.metrics.v1.rs index b723f424e49..0c2da7bda93 100644 --- a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.metrics.v1.rs +++ b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.metrics.v1.rs @@ -8,7 +8,7 @@ /// /// When new fields are added into this message, the OTLP request MUST be updated /// as well. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MetricsData { @@ -21,7 +21,7 @@ pub struct MetricsData { pub resource_metrics: ::prost::alloc::vec::Vec, } /// A collection of ScopeMetrics from a Resource. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResourceMetrics { @@ -38,7 +38,7 @@ pub struct ResourceMetrics { pub schema_url: ::prost::alloc::string::String, } /// A collection of Metrics produced by an Scope. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScopeMetrics { @@ -139,7 +139,7 @@ pub struct ScopeMetrics { /// to support correct rate calculation. Although it may be omitted /// when the start time is truly unknown, setting StartTimeUnixNano is /// strongly encouraged. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metric { @@ -164,7 +164,7 @@ pub mod metric { /// Data determines the aggregation type (if any) of the metric, what is the /// reported value type for the data points, as well as the relatationship to /// the time interval over which they are reported. - #[derive(Serialize, Deserialize)] + #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Data { @@ -189,7 +189,7 @@ pub mod metric { /// aggregation, regardless of aggregation temporalities. Therefore, /// AggregationTemporality is not included. Consequently, this also means /// "StartTimeUnixNano" is ignored for all data points. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Gauge { @@ -198,7 +198,7 @@ pub struct Gauge { } /// Sum represents the type of a scalar metric that is calculated as a sum of all /// reported measurements over a time interval. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Sum { @@ -214,7 +214,7 @@ pub struct Sum { } /// Histogram represents the type of a metric that is calculated by aggregating /// as a Histogram of all reported measurements over a time interval. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Histogram { @@ -227,7 +227,7 @@ pub struct Histogram { } /// ExponentialHistogram represents the type of a metric that is calculated by aggregating /// as a ExponentialHistogram of all reported double measurements over a time interval. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExponentialHistogram { @@ -244,7 +244,7 @@ pub struct ExponentialHistogram { /// data type. These data points cannot always be merged in a meaningful way. /// While they can be useful in some applications, histogram data points are /// recommended for new applications. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Summary { @@ -253,7 +253,7 @@ pub struct Summary { } /// NumberDataPoint is a single data point in a timeseries that describes the /// time-varying scalar value of a metric. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NumberDataPoint { @@ -293,7 +293,7 @@ pub struct NumberDataPoint { pub mod number_data_point { /// The value itself. A point is considered invalid when one of the recognized /// value fields is not present inside this oneof. - #[derive(Serialize, Deserialize)] + #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { @@ -313,7 +313,7 @@ pub mod number_data_point { /// If the histogram does not contain the distribution of values, then both /// "explicit_bounds" and "bucket_counts" must be omitted and only "count" and /// "sum" are known. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HistogramDataPoint { @@ -395,7 +395,7 @@ pub struct HistogramDataPoint { /// summary statistics for a population of values, it may optionally contain the /// distribution of those values across a set of buckets. /// -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExponentialHistogramDataPoint { @@ -485,7 +485,7 @@ pub struct ExponentialHistogramDataPoint { pub mod exponential_histogram_data_point { /// Buckets are a set of bucket counts, encoded in a contiguous array /// of counts. - #[derive(Serialize, Deserialize)] + #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Buckets { @@ -509,7 +509,7 @@ pub mod exponential_histogram_data_point { } /// SummaryDataPoint is a single data point in a timeseries that describes the /// time-varying values of a Summary metric. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SummaryDataPoint { @@ -564,7 +564,7 @@ pub mod summary_data_point { /// /// See the following issue for more context: /// - #[derive(Serialize, Deserialize)] + #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValueAtQuantile { @@ -583,7 +583,7 @@ pub mod summary_data_point { /// Exemplars also hold information about the environment when the measurement /// was recorded, for example the span and trace ID of the active span when the /// exemplar was recorded. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Exemplar { @@ -621,7 +621,7 @@ pub mod exemplar { /// The value of the measurement that was recorded. An exemplar is /// considered invalid when one of the recognized value fields is not present /// inside this oneof. - #[derive(Serialize, Deserialize)] + #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { @@ -634,7 +634,7 @@ pub mod exemplar { /// AggregationTemporality defines how a metric aggregator reports aggregated /// values. It describes how those values relate to the time interval over /// which they are aggregated. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum AggregationTemporality { @@ -731,7 +731,7 @@ impl AggregationTemporality { /// /// (point.flags & FLAG_NO_RECORDED_VALUE) == FLAG_NO_RECORDED_VALUE /// -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum DataPointFlags { diff --git a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.resource.v1.rs b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.resource.v1.rs index 0d286e7b4d8..cca43e3c694 100644 --- a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.resource.v1.rs +++ b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.resource.v1.rs @@ -1,5 +1,5 @@ /// Resource information. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Resource { diff --git a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.trace.v1.rs b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.trace.v1.rs index cbb578273f3..abb6ab679e9 100644 --- a/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.trace.v1.rs +++ b/quickwit/quickwit-proto/src/codegen/opentelemetry/opentelemetry.proto.trace.v1.rs @@ -8,7 +8,7 @@ /// /// When new fields are added into this message, the OTLP request MUST be updated /// as well. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TracesData { @@ -21,7 +21,7 @@ pub struct TracesData { pub resource_spans: ::prost::alloc::vec::Vec, } /// A collection of ScopeSpans from a Resource. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResourceSpans { @@ -38,7 +38,7 @@ pub struct ResourceSpans { pub schema_url: ::prost::alloc::string::String, } /// A collection of Spans produced by an InstrumentationScope. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScopeSpans { @@ -57,7 +57,7 @@ pub struct ScopeSpans { /// A Span represents a single operation performed by a single component of the system. /// /// The next available field id is 17. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Span { @@ -167,7 +167,7 @@ pub struct Span { pub mod span { /// Event is a time-stamped annotation of the span, consisting of user-supplied /// text description and key-value pairs. - #[derive(Serialize, Deserialize)] + #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Event { @@ -194,7 +194,7 @@ pub mod span { /// different trace. For example, this can be used in batching operations, /// where a single batch handler processes multiple requests from different /// traces or when the handler receives a request from a different project. - #[derive(Serialize, Deserialize)] + #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Link { @@ -222,7 +222,7 @@ pub mod span { } /// SpanKind is the type of span. Can be used to specify additional relationships between spans /// in addition to a parent/child relationship. - #[derive(Serialize, Deserialize)] + #[derive(serde::Serialize, serde::Deserialize)] #[derive( Clone, Copy, @@ -288,7 +288,7 @@ pub mod span { } /// The Status type defines a logical error model that is suitable for different /// programming environments, including REST APIs and RPC APIs. -#[derive(Serialize, Deserialize)] +#[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Status { @@ -303,7 +303,7 @@ pub struct Status { pub mod status { /// For the semantics of status codes see /// - #[derive(Serialize, Deserialize)] + #[derive(serde::Serialize, serde::Deserialize)] #[serde(rename_all = "snake_case")] #[derive( Clone, diff --git a/quickwit/quickwit-proto/src/codegen/quickwit/quickwit.search.rs b/quickwit/quickwit-proto/src/codegen/quickwit/quickwit.search.rs index 189019162f8..3fc4d5bdcaa 100644 --- a/quickwit/quickwit-proto/src/codegen/quickwit/quickwit.search.rs +++ b/quickwit/quickwit-proto/src/codegen/quickwit/quickwit.search.rs @@ -1,5 +1,5 @@ /// / Scroll Request -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScrollRequest { @@ -9,7 +9,7 @@ pub struct ScrollRequest { #[prost(uint32, optional, tag = "2")] pub scroll_ttl_secs: ::core::option::Option, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PutKvRequest { @@ -20,25 +20,25 @@ pub struct PutKvRequest { #[prost(uint32, tag = "3")] pub ttl_secs: u32, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PutKvResponse {} -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetKvRequest { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetKvResponse { #[prost(bytes = "vec", optional, tag = "1")] pub payload: ::core::option::Option<::prost::alloc::vec::Vec>, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReportSplit { @@ -49,18 +49,18 @@ pub struct ReportSplit { #[prost(string, tag = "1")] pub storage_uri: ::prost::alloc::string::String, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReportSplitsRequest { #[prost(message, repeated, tag = "1")] pub report_splits: ::prost::alloc::vec::Vec, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ReportSplitsResponse {} -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListFieldsRequest { @@ -79,7 +79,7 @@ pub struct ListFieldsRequest { #[prost(int64, optional, tag = "4")] pub end_timestamp: ::core::option::Option, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LeafListFieldsRequest { @@ -98,14 +98,14 @@ pub struct LeafListFieldsRequest { #[prost(string, repeated, tag = "4")] pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListFieldsResponse { #[prost(message, repeated, tag = "1")] pub fields: ::prost::alloc::vec::Vec, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListFieldsEntryResponse { @@ -135,14 +135,14 @@ pub struct ListFieldsEntryResponse { ::prost::alloc::string::String, >, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListFields { #[prost(message, repeated, tag = "1")] pub fields: ::prost::alloc::vec::Vec, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[derive(Eq, Hash)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -192,7 +192,7 @@ pub struct SearchRequest { #[prost(enumeration = "CountHits", tag = "17")] pub count_hits: i32, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[derive(Eq, Hash)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -207,7 +207,7 @@ pub struct SortField { #[prost(enumeration = "SortDatetimeFormat", optional, tag = "3")] pub sort_datetime_format: ::core::option::Option, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SearchResponse { @@ -242,14 +242,14 @@ pub struct SearchResponse { #[prost(uint64, tag = "8")] pub num_successful_splits: u64, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SearchPlanResponse { #[prost(string, tag = "1")] pub result: ::prost::alloc::string::String, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SplitSearchError { @@ -265,7 +265,7 @@ pub struct SplitSearchError { } /// / A LeafSearchRequest can span multiple indices. /// / -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LeafSearchRequest { @@ -287,7 +287,7 @@ pub struct LeafSearchRequest { pub index_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// / LeafRequestRef references data in LeafSearchRequest to deduplicate data. -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LeafRequestRef { @@ -302,7 +302,7 @@ pub struct LeafRequestRef { #[prost(message, repeated, tag = "3")] pub split_offsets: ::prost::alloc::vec::Vec, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SplitIdAndFooterOffsets { @@ -339,7 +339,7 @@ pub struct SplitIdAndFooterOffsets { /// flattened by concatenating the path to the root. /// /// See `quickwit_search::convert_leaf_hit` -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LeafHit { @@ -353,7 +353,7 @@ pub struct LeafHit { #[prost(string, optional, tag = "3")] pub leaf_snippet_json: ::core::option::Option<::prost::alloc::string::String>, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Hit { @@ -385,7 +385,7 @@ pub struct Hit { /// - the split_id, /// - the segment_ord, /// - the doc id. -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[derive(Eq, Hash)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -404,7 +404,7 @@ pub struct PartialHit { #[prost(uint32, tag = "4")] pub doc_id: u32, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[derive(Ord, PartialOrd)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -414,7 +414,7 @@ pub struct SortByValue { } /// Nested message and enum types in `SortByValue`. pub mod sort_by_value { - #[derive(Serialize, Deserialize, utoipa::ToSchema)] + #[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[serde(rename_all = "snake_case")] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] @@ -429,7 +429,7 @@ pub mod sort_by_value { Boolean(bool), } } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LeafSearchResponse { @@ -458,7 +458,7 @@ pub struct LeafSearchResponse { ::prost::alloc::vec::Vec, >, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnippetRequest { @@ -467,7 +467,7 @@ pub struct SnippetRequest { #[prost(string, tag = "2")] pub query_ast_resolved: ::prost::alloc::string::String, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FetchDocsRequest { @@ -489,7 +489,7 @@ pub struct FetchDocsRequest { #[prost(string, tag = "6")] pub doc_mapper: ::prost::alloc::string::String, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FetchDocsResponse { @@ -497,7 +497,7 @@ pub struct FetchDocsResponse { #[prost(message, repeated, tag = "1")] pub hits: ::prost::alloc::vec::Vec, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListTermsRequest { @@ -521,7 +521,7 @@ pub struct ListTermsRequest { #[prost(bytes = "vec", optional, tag = "8")] pub end_key: ::core::option::Option<::prost::alloc::vec::Vec>, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListTermsResponse { @@ -539,7 +539,7 @@ pub struct ListTermsResponse { #[prost(string, repeated, tag = "4")] pub errors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LeafListTermsRequest { @@ -555,7 +555,7 @@ pub struct LeafListTermsRequest { #[prost(string, tag = "3")] pub index_uri: ::prost::alloc::string::String, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LeafListTermsResponse { @@ -572,7 +572,7 @@ pub struct LeafListTermsResponse { #[prost(uint64, tag = "4")] pub num_attempted_splits: u64, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SearchStreamRequest { @@ -600,7 +600,7 @@ pub struct SearchStreamRequest { #[prost(string, repeated, tag = "10")] pub snippet_fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LeafSearchStreamRequest { @@ -620,7 +620,7 @@ pub struct LeafSearchStreamRequest { #[prost(string, tag = "6")] pub index_uri: ::prost::alloc::string::String, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LeafSearchStreamResponse { @@ -631,7 +631,7 @@ pub struct LeafSearchStreamResponse { #[prost(string, tag = "2")] pub split_id: ::prost::alloc::string::String, } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[serde(rename_all = "snake_case")] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -683,7 +683,7 @@ impl ListFieldType { } } } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[serde(rename_all = "snake_case")] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -714,7 +714,7 @@ impl CountHits { } } } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[serde(rename_all = "snake_case")] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -749,7 +749,7 @@ impl SortOrder { /// Sort value format for datetime field. /// We keep an enum with only one format /// for future extension. -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[serde(rename_all = "snake_case")] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -777,7 +777,7 @@ impl SortDatetimeFormat { } } } -#[derive(Serialize, Deserialize, utoipa::ToSchema)] +#[derive(serde::Serialize, serde::Deserialize, utoipa::ToSchema)] #[serde(rename_all = "snake_case")] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] diff --git a/quickwit/quickwit-proto/src/control_plane/mod.rs b/quickwit/quickwit-proto/src/control_plane/mod.rs index 8184851845e..ce3b50dca9f 100644 --- a/quickwit/quickwit-proto/src/control_plane/mod.rs +++ b/quickwit/quickwit-proto/src/control_plane/mod.rs @@ -20,6 +20,7 @@ use quickwit_actors::AskError; use quickwit_common::rate_limited_error; use quickwit_common::tower::{MakeLoadShedError, RpcName, TimeoutExceeded}; +use serde::{Deserialize, Serialize}; use thiserror; use crate::metastore::{MetastoreError, OpenShardSubrequest}; diff --git a/quickwit/quickwit-proto/src/developer/mod.rs b/quickwit/quickwit-proto/src/developer/mod.rs index 2ed98190b17..a6472585042 100644 --- a/quickwit/quickwit-proto/src/developer/mod.rs +++ b/quickwit/quickwit-proto/src/developer/mod.rs @@ -25,7 +25,7 @@ include!("../codegen/quickwit/quickwit.developer.rs"); pub type DeveloperResult = std::result::Result; -#[derive(Debug, thiserror::Error, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Debug, thiserror::Error, Eq, PartialEq, serde::Serialize, serde::Deserialize)] #[serde(rename_all = "snake_case")] pub enum DeveloperError { #[error("internal error: {0}")] diff --git a/quickwit/quickwit-proto/src/ingest/mod.rs b/quickwit/quickwit-proto/src/ingest/mod.rs index 48a410cd5ba..72a66082421 100644 --- a/quickwit/quickwit-proto/src/ingest/mod.rs +++ b/quickwit/quickwit-proto/src/ingest/mod.rs @@ -23,6 +23,7 @@ use bytes::Bytes; use bytesize::ByteSize; use quickwit_common::rate_limited_error; use quickwit_common::tower::MakeLoadShedError; +use serde::{Deserialize, Serialize}; use self::ingester::{PersistFailureReason, ReplicateFailureReason}; use self::router::IngestFailureReason; diff --git a/quickwit/quickwit-proto/src/lib.rs b/quickwit/quickwit-proto/src/lib.rs index c5a2aa5034d..aa8f49fcb97 100644 --- a/quickwit/quickwit-proto/src/lib.rs +++ b/quickwit/quickwit-proto/src/lib.rs @@ -109,9 +109,6 @@ pub mod opentelemetry { } } -#[macro_use] -extern crate serde; - impl TryFrom for search::SearchRequest { type Error = anyhow::Error;