From 01864b44b51c56b980a36d2829c876de0e688f4f Mon Sep 17 00:00:00 2001 From: Nikhil Sinha Date: Sun, 5 Jan 2025 22:13:18 -0500 Subject: [PATCH] fix: convert int to string for otel attributes The OTEL collector intermittently sends the intValue attribute as both a string and as an integer Schema merge fails in Parseable because of error - `from data_type = Float64 does not equal Utf8` A few field attributes that cause such issues are - `server.port`, `http.status_code`, `status` etc hence, it is safe to treat the intValue as string --- src/otel/otel_utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/otel/otel_utils.rs b/src/otel/otel_utils.rs index 3ac051771..fabed184f 100644 --- a/src/otel/otel_utils.rs +++ b/src/otel/otel_utils.rs @@ -31,7 +31,7 @@ pub fn collect_json_from_value(key: &String, value: OtelValue) -> BTreeMap { - value_json.insert(key.to_string(), Value::Number(int_val.into())); + value_json.insert(key.to_string(), Value::String(int_val.to_string())); } OtelValue::DoubleValue(double_val) => { if let Some(number) = serde_json::Number::from_f64(double_val) {