Hi,
I am having an issue with open telemetry tracing within Python workers. The only traces being captured are RunActivity
type. There are no RunWorkflow
traces that act as parent traces of RunActivity
or StartActivity
traces.
I followed these instructions to set up instrumentation - Instrumentation | OpenTelemetry
And this to configure temporal to emit OTLP traces using the above instrumentation - Observability - Python SDK | Temporal Platform Documentation
Here is my tracer intrumentation logic
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
provider = TracerProvider()
provider.add_span_processor(BatchSpanProcessor(OTLPSpanExporter()))
trace.set_tracer_provider(provider)
And here is my temporal config to intercept and emit traces
from temporalio.contrib.opentelemetry import TracingInterceptor
Client.connect(
config.temporal_address,
namespace="default",
tls=False,
interceptors=[TracingInterceptor()],
)
The result is emitted traces that look like this. Note that they are all RunActivity
traces, there are no RunWorkflow
traces or StartActivity
traces.
I have also configured this for Java workers. The configuration was very similar. The same things were created and set, just using java libraries and paradigms.
The result is java traces that include RunWorkflow
, RunActivity
, and StartActivity
traces. The RunWorkflow
traces are acting as parents of StartActivity
. This is the behaviour that I want from my Python workers.
How can I get my python workers to emit this RunWorkflow
and StartActivity
level tracing in the same way that java does? Is this possible at all or is there some limitation for python workers?
I’ve looked through the temporal observability documentation and have not found any other relevant configuration or information about this.