Repository navigation
Conversation
The gen_ai.client.inference.operation.details checkpoint brief in agents/signals.yaml sat in a YAML flow mapping, so the comma inside it started a new (invalid) mapping entry and truncated the brief at 'events cannot be referenced'. Quote the value so the whole sentence survives into the generated Rust, Python and Markdown docs. Co-authored-by: Jonas Schell <jonas@livekit.io>
Readers migrating to canonical lk.* keys need one source of truth for the legacy spellings each canonical key replaces, and simple helpers to normalize an ingest and expand a query, rather than ad-hoc fallback lists per consumer (cloud-observability, cloud-api-server, livekit/web). Model: extend renamed_from on the shared keys with a sibling 'aliases' list for the legacy spellings beyond the single OTLP dotted rename (the pre-#7973 Agents span names and the Go logger / collector spellings such as roomID, room_id). renamed_from.key stays the OTLP rename that live-check reads, so live-check remains OTLP-only. Policy: livekit_shared_rename now forbids defining the dotted rename or any alias as a key, and a new livekit_alias_collision rejects a legacy spelling that maps to more than one canonical key, so the helpers stay unambiguous. Both run in default and --v2 modes, with negative fixtures. Codegen: RenamedKeys now covers every alias; KeyAliases maps a canonical key to its legacy spellings; and NormalizeKey, NormalizeValue and AliasesFor (plus normalizeKey/normalizeValue/aliasesFor in TypeScript, exported from @livekit/protocol/semconv with no @bufbuild/protobuf dep) give readers the normalize-on-ingest and expand-on-query operations. The Markdown 'Old spellings' table lists the aliases, and the README documents the dual-emit -> normalize/expand -> retire lifecycle. Also fix the Go metric doc comments to omit the empty Unit clause for unitless metrics (was rendering 'Instrument: counter, unit: ``.'). Part of OCD-3830. Co-authored-by: Jonas Schell <jonas@livekit.io>
- mage otel snapshots otel/gen and restores it if generation, the Go build or gotest fails, so the Generate workflow never commits a broken partial regeneration. - generate.sh runs the go.mod toolchain's gofmt (not whatever is on PATH) and rejects a flat-namespace constant collision in the generated Go with the offending name, rather than leaving it to a cryptic 'redeclared' compile error (Rust and Python keep these in modules and classes, so only Go can collide). - tests/codegen.sh round-trips the tricky escape value through the Go toolchain alongside rustc, tsc and python3. - packages/javascript adds a node10 types fallback (typesVersions) for the @livekit/protocol/semconv subpath, for consumers on classic module resolution that do not read the exports map. Part of OCD-3830. Co-authored-by: Jonas Schell <jonas@livekit.io>
Regenerated from the model, policy and template changes: the legacy-key alias maps and reader helpers in Go and TypeScript, the fuller checkpoint brief, and the cleaned unitless-metric doc comments. Part of OCD-3830. Co-authored-by: Jonas Schell <jonas@livekit.io>
|
generate.sh runs under 'set -euo pipefail', so the collision-guard grep aborted the script when semconv.go had no matching const lines. The real output always has consts, but tests/generate.sh drives generate.sh with a stub weaver that emits a const-less 'package semconv', which tripped it and failed the 'generated outputs are current' CI step. Append '|| true' so no match is benign; a real duplicate still makes uniq -d emit it. Co-authored-by: Jonas Schell <jonas@livekit.io>
… aliases - normalizeKey / aliasesFor / normalizeValue looked up plain object literals, so a key such as `constructor` or `toString` resolved to an Object.prototype member (normalizeKey returned a function, aliasesFor threw). Look up own properties only. - New livekit_alias_duplicate policy: a renamed_from alias that repeats the key, renamed_from.key or another alias would be a duplicate key in the generated Go map and TS object (a compile error in both), and the collision rule's set of pairs hides it. Adds a negative fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VE54KsZAzb79ACbpArh9Zv
|
|
Summary
Establishes a single, centralized way in
livekit/protocol/otel(Weaver) to represent and resolve legacy telemetry key aliases, with matching reader helpers in Go and TypeScript. Readers migrating to canonicallk.*keys (cloud-observability,cloud-api-server,livekit/web) now share one source of truth instead of reinventing ad-hoc fallback lists during dual-emit.Resolves OCD-3830.
What changed
Registry schema (
otel/model/shared/registry.yaml)renamed_fromannotation on the shared keys with a siblingaliaseslist for the legacy spellings beyond the single OTLP dotted rename — the pre-#7973 Agents span names (lk.room_sid,lk.track_sid, …) and the Go logger / collector spellings (roomID,room_id,participantID,participantIdentity, …).renamed_from.keystays the OTLP dotted rename that live-check reads, so live-check remains OTLP-only (it never flags camelCase Go-logger spellings). Legacy spellings are never registered keys; they live only in the generated alias maps.lk.job_idis intentionally left a binding-only key (job_id), per the existing README stance that job renaming is out of scope. Keys with no canonicallk.*key yet (e.g.nodeID) are deferred to their owning surface, as agreed.Policy (
otel/policies/resolved.rego,otel/tests/negatives/)livekit_shared_renamenow forbids defining the dotted rename or any alias as a key.livekit_alias_collisionhard-fails a legacy spelling that maps to more than one canonical key, so the helpers stay unambiguous.--v2modes, with new negative fixturesalias-defined.yamlandalias-collision.yaml; findings table updated in the README.Codegen
otel/gen/go/semconv.go):RenamedKeysnow covers every alias; newKeyAliases(canonical → legacy spellings); new helpersNormalizeKey,NormalizeValue,AliasesFor— pure, zero external deps.otel/gen/ts/semconv.ts, exported from@livekit/protocol/semconv): matchingRENAMED_KEYS,RENAMED_VALUES,KEY_ALIASES,normalizeKey,normalizeValue,aliasesFor— no@bufbuild/protobufdependency.Tests
otel/gotest/semconv_test.go: relaxed the hard-coded 8-entryRenamedKeyscheck to a subset + structural invariants, and addedTestKeyAliases,TestNormalizeKey,TestAliasesFor,TestNormalizeValue.Follow-ups folded in from the #2019 review (incl. pblazej's threads)
lk.room_sid,room_id,lk.track_sid, …) are now inRenamedKeys/renamed_from.aliases, so the collector map actually normalizes older captures.otel/model/agents/signals.yamlwhose unquoted comma truncated it (events cannot be referenced→ full sentence). Fuller brief now flows into the generated Rust/Python/Markdown.mage otelsnapshotsotel/genand restores it if generation, the Go build orgotestfails, so the Generate workflow never commits a broken partial result.tests/codegen.shnow round-trips the escape value through the Go toolchain alongside rustc, tsc and python3.semconv.go.j2no longer render an emptyUnit:clause (wasInstrument: counter, unit: ``.).generate.shruns the go.mod toolchain'sgofmtinstead of a baregofmtfromPATH.TestRenamedKeysno longer hard-codes 8 renames (subset + invariants).packages/javascriptadds anode10types fallback (typesVersions) for the./semconvsubpath, for consumers on classic module resolution that don't readexports.generate.shrejects a duplicate top-level constant in the generated Go with the offending name (Rust/Python keep these nested in modules/classes, so only Go can collide), ahead of a crypticredeclaredcompile error.Verification
All run locally with weaver 0.28.0 (the pinned CI version):
otel/check.sh— clean (only the pre-existinglivekit_client_namespaceadvice)otel/tests/negatives.sh— all fixtures fail with their named finding in both modes, including the two new alias fixturesotel/generate.sh+git diff --cached otel/gen— no diff (generated outputs current)go build ./otel/gen/go/...,go vet,go test ./otel/gotest/...— passtsc --strict --noEmit --target es2020 otel/gen/ts/semconv.ts— passotel/tests/codegen.sh(now incl. Go),otel/tests/generate.sh,otel/tests/live-check.sh— passrustc -D warnings -D missing_docs,python3 -I -W erroron generated outputs — passpnpm --filter @livekit/protocol build— pass