Skip to content

Commit fefcd34

Browse files
revert converting array to string for otel metrics
1 parent f81c59e commit fefcd34

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/otel/metrics.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,9 @@ fn flatten_histogram(histogram: &Histogram) -> Vec<Map<String, Value>> {
200200
.map(|&count| Value::Number(count.into()))
201201
.collect(),
202202
);
203-
let data_point_bucket_counts_string =
204-
serde_json::to_string(&data_point_bucket_counts).unwrap();
205203
data_point_json.insert(
206204
"data_point_bucket_counts".to_string(),
207-
Value::String(data_point_bucket_counts_string),
205+
data_point_bucket_counts,
208206
);
209207
let data_point_explicit_bounds = Value::Array(
210208
data_point
@@ -213,11 +211,9 @@ fn flatten_histogram(histogram: &Histogram) -> Vec<Map<String, Value>> {
213211
.map(|bound| Value::Number(serde_json::Number::from_f64(*bound).unwrap()))
214212
.collect(),
215213
);
216-
let data_point_explicit_bounds_string =
217-
serde_json::to_string(&data_point_explicit_bounds).unwrap();
218214
data_point_json.insert(
219215
"data_point_explicit_bounds".to_string(),
220-
Value::String(data_point_explicit_bounds_string),
216+
data_point_explicit_bounds,
221217
);
222218
let exemplar_json = flatten_exemplar(&data_point.exemplars);
223219
for (key, value) in exemplar_json {

0 commit comments

Comments
 (0)