Skip to main content

Module observability

Module observability 

Source
Expand description

Sentry and tracing, initialised in the one order that works.

sentry::init binds its hub to the calling thread; threads spawned afterwards inherit it. #[tokio::main] spawns its workers before running the body of main, so initialising there never reaches them and every error raised on a worker is dropped. Hence: initialise on the main thread, then build the runtime — which is what bootstrap does.

ObservabilityGuard flushes on drop, so it must outlive the server.

Structs§

Observability
How this process reports errors and logs.
ObservabilityGuard
Keeps error monitoring alive, and flushes it on drop. Bind it to _guard, never _, which would drop it immediately.

Enums§

ObservabilityError
Why observability could not be configured.

Constants§

DEFAULT_LOG_FILTER
The log filter fallback when RUST_LOG is unset.
ENV_SENTRY_DSN
The environment variable holding the Sentry DSN.
UNKNOWN_RELEASE
The release string used when the application does not name itself.