You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: shared/telemetry/README.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ Every event carries a fixed allowlist enforced by `lib/events.js`. Field names m
34
34
35
35
-`pluginName`, `pluginVersion` — read from the plugin's `.claude-plugin/plugin.json`
36
36
-`sessionId` — random UUID generated once per Node process; not persisted
37
-
-`correlationId` — a per-start unique ID generated inline at emit time (it no longer joins events; `skill_completed` is no longer emitted)
37
+
-`correlationId` — a per-start unique ID generated inline at emit time
38
38
-`osName`, `osVersion` — `process.platform` and OS release string
39
39
-`nodeVersion` — major version only, e.g. `v22`
40
40
@@ -47,14 +47,13 @@ Every event carries a fixed allowlist enforced by `lib/events.js`. Field names m
47
47
**Per-event:**
48
48
49
49
-`skillName` (on every event)
50
-
-`outcome` (`success` | `failure`), `durationMs` (int), `errorClass` (Error constructor name only), `errorDescription` (`err.code` only) — **defined for `skill_completed`, which is no longer emitted.** The `buildSkillCompleted` builder and these fields remain in `lib/events.js` (dormant, not wired to any hook).
51
50
-`eventInfo` — caller-supplied JSON object (dynamic Kusto column). The caller is responsible for not putting PII in this payload.
52
51
53
52
## What is NEVER sent
54
53
55
54
File paths, cwd, env vars (except the telemetry kill switch), site names, Dataverse URLs, stack traces, `err.message` text, skill arguments, tool inputs, prompt text, usernames, hostnames.
56
55
57
-
`errorClass` is the `Error` constructor name only (e.g. `TypeError`). `errorDescription` is restricted to `err.code` (e.g. `ENOENT`, `ECONNREFUSED`) — the free-form `err.message` is never emitted because it can contain file paths, GUIDs, or other user context. The dispatcher also runs a defense-in-depth allowlist filter against `FIELD_TYPES` before serializing, so any field that bypasses the builders is dropped before it reaches the wire.
56
+
The dispatcher runs a defense-in-depth allowlist filter against `FIELD_TYPES` before serializing, so any field that bypasses the builders is dropped before it reaches the wire.
In `plugins/<your-plugin>/hooks/hooks.json`, register the three hook scripts that ship with this library pattern. The Power Pages plugin's `hooks.json` is the reference example. Copy these three hook entry points into your `hooks/` directory:
123
122
124
123
-`run-skill-pretool-telemetry.js` — emits `skill_started` on `PreToolUse(Skill)`
125
-
-`run-skill-posttool-validation.js` — runs your validator on `PostToolUse(Skill)` (no telemetry emission)
124
+
-`run-skill-posttool-validation.js` — runs your validator on `PostToolUse(Skill)`
126
125
-`run-user-prompt-telemetry.js` — emits `skill_started` on `UserPromptSubmit` when the prompt is a tracked `/plugin:skill` slash command
127
126
128
127
These hooks must call out to your plugin's `scripts/lib/<plugin>-hook-utils.js` for the tracked-skill list. Adapt the imports to your plugin's layout.
0 commit comments