Telemetry
Anonymous usage telemetry switches.
Anonymous usage telemetry switches.
What is collected and never collected: Telemetry and privacy. These calls read and change the same switches as cua telemetry; the SDK records its own events.
telemetry_status#Telemetry state, and exactly what every event carries.
def telemetry_status() -> TelemetryStatusReturns TelemetryStatus
telemetry_set_enabled#Turns usage telemetry on or off for this machine ($CUA_HOME/config.toml,
the same switch as cua telemetry off and the Spaces app setting). The
environment (DO_NOT_TRACK, CUA_TELEMETRY) still wins.
def telemetry_set_enabled(enabled: bool) -> TelemetryStatus| Parameter | Type | Default |
|---|---|---|
enabled | bool | required |
Returns TelemetryStatus · Raises CuaError
telemetry_show_last#The last limit events queued or sent from this machine, exactly as
sent, as JSON ([{status, payload}]).
def telemetry_show_last(limit: int) -> str| Parameter | Type | Default |
|---|---|---|
limit | u32 | required |
Returns String
telemetry_schema_json#Every event and property that may be sent, as JSON.
def telemetry_schema_json() -> strReturns String
telemetry_reset_id#Deletes the anonymous install id and its salt.
def telemetry_reset_id() -> NoneRaises CuaError
StreamStatsReport record#One stream session's aggregate stats (sampled).
| Field | Type | Default | Description |
|---|---|---|---|
transport | String | quic, webrtc, websocket or grpc. | |
codec | String | h264, hevc, av1, vp8, vp9, jpeg or png. | |
hw_decode / hwDecode | Option<bool> | Hardware decode (None: not decoded here). | |
avg_fps / avgFps | f64 | ||
p95_latency_ms / p95LatencyMs | Option<f64> | p95 input-to-present or control round trip, ms. | |
height | u32 | Stream height in pixels. | |
duration_ms / durationMs | u64 |
TelemetryStatus record#Telemetry state.
Returned by telemetry_set_enabled, telemetry_status.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | Usage events may be sent. | |
source | String | Why (env CUA_TELEMETRY, env DO_NOT_TRACK, config <path>, CI environment ..., default). | |
source_kind / sourceKind | String | do_not_track, env, legacy_env, config, ci or default. | |
is_ci / isCi | bool | Running in CI. | |
install_id / installId | Option<String> | The first 8 characters of the anonymous install id, if one exists. | |
notice_shown / noticeShown | bool | The first-run notice was shown on this machine. | |
endpoint | String | Where batches go. | |
product | String | Which Cua program events are attributed to. | |
envelope_json / envelopeJson | String | The exact properties every event carries, as JSON. |
telemetry_acknowledge_notice#Records that the first-run notice was shown in the app's UI (nothing is
sent from a machine before that). Apps that show the notice themselves
call telemetry_use_app_notice first so the SDK does not print it.
def telemetry_acknowledge_notice() -> Nonetelemetry_flush#Sends queued events now, waiting at most timeout_ms; anything left
is kept on disk for a later process.
def telemetry_flush(timeout_ms: int) -> None| Parameter | Type | Default |
|---|---|---|
timeout_ms | u32 | required |
telemetry_notice_text#The first-run notice text (an app shows it in its own UI, then calls
telemetry_acknowledge_notice).
def telemetry_notice_text() -> strReturns String
telemetry_record_bench_run#Records a finished cua-bench run: the taskset (catalog name, else
custom), the aggregate success rate (0 to 1, bucketed), the task count
(bucketed) and the outcome (ok, error, cancelled).
def telemetry_record_bench_run(taskset: str, success_rate: Optional[float], task_count: int, outcome: str) -> bool| Parameter | Type | Default |
|---|---|---|
taskset | String | required |
success_rate | Option<f64> | required |
task_count | u64 | required |
outcome | String | required |
Returns bool
telemetry_record_feature#Records use of a Spaces app feature (fixed names: space_create_local,
teleport_drop, ... see the docs). Returns whether it was queued;
unknown names are dropped.
def telemetry_record_feature(feature: str) -> bool| Parameter | Type | Default |
|---|---|---|
feature | String | required |
Returns bool
telemetry_record_onboarding_step#Records an install or onboarding funnel step (fixed names:
onboarding_shown, signed_in, first_space_created, ...; first_*
steps count once per install). Returns whether it was queued.
def telemetry_record_onboarding_step(step: str, ok: bool) -> bool| Parameter | Type | Default |
|---|---|---|
step | String | required |
ok | bool | required |
Returns bool
telemetry_record_stream_stats#Records one stream session's aggregate stats (bucketed and sampled).
def telemetry_record_stream_stats(stats: StreamStatsReport) -> bool| Parameter | Type | Default |
|---|---|---|
stats | StreamStatsReport | required |
Returns bool
telemetry_set_surface#Names the SDK surface events are attributed to. Bindings call it at
import: sdk_python, sdk_typescript, sdk_swift, sdk_kotlin;
apps pass their own product (spaces_app). Unknown names are ignored.
def telemetry_set_surface(surface: str, version: str) -> None| Parameter | Type | Default |
|---|---|---|
surface | String | required |
version | String | required |
telemetry_use_app_notice#The host app shows the first-run notice itself (no stderr notice).
def telemetry_use_app_notice() -> None