Skip to content

Commit

Permalink
-rc3
Browse files Browse the repository at this point in the history
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
  • Loading branch information
blt committed Nov 8, 2023
1 parent 034a598 commit 9cb9edd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lading/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lading"
version = "0.20.0-rc2"
version = "0.20.0-rc3"
authors = ["Brian L. Troutwine <brian.troutwine@datadoghq.com>", "George Hahn <george.hahn@datadoghq.com"]
edition = "2021"
license = "MIT"
Expand Down
11 changes: 5 additions & 6 deletions lading/src/target_metrics/expvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

use std::time::Duration;

use metrics::{gauge, register_histogram};
use metrics::gauge;
use serde::Deserialize;
use serde_json::Value;
use tracing::{error, info, trace};
use tracing::{debug, error, info, trace};

use crate::signals::Shutdown;

Expand Down Expand Up @@ -64,9 +64,6 @@ impl Expvar {

let mut timer = tokio::time::interval(Duration::from_secs(1));

let content_length =
register_histogram!("target_metrics_content_length", "source" => "expvar");

loop {
tokio::select! {
_ = timer.tick() => {
Expand All @@ -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::<Value>().await else {
Expand Down
11 changes: 5 additions & 6 deletions lading/src/target_metrics/prometheus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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() => {
Expand All @@ -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));
Expand Down

0 comments on commit 9cb9edd

Please sign in to comment.