Open
Conversation
Add pre_stream_generate/post_stream_generate lifecycle hooks that bracket each generator __next__/__anext__ call, enabling per-yield instrumentation for streaming actions. Also improves attributes added for streaming to distinguish internal computation from consumer time. OpenTelemetryBridge accepts a new streaming_telemetry parameter (StreamingTelemetryMode enum) controlling how streaming actions are instrumented: - SINGLE_SPAN (default): single action span, backwards compatible - EVENT: action span + stream_completed summary event with generation/consumer timing, iteration count, and TTFT - CHUNK_SPANS: per-yield child spans, no action span - BOTH: action span with summary event + per-yield child spans
Surface generation-vs-consumer timing data in the Burr tracker and UI, independent of the OpenTelemetry streaming telemetry modes. Tracker changes: - Extend StreamState with timing fields (generation_time_ns, consumer_time_ns, first_item_time_ns, etc.) accumulated via PreStreamGenerateHook/PostStreamGenerateHook - Add generate hooks to SyncTrackingClient in both base.py and client.py with defensive getattr for subclass compatibility - Add optional timing fields to EndStreamModel (generation_time_ms, consumer_time_ms, first_item_time_ms) with None defaults for backwards compatibility - Update post_end_stream in both LocalTrackingClient and S3TrackingClient to convert and write accumulated timing UI changes: - Add timing fields to EndStreamModel.ts TypeScript type - Update StepList.tsx end_stream rendering to show "gen: Xms · consumer: Yms · N items · TTFT: Zms" when timing data is available, falling back to legacy throughput display Documentation: - Add "Streaming Telemetry Modes" section to additional-visibility.rst - Add StreamingTelemetryMode to opentelemetry.rst API reference - Add 4 new generate hook classes to lifecycle.rst - Add "Telemetry & Observability" section to streaming-actions.rst - Add "Streaming Timing" section to tracking.rst - Update monitoring.rst and examples/opentelemetry/README.md - Update design doc to reflect final implementation Example: - Add --tracker flag to streaming_telemetry_modes.py for validating timing data in the Burr UI Tests: - 6 new tests covering StreamState defaults, timing accumulation, defensive noop, EndStreamModel backwards compat, and sync/async end-to-end with LocalTrackingClient
|
A preview of 448b03c is uploaded and can be seen here: ✨ https://burr.dagworks.io/pull/665 ✨ Changes may take a few minutes to propagate. Since this is a preview of production, content with |
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.
Changes
Add configurable streaming telemetry to the OpenTelemetry bridge and surface generation-vs-consumer timing in the Burr tracker and UI.
How I tested this
Notes
Checklist