temporalio / sdk-typescript

Temporal TypeScript SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] `Workflow referenced an unregistered external sink` when using `@temporalio/interceptors-opentelemetry`

HalfdanJ opened this issue · comments

What are you really trying to do?

I'm using the @temporalio/interceptors-opentelemetry package in combination with the bundleWorkflowCode feature from @temporalio/worker.

Describe the bug

The interceptors work as expected, but I also get a lot of errors in the logs that so far seem harmless but very noisy.

   severity: "ERROR"
   message: "Workflow referenced an unregistered external sink"
   metadata: {
      "ifaceName": "exporter",
      "fnName": "export"
   }

If I take out the interceptor from the workflowInterceptorModules configuration, the errors disappear. I can further narrow it down to the inclusion of OpenTelemetryOutboundInterceptor in outbound interceptors like this:

export const interceptors: WorkflowInterceptorsFactory = () => ({
  outbound: [new OpenTelemetryOutboundInterceptor()],
});

Minimal Reproduction

I can create one if needed, but havent done so yet.

Environment/Versions

  • OS and processor: Mac
  • Temporal Version: 1.9.3

I think you are missing the sinks configuration on your Worker:

  const worker = await Worker.create({
    workflowsBundle: ...,
    interceptors: {
      activityInbound: [(ctx) => new OpenTelemetryActivityInboundInterceptor(ctx)],
    },

    // Make sure to include this block; `exporter` and `resource` 
    sinks: {
      exporter: makeWorkflowExporter(exporter, resource),
    },
  });

Please our Open Telemetry tracing interceptors sample here.

Ah you are right. I actually already had the sinks, but i was conditionally disabling them not realizing that was were the error stemmed from.

One piece of feedback, it would be useful to make note of them in the readme, or make more explicit note of them in the sample since its easy to miss the need for it.