pub enum TransactionOrSpan {
Transaction(Transaction),
Span(Span),
}Expand description
A wrapper that groups a Transaction and a Span together.
Variants§
Implementations§
Source§impl TransactionOrSpan
impl TransactionOrSpan
Sourcepub fn set_data(&self, key: &str, value: Value)
pub fn set_data(&self, key: &str, value: Value)
Set some extra information to be sent with this Transaction/Span.
Sourcepub fn get_trace_context(&self) -> TraceContext
pub fn get_trace_context(&self) -> TraceContext
Get the TransactionContext of the Transaction/Span.
Note that this clones the underlying value.
Sourcepub fn get_status(&self) -> Option<SpanStatus>
pub fn get_status(&self) -> Option<SpanStatus>
Set the status of the Transaction/Span.
Sourcepub fn set_status(&self, status: SpanStatus)
pub fn set_status(&self, status: SpanStatus)
Set the status of the Transaction/Span.
Sourcepub fn set_request(&self, request: Request)
pub fn set_request(&self, request: Request)
Set the HTTP request information for this Transaction/Span.
Sourcepub fn iter_headers(&self) -> TraceHeadersIter ⓘ
pub fn iter_headers(&self) -> TraceHeadersIter ⓘ
Returns the headers needed for distributed tracing.
Use crate::Scope::iter_trace_propagation_headers to obtain the active
trace’s distributed tracing headers.
Sourcepub fn is_sampled(&self) -> bool
👎Deprecated: the returned value may not accurately represent the sampling decision
pub fn is_sampled(&self) -> bool
the returned value may not accurately represent the sampling decision
Get the sampling decision for this Transaction/Span.
The returned bool does not fully represent the sampling state of this
Transaction/Span. Although true reliably indicates that the
Transaction/Span is sampled, a value of false can mean either that the
Transaction/Span is not sampled, or that tracing is disabled and the
sampling decision is deferred. This method therefore should no longer be
used, especially not for trace continuation purposes.
For trace propagation, use Self::iter_headers or
crate::Scope::iter_trace_propagation_headers instead, to ensure
correct results.
Sourcepub fn start_child(&self, op: &str, description: &str) -> Span
pub fn start_child(&self, op: &str, description: &str) -> Span
Starts a new child Span with the given op and description.
The span must be explicitly finished via Span::finish, as it will
otherwise not be sent to Sentry.
Sourcepub fn start_child_with_details(
&self,
op: &str,
description: &str,
id: SpanId,
timestamp: SystemTime,
) -> Span
pub fn start_child_with_details( &self, op: &str, description: &str, id: SpanId, timestamp: SystemTime, ) -> Span
Starts a new child Span with the given op, description and id.
The span must be explicitly finished via Span::finish, as it will
otherwise not be sent to Sentry.
Sourcepub fn finish_with_timestamp(self, timestamp: SystemTime)
pub fn finish_with_timestamp(self, timestamp: SystemTime)
Finishes the Transaction/Span with the provided end timestamp.
This records the end timestamp and either sends the inner Transaction
directly to Sentry, or adds the Span to its transaction.
Sourcepub fn finish(self)
pub fn finish(self)
Finishes the Transaction/Span.
This records the current timestamp as the end timestamp and either sends the inner Transaction
directly to Sentry, or adds the Span to its transaction.