Skip to content

Rework telemetry to support durable execution case#219

Open
anbuzin wants to merge 3 commits into
mainfrom
durable-telemetry-2
Open

Rework telemetry to support durable execution case#219
anbuzin wants to merge 3 commits into
mainfrom
durable-telemetry-2

Conversation

@anbuzin

@anbuzin anbuzin commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator
  1. convert Span to pydantic so they can travel as json
  2. introduce Sink that all spans go to. default sink is the adapter registry. users can explicitly swap it out with a different sink using a context manager. in the workflow body:
sink = ai.telemetry.Collector()
with use_sink(sink):
    # do the stuff
    
await send_spans_step(sink.finished)  # send all spans in a step
  1. spans no longer have methods that immediately send them to adapters. instead, you can mutate span's attributes, then call span.push to send the updated version to the sink.

the async with span("foo") as sp api didn't change much, actually, it's just different under the hood. the Adapter api hasn't changed at all.

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-python Ready Ready Preview, Comment Jul 17, 2026 10:12pm

@anbuzin anbuzin added the feature New functionality label Jul 17, 2026
@anbuzin
anbuzin marked this pull request as draft July 17, 2026 05:39
@anbuzin
anbuzin marked this pull request as ready for review July 17, 2026 20:34
@anbuzin
anbuzin requested a review from msullivan July 17, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant