Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit ec484ee

Browse files
author
Sébastien Dan
authored
fix: make traceparent source spans sync (#28)
1 parent c1f3a8d commit ec484ee

File tree

1 file changed

+14
-8
lines changed
  • packages/frontend/src/components/steps

1 file changed

+14
-8
lines changed

packages/frontend/src/components/steps/Step2.tsx

+14-8
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,15 @@ const Step2 = ({ onFinish }: StepProps) => {
141141
if (proof && trie) {
142142
const sendExecutorServiceSpan = apmTransaction?.startSpan(
143143
'send-request-to-executor-service',
144-
'app'
144+
'app',
145+
{ sync: true }
145146
)
146147

147-
const traceparent = `00-${
148-
(sendExecutorServiceSpan as any).traceId
149-
}-${(sendExecutorServiceSpan as any).id}-01`
148+
const traceparent = sendExecutorServiceSpan
149+
? `00-${(sendExecutorServiceSpan as any).traceId}-${
150+
(sendExecutorServiceSpan as any).id
151+
}-01`
152+
: ''
150153

151154
const iface = new ethers.utils.Interface(ERC20MessagingJSON.abi)
152155
let tokenSentLogIndex: number | undefined = undefined
@@ -185,12 +188,15 @@ const Step2 = ({ onFinish }: StepProps) => {
185188
sendExecutorServiceSpan?.end()
186189
const observeExecutorJobSpan = apmTransaction?.startSpan(
187190
'wait-for-executor-service-job-execution',
188-
'app'
191+
'app',
192+
{ sync: true }
189193
)
190194

191-
const traceparent = `00-${
192-
(observeExecutorJobSpan as any).traceId
193-
}-${(observeExecutorJobSpan as any).id}-01`
195+
const traceparent = observeExecutorJobSpan
196+
? `00-${(observeExecutorJobSpan as any).traceId}-${
197+
(observeExecutorJobSpan as any).id
198+
}-01`
199+
: ''
194200

195201
observeExecutorServiceJob(job.id, { traceparent }).subscribe({
196202
next: (progress: number) => {

0 commit comments

Comments
 (0)