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§
Structs§
- Telemetry
Guard - 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
PostHogclient from environment variables and returns it wrapped in anArc. - install_
posthog_ client - Installs
clientinto the sharedPostHogslot, replacing any previous value. - posthog_
client_ slot - Returns a reference to the shared
PostHogclient slot. - shutdown
- Flushes the
PostHogclient, 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.