aingle_observability/
open.rs

1pub use off::*;
2pub use context_wrap::MsgWrap;
3
4#[cfg(feature = "channels")]
5pub mod channel;
6mod context_wrap;
7
8#[allow(missing_docs)]
9mod off;
10
11/// Opentelemetry span extension trait.
12/// This trait provides helper methods to the
13/// [tracing::Span] for crossing thread and
14/// process boundaries.
15pub trait OpenSpanExt {
16    /// Get the context of this span.
17    fn get_context(&self) -> Context;
18    /// Get the context of the current span.
19    fn get_current_context() -> Context;
20    /// Get the context as message pack bytes for
21    /// sending over process boundaries.
22    fn get_context_bytes(&self) -> Vec<u8> {
23        Vec::with_capacity(0)
24    }
25    /// Get the current span as message pack bytes.
26    fn get_current_bytes() -> Vec<u8>;
27    /// Set the context of this span.
28    fn set_context(&self, context: Context);
29    /// Set the context of the current span.
30    fn set_current_context(context: Context);
31    #[allow(unused_variables)]
32    /// Set the context of this span from bytes over the network.
33    fn set_from_bytes(&self, bytes: Vec<u8>) {}
34    /// Set the current span context from message pack bytes.
35    fn set_current_bytes(bytes: Vec<u8>);
36    /// Display this spans context as a String.
37    fn display_context(&self) -> String;
38}