Add distributed tracing using opentelemetry#119
Draft
andystaples wants to merge 8 commits intomicrosoft:mainfrom
Draft
Add distributed tracing using opentelemetry#119andystaples wants to merge 8 commits intomicrosoft:mainfrom
andystaples wants to merge 8 commits intomicrosoft:mainfrom
Conversation
…com/andystaples/durabletask-python into andystaples/add-distributed-tracing
4 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds OpenTelemetry-based distributed tracing to the Durable Task Python SDK by propagating W3C trace context through the gRPC protocol and emitting spans for orchestration, activity, sub-orchestration, timer, entity, and event operations.
Changes:
- Introduces
durabletask.internal.tracingwith optional OpenTelemetry helpers for context extraction/injection and span lifecycle management. - Updates worker + client code paths to propagate
TraceContextover gRPC and to create/finish spans across multi-dispatch orchestration replays. - Adds a comprehensive tracing test suite and updates dependency metadata to include OpenTelemetry packages/extras.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/durabletask/test_tracing.py | New unit/integration-style tests covering tracing utilities and replay/lifecycle behavior |
| durabletask/internal/tracing.py | New tracing utility module (optional OpenTelemetry dependency) |
| durabletask/worker.py | Server-side span creation/propagation; persists orchestration + client spans across dispatches |
| durabletask/client.py | Producer spans + parent trace context injection for orchestration creation and entity signals |
| durabletask/internal/helpers.py | Adds parent_trace_context to schedule/sub-orchestration action helpers |
| pyproject.toml | Adds opentelemetry optional dependency extra |
| requirements.txt | Adds OpenTelemetry packages to the dev/test requirements list |
| CHANGELOG.md | Notes improved distributed tracing support |
You can also share your feedback on Copilot code review. Take the survey.
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.
Adds support for Distributed Tracing by passing the trace information for orchestrations passed in the gRPC spec to activitites/entities/sub-orchestrations
Compare to the Dotnet SDK: https://github.com/microsoft/durabletask-dotnet
Jaeger profile for fan-out orchestration:

DTS view of the same orchestration:

Resolves #97