Skip to content

Commit 80e2e24

Browse files
committed
removed labels
Signed-off-by: Caleb Metz <caleb.metz@datadoghq.com>
1 parent 948b64e commit 80e2e24

13 files changed

Lines changed: 20 additions & 34 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
- dogstatsd generator can be configured to use metric names, tag names and tag
2727
values from a configured list. Configured with `metric_names`, `tag_names` and
2828
`tag_values`.
29-
- All blackholes now emit a `total_bytes_received` metric with a single
30-
`component:blackhole` label, providing an aggregated byte count across all
31-
blackhole types and IDs.
29+
- All blackholes now emit a `total_bytes_received` metric (no labels),
30+
providing an aggregated byte count across all blackhole types and IDs.
3231
## Fixed
3332
- Fixed a race condition in `lading_signal` that caused lading to hang on shutdown.
3433

lading/src/blackhole/common.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ use tokio::{
1616
};
1717
use tracing::{debug, error, info, warn};
1818

19-
/// Labels shared by all blackholes to ensure a single aggregated `total_bytes_received` series.
20-
///
21-
/// Note: the meaning of "bytes" varies by transport — HTTP-based blackholes report wire bytes,
22-
/// while gRPC-based blackholes (OTLP gRPC, Datadog Stateful Logs) report protobuf `encoded_len()`.
23-
pub(super) static COMMON_BLACKHOLE_LABELS: &[(&str, &str)] = &[("component", "blackhole")];
24-
2519
#[derive(thiserror::Error, Debug)]
2620
pub enum Error {
2721
/// Wrapper for [`std::io::Error`].

lading/src/blackhole/datadog.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ use tokio::net::TcpListener;
4545
use tracing::{debug, error, info, trace, warn};
4646

4747
use super::General;
48-
use crate::blackhole::common::COMMON_BLACKHOLE_LABELS;
4948
use crate::proto::datadog::intake::metrics::MetricPayload;
5049

5150
#[derive(thiserror::Error, Debug)]
@@ -221,7 +220,7 @@ async fn handle_request(
221220

222221
let body_len = whole_body.len() as u64;
223222
counter!("bytes_received", labels).increment(body_len);
224-
counter!("total_bytes_received", COMMON_BLACKHOLE_LABELS).increment(body_len);
223+
counter!("total_bytes_received").increment(body_len);
225224

226225
let content_type = headers
227226
.get(header::CONTENT_TYPE)

lading/src/blackhole/datadog_stateful_logs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use tonic::{Request, Response, Status, transport};
3030
use tracing::{error, info};
3131

3232
use super::General;
33-
use crate::blackhole::common::COMMON_BLACKHOLE_LABELS;
3433

3534
#[derive(thiserror::Error, Debug)]
3635
/// Errors produced by [`DatadogStatefulLogs`].
@@ -188,7 +187,7 @@ impl StatefulLogsService for StatefulLogsServiceImpl {
188187
let size = batch.encoded_len() as u64;
189188

190189
counter!("bytes_received", &labels).increment(size);
191-
counter!("total_bytes_received", COMMON_BLACKHOLE_LABELS).increment(size);
190+
counter!("total_bytes_received").increment(size);
192191
counter!("batches_received", &labels).increment(1);
193192

194193
// Count data items in the batch

lading/src/blackhole/http.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::{net::SocketAddr, time::Duration};
2020
use tracing::error;
2121

2222
use super::General;
23-
use crate::blackhole::common::{self, COMMON_BLACKHOLE_LABELS};
23+
use crate::blackhole::common;
2424

2525
fn default_concurrent_requests_max() -> usize {
2626
100
@@ -163,7 +163,7 @@ async fn srv(
163163

164164
let body_len = body.len() as u64;
165165
counter!("bytes_received", &metric_labels).increment(body_len);
166-
counter!("total_bytes_received", COMMON_BLACKHOLE_LABELS).increment(body_len);
166+
counter!("total_bytes_received").increment(body_len);
167167

168168
let mut labels_with_path = metric_labels.clone();
169169
labels_with_path.push(("path".to_string(), path));

lading/src/blackhole/otlp/grpc.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! gRPC implementation of the OTLP blackhole.
22
3-
use crate::blackhole::common::COMMON_BLACKHOLE_LABELS;
43
use metrics::counter;
54
use opentelemetry_proto::tonic::collector::logs::v1::{
65
ExportLogsServiceRequest, ExportLogsServiceResponse,
@@ -87,7 +86,7 @@ impl MetricsService for OtlpMetricsService {
8786
let size = request.encoded_len() as u64;
8887

8988
counter!("bytes_received", &self.labels).increment(size);
90-
counter!("total_bytes_received", COMMON_BLACKHOLE_LABELS).increment(size);
89+
counter!("total_bytes_received").increment(size);
9190
counter!("requests_received", &self.labels).increment(1);
9291

9392
let mut total_points: u64 = 0;
@@ -137,7 +136,7 @@ impl TraceService for OtlpTracesService {
137136
let size = request.encoded_len() as u64;
138137

139138
counter!("bytes_received", &self.labels).increment(size);
140-
counter!("total_bytes_received", COMMON_BLACKHOLE_LABELS).increment(size);
139+
counter!("total_bytes_received").increment(size);
141140
counter!("requests_received", &self.labels).increment(1);
142141

143142
let mut total_spans: u64 = 0;
@@ -177,7 +176,7 @@ impl LogsService for OtlpLogsService {
177176
let size = request.encoded_len() as u64;
178177

179178
counter!("bytes_received", &self.labels).increment(size);
180-
counter!("total_bytes_received", COMMON_BLACKHOLE_LABELS).increment(size);
179+
counter!("total_bytes_received").increment(size);
181180
counter!("requests_received", &self.labels).increment(1);
182181

183182
let mut total_logs: u64 = 0;

lading/src/blackhole/otlp/http.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use std::time::Duration;
2121
use tokio::task::JoinHandle;
2222
use tracing::{error, info};
2323

24-
use crate::blackhole::common::{self, COMMON_BLACKHOLE_LABELS};
24+
use crate::blackhole::common;
2525

2626
/// Run the HTTP server for OTLP
2727
pub(crate) fn run_server(
@@ -197,7 +197,7 @@ impl OtlpHttpHandler {
197197
&& length == 0
198198
{
199199
counter!("bytes_received", &self.labels).increment(0);
200-
counter!("total_bytes_received", COMMON_BLACKHOLE_LABELS).increment(0);
200+
counter!("total_bytes_received").increment(0);
201201

202202
let (response_bytes, content_type) = match (path_ref, response_format) {
203203
("/v1/metrics", ResponseFormat::Json) => (
@@ -239,7 +239,7 @@ impl OtlpHttpHandler {
239239

240240
let body_len = body_bytes.len() as u64;
241241
counter!("bytes_received", &self.labels).increment(body_len);
242-
counter!("total_bytes_received", COMMON_BLACKHOLE_LABELS).increment(body_len);
242+
counter!("total_bytes_received").increment(body_len);
243243

244244
let response_bytes =
245245
match crate::codec::decode(content_encoding.as_ref(), body_bytes.clone()) {

lading/src/blackhole/splunk_hec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc_hash::FxHashMap;
2020
use serde::{Deserialize, Serialize};
2121

2222
use super::General;
23-
use crate::blackhole::common::{self, COMMON_BLACKHOLE_LABELS};
23+
use crate::blackhole::common;
2424

2525
static ACK_ID: AtomicU64 = AtomicU64::new(0);
2626

@@ -105,7 +105,7 @@ async fn srv(
105105
let bytes = body.boxed().collect().await?.to_bytes();
106106
let bytes_len = bytes.len() as u64;
107107
counter!("bytes_received", &*labels).increment(bytes_len);
108-
counter!("total_bytes_received", COMMON_BLACKHOLE_LABELS).increment(bytes_len);
108+
counter!("total_bytes_received").increment(bytes_len);
109109

110110
match crate::codec::decode(parts.headers.get(hyper::header::CONTENT_ENCODING), bytes) {
111111
Err(response) => Ok(*response),

lading/src/blackhole/sqs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::{fmt::Write, net::SocketAddr};
1717
use tracing::{debug, error};
1818

1919
use super::General;
20-
use crate::blackhole::common::{self, COMMON_BLACKHOLE_LABELS};
20+
use crate::blackhole::common;
2121

2222
#[derive(thiserror::Error, Debug)]
2323
/// Errors produced by [`Sqs`]
@@ -238,7 +238,7 @@ async fn srv(
238238
let bytes = body.boxed().collect().await?.to_bytes();
239239
let bytes_len = bytes.len() as u64;
240240
counter!("bytes_received", &metric_labels).increment(bytes_len);
241-
counter!("total_bytes_received", COMMON_BLACKHOLE_LABELS).increment(bytes_len);
241+
counter!("total_bytes_received").increment(bytes_len);
242242

243243
let action = match serde_qs::from_bytes::<Action>(&bytes) {
244244
Ok(a) => a,

lading/src/blackhole/tcp.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use tokio_util::io::ReaderStream;
1818
use tracing::info;
1919

2020
use super::General;
21-
use crate::blackhole::common::COMMON_BLACKHOLE_LABELS;
2221

2322
#[derive(thiserror::Error, Debug)]
2423
/// Errors emitted by [`Tcp`]
@@ -89,7 +88,7 @@ impl Tcp {
8988
if let Ok(msg) = msg {
9089
let len = msg.len() as u64;
9190
counter!("bytes_received", labels).increment(len);
92-
counter!("total_bytes_received", COMMON_BLACKHOLE_LABELS).increment(len);
91+
counter!("total_bytes_received").increment(len);
9392
}
9493
}
9594
}

0 commit comments

Comments
 (0)