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§

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.

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.

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.

Set the sampling decision for this Transaction.

This can be either an explicit boolean flag, or None, which will fall back to use the configured traces_sample_rate option.

Get the sampling decision for this Transaction.

Get the name of this Transaction.

Get the operation of this Transaction.

Get the Trace ID of this Transaction.

Get the custom context of this Transaction.

Update the custom context of this Transaction.

For simply adding a key, use the custom_insert method.

Inserts a key-value pair into the custom context.

If the context did not have this key present, None is returned.

If the context did have this key present, the value is updated, and the old value is returned.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.