pub struct SentryHttpLayer { /* private fields */ }
tower
only.Expand description
Tower Layer that captures Http Request information.
The Service created by this Layer can optionally start a new performance monitoring transaction for each incoming request, continuing the trace based on incoming distributed tracing headers.
The created transaction will automatically use the request URI as its name.
This is sometimes not desirable in case the request URI contains unique IDs
or similar. In this case, users should manually override the transaction name
in the request handler using the Scope::set_transaction
method.
By default, the service will filter out potentially sensitive headers from the captured
requests. By enabling with_pii
, you can opt in to capturing all headers instead.
Implementations§
Source§impl SentryHttpLayer
impl SentryHttpLayer
Sourcepub fn new() -> SentryHttpLayer
pub fn new() -> SentryHttpLayer
Creates a new Layer that only captures request information.
If a client is bound to the main Hub (i.e. the SDK has already been initialized), set with_pii
based on the send_default_pii
client option.
Sourcepub fn with_transaction() -> SentryHttpLayer
👎Deprecated since 0.38.0: please use enable_transaction
instead
pub fn with_transaction() -> SentryHttpLayer
enable_transaction
insteadCreates a new Layer which starts a new performance monitoring transaction for each incoming request.
Sourcepub fn enable_transaction(self) -> SentryHttpLayer
pub fn enable_transaction(self) -> SentryHttpLayer
Enable starting a new performance monitoring transaction for each incoming request.
Sourcepub fn enable_pii(self) -> SentryHttpLayer
pub fn enable_pii(self) -> SentryHttpLayer
Include PII in captured requests. Potentially sensitive headers are not filtered out.
Trait Implementations§
Source§impl Clone for SentryHttpLayer
impl Clone for SentryHttpLayer
Source§fn clone(&self) -> SentryHttpLayer
fn clone(&self) -> SentryHttpLayer
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more