class OpenTelemetryPlugin(SimplePlugin): (source)
Known subclasses: temporalio.contrib.gcp.cloud_run.opentelemetry.OpenTelemetryPlugin
Constructor: OpenTelemetryPlugin(add_temporal_spans)
OpenTelemetry plugin for Temporal SDK.
Warning
This class is experimental and may change in future versions. Use with caution in production environments.
This plugin integrates OpenTelemetry tracing with the Temporal SDK, providing automatic span creation for workflows, activities, and other Temporal operations. It uses the new OpenTelemetryInterceptor implementation.
Unlike the prior TracingInterceptor, this allows for accurate duration spans and parenting inside a workflow using opentelemetry.trace.get_tracer() directly.
Your tracer provider should be created with create_tracer_provider for it to be used within a Temporal worker.
| Method | __init__ |
Initialize the OpenTelemetry plugin. |
Inherited from SimplePlugin:
| Method | configure |
See base class. |
| Method | configure |
See base class. |
| Method | configure |
See base class. |
| Async Method | connect |
See base class. |
| Method | name |
See base class. |
| Async Method | run |
See base class. |
| Async Method | run |
See base class. |
| Instance Variable | activities |
Undocumented |
| Instance Variable | data |
Undocumented |
| Instance Variable | interceptors |
Undocumented |
| Instance Variable | nexus |
Undocumented |
| Instance Variable | run |
Undocumented |
| Instance Variable | workflow |
Undocumented |
| Instance Variable | workflow |
Undocumented |
| Instance Variable | workflows |
Undocumented |
| Instance Variable | _name |
Undocumented |
temporalio.plugin.SimplePlugin.__init__Initialize the OpenTelemetry plugin.
| Parameters | |
addbool | Whether to add additional Temporal-specific spans for operations like StartWorkflow, RunWorkflow, etc. |