11# telemetry
22
3- Plugin analytics as a plugin: one ` engine.create ` step adds ` $.telemetry `
4- to the engine interface every plugin above it is handed, built over the
3+ Plugin analytics as a plugin: one ` engine.create ` step adds ` $.telemetry ` to
4+ the engine interface every plugin above it is handed, built over the
55` $.session ` and ` $.http ` nouns beneath. ` $.telemetry.log({ event, props }) `
66sends one event as one first-party row, ` tengu_plugin_<event> ` ;
7- ` $.telemetry.mark({ feature, kind, reason? }) ` marks one use of a feature as
8- the CLI's own feature events do, ` tengu_feature_<kind> ` with a
9- ` feature_name ` . Each call is one POST to the event-logging ingest with the
10- session's own credential (` $.session.authorize() ` , resolved at each call),
11- one attempt, nothing batched; a session with no first-party credential, or
12- an ingest that refuses, rejects the caller's promise.
7+ ` $.telemetry.mark({ feature, kind, reason?, props? }) ` marks one use of a
8+ feature as the CLI's own feature events do, ` tengu_feature_<kind> ` with a
9+ ` feature_name ` and the mark's properties beside it. Each call is one POST to
10+ the event-logging ingest with the session's own credential
11+ (` $.session.authorize() ` , resolved at each call), one attempt, nothing
12+ batched; a session with no first-party credential, or an ingest that
13+ refuses, rejects the caller's promise.
1314
1415It sends nothing wherever the CLI's own analytics are off: under
1516` DISABLE_TELEMETRY ` , ` CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC ` or
@@ -22,9 +23,10 @@ to a third-party provider or a cloud gateway sends nothing more. The row's
2223
2324Nothing free-form reaches a row. An event name and every property key is a
2425snake_case token; a value is a finite number, a boolean, or a Choice (a
25- string named together with the list it is chosen from); ` mark ` takes ` ok ` ,
26- ` sad ` or ` bad ` , with a ` reason ` required on the last two and refused on the
27- first. An entry that breaks a rule is refused before anything is sent.
26+ string named together with the list it is chosen from), under ` log ` and
27+ ` mark ` alike; ` mark ` takes ` ok ` , ` sad ` or ` bad ` , with a ` reason ` required on
28+ the last two and refused on the first. An entry that breaks a rule is
29+ refused before anything is sent.
2830
2931` hooks/register.ts ` is the module; ` hooks/telemetry-types/ ` is the noun's
3032type as a caller sees it.
0 commit comments