-
-
Notifications
You must be signed in to change notification settings - Fork 278
Description
🔭 Sneak Peek: OpenTelemetry + Phoenix Driver for Prism PHP
I’ve been experimenting with early OpenTelemetry instrumentation for Prism PHP along with a built-in Phoenix driver, and the initial results look promising.
Right now, we can already visualize the full streaming flow in Phoenix:
- Root span for
prism.text.asStream - Nested
streamStepspans toolCallspans with timing- Clear end-to-end latency view
This significantly improves visibility into multi-step streaming chains. Also visualization for embedding, text handlers etc are supported. This internally dispatches simple laravel events and adds open telemetry based observability platforms like phoenix as a driver. Thus, one can also integrate telescope, pulse, etc.
🚀 What More We Can Unlock
Currently I am mainly tracks step-level events, but there’s room to go deeper:
- Track full request timing (including time to first chunk)
- Token usage per step and aggregated totals
- Better separation of model vs tool latency
- Cost tracking once PR Feat: 💰 Track cost in Usage value object #920 is merged
Adopting a central streaming handler (see #894) would make this much easier to implement cleanly without duplicating instrumentation across the codebase.
This is still an early sneak peek, but it shows strong potential to make Prism much more production-observable. Feedback welcome!