Class: Temporalio::Contrib::OpenTelemetry::TracingInterceptor

Inherits:
Object
  • Object
show all
Includes:
Temporalio::Client::Interceptor, Worker::Interceptor::Activity, Worker::Interceptor::Workflow
Defined in:
lib/temporalio/contrib/open_telemetry.rb

Overview

Tracing interceptor to add OpenTelemetry traces to clients, activities, and workflows.

Constant Summary

Constants included from Worker::Interceptor::Workflow

Worker::Interceptor::Workflow::CancelExternalWorkflowInput, Worker::Interceptor::Workflow::ExecuteActivityInput, Worker::Interceptor::Workflow::ExecuteInput, Worker::Interceptor::Workflow::ExecuteLocalActivityInput, Worker::Interceptor::Workflow::HandleQueryInput, Worker::Interceptor::Workflow::HandleSignalInput, Worker::Interceptor::Workflow::HandleUpdateInput, Worker::Interceptor::Workflow::InitializeContinueAsNewErrorInput, Worker::Interceptor::Workflow::SignalChildWorkflowInput, Worker::Interceptor::Workflow::SignalExternalWorkflowInput, Worker::Interceptor::Workflow::SleepInput, Worker::Interceptor::Workflow::StartChildWorkflowInput

Constants included from Worker::Interceptor::Activity

Worker::Interceptor::Activity::ExecuteInput, Worker::Interceptor::Activity::HeartbeatInput

Constants included from Temporalio::Client::Interceptor

Temporalio::Client::Interceptor::BackfillScheduleInput, Temporalio::Client::Interceptor::CancelWorkflowInput, Temporalio::Client::Interceptor::CompleteAsyncActivityInput, Temporalio::Client::Interceptor::CountWorkflowsInput, Temporalio::Client::Interceptor::CreateScheduleInput, Temporalio::Client::Interceptor::DeleteScheduleInput, Temporalio::Client::Interceptor::DescribeScheduleInput, Temporalio::Client::Interceptor::DescribeWorkflowInput, Temporalio::Client::Interceptor::FailAsyncActivityInput, Temporalio::Client::Interceptor::FetchWorkflowHistoryEventsInput, Temporalio::Client::Interceptor::HeartbeatAsyncActivityInput, Temporalio::Client::Interceptor::ListSchedulesInput, Temporalio::Client::Interceptor::ListWorkflowPageInput, Temporalio::Client::Interceptor::PauseScheduleInput, Temporalio::Client::Interceptor::PollWorkflowUpdateInput, Temporalio::Client::Interceptor::QueryWorkflowInput, Temporalio::Client::Interceptor::ReportCancellationAsyncActivityInput, Temporalio::Client::Interceptor::SignalWithStartWorkflowInput, Temporalio::Client::Interceptor::SignalWorkflowInput, Temporalio::Client::Interceptor::StartUpdateWithStartWorkflowInput, Temporalio::Client::Interceptor::StartWorkflowInput, Temporalio::Client::Interceptor::StartWorkflowUpdateInput, Temporalio::Client::Interceptor::TerminateWorkflowInput, Temporalio::Client::Interceptor::TriggerScheduleInput, Temporalio::Client::Interceptor::UnpauseScheduleInput, Temporalio::Client::Interceptor::UpdateScheduleInput

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tracer, header_key: '_tracer-data', propagator: ::OpenTelemetry::Context::Propagation::CompositeTextMapPropagator.compose_propagators( [ ::OpenTelemetry::Trace::Propagation::TraceContext::TextMapPropagator.new, ::OpenTelemetry::Baggage::Propagation::TextMapPropagator.new ] ), always_create_workflow_spans: false) ⇒ TracingInterceptor

Create interceptor.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/temporalio/contrib/open_telemetry.rb', line 31

def initialize(
  tracer,
  header_key: '_tracer-data',
  propagator: ::OpenTelemetry::Context::Propagation::CompositeTextMapPropagator.compose_propagators(
    [
      ::OpenTelemetry::Trace::Propagation::TraceContext::TextMapPropagator.new,
      ::OpenTelemetry::Baggage::Propagation::TextMapPropagator.new
    ]
  ),
  always_create_workflow_spans: false
)
  @tracer = tracer
  @header_key = header_key
  @propagator = propagator
  @always_create_workflow_spans = always_create_workflow_spans
end

Instance Attribute Details

#tracerOpenTelemetry::Trace::Tracer (readonly)



19
20
21
# File 'lib/temporalio/contrib/open_telemetry.rb', line 19

def tracer
  @tracer
end