Struct sentry::TransactionContext
source · [−]pub struct TransactionContext { /* private fields */ }
Expand description
The Transaction Context used to start a new Performance Monitoring Transaction.
The Transaction Context defines the metadata for a Performance Monitoring Transaction, and also the connection point for distributed tracing.
Implementations
sourceimpl TransactionContext
impl TransactionContext
sourcepub fn new(name: &str, op: &str) -> TransactionContext
pub fn new(name: &str, op: &str) -> TransactionContext
Creates a new Transaction Context with the given name
and op
.
See https://docs.sentry.io/platforms/native/enriching-events/transaction-name/
for an explanation of a Transaction’s name
, and
https://develop.sentry.dev/sdk/performance/span-operations/ for conventions
around an operation
’s value.
See also the TransactionContext::continue_from_headers
function that
can be used for distributed tracing.
sourcepub fn continue_from_headers<'a, I>(
name: &str,
op: &str,
headers: I
) -> TransactionContext where
I: IntoIterator<Item = (&'a str, &'a str)>,
pub fn continue_from_headers<'a, I>(
name: &str,
op: &str,
headers: I
) -> TransactionContext where
I: IntoIterator<Item = (&'a str, &'a str)>,
Creates a new Transaction Context based on the distributed tracing headers
.
The headers
in particular need to include the sentry-trace
header,
which is used to associate the transaction with a distributed trace.
sourcepub fn continue_from_span(
name: &str,
op: &str,
span: Option<TransactionOrSpan>
) -> TransactionContext
pub fn continue_from_span(
name: &str,
op: &str,
span: Option<TransactionOrSpan>
) -> TransactionContext
Creates a new Transaction Context based on an existing Span.
This should be used when an independent computation is spawned on another thread and should be connected to the calling thread via a distributed tracing transaction.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TransactionContext
impl Send for TransactionContext
impl Sync for TransactionContext
impl Unpin for TransactionContext
impl UnwindSafe for TransactionContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more