class documentation
class ReplaySafeTracerProvider(TracerProvider): (source)
Constructor: ReplaySafeTracerProvider(tracer_provider, id_generator)
A tracer provider that is safe for use during workflow replay.
Warning
This class is experimental and may change in future versions. Use with caution in production environments.
This tracer provider wraps an OpenTelemetry TracerProvider and ensures that telemetry operations are safe during workflow replay by using replay-safe spans and tracers.
| Method | __init__ |
Initialize the replay-safe tracer provider. |
| Method | add |
Add a span processor to the underlying tracer provider. |
| Method | force |
Force flush the underlying tracer provider. |
| Method | get |
Get a replay-safe tracer from the underlying provider. |
| Method | id |
Gets the temporal id generator associated with this provider. |
| Method | shutdown |
Shutdown the underlying tracer provider. |
| Instance Variable | _id |
Undocumented |
| Instance Variable | _tracer |
Undocumented |
def __init__(self, tracer_provider:
trace_sdk.TracerProvider, id_generator: TemporalIdGenerator):
(source)
¶
Initialize the replay-safe tracer provider.
| Parameters | |
tracertrace_sdk.TracerProvider | The underlying OpenTelemetry TracerProvider to wrap. Must use a _TemporalIdGenerator for replay safety. |
idTemporalIdGenerator | Undocumented |
| Raises | |
ValueError | If the tracer provider doesn't use a _TemporalIdGenerator. |
Add a span processor to the underlying tracer provider.
| Parameters | |
spantrace_sdk.SpanProcessor | The span processor to add. |
def get_tracer(self, instrumenting_module_name:
str, instrumenting_library_version: str | None = None, schema_url: str | None = None, attributes: types.Attributes | None = None) -> Tracer:
(source)
¶
Get a replay-safe tracer from the underlying provider.
| Parameters | |
instrumentingstr | The name of the instrumenting module. |
instrumentingstr | None | The version of the instrumenting library. |
schemastr | None | The schema URL for the tracer. |
attributes:types.Attributes | None | Additional attributes for the tracer. |
| Returns | |
Tracer | A replay-safe tracer instance. |