File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
docs/platforms/rust/guides/tracing Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ fn main() {
59
59
. with (sentry_layer )
60
60
. init ();
61
61
62
- // Futures need to be bound to a Hub
62
+ // Futures should to be bound to a Hub
63
63
// Learn more at https://docs.rs/sentry-core/latest/sentry_core/#parallelism-concurrency-and-async
64
64
fail (). bind_hub (sentry :: Hub :: current ()). await ;
65
65
}
@@ -68,18 +68,21 @@ fn main() {
68
68
#[tracing:: instrument] // Captures a root span (transaction) around this function execution
69
69
# ___PRODUCT_OPTION_END___ performance
70
70
async fn fail () {
71
+ tracing :: debug! (" Doing work" ); // Adds a breadrcumb
71
72
# ___PRODUCT_OPTION_START___ performance
72
73
let _span = tracing :: info_span (" Child span" ). entered (); // Captures a child span
73
74
# ___PRODUCT_OPTION_END___ performance
74
75
tracing :: error! (" Everything is on fire!" );
75
76
}
76
77
```
77
78
79
+ By default, error level events are captured as Sentry events, while anything at or above info is added as a breadcrumb.
80
+
78
81
{ /* ___PRODUCT_OPTION_START___ logs */ }
79
82
80
- To capture logs for ` tracing ` events, you need to set up a custom event filter, like so:
83
+ To capture structured logs for ` tracing ` events instead , you need to set up the Sentry layer with a custom event filter that maps to logs , like so:
81
84
82
- ``` rs
85
+ ``` rust
83
86
use sentry :: integrations :: tracing :: EventFilter ;
84
87
85
88
sentry :: integrations :: tracing :: layer (). event_filter (| md | match * md . level () {
You can’t perform that action at this time.
0 commit comments