Skip to main content

Module telemetry_aggregate

Module telemetry_aggregate 

Source
Expand description

Privacy-safe daily telemetry aggregation.

Every UTC day keeps cumulative totals. A send carries the full totals of today (and of any closed day with unsent activity) under that day’s bucket. The server replaces per-day rows, so sending several times a day is idempotent: tool usage reaches the server within the day, and a one-day user is counted without having to come back.

Structs§

DailySendLease

Enums§

SendTrigger
What prompted a send attempt.

Constants§

DAILY_SEND_CAP
Most send attempts per installation and UTC day: a snapshot every half hour of a day in use. The server admits sixty (from Oct 2026; ten before); the rest stays in reserve for retries and clock skew between client and server.

Functions§

begin_daily_send
Hold the cross-process state lease until network, ledger, and acknowledgement finish. Refuses while the next send is not yet due.
begin_send
Admission and payload resolve one clock reading under the aggregate lock, so competing senders cannot both pass a stale caller-side precheck.
build_daily_heartbeat
last_sent_bucket
pending_daily_batch
persist_process_counters
Persist this process’s unsent tool counters so they survive process exit and reach the next daily batch. While telemetry is disabled the counters are skipped instead, so re-enabling never back-fills opted-out activity.
preview_daily_batch
Build the exact currently eligible payload without advancing durable state.
purge_local_state
purge_local_state_then
record_autopilot_decisions
record_autopilot_fallback
record_checkout_started
record_current_version
record_error_category
record_feature
Counts one use of a registry feature (core::telemetry_features) for today; ok = false also counts a failure. Invalid codes are ignored.
record_feature_counts
Adds (code, count, failures) tallies for today in one locked write. Invalid codes and empty tallies are ignored.
record_setup_completion
record_sync_result
rotate_identity_state_then