Skip to content

Commit

Permalink
remove deprecated functions
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Wakely <fungus.humungus@gmail.com>
  • Loading branch information
StephenWakely committed Sep 6, 2023
1 parent 592d92b commit 461afbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/sinks/vector/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ async fn healthcheck(

let request = service.client.health_check(proto::HealthCheckRequest {});
match request.await {
Ok(response) => match proto::ServingStatus::from_i32(response.into_inner().status) {
Some(proto::ServingStatus::Serving) => Ok(()),
Some(status) => Err(Box::new(VectorSinkError::Health {
Ok(response) => match proto::ServingStatus::try_from(response.into_inner().status) {
Ok(proto::ServingStatus::Serving) => Ok(()),
Ok(status) => Err(Box::new(VectorSinkError::Health {
status: Some(status.as_str_name()),
})),
None => Err(Box::new(VectorSinkError::Health { status: None })),
Err(_) => Err(Box::new(VectorSinkError::Health { status: None })),
},
Err(source) => Err(Box::new(VectorSinkError::Request { source })),
}
Expand Down
10 changes: 5 additions & 5 deletions src/sources/datadog_agent/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ pub(crate) fn decode_ddseries_v2(
.then(|| tags.replace("source_type_name".into(), serie.source_type_name));
// As per https://github.com/DataDog/datadog-agent/blob/a62ac9fb13e1e5060b89e731b8355b2b20a07c5b/pkg/serializer/internal/metrics/iterable_series.go#L224
// serie.unit is omitted
match metric_payload::MetricType::from_i32(serie.r#type) {
Some(metric_payload::MetricType::Count) => serie
match metric_payload::MetricType::try_from(serie.r#type) {
Ok(metric_payload::MetricType::Count) => serie
.points
.iter()
.map(|dd_point| {
Expand All @@ -277,7 +277,7 @@ pub(crate) fn decode_ddseries_v2(
.with_namespace(namespace)
})
.collect::<Vec<_>>(),
Some(metric_payload::MetricType::Gauge) => serie
Ok(metric_payload::MetricType::Gauge) => serie
.points
.iter()
.map(|dd_point| {
Expand All @@ -297,7 +297,7 @@ pub(crate) fn decode_ddseries_v2(
.with_namespace(namespace)
})
.collect::<Vec<_>>(),
Some(metric_payload::MetricType::Rate) => serie
Ok(metric_payload::MetricType::Rate) => serie
.points
.iter()
.map(|dd_point| {
Expand All @@ -323,7 +323,7 @@ pub(crate) fn decode_ddseries_v2(
.with_namespace(namespace)
})
.collect::<Vec<_>>(),
Some(metric_payload::MetricType::Unspecified) | None => {
Ok(metric_payload::MetricType::Unspecified) | Err(_) => {
warn!("Unspecified metric type ({}).", serie.r#type);
Vec::new()
}
Expand Down

0 comments on commit 461afbd

Please sign in to comment.