docs(telemetry): instrumentation conventions + snake_case attribute keys#996
Open
EhabY wants to merge 2 commits into
Open
docs(telemetry): instrumentation conventions + snake_case attribute keys#996EhabY wants to merge 2 commits into
EhabY wants to merge 2 commits into
Conversation
13ac79c to
df89efa
Compare
This was referenced Jun 9, 2026
…e keys Add src/instrumentation/CONVENTIONS.md documenting how telemetry is structured (explicit span threading, imperative setProperty, event/attribute naming, namespace grouping, properties vs measurements) and link it from CONTRIBUTING. Align existing instrumentation with the OTel naming convention: - rename caller-supplied property/measurement keys from camelCase to snake_case (auth, ssh, workspace, activation, websocket, cli.download); - strip unit suffixes from exported metric names into the OTLP unit field (latency_ms -> metric latency, unit ms) so Prometheus suffixes cleanly; - group the token-refresh span under its namespace (auth.token_refreshed -> auth.token_refresh.completed) next to auth.token_refresh.deduped. Framework-managed result/durationMs are left unchanged.
df89efa to
ca8c7ec
Compare
- rename the trace outcome hook fail() -> error() and the category fetch_failed -> fetch_error to match the recordError vocabulary - name count measurements <entity>.count (agent.count, workspace.count, event.count, interval.count) per OTel, replacing flat _count keys - set error.type on auth error spans (login/logout exceptions, auth_failed) and split auth outcomes so errors carry error.type, aborts carry reason - fold the general telemetry review findings into CONVENTIONS.md and trim for conciseness
andrewdennis117
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Establishes a shared style for local telemetry instrumentation so the in-flight telemetry branches can converge on one convention.
src/instrumentation/CONVENTIONS.md(linked fromCONTRIBUTING.md) covering:setProperty), and you never return a value purely to log it,domain.snake_case(past tense for point-in-time logs), and attribute keys follow the OTel convention — lowercase,.for hierarchy,_for words, never camelCase,auth,ssh,workspace,activation,websocket, andcli.download(e.g.cacheSource/workspaceName/maxBackoffMs-style →cache_source/workspace_name/*_ms). The metrics export unit-suffix table is updated to match. Framework-managedresult/durationMs(never emitted as attributes) are left as-is.Why
Telemetry is local-only and unreleased, so unifying the naming now is free. Merging this first gives the other telemetry branches a conformant base to rebase onto and a doc to follow.