Skip to main content

Class: OpenTelemetryOutboundInterceptor

Experimental

Intercepts outbound calls to schedule an Activity

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

@temporalio/workflow must be provided by host package in order to function.

This interceptor is experimental and APIs may change without notice.

Implements​

Constructors​

Constructor​

new OpenTelemetryOutboundInterceptor(): OpenTelemetryOutboundInterceptor

Experimental

Returns​

OpenTelemetryOutboundInterceptor

Methods​

continueAsNew()​

continueAsNew(input, next): Promise<never>

Experimental

Called when Workflow calls continueAsNew.

Parameters​

input​

ContinueAsNewInput

next​

OmitLastParam<(input, next) => Promise<never>>

Returns​

Promise<never>

Implementation of​

WorkflowOutboundCallsInterceptor.continueAsNew


getLogAttributes()​

getLogAttributes(input, next): Record<string, unknown>

Experimental

Called on each invocation of the workflow.log methods.

The attributes returned in this call are attached to every log message.

Parameters​

input​

GetLogAttributesInput

next​

OmitLastParam<(input, next) => Record<string, unknown>>

Returns​

Record<string, unknown>

Implementation of​

WorkflowOutboundCallsInterceptor.getLogAttributes


getMetricTags()​

getMetricTags(input, next): GetMetricTagsInput

Experimental

Called once every time a metric is emitted from a Workflow metric (ie. a metric created from workflow.metricMeter).

Tags returned by this hook are prepended to tags defined at the metric level and tags defined on the emitter function itself.

Parameters​

input​

GetMetricTagsInput

next​

OmitLastParam<(input, next) => MetricTags>

Returns​

GetMetricTagsInput

Implementation of​

WorkflowOutboundCallsInterceptor.getMetricTags


scheduleActivity()​

scheduleActivity(input, next): Promise<unknown>

Experimental

Called when Workflow schedules an Activity.

Parameters​

input​

ActivityInput

next​

OmitLastParam<(input, next) => Promise<unknown>>

Returns​

Promise<unknown>

result of the activity execution

Implementation of​

WorkflowOutboundCallsInterceptor.scheduleActivity


scheduleLocalActivity()​

scheduleLocalActivity(input, next): Promise<unknown>

Experimental

Called when Workflow schedules a local Activity.

Parameters​

input​

LocalActivityInput

next​

OmitLastParam<(input, next) => Promise<unknown>>

Returns​

Promise<unknown>

result of the activity execution

Implementation of​

WorkflowOutboundCallsInterceptor.scheduleLocalActivity


signalWithStartWorkflow()​

signalWithStartWorkflow(input, next): Promise<NexusOperationHandle<SignalWithStartWorkflowResponse>>

Experimental

Parameters​

input​

SignalWithStartWorkflowRequest

next​

OmitLastParam<(input, next) => Promise<NexusOperationHandle<SignalWithStartWorkflowResponse>>>

Returns​

Promise<NexusOperationHandle<SignalWithStartWorkflowResponse>>

Implementation of​

WorkflowOutboundCallsInterceptor.signalWithStartWorkflow


signalWorkflow()​

signalWorkflow(input, next): Promise<void>

Experimental

Called when Workflow signals a child or external Workflow.

Parameters​

input​

SignalWorkflowInput

next​

OmitLastParam<(input, next) => Promise<void>>

Returns​

Promise<void>

Implementation of​

WorkflowOutboundCallsInterceptor.signalWorkflow


startChildWorkflowExecution()​

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

Experimental

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​

input​

StartChildWorkflowExecutionInput

next​

OmitLastParam<(input, next) => Promise<[Promise<string>, Promise<unknown>]>>

Returns​

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

Implementation of​

WorkflowOutboundCallsInterceptor.startChildWorkflowExecution


startNexusOperation()​

startNexusOperation(input, next): Promise<StartNexusOperationOutput>

Experimental

Called when Workflow starts a Nexus Operation.

Parameters​

input​

StartNexusOperationInput

next​

OmitLastParam<(input, next) => Promise<StartNexusOperationOutput>>

Returns​

Promise<StartNexusOperationOutput>

Implementation of​

WorkflowOutboundCallsInterceptor.startNexusOperation