Skip to content

Commit

Permalink
Update telemetry function to take operation instead of entire tracing…
Browse files Browse the repository at this point in the history
… span
  • Loading branch information
aws-hans-pistor committed Oct 24, 2024
1 parent 98df814 commit 3000b47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mountpoint-s3-client/src/s3_crt_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ impl S3CrtClientInner {
}

if let Some(telemetry_callback) = &telemetry_callback {
telemetry_callback.on_telemetry(metrics, &span_telemetry);
telemetry_callback.on_telemetry(metrics, op);
}
})
.on_headers(move |headers, response_status| {
Expand Down Expand Up @@ -1359,7 +1359,7 @@ impl ObjectClient for S3CrtClient {
}

pub trait OnTelemetry: std::fmt::Debug + Send + Sync {
fn on_telemetry(&self, request_metrics: &RequestMetrics, span: &Span);
fn on_telemetry(&self, request_metrics: &RequestMetrics, operation: &str);
}

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion mountpoint-s3-client/tests/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ async fn test_custom_telemetry_callback() {
}

impl OnTelemetry for CustomOnTelemetry {
fn on_telemetry(&self, _request_metrics: &RequestMetrics, _span: &tracing::Span) {
fn on_telemetry(&self, _request_metrics: &RequestMetrics, _operation: &str) {
metrics::counter!(self.metric_name.clone()).absolute(self.metric_value);
}
}
Expand Down

0 comments on commit 3000b47

Please sign in to comment.