Skip to content

Commit 44016ce

Browse files
authored
docs(telemetry): add event inventory (#1000)
Catalog every emitted event in src/instrumentation/EVENTS.md (grouped by category, then signal kind) and round out CONVENTIONS.md privacy guidance. Closes #987
1 parent 2b0a27e commit 44016ce

2 files changed

Lines changed: 540 additions & 6 deletions

File tree

src/instrumentation/CONVENTIONS.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ lives here in `src/instrumentation`.
1515
- Numbers go in `measurements` (raw), never pre-bucketed into string properties.
1616
- Set attributes imperatively with `setProperty`/`setMeasurement`; never add a
1717
return value that exists only to be logged.
18-
- No secrets, tokens, query strings, or unbounded values in properties; routes
19-
go through `normalizeRoute`.
18+
- No secrets, tokens, query strings, file paths, or other unbounded user
19+
content in properties; routes go through `normalizeRoute`.
2020
- Let the framework set `result`; add a domain `outcome` only when an operation
2121
has several success modes. Errors go to a typed `error.type` union; non-error
2222
early exits call `markAborted`.
@@ -149,10 +149,18 @@ Coder's own pipeline, so a bare `cache_source` can't collide with a future OTel
149149

150150
## Safety
151151

152-
Never put tokens, credentials, full URLs with query strings, or unbounded user
153-
input into properties. Routes go through `normalizeRoute`
154-
(`src/logging/routeNormalization.ts`). Prefer a closed union over a free-form
155-
string for any property a dashboard groups by.
152+
Never put tokens, credentials, file paths, full URLs with query strings, or
153+
user-provided content (prompts, messages, titles) into properties. Routes go
154+
through `normalizeRoute` (`src/logging/routeNormalization.ts`). Prefer a closed
155+
union over a free-form string for any property a dashboard groups by, and keep
156+
metric attributes low-cardinality: every distinct value combination becomes its
157+
own series.
158+
159+
Identifying dimensions are deliberate, not default. `deployment_url`,
160+
`machine_id`, and `session_id` ride along in the session context, so events
161+
never repeat them as properties. Workspace and agent names are opt-in per
162+
event: include them only where the event is useless without them
163+
(`workspace.state_transitioned`), omit them everywhere else.
156164

157165
## Tests
158166

0 commit comments

Comments
 (0)