pub struct Link {
pub trace_id: Vec<u8>,
pub span_id: Vec<u8>,
pub trace_state: String,
pub attributes: Vec<KeyValue>,
pub dropped_attributes_count: u32,
pub flags: u32,
}
gen-tonic-messages
and trace
only.Expand description
A pointer from the current span to another span in the same trace or in a different trace. For example, this can be used in batching operations, where a single batch handler processes multiple requests from different traces or when the handler receives a request from a different project.
Fields§
§trace_id: Vec<u8>
A unique identifier of a trace that this linked span is part of. The ID is a 16-byte array.
span_id: Vec<u8>
A unique identifier for the linked span. The ID is an 8-byte array.
trace_state: String
The trace_state associated with the link.
attributes: Vec<KeyValue>
attributes is a collection of attribute key/value pairs on the link. Attribute keys MUST be unique (it is not allowed to have more than one attribute with the same key).
dropped_attributes_count: u32
dropped_attributes_count is the number of dropped attributes. If the value is 0, then no attributes were dropped.
flags: u32
Flags, a bit field.
Bits 0-7 (8 least significant bits) are the trace flags as defined in W3C Trace
Context specification. To read the 8-bit W3C trace flag, use
flags & SPAN_FLAGS_TRACE_FLAGS_MASK
.
See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions.
Bits 8 and 9 represent the 3 states of whether the link is remote.
The states are (unknown, is not remote, is remote).
To read whether the value is known, use (flags & SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK) != 0
.
To read whether the link is remote, use (flags & SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK) != 0
.
Readers MUST NOT assume that bits 10-31 (22 most significant bits) will be zero. When creating new spans, bits 10-31 (most-significant 22-bits) MUST be zero.
[Optional].
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Link
impl<'de> Deserialize<'de> for Link
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Message for Link
impl Message for Link
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.impl StructuralPartialEq for Link
Auto Trait Implementations§
impl Freeze for Link
impl RefUnwindSafe for Link
impl Send for Link
impl Sync for Link
impl Unpin for Link
impl UnwindSafe for Link
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request