diff --git a/CHANGELOG.md b/CHANGELOG.md index 5316a346d..b19b65f5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## [0.20.0-rc3] +### Changed +- Instrumentation of content length changed to logs to avoid expanding capture files. + ## [0.20.0-rc2] ### Changed - Target metrics now stream where possible, instrument content length from target. diff --git a/Cargo.lock b/Cargo.lock index e53aa4b58..10853b35e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1026,7 +1026,7 @@ dependencies = [ [[package]] name = "lading" -version = "0.20.0-rc2" +version = "0.20.0-rc3" dependencies = [ "async-pidfd", "byte-unit", diff --git a/lading/Cargo.toml b/lading/Cargo.toml index 57bb73c70..81a37267b 100644 --- a/lading/Cargo.toml +++ b/lading/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lading" -version = "0.20.0-rc2" +version = "0.20.0-rc3" authors = ["Brian L. Troutwine ", "George Hahn "expvar"); - loop { tokio::select! { _ = timer.tick() => { @@ -75,7 +72,9 @@ impl Expvar { continue; }; if let Some(cl) = resp.content_length() { - content_length.record(cl as f64); + info!("expvar content length: {cl}"); + } else { + debug!("no content length in expvar response"); } let Ok(json) = resp.json::().await else { diff --git a/lading/src/target_metrics/prometheus.rs b/lading/src/target_metrics/prometheus.rs index 420c8f8f6..97f041e05 100644 --- a/lading/src/target_metrics/prometheus.rs +++ b/lading/src/target_metrics/prometheus.rs @@ -7,12 +7,12 @@ use std::{str::FromStr, time::Duration}; use futures::TryStreamExt; -use metrics::{absolute_counter, gauge, register_histogram}; +use metrics::{absolute_counter, gauge}; use rustc_hash::FxHashMap; use serde::Deserialize; use tokio::io::AsyncBufReadExt; use tokio_util::io::StreamReader; -use tracing::{error, info, trace, warn}; +use tracing::{debug, error, info, trace, warn}; use crate::signals::Shutdown; @@ -109,9 +109,6 @@ impl Prometheus { let mut timer = tokio::time::interval(Duration::from_secs(1)); - let content_length = - register_histogram!("target_metrics_content_length", "source" => "prometheus"); - loop { tokio::select! { _ = timer.tick() => { @@ -120,7 +117,9 @@ impl Prometheus { continue; }; if let Some(cl) = resp.content_length() { - content_length.record(cl as f64); + info!("expvar content length: {cl}"); + } else { + debug!("no content length in expvar response"); } let reader = StreamReader::new(resp.bytes_stream().map_err(convert_err));