File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
lading/src/target_metrics Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
12
- Introduced the ability for users to configure lading's sample rate,
13
13
configuration option ` sample_period_milliseconds ` in ` lading.yaml ` .
14
14
- Users can now configure expvar scraping on https endpoints, skipping certificate validation.
15
+ - Fixes issue when parsing ` NaN ` values from a prometheus endpoint
15
16
16
17
## [ 0.25.4]
17
18
## Changed
Original file line number Diff line number Diff line change @@ -276,6 +276,11 @@ pub(crate) async fn scrape_metrics(
276
276
}
277
277
} ;
278
278
279
+ if value. is_nan ( ) {
280
+ warn ! ( "Skipping NaN gauge value" ) ;
281
+ continue ;
282
+ }
283
+
279
284
gauge ! ( format!( "target/{name}" ) , & all_labels. unwrap_or_default( ) ) . set ( value) ;
280
285
}
281
286
Some ( MetricType :: Counter ) => {
@@ -287,6 +292,11 @@ pub(crate) async fn scrape_metrics(
287
292
}
288
293
} ;
289
294
295
+ if value. is_nan ( ) {
296
+ warn ! ( "Skipping NaN counter value" ) ;
297
+ continue ;
298
+ }
299
+
290
300
let value = if value < 0.0 {
291
301
warn ! ( "Negative counter value unhandled" ) ;
292
302
continue ;
You can’t perform that action at this time.
0 commit comments