Skip to content

Commit

Permalink
Adjust splunk_hec to distinguish decoded and raw bytes received
Browse files Browse the repository at this point in the history
Similar to #1166 this commit adds a `decoded_bytes_received` so that the telemetry
from this blackhole matches the others in the project, measuring the raw/wire bytes
in `bytes_received`.

Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
  • Loading branch information
blt committed Dec 17, 2024
1 parent 14c4c66 commit 471f454
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lading/src/blackhole/splunk_hec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,12 @@ async fn srv(

let (parts, body) = req.into_parts();
let bytes = body.collect().await?.to_bytes();
counter!("bytes_received", &metric_labels).increment(bytes.len() as u64);

match crate::codec::decode(parts.headers.get(hyper::header::CONTENT_ENCODING), bytes) {
Err(response) => Ok(response),
Ok(body) => {
counter!("bytes_received", &*labels).increment(body.len() as u64);
counter!("decoded_bytes_received", &metric_labels).increment(body.len() as u64);

let mut okay = Response::default();
*okay.status_mut() = StatusCode::OK;
Expand Down

0 comments on commit 471f454

Please sign in to comment.