-
-
Notifications
You must be signed in to change notification settings - Fork 277
Telemetry Processor (1): Add basic APIs for processing telemetry types e.g log, span #3407
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
Merged
buenaflor
merged 33 commits into
feat/span-first
from
feat/buffer/pr-1-telemetry-item-interface
Dec 17, 2025
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
7e7a385
feat(telemetry): Introduce TelemetryItem interface and implement tele…
buenaflor 72639df
feat(telemetry): Enhance telemetry processing with buffer registratio…
buenaflor d14838a
refactor(tests): Remove unused initialization tests from telemetry pr…
buenaflor 02b1d34
feat(telemetry): Integrate telemetry processing into SentryOptions
buenaflor f80d9ba
refactor(telemetry): Simplify telemetry buffer handling in DefaultTel…
buenaflor 388409c
feat(telemetry): Implement in-memory telemetry buffer for span and lo…
buenaflor ca184fc
fix(span): Ensure child span inherits traceId from parent correctly
buenaflor 534aee1
fix(noop_span): Correct segmentSpan implementation to return the curr…
buenaflor cba8450
Merge branch 'feat/span-first' into feat/buffer/pr-1-telemetry-item-i…
buenaflor 59927dc
Formatting
buenaflor ed407b1
feat(telemetry): Enhance DefaultTelemetryProcessor with customizable …
buenaflor b4dc2a1
refactor(span): Update SimpleSpan to use configurable clock for times…
buenaflor 01c771b
refactor(telemetry): Simplify DefaultTelemetryProcessor by removing b…
buenaflor b868f54
refactor(telemetry): Remove unused telemetry item import from NoOpSpan
buenaflor 874c684
refactor(telemetry): Replace TelemetryItem with SentryEncodable inter…
buenaflor eedfd0b
docs(telemetry): Add documentation for SentryEncodable and TelemetryB…
buenaflor 13955bd
refactor(span): Improve traceId inheritance logic in SimpleSpan const…
buenaflor b522089
fix(span): Ensure endTimestamp is stored in UTC format in SimpleSpan
buenaflor 8ea876a
feat(telemetry): Prevent NoOpSpan and UnsetSpan from being added to t…
buenaflor d54ae8b
docs(telemetry): Enhance documentation for TelemetryProcessor methods
buenaflor 9434be4
docs(telemetry): Remove outdated flush method documentation in Defaul…
buenaflor cc9815b
docs(telemetry): Remove outdated constructor documentation in Default…
buenaflor bcde33e
refactor(telemetry): Remove SentryEncodable interface and simplify re…
buenaflor ed1ce35
refactor(telemetry): Rename BufferedItem to EncodedItem and update re…
buenaflor a12ff23
refactor(span): Simplify traceId assignment in SimpleSpan constructor
buenaflor 4d50af0
refactor(telemetry): Integrate telemetry processing into SentryClient
buenaflor 43a8d5a
refactor(telemetry): Implement JsonEncodable interface for telemetry …
buenaflor fe868cb
Merge branch 'feat/span-first' into feat/buffer/pr-1-telemetry-item-i…
buenaflor a072baa
refactor(telemetry): Update telemetry buffer implementation and enhan…
buenaflor 1fb4a80
refactor(telemetry): Rename flush methods to clear for clarity
buenaflor 28ff74c
refactor(telemetry): Rename flush method to clear in MockTelemetryBuffer
buenaflor 3a1904d
refactor(telemetry): Update futures type in telemetry processor
buenaflor ff13cc4
refactor(telemetry): Rename asyncFlush to asyncClear in MockTelemetry…
buenaflor 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
Some comments aren't visible on the classic Files Changed page.
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
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
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
3 changes: 3 additions & 0 deletions
3
packages/dart/lib/src/telemetry_processing/json_encodable.dart
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,3 @@ | ||
| abstract interface class JsonEncodable { | ||
| Map<String, dynamic> toJson(); | ||
| } |
42 changes: 42 additions & 0 deletions
42
packages/dart/lib/src/telemetry_processing/telemetry_buffer.dart
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,42 @@ | ||
| import 'dart:async'; | ||
|
|
||
| import '../../sentry.dart'; | ||
| import 'json_encodable.dart'; | ||
|
|
||
| /// A buffer that batches telemetry items for efficient transmission to Sentry. | ||
| /// | ||
| /// Collects items of type [T] and sends them in batches rather than | ||
| /// individually, reducing network overhead. | ||
| abstract class TelemetryBuffer<T> { | ||
| /// Adds an item to the buffer. | ||
| void add(T item); | ||
|
|
||
| /// When executed immediately sends all buffered items to Sentry and clears the buffer. | ||
| FutureOr<void> clear(); | ||
| } | ||
|
|
||
| /// Pairs an item with its encoded bytes for size tracking and transmission. | ||
| class BufferedItem<T> { | ||
| final T item; | ||
| final List<int> encoded; | ||
|
|
||
| BufferedItem(this.item, this.encoded); | ||
| } | ||
|
|
||
| /// In-memory buffer with time and size-based flushing. | ||
| class InMemoryTelemetryBuffer<T extends JsonEncodable> | ||
| extends TelemetryBuffer<T> { | ||
| InMemoryTelemetryBuffer(); | ||
|
|
||
| @override | ||
| void add(T item) { | ||
| final encoded = utf8JsonEncoder.convert(item.toJson()); | ||
| final _ = BufferedItem(item, encoded); | ||
| // TODO(next-pr): finish this impl | ||
| } | ||
buenaflor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| @override | ||
| FutureOr<void> clear() { | ||
| // TODO(next-pr): finish this impl | ||
| } | ||
| } | ||
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.