Skip to content

Commit fdcd881

Browse files
authored
Adjust splunk_hec to distinguish decoded and raw bytes received (#1167)
### What does this PR do? 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`.
1 parent 14c4c66 commit fdcd881

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8-
## Changed
9-
- The `bytes_received` metric in the HTTP blackhole now tracks wire bytes, the
10-
former metric is preserved with `decoded_bytes_received`.
8+
- The `bytes_received` metric in the HTTP and splunk_hec blackholes now tracks
9+
wire bytes, the former metric is preserved with `decoded_bytes_received`.
1110
- Base image is now bookworm, updated from bullseye.
1211

1312
## [0.25.1]

lading/src/blackhole/splunk_hec.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,12 @@ async fn srv(
9696

9797
let (parts, body) = req.into_parts();
9898
let bytes = body.collect().await?.to_bytes();
99+
counter!("bytes_received", &*labels).increment(bytes.len() as u64);
99100

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

105106
let mut okay = Response::default();
106107
*okay.status_mut() = StatusCode::OK;

0 commit comments

Comments
 (0)