Skip to main content

Crate openauth_telemetry

Crate openauth_telemetry 

Source
Expand description

Telemetry collection compatible with Better Auth @better-auth/telemetry (v1.6.9).

§Environment variables

All telemetry-related variables use the OPENAUTH_* prefix:

PurposeVariable
Master switchOPENAUTH_TELEMETRY
Debug logging (prints JSON instead of POST)OPENAUTH_TELEMETRY_DEBUG
Collector URLOPENAUTH_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 (None unless overridden in tests).
  • get_telemetry_auth_config emits Better Auth-shaped JSON; many branches are static defaults until matching fields exist on openauth_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 reqwest when the http feature 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§

TelemetryPublisher
Live telemetry handle (Self::publish is 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