Expand description
Telemetry collection compatible with Better Auth @better-auth/telemetry (v1.6.9).
§Environment variables
All telemetry-related variables use the OPENAUTH_* prefix:
| Purpose | Variable |
|---|---|
| Master switch | OPENAUTH_TELEMETRY |
| Debug logging (prints JSON instead of POST) | OPENAUTH_TELEMETRY_DEBUG |
| Collector URL | OPENAUTH_TELEMETRY_ENDPOINT |
Unless OPENAUTH_TELEMETRY_ENDPOINT is set or TelemetryContext::custom_track is provided, the publisher is a no-op: nothing is sent over the network. The maintainer of OpenAuth does not receive telemetry by default; whoever deploys the app chooses the endpoint (their own collector, internal analytics, etc.) or wires custom_track.
§Intentional gaps vs upstream
- Framework detection is stubbed to Axum until HTTP stack sniffing exists.
- Database detection from manifests is not implemented (
Noneunless overridden in tests). get_telemetry_auth_configemits Better Auth-shaped JSON; many branches are static defaults until matching fields exist onopenauth_core::options::OpenAuthOptions.- Runtime is reported as
rust(not Node/Bun/Deno). - System metrics (CPU, memory, Docker, WSL, TTY) are mostly unset (
null), matching the non-Node “edge” build of upstream telemetry. - HTTP: JSON POST uses
reqwestwhen thehttpfeature is enabled (default).
Re-exports§
pub use types::CustomTrackFn;pub use types::DetectionInfo;pub use types::RuntimeInfo;pub use types::TelemetryContext;pub use types::TelemetryEvent;pub use types::TelemetryHttpError;pub use types::TelemetryHttpTransport;pub use types::TelemetryTestHooks;
Modules§
- types
- Telemetry types shared with the Better Auth telemetry payload shape.
Structs§
- Telemetry
Publisher - Live telemetry handle (
Self::publishis a no-op when telemetry is disabled).
Constants§
- VERSION
- Current crate version.
Functions§
- create_
telemetry - Creates a telemetry publisher (possibly a hard no-op when neither endpoint nor custom track exist).
- get_
telemetry_ auth_ config