diff options
author | Alex Auvolat <alex@adnab.me> | 2022-02-24 13:18:51 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-03-14 10:54:12 +0100 |
commit | f869ca625d025d8c52af405392d2081bd81437a8 (patch) | |
tree | b7ad1950afdde2ff9cd6caf1a932a6e5a27c9706 /src/rpc/rpc_helper.rs | |
parent | 0cc31ee16994d11f4446186c817d8492b0b54f6b (diff) | |
download | garage-f869ca625d025d8c52af405392d2081bd81437a8.tar.gz garage-f869ca625d025d8c52af405392d2081bd81437a8.zip |
Add spans to table calls, change span names in RPC
Diffstat (limited to 'src/rpc/rpc_helper.rs')
-rw-r--r-- | src/rpc/rpc_helper.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/rpc/rpc_helper.rs b/src/rpc/rpc_helper.rs index 4114724f..89225511 100644 --- a/src/rpc/rpc_helper.rs +++ b/src/rpc/rpc_helper.rs @@ -234,9 +234,23 @@ impl RpcHelper { let quorum = strategy.rs_quorum.unwrap_or(to.len()); let tracer = opentelemetry::global::tracer("garage"); - let mut span = tracer.start(format!("RPC {} to {}", endpoint.path(), to.len())); + let span_name = if strategy.rs_interrupt_after_quorum { + format!("RPC {} to {} of {}", endpoint.path(), quorum, to.len()) + } else { + format!( + "RPC {} to {} (quorum {})", + endpoint.path(), + to.len(), + quorum + ) + }; + let mut span = tracer.start(span_name); span.set_attribute(KeyValue::new("to", format!("{:?}", to))); span.set_attribute(KeyValue::new("quorum", quorum as i64)); + span.set_attribute(KeyValue::new( + "interrupt_after_quorum", + strategy.rs_interrupt_after_quorum.to_string(), + )); self.try_call_many_internal(endpoint, to, msg, strategy, quorum) .with_context(Context::current_with_span(span)) |