Skip to main content

Class: OpenTelemetryOutboundInterceptor

opentelemetry.OpenTelemetryOutboundInterceptor

Intercepts outbound calls to schedule an Activity

Wraps the operation in an opentelemetry Span and passes it to the Activity via headers.

Implements

Constructors

constructor

new OpenTelemetryOutboundInterceptor(): OpenTelemetryOutboundInterceptor

Returns

OpenTelemetryOutboundInterceptor

Methods

continueAsNew

continueAsNew(input, next): Promise<never>

Called when Workflow calls continueAsNew

Parameters

NameType
inputContinueAsNewInput
nextOmitLastParam<(input: ContinueAsNewInput, next: OmitLastParam<(input: ContinueAsNewInput, next: OmitLastParam<...>) => Promise<never>>) => Promise<never>>

Returns

Promise<never>

Implementation of

WorkflowOutboundCallsInterceptor.continueAsNew


scheduleActivity

scheduleActivity(input, next): Promise<unknown>

Called when Workflow schedules an Activity

Parameters

NameType
inputActivityInput
nextOmitLastParam<(input: ActivityInput, next: OmitLastParam<(input: ActivityInput, next: OmitLastParam<...>) => Promise<unknown>>) => Promise<unknown>>

Returns

Promise<unknown>

result of the activity execution

Implementation of

WorkflowOutboundCallsInterceptor.scheduleActivity


startChildWorkflowExecution

startChildWorkflowExecution(input, next): Promise<[Promise<string>, Promise<unknown>]>

Called when Workflow starts a child workflow execution, the interceptor function returns 2 promises:

  • The first resolves with the runId when the child workflow has started or rejects if failed to start.
  • The second resolves with the workflow result when the child workflow completes or rejects on failure.

Parameters

NameType
inputStartChildWorkflowExecutionInput
nextOmitLastParam<(input: StartChildWorkflowExecutionInput, next: OmitLastParam<(input: StartChildWorkflowExecutionInput, next: OmitLastParam<...>) => Promise<[Promise<string>, Promise<unknown>]>>) => Promise<[Promise<string>, Promise<unknown>]>>

Returns

Promise<[Promise<string>, Promise<unknown>]>

Implementation of

WorkflowOutboundCallsInterceptor.startChildWorkflowExecution