sdk-typescript icon indicating copy to clipboard operation
sdk-typescript copied to clipboard

Instrument signals with OTel

Open iravid opened this issue 1 year ago • 4 comments

What was changed

Add instrumentation to signal in the client interceptor and handleSignal in the workflow inbound interceptor.

Why?

We're starting activities from signal handlers and would like to see them on the same trace.

Checklist

  1. How was this tested:

Haven't seen tests in this module - lmk if needed! Will test this soon on our own project.

  1. Any docs updates needed?

Don't think so!

iravid avatar Jun 22 '24 12:06 iravid

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 22 '24 12:06 CLAassistant

Thanks @iravid for sharing this.

There's a few things that needs to happen before we can merge this:

  • Handle WorkflowOutboundCallsInterceptor.signalWorkflow so that spans propagate when a workflow signals another workflow;
  • Add a corresponding check in test-otel.ts.

Also, if you feel up to the task, we should do the same with handleUpdate and friends.

mjameswh avatar Jun 25 '24 13:06 mjameswh

Thanks @mjameswh! Will happily address those two; thanks for the pointer to the tests.

I'm a bit short on time this week so if alright by you will save instrumentation of the other operations for another PR?

iravid avatar Jun 25 '24 14:06 iravid

I'm a bit short on time this week so if alright by you will save instrumentation of the other operations for another PR?

Sure, no problem.

mjameswh avatar Jun 25 '24 14:06 mjameswh

Hey @mjameswh apologies for the delay here (😅) - added the requested adjustments and tested locally by removing the .skip on the integration test and running npm run test with RUN_INTEGRATION_TESTS=true

iravid avatar Sep 28 '24 14:09 iravid

Hi @mjameswh - any chance you could have a look here?

iravid avatar Nov 07 '24 15:11 iravid