Repository navigation
feat(telemetry): add the crate with its event model and OTLP encoding #1479
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
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
205ab30
feat(telemetry): add the crate with its event model and OTLP encoding
pblazej fc0ef58
docs(telemetry): specify resource attributes, events, logs and spans
pblazej 2716873
fix(telemetry): stamp records at capture and keep open spans resolvable
pblazej 6271ffe
fix(telemetry): enforce the custom attribute limit atomically and own…
pblazej 0424f50
refactor(telemetry): add TelemetryEvent::default and a span kind conv…
pblazej 0f95504
docs(telemetry): add the README, SPEC rules and a stage-true changeset
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-telemetry: minor | ||
| --- | ||
|
|
||
| Add `livekit-telemetry`, the internal client telemetry core shared by the LiveKit client SDKs. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
| # Changelog |
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,25 @@ | ||
| [package] | ||
| name = "livekit-telemetry" | ||
| description = "Client telemetry core for LiveKit: buffers events on-device and exports them as OTLP" | ||
| version = "0.1.0" | ||
| readme = "README.md" | ||
| license.workspace = true | ||
| edition.workspace = true | ||
| repository.workspace = true | ||
|
|
||
| [dependencies] | ||
| log = { workspace = true } | ||
| prost = { workspace = true } | ||
| rand = { workspace = true } | ||
| # OTLP message types only (`gen-tonic-messages` = prost structs, no tonic). Same prost as | ||
| # livekit-protocol so a single prost is linked. | ||
| opentelemetry-proto = { version = "0.32", default-features = false, features = ["logs", "trace", "gen-tonic-messages"] } | ||
| uniffi = { workspace = true, features = ["scaffolding-ffi-buffer-fns"], optional = true } | ||
|
|
||
| [features] | ||
| uniffi = ["dep:uniffi"] | ||
|
|
||
| # How CI checks this crate's features, read by | ||
| # `.github/workflows/feature-combinations-curated.yml` via `cargo metadata`. | ||
| [package.metadata.feature-combinations] | ||
| mode = "powerset" | ||
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,19 @@ | ||
| # LiveKit Telemetry | ||
|
|
||
| **Important**: | ||
| This is an internal crate for client telemetry in LiveKit client SDKs and is not meant to be | ||
| used directly. | ||
|
|
||
| It currently holds the shared data model and its encoding: | ||
|
|
||
| - **Records.** `TelemetryEvent`, `LogRecord`, `Attribute` / `AttributeValue`, `Severity` and | ||
| `SpanOutcome`: the events, log lines and span outcomes a platform SDK hands over. | ||
| - **Buffers.** Bounded, drop-oldest queues for records and spans, each filed under the session | ||
| (trace) it belongs to; every drop is counted. | ||
| - **Encoding.** [OTLP/HTTP](https://opentelemetry.io/docs/specs/otlp/) protobuf logs and traces, | ||
| using the `opentelemetry-proto` message types only (no gRPC stack). | ||
|
|
||
| The pipeline that batches, caches and uploads records is not part of the crate yet. | ||
|
|
||
| Event names, attributes and span rules are defined in [`SPEC.md`](SPEC.md). It is the contract | ||
| for the whole crate, including the parts not implemented yet. |
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.
Uh oh!
There was an error while loading. Please reload this page.