Repository navigation
feat(telemetry): add client telemetry #2109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pblazej
wants to merge
7
commits into
main
Choose a base branch
from
blaze/telemetry
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
618ce2b
feat(telemetry): add the OTLP pipeline, write-ahead cache and Cloud d…
pblazej 57ced56
feat(telemetry): add Room scopes, spans and paced stats polling
pblazej a01895c
feat(telemetry): capture device state and SDK warnings
pblazej 410c1e9
feat(telemetry): expose opt-out, custom events and the host seam
pblazej 720df34
feat(telemetry): instrument Room, engine and signal client
pblazej e712e1d
test(telemetry): unit tests and the collector story
pblazej f696c75
chore(telemetry): changeset, size budget and module map
pblazej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'livekit-client': minor | ||
| --- | ||
|
|
||
| Add client telemetry: every Room on LiveKit Cloud reports its connect, reconnect, publish and subscribe spans, RTC statistics windows, SDK warnings and device state to its own project when the token carries the observability grant; `disableTelemetry()` opts the process out, `Room.emitTelemetryEvent()` and `Room.setTelemetryAttribute()` add the app's own events and correlation ids. |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # Client telemetry (maintainers) | ||
|
|
||
| The contract — events, attributes, cadences, destination and upload policy — is | ||
| [`livekit-telemetry/SPEC.md`](https://github.com/livekit/rust-sdks/blob/main/livekit-telemetry/SPEC.md) | ||
| in rust-sdks. The Swift, Kotlin and Dart SDKs get it from the Rust core; a browser cannot link | ||
| that core, so `src/telemetry/` is the same pipeline in TypeScript, and `@livekit/react-native` | ||
| reuses it (it only wires `configureTelemetryHost()`: a file cache, device state, resource names). | ||
|
|
||
| | File | Role | | ||
| |---|---| | ||
| | `index.ts` | installs the pipeline with the first Room; `disableTelemetry()`; the host hook; SDK warn/error capture | | ||
| | `scope.ts` | one per Room: trace id, Room attributes, `lk.connect` / `lk.reconnect` / `lk.publish` / `lk.subscribe`, RTC windows, the two app calls | | ||
| | `pipeline.ts` | queue → write-ahead cache → one request in flight; projects, tokens, holds, budget, the answer table, the self-report, opt-out | | ||
| | `transport.ts` | Cloud URL rules, token claims, answer classification, Retry-After, backoff, the request | | ||
| | `otlp.ts` | record shapes and a protobuf writer for the two OTLP export requests | | ||
| | `webrtc.ts`, `poller.ts` | one `getStats()` per peer connection → SPEC readings → windows | | ||
| | `storage.ts`, `device.ts` | the cache interface and memory store; device state → events, cadence, holds | | ||
|
|
||
| Tests: `telemetry.test.ts` (unit, mock fetch) and `telemetry.browser.test.ts` (the whole story in | ||
| Chromium against `livekit-server --dev` and a local collector; see the PR for the commands). |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete: a comment about the review rounds. The diff shows the limit change. -3 lines.
Intent: the code comment describes the code, not the history of the PR.