Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

Sentry telemetry — opt-in error/panic reporting.

Disabled by default. Operators enable it by setting SENTRY_DSN (and optionally SENTRY_ENVIRONMENT) before launching the worker. Nothing is hard-coded so the public repo never carries a DSN.

Wiring:

  • init() reads env vars, constructs SentryConfig, and calls sentry::init. The returned ClientInitGuard must live for the entire program — main.rs keeps it in a binding that drops on shutdown, flushing any in-flight events.
  • tracing_layer() returns a sentry-tracing layer that maps error -> Sentry event, warn -> breadcrumb, lower -> ignored. Layered into the global tracing-subscriber registry in main.rs.

Panic capture is on by default (the panic feature is part of sentry’s default feature set).

Structs§

SentryConfig
Fully-resolved Sentry client configuration. Built either from the host environment (from_env) or — in tests — by passing inputs directly to from_env_inner.

Functions§

build_client_options
Build the sentry::ClientOptions for a resolved config. Returns None (and leaves a tracing warning) when the DSN string can’t be parsed — split out from init so we can exercise both branches without mutating global Sentry state.
init
Initialise Sentry from the process environment.
tracing_layer
Build the sentry-tracing layer with our chosen severity mapping.