aboutsummaryrefslogtreecommitdiff
path: root/src/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client.rs b/src/client.rs
index e08b30b..d6caf68 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -14,7 +14,7 @@ use tokio_util::compat::*;
#[cfg(feature = "telemetry")]
use opentelemetry::{
trace::{FutureExt, Span, SpanKind, TraceContextExt, Tracer},
- Context,
+ Context, KeyValue,
};
#[cfg(feature = "telemetry")]
use opentelemetry_contrib::trace::propagator::binary::*;
@@ -136,7 +136,7 @@ impl ClientConn {
cfg_if::cfg_if! {
if #[cfg(feature = "telemetry")] {
let tracer = opentelemetry::global::tracer("netapp");
- let span = tracer.span_builder(format!("RPC >> {}", path))
+ let mut span = tracer.span_builder(format!("RPC >> {}", path))
.with_kind(SpanKind::Server)
.start(&tracer);
let propagator = BinaryPropagator::new();
@@ -174,6 +174,10 @@ impl ClientConn {
}
trace!("request: query_send {}, {} bytes", id, bytes.len());
+
+ #[cfg(feature = "telemetry")]
+ span.set_attribute(KeyValue::new("len_query", bytes.len() as i64));
+
query_send.send((id, prio, bytes))?;
cfg_if::cfg_if! {