Skip to content

Commit 26eafa7

Browse files
fix: OTEL format (#823)
otel common schema to treat float as f64 and integer as string
1 parent 47eaf48 commit 26eafa7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/src/handlers/http/otel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn collect_json_from_any_value(
4747
if value.double_val.is_some() {
4848
value_json.insert(
4949
key.to_string(),
50-
Value::String(value.double_val.as_ref().unwrap().to_owned()),
50+
Value::Number(serde_json::Number::from_f64(value.double_val.unwrap()).unwrap()),
5151
);
5252
}
5353

server/src/handlers/http/otel/opentelemetry.proto.common.v1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#[serde(rename = "intValue")]
4040
pub int_val: Option<String>,
4141
#[serde(rename = "doubleValue")]
42-
pub double_val: Option<String>,
42+
pub double_val: Option<f64>,
4343
#[serde(rename = "arrayValue")]
4444
pub array_val: Option<ArrayValue>,
4545
#[serde(rename = "keyVauleList")]

0 commit comments

Comments
 (0)