Skip to content

Commit

Permalink
Merge branch 'main' into sopell/smaps-pathnames-whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
scottopell authored Feb 6, 2025
2 parents eb5f3f8 + b7b446f commit 1a2725d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
configuration option `sample_period_milliseconds` in `lading.yaml`.
- Users can now configure expvar scraping on https endpoints, skipping certificate validation.
- `smaps` parsing logic correctly collects memory region pathnames that contain whitespace
- Fixes issue when parsing `NaN` values from a prometheus endpoint

## [0.25.4]
## Changed
Expand Down
10 changes: 10 additions & 0 deletions lading/src/target_metrics/prometheus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ pub(crate) async fn scrape_metrics(
}
};

if value.is_nan() {
warn!("Skipping NaN gauge value");
continue;
}

gauge!(format!("target/{name}"), &all_labels.unwrap_or_default()).set(value);
}
Some(MetricType::Counter) => {
Expand All @@ -287,6 +292,11 @@ pub(crate) async fn scrape_metrics(
}
};

if value.is_nan() {
warn!("Skipping NaN counter value");
continue;
}

let value = if value < 0.0 {
warn!("Negative counter value unhandled");
continue;
Expand Down

0 comments on commit 1a2725d

Please sign in to comment.