Skip to content

Commit 1d2cd94

Browse files
authored
Fix stale workflow.tracer() references in OpenTelemetry contrib (#1662)
workflow.tracer() does not exist; point the plugin and completed_span docstrings and the README at opentelemetry.trace.get_tracer().
1 parent c6386e9 commit 1d2cd94

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

temporalio/contrib/opentelemetry/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ worker = Worker(
6868
- **Accurate Duration Spans**: Workflow spans have real durations reflecting actual execution time
6969
- **Direct OpenTelemetry Usage**: Use `opentelemetry.trace.get_tracer()` directly within workflows
7070
- **Better Span Hierarchy**: More accurate parent-child relationships within workflows
71-
- **Workflow Context Access**: Access spans within workflows using `temporalio.contrib.opentelemetry.workflow.tracer()`
71+
- **Workflow Context Access**: Access spans within workflows using `opentelemetry.trace.get_tracer()`
7272

7373
#### ⚠️ Considerations:
7474
- **Experimental Status**: Subject to breaking changes in future versions

temporalio/contrib/opentelemetry/_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class OpenTelemetryPlugin(SimplePlugin):
1818
It uses the new OpenTelemetryInterceptor implementation.
1919
2020
Unlike the prior TracingInterceptor, this allows for accurate duration spans and parenting inside a workflow
21-
with temporalio.contrib.opentelemetry.workflow.tracer()
21+
using opentelemetry.trace.get_tracer() directly.
2222
2323
Your tracer provider should be created with `create_tracer_provider` for it to be used within a Temporal worker.
2424
"""

temporalio/contrib/opentelemetry/workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def completed_span(
3030
span and this interceptor is configured on the worker and the span is on
3131
the context).
3232
33-
To create a long-running span or to create a span that actually spans other code use OpenTelemetryPlugin and tracer().
33+
To create a long-running span or to create a span that actually spans other code use OpenTelemetryPlugin and opentelemetry.trace.get_tracer().
3434
3535
Args:
3636
name: Name of the span.

0 commit comments

Comments
 (0)