Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgajg1134 committed Sep 18, 2024
1 parent 226f7ab commit e4027aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
13 changes: 4 additions & 9 deletions data-pipeline/src/trace_exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl TraceExporter {
self.emit_metric(
HealthMetric::Count(STAT_SEND_TRACES_ERRORS, 1),
Some(vec![
Tag::new("response_code", response_status.as_str()).unwrap()
&Tag::new("response_code", response_status.as_str()).unwrap()
]),
);
anyhow::bail!("Agent did not accept traces: {response_body}");
Expand Down Expand Up @@ -235,18 +235,13 @@ impl TraceExporter {
}

/// Emit a health metric to dogstatsd
fn emit_metric(&self, metric: HealthMetric, custom_tags: Option<Vec<Tag>>) {
fn emit_metric(&self, metric: HealthMetric, custom_tags: Option<Vec<&Tag>>) {
if let Some(flusher) = &self.dogstatsd {
if custom_tags.is_some() {
match metric {
HealthMetric::Count(name, c) => {
let tags = self
.common_stats_tags
.clone() // TODO: how the heck do we get around needing a clone here... :(
.into_iter()
.chain(custom_tags.unwrap())
.collect::<Vec<Tag>>();
flusher.send(vec![DogStatsDAction::Count(name, c, &tags)])
let tags = self.common_stats_tags.iter().chain(custom_tags.unwrap());
flusher.send(vec![DogStatsDAction::Count(name, c, tags)])
}
}
} else {
Expand Down
1 change: 0 additions & 1 deletion dogstatsd-client/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0
#![feature(variant_count)]

use ddcommon::tag::Tag;
use ddcommon::Endpoint;
Expand Down

0 comments on commit e4027aa

Please sign in to comment.