Skip to content

Commit 4d617f4

Browse files
authored
feat(telemetry): opt-in anonymous usage stats on a daily update ping (#128476)
* feat(telemetry): add opt-in anonymous usage reporting * docs(telemetry): document anonymous update and privacy controls * feat(telemetry): report show state as JSON Give the reporting command a machine-readable form and classify the group and mutations against the CLI JSON-output policy.
1 parent eef9aaa commit 4d617f4

49 files changed

Lines changed: 1803 additions & 335 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎VISION.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ We prioritize secure defaults, but also expose clear knobs for trusted high-powe
6060

6161
Privacy follows the same default rule.
6262
OpenClaw sends no usage analytics, tracking identifiers, or attribution tags unless the operator turned that on themselves.
63-
A change that needs such signals waits until an explicit user-facing opt-in exists for them.
63+
The setup wizard offers optional anonymous feature statistics, with no selected by default; the daily update check reports version and platform and can be disabled.
64+
See [Usage telemetry and update checks](https://docs.openclaw.ai/gateway/telemetry).
6465

6566
## Plugins & Memory
6667

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"core": 2339,
2+
"core": 2342,
33
"channel": 3584,
44
"plugin": 3978
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
6768a9d1083664a60bea75df4ac606b761760ed1deb4ffee00d39a8de8bcac88 config-baseline.json
2-
e25fb219d62550bc05314e320cd66d0d9e4161e50ac89ac84606dcaae8719084 config-baseline.core.json
1+
ac6fc6872da112e588f289a5bdc713affb7f76c019031a93bdb7a34964a4ce44 config-baseline.json
2+
16f67f4b0b19b3863ee673ec5b5dd86c7d493e433f41ee949857fc6e6d594938 config-baseline.core.json
33
3300f931abce160c1d6768af1a358683b8f77af479e8b728aeefd38039a61507 config-baseline.channel.json
44
ed7c7e8dfe9d676ebbf60b5ee55f72d1f9e0286ffb37743f40f6c337816b166d config-baseline.plugin.json

‎docs/docs.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,6 +1677,7 @@
16771677
"gateway/heartbeat",
16781678
"gateway/doctor",
16791679
"gateway/audit",
1680+
"gateway/telemetry",
16801681
"logging",
16811682
"gateway/opentelemetry",
16821683
"gateway/prometheus",

‎docs/gateway/configuration-reference.md‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,26 @@ writer is best-effort, not a lossless compliance archive.
15181518

15191519
---
15201520

1521+
## Telemetry
1522+
1523+
```json5
1524+
{
1525+
telemetry: {
1526+
enabled: false,
1527+
consentedAt: "2026-08-02T12:00:00.000Z",
1528+
},
1529+
}
1530+
```
1531+
1532+
- `enabled`: include anonymous channel names, provider families, plugin count, and recent session count in the existing daily update-check request (default: `false`). Interactive setup offers an explicit opt-in with **No thanks** selected by default; non-interactive setup never enables it. `DO_NOT_TRACK=1` or `DO_NOT_TRACK=true` always disables feature statistics without disabling the update check.
1533+
- `consentedAt`: ISO timestamp recording when the operator accepted or declined feature statistics. Prevents interactive setup from asking again.
1534+
- `openclaw telemetry show` displays the exact current request; `openclaw telemetry on` and `openclaw telemetry off` update the preference and consent timestamp.
1535+
- `OPENCLAW_TELEMETRY_ENDPOINT`: optional full endpoint URL for testing or a self-hosted service. Defaults to `https://telemetry.openclaw.ai/api/latest-version`.
1536+
1537+
See [Usage telemetry and update checks](/gateway/telemetry) for the complete payload, privacy guarantees, and all opt-out controls.
1538+
1539+
---
1540+
15211541
## Update
15221542

15231543
```json5
@@ -1534,8 +1554,8 @@ writer is best-effort, not a lossless compliance archive.
15341554
```
15351555

15361556
- `channel`: release channel - `"stable"`, `"extended-stable"`, `"beta"`, or `"dev"`. Extended-stable is package-only: foreground commands own installation, while the Gateway may emit read-only update hints.
1537-
- `checkOnStart`: check for npm updates when the gateway starts (default: `true`). Stored extended-stable selections use the same read-only hint and 24-hour hint schedule.
1538-
- `auto.enabled`: enable background auto-update campaigns for stable and beta package installs and dev git installs (default: `false`). Extended-stable never applies automatically.
1557+
- `checkOnStart`: check for updates through `https://telemetry.openclaw.ai/api/latest-version` when the Gateway starts and at most once every 24 hours afterward (default: `true`). The default request shares only the OpenClaw version and platform information in its `User-Agent`; anonymous feature statistics are included only when `telemetry.enabled` is `true`. Setting this to `false`, or setting `OPENCLAW_NO_AUTO_UPDATE=1`, prevents all automatic update requests, feature statistics, and update notices, even when `auto.enabled` is `true`. Stored extended-stable selections use the same read-only hint and 24-hour hint schedule.
1558+
- `auto.enabled`: enable background auto-update campaigns for stable and beta package installs and dev git installs when `checkOnStart` is also enabled (default: `false`). Extended-stable never applies automatically.
15391559

15401560
---
15411561

‎docs/gateway/telemetry.md‎

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
---
2+
summary: "Understand daily update checks, optional anonymous feature statistics, and every privacy control"
3+
title: "Usage telemetry and update checks"
4+
read_when:
5+
- Checking what information OpenClaw sends during its daily update check
6+
- Enabling or disabling anonymous feature statistics
7+
- Disabling all automatic update-check requests
8+
---
9+
10+
OpenClaw checks for a newer version at most once every 24 hours. By default,
11+
this request includes only basic software and platform information. Anonymous
12+
feature statistics are sent only when you explicitly opt in, and they reuse the
13+
same request rather than creating a second one.
14+
15+
## Inspect what is sent
16+
17+
Run this command before or after changing your preference:
18+
19+
```bash
20+
openclaw telemetry show
21+
```
22+
23+
Add `--json` to get the same state and payload as one machine-readable
24+
document.
25+
26+
The output shows whether feature statistics are enabled, why they are enabled
27+
or disabled, the request endpoint, and the last successful check. When feature
28+
statistics are enabled, it prints the exact JSON payload the next request would
29+
send. When they are disabled, it shows the update-only request and its
30+
`User-Agent` header instead.
31+
32+
## Daily update check
33+
34+
The default request is:
35+
36+
```http
37+
GET https://telemetry.openclaw.ai/api/latest-version
38+
User-Agent: openclaw/2026.8.2 (darwin; node/26.0.1; arm64; gateway)
39+
```
40+
41+
The `User-Agent` contains the OpenClaw version, operating system, Node.js
42+
version, CPU architecture, and whether the request came from the Gateway or
43+
CLI. It has no request body, install identifier, machine identifier, or random
44+
tracking identifier.
45+
46+
The service responds with the latest version and, optionally, a short
47+
operator-facing note. OpenClaw displays an available update and its note through
48+
the existing update notice. Unreachable services, timeouts, invalid responses,
49+
and other failed checks do not interrupt startup or normal operation.
50+
51+
A successful response and its timestamp are cached in the existing shared state
52+
database. Startup reuses the cached result for the next 24 hours, and a running
53+
Gateway checks again during normal maintenance with a small random delay. Failed
54+
checks do not count as successful daily checks.
55+
56+
For testing or self-hosting, set `OPENCLAW_TELEMETRY_ENDPOINT` to your complete
57+
replacement endpoint URL. The public server source is available at
58+
[openclaw/telemetry](https://github.com/openclaw/telemetry).
59+
60+
## Optional anonymous feature statistics
61+
62+
Feature statistics are **off by default**. Interactive setup offers a one-time
63+
opt-in with **No thanks** selected by default. Non-interactive and scripted
64+
installations never opt in automatically. OpenClaw records when you accepted or
65+
declined so it does not ask again.
66+
67+
When you explicitly enable feature statistics, the same daily request becomes a
68+
`POST` with this complete JSON payload:
69+
70+
```json
71+
{
72+
"schema": 1,
73+
"version": "2026.8.2",
74+
"platform": "darwin-arm64",
75+
"node": "26.0.1",
76+
"surface": "gateway",
77+
"features": {
78+
"channels": ["discord", "telegram"],
79+
"providerFamilies": ["anthropic", "openai"],
80+
"pluginsEnabled": 7,
81+
"sessionsLast24h": 14
82+
}
83+
}
84+
```
85+
86+
| Field | Meaning |
87+
| --------------------------- | ------------------------------------------------------------------------- |
88+
| `schema` | Payload format version, currently `1`. |
89+
| `version` | Installed OpenClaw version. |
90+
| `platform` | Operating system and CPU architecture. |
91+
| `node` | Running Node.js version. |
92+
| `surface` | Request origin: `gateway` or `cli`. |
93+
| `features.channels` | Enabled channel plugin names, sorted alphabetically. |
94+
| `features.providerFamilies` | Configured provider names, sorted alphabetically; never model names. |
95+
| `features.pluginsEnabled` | Number of enabled plugins, without plugin names or configuration details. |
96+
| `features.sessionsLast24h` | Number of sessions observed during the preceding 24 hours. |
97+
98+
The sender and `openclaw telemetry show` use the same payload builder, so the
99+
JSON displayed by the CLI is the same payload the sender would use at that
100+
moment.
101+
102+
### What is never collected
103+
104+
Neither request tier includes message content, prompts, model names, API keys,
105+
credentials, secret references, file paths, hostnames, account identifiers,
106+
user identifiers, or installation and machine identifiers. OpenClaw does not
107+
create a random UUID or other persistent request identifier, so daily requests
108+
cannot be linked through an OpenClaw-issued identifier.
109+
110+
Anonymous feature statistics are separate from optional, operator-configured
111+
[OpenTelemetry export](/gateway/opentelemetry).
112+
113+
## Turn feature statistics on or off
114+
115+
Enable or disable anonymous feature statistics at any time:
116+
117+
```bash
118+
openclaw telemetry on
119+
openclaw telemetry off
120+
```
121+
122+
You can also configure the same preference directly:
123+
124+
```json5
125+
{
126+
telemetry: {
127+
enabled: false,
128+
},
129+
}
130+
```
131+
132+
Set `DO_NOT_TRACK=1` or `DO_NOT_TRACK=true` to force feature statistics off,
133+
even when `telemetry.enabled` is `true`. `DO_NOT_TRACK` does not disable the
134+
daily update check: OpenClaw sends the update-only `GET` request without a
135+
feature-statistics body.
136+
137+
## Disable every automatic update request
138+
139+
To go fully dark, disable the existing startup update check:
140+
141+
```json5
142+
{
143+
update: {
144+
checkOnStart: false,
145+
},
146+
}
147+
```
148+
149+
This stops both tiers and every automatic update request: no update request, no
150+
feature statistics, and no update notice, even when `update.auto.enabled` is
151+
`true`. Setting `OPENCLAW_NO_AUTO_UPDATE=1` also prevents automatic update
152+
requests and applies. Explicit update commands remain available when you choose
153+
to run them.
154+
155+
See [Configuration reference](/gateway/configuration-reference#telemetry) for
156+
the full `telemetry` configuration and
157+
[Update configuration](/gateway/configuration-reference#update) for the
158+
automatic update-check controls.

‎docs/install/updating.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,13 @@ Every failed apply ends the campaign so the UI does not remain on
322322
in the restart sentinel and surface after the Gateway returns; direct
323323
unsupervised failures remain in the running Gateway's logs.
324324

325-
`OPENCLAW_NO_AUTO_UPDATE=1` and external-supervisor mode disable automatic
326-
applies entirely. Startup update hints can still run unless
327-
`update.checkOnStart` is also disabled.
325+
`update.checkOnStart: false` disables all automatic update checks, feature
326+
statistics, and update notices, even when `update.auto.enabled` is `true`.
327+
`OPENCLAW_NO_AUTO_UPDATE=1` also disables automatic checks and applies.
328+
External-supervisor mode disables automatic applies; startup update hints can
329+
still run unless `update.checkOnStart` is also disabled. See
330+
[Usage telemetry and update checks](/gateway/telemetry) for the information
331+
sent by the daily check and optional anonymous feature statistics.
328332

329333
The gateway also logs an update hint on startup (disable with
330334
`update.checkOnStart: false`). Stored extended-stable selections use this

‎src/cli/command-catalog.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ export const cliCommandCatalog: readonly CliCommandCatalogEntry[] = [
187187
},
188188
route: { id: "status" },
189189
},
190+
{
191+
commandPath: ["telemetry"],
192+
policy: { configGuard: "skip", loadPlugins: "never", networkProxy: "bypass" },
193+
},
190194
{
191195
commandPath: ["health"],
192196
policy: {

‎src/cli/program/register.subclis-core.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ const entrySpecs: readonly CommandGroupDescriptorSpec<SubCliRegistrar>[] = [
120120
loadModule: () => import("../promos-cli.js"),
121121
exportName: "registerPromosCli",
122122
},
123+
{
124+
commandNames: ["telemetry"],
125+
loadModule: () => import("../telemetry-cli.js"),
126+
exportName: "registerTelemetryCli",
127+
},
123128
]),
124129
{
125130
commandNames: ["infer", "capability"],

‎src/cli/program/root-command-descriptions.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const JSON_NOT_APPLICABLE = {
5050
"system",
5151
"system heartbeat",
5252
"promos",
53+
"telemetry",
5354
"infer",
5455
"infer model",
5556
"infer model auth",
@@ -146,6 +147,8 @@ const JSON_NOT_APPLICABLE = {
146147
"uninstall",
147148
"backup enable",
148149
"backup disable",
150+
"telemetry on",
151+
"telemetry off",
149152
"config set",
150153
"mcp add",
151154
"mcp set",

0 commit comments

Comments
 (0)