You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most convenient way to use this library is the `sentry::init` function, which starts a Sentry client with a default set of integrations, and binds it to the current Hub.
34
34
35
-
The `sentry::init` function returns a guard that, when dropped, will flush Events that were not yet sent to the Sentry service. It has a twosecond deadline for this, so shutdown of applications might slightly delay as a result. Keeping the guard around or sending events will not work.
35
+
The `sentry::init` function returns a guard that when dropped, will flush Events that weren't yet sent to Sentry. It has a two-second deadline, so application shutdown may be slightly delayed as a result. Be sure to keep the guard or you won't be able to send events.
36
36
37
37
<SignInNote />
38
38
@@ -43,7 +43,44 @@ let _guard = sentry::init(("___PUBLIC_DSN___", sentry::ClientOptions {
43
43
}));
44
44
```
45
45
46
-
**Important:** Note your DSN. The DSN (Data Source Name) tells the SDK where to send events. If you forget it, view Settings -> Projects -> Client Keys (DSN) in sentry.io.
46
+
**Important:** Remember your DSN. The DSN (Data Source Name) tells the SDK where to send events. If you forget it you can find it be going to: Settings -> Projects -> Client Keys (DSN) in sentry.io.
47
+
48
+
### Async Main Function
49
+
50
+
In a multithreaded application, spawned threads should inherit the Hub from the main thread. In order for that to happen, the Sentry client must be initialized before starting an async runtime or spawning threads. This means you'll have to avoid using macros such as `#[tokio::main]` or `#[actix_web::main]`, because they start the runtime first. So rather than doing this:
0 commit comments