@open-infra/telemetry-tauri
v0.2.0
Published
Consent-aware Tauri command tracing and W3C context propagation into a companion Rust bridge.
Maintainers
Readme
@open-infra/telemetry-tauri
Connects consented webview command spans to Rust child spans using W3C trace context. The existing browser runtime owns the JavaScript providers and export policy. The application owns the Rust subscriber/exporter.
import { createTauriTelemetry } from '@open-infra/telemetry-tauri';
const desktop = createTauriTelemetry(browserRuntime, { commands: ['save_document'] });
const result = await desktop.invoke<string>('save_document', { document: appData });
await desktop.flush();Only allowlisted commands are instrumented. Payloads and return values are never recorded. Unknown commands, ungranted consent, inactive runtimes and calls that already carry a telemetryContext argument preserve normal invocation without injected telemetry. The allowlist is capped at 128 entries. Importing the adapter does not start providers.
The tarball includes the companion Rust crate in rust/. Add it as a Cargo path dependency, register NativeTelemetryConsent as application state, and accept an optional CommandTelemetryContext argument in instrumented commands. A trusted application-owned consent command sets the native epoch on grant and clears it on denial/revocation; untrusted command payloads must not grant native consent. See rust/README.md for the wrapper. This context bridge does not install exporters, implement crash capture, or enforce privacy inside arbitrary application-owned Rust instrumentation. The Rust crate is not published on crates.io by this npm release.
Tauri command documentation: https://v2.tauri.app/develop/calling-rust/
