Skip to content

Commit 71801df

Browse files
fix: convert int to string for otel attributes (#1065)
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
1 parent 8d666f0 commit 71801df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/otel/otel_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn collect_json_from_value(key: &String, value: OtelValue) -> BTreeMap<Strin
3131
value_json.insert(key.to_string(), Value::Bool(bool_val));
3232
}
3333
OtelValue::IntValue(int_val) => {
34-
value_json.insert(key.to_string(), Value::Number(int_val.into()));
34+
value_json.insert(key.to_string(), Value::String(int_val.to_string()));
3535
}
3636
OtelValue::DoubleValue(double_val) => {
3737
if let Some(number) = serde_json::Number::from_f64(double_val) {

0 commit comments

Comments
 (0)