Description
Implement OpenTelemetry integration for the Stories framework using hooks to enable distributed tracing capabilities.
Requirements
- Story Run Tracing: Each story execution should create a separate root span
- Step-level Tracing: Each step within a story should create a nested span as a child of the story span
- Hook-based Implementation: Use hooks to instrument story lifecycle events without requiring invasive code changes
- Context Propagation: Ensure proper trace context propagation across story runs and steps
- Configurable: Allow users to enable/disable tracing and configure OpenTelemetry exporters
Implementation Details
Hook Integration
on_story_start: Create root span for story execution
on_story_end: End root span, record final status
on_step_start: Create child span for step execution
on_step_end: End step span, record step result
Span Attributes
- Story span: story_id, story_name, started_at, ended_at, status
- Step span: step_id, step_name, step_order, started_at, ended_at, status
Configuration
- Support for standard OpenTelemetry exporters (OTLP, Jaeger, Zipkin, etc.)
- Configurable span attributes and naming conventions
- Optional: trace sampling configuration
Testing
- Unit tests for hook execution
- Integration tests with OpenTelemetry SDK
- Example demonstrating tracing with Jaeger backend
Description
Implement OpenTelemetry integration for the Stories framework using hooks to enable distributed tracing capabilities.
Requirements
Implementation Details
Hook Integration
on_story_start: Create root span for story executionon_story_end: End root span, record final statuson_step_start: Create child span for step executionon_step_end: End step span, record step resultSpan Attributes
Configuration
Testing