We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a717313 commit b043a75Copy full SHA for b043a75
src/analytics.rs
@@ -287,10 +287,14 @@ async fn fetch_ingestors_metrics(
287
.send()
288
.await
289
.expect("should respond");
290
-
291
- let data = serde_json::from_slice::<NodeMetrics>(&resp.bytes().await?)?;
292
- vec.push(data);
293
- active_ingestors += 1;
+ // check if the response is valid
+ if let Ok(data) = serde_json::from_slice::<NodeMetrics>(&resp.bytes().await?) {
+ active_ingestors += 1;
+ vec.push(data);
294
+ } else {
295
+ offline_ingestors += 1;
296
+ continue;
297
+ }
298
}
299
300
node_metrics.accumulate(&mut vec);
0 commit comments