Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

Telemetry facade. Currently wraps Sentry. Designed for extraction to docspec-telemetry when (a) OpenTelemetry is added, OR (b) docspec-cli wants Sentry, OR (c) Prometheus metrics land. Keep the public API surface stable and free of HTTP-specific types.

Modules§

posthog
PostHog telemetry backend.
sentry
Sentry telemetry backend internals.

Structs§

TelemetryGuard
Keeps the telemetry client alive until shutdown so buffered events can flush.

Functions§

init
Initializes telemetry from the configured environment and returns its guard.
init_posthog_client_from_env
Constructs a PostHog client from environment variables and returns it wrapped in an Arc.
install_posthog_client
Installs client into the shared PostHog slot, replacing any previous value.
posthog_client_slot
Returns a reference to the shared PostHog client slot.
shutdown
Flushes the PostHog client, waiting for in-flight events to drain.
tower_http_layer
Returns a tower HTTP layer that enriches Sentry events when telemetry is initialized.
tower_new_layer
Returns a tower layer that binds a Sentry hub to each request when telemetry is initialized.
tracing_layer
Returns a Sentry tracing layer when telemetry is initialized.