Skip to content

fix: align the OpenTelemetry instrumentation scope with Durable Task SDKs - #372

Open
JasonWinters (richarmurray6y8-creator) wants to merge 2 commits into
microsoft:mainfrom
richarmurray6y8-creator:fix/otel-instrumentation-scope-369
Open

JasonWinters (richarmurray6y8-creator) wants to merge 2 commits into
microsoft:mainfrom
richarmurray6y8-creator:fix/otel-instrumentation-scope-369

Conversation

@richarmurray6y8-creator

Copy link
Copy Markdown

Summary

Fixes #369. Python Durable Task spans now use the Microsoft.DurableTask instrumentation scope documented for the portable SDKs. The changelog explains how to update queries and collector filters that match the previous durabletask scope.

The Azure Functions tracing test distinguishes worker spans using their configured service.name, so it can still detect duplicate Python lifecycle spans when the host and worker share a scope name.

Verification

  • Both new exporter assertions failed on the old scope and pass with the change.
  • Core SDK on Python 3.11: 1,674 passed, 510 skipped.
  • Azure Functions unit tests on Python 3.13: 700 passed, 93 deselected.
  • A real OpenTelemetry Collector received both an SDK span and a deferred client span with Microsoft.DurableTask and the Python worker resource.
  • The local Functions host end-to-end test was skipped because Azure Functions Core Tools was unavailable.

Serialization compatibility

The change applies to OpenTelemetry scope metadata.

Copilot AI balanced review requested due to automatic review settings November 30, 2026 00:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Azure Managed provider changelog is missing migration guidance for updating tracing scope filters from durabletask to Microsoft.DurableTask.

1 open issue
What changed in this PR

Aligns Python Durable Task spans with the shared Microsoft.DurableTask OpenTelemetry instrumentation scope, addressing #369 and simplifying cross-language tracing filters.

Changes:

  • Renames the instrumentation scope and documents migration for existing filters.
  • Adds scope assertions for regular and deferred spans.
  • Updates the Functions tracing test to distinguish host and worker spans by service.name.
File Description
tests/​durabletask/​test_tracing.py Verifies the scope on regular and deferred spans.
tests/​azure-functions-durable/​e2e/​test_distributed_tracing_e2e.py Uses worker resource identity to detect duplicate lifecycle spans.
tests/​azure-functions-durable/​e2e/​_harness.py Preserves resource metadata on collected spans.
durabletask/​internal/​tracing.py Sets the scope to Microsoft.DurableTask.
CHANGELOG.md Documents the scope change and filter migration.

Review effort: Balanced

Comment thread CHANGELOG.md
Comment on lines +19 to +21
- Python SDK spans now use the `Microsoft.DurableTask` OpenTelemetry instrumentation
scope. Update queries, dashboards, and collector filters that use the previous
`durabletask` scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracing instrumentation scope is "durabletask" instead of "Microsoft.DurableTask"

2 participants