From 40d3dd8c8fc632ced8e4ea227998c03fbf3aad71 Mon Sep 17 00:00:00 2001 From: Miguel Fernandez Date: Fri, 30 Dec 2022 18:46:29 +0100 Subject: [PATCH] Fix clippy fixes and remove test doc --- .../core/src/telemetry/capturing/capturer.rs | 2 +- query-engine/core/src/telemetry/models.rs | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/query-engine/core/src/telemetry/capturing/capturer.rs b/query-engine/core/src/telemetry/capturing/capturer.rs index ed3a044db627..8d696f984de7 100644 --- a/query-engine/core/src/telemetry/capturing/capturer.rs +++ b/query-engine/core/src/telemetry/capturing/capturer.rs @@ -179,7 +179,7 @@ impl Candidate<'_, models::LogEvent> { } models::LogEvent { - name: name, + name, level: "query".to_string(), attributes: attrs, ..self.value diff --git a/query-engine/core/src/telemetry/models.rs b/query-engine/core/src/telemetry/models.rs index 57ddd2afdecb..03536ee9857a 100644 --- a/query-engine/core/src/telemetry/models.rs +++ b/query-engine/core/src/telemetry/models.rs @@ -180,19 +180,7 @@ fn convert_to_high_res_time(time: Duration) -> HrTime { /// Transforms an [`opentelemetry::Value`] to a [`serde_json::Value`] /// This is because we want to flatten the JSON representation for a value, which by default will /// be a nested structure informing of the type. For instance a float [`opentelemetry::Value`] -/// would be represented as json as: -/// -/// ``` -/// "value": { -/// "F64": 4.887 -/// } -/// ``` -/// -/// But we want it to be just: -/// -/// ``` -/// "value": 4.887 -/// ``` +/// would be represented as json as `{"f64": 1.0}`. This function will flatten it to just `1.0`. fn to_json_value(value: &Value) -> serde_json::Value { match value { Value::String(s) => json!(s),