Skip to main content

Crate teksilo_analytics_plausible

Crate teksilo_analytics_plausible 

Source
Expand description

teksilo-analytics-plausible — Plausible adapter for teksilo-telemetry.

Privacy posture: anonymous-by-design. The adapter transmits no client-side identifier, no UUID, no fingerprint. Plausible derives a per-day session hash server-side from X-Forwarded-For + User-Agent + a daily- rotating server-held salt; this scheme is on the CNIL consent-exempt audience-measurement list.

ⓘ
use teksilo_analytics_plausible::PlausibleAdapter;
use teksilo_telemetry::{TelemetryBundle, TelemetryMode, UsageReporter};
use std::rc::Rc;

let plausible = PlausibleAdapter::builder()
    .endpoint("https://plausible.io/api/event")
    .domain("skribisto.app")
    .build();

let telemetry = TelemetryBundle::new(EVENT_SCHEMA_VERSION)
    .with_anonymous(Rc::new(plausible) as Rc<dyn UsageReporter>)
    .with_default_mode(TelemetryMode::Anonymous);

Adapter lifecycle:

  1. PlausibleAdapter::builder().build() spawns a worker thread that owns the in-flight buffer and the HTTP client.
  2. record(event) converts to OwnedEvent and sends through a channel to the worker. Non-blocking — the UI thread never waits on HTTP.
  3. The worker batches up to max_batch_size events or flushes every flush_interval and POSTs to the configured endpoint.
  4. Failed requests are retried with exponential backoff (capped at max_backoff).
  5. Drop signals the worker, blocks for graceful shutdown flush. Pending events are best-effort flushed on exit.

Structs§

PlausibleAdapter
Plausible-backed UsageReporter.
PlausibleAdapterBuilder
PlausibleConfig
Static configuration for the Plausible adapter.
PlausibleEvent