File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,23 @@ function Start-DurableOrchestration {
113113 $InstanceId = (New-Guid ).Guid
114114 }
115115
116+ $invocationId = GetInvocationIdFromModulePrivateData
117+
118+ $activityResponse = Get-CurrentActivityForInvocation - InvocationId $invocationId
119+ $activity = $activityResponse.activity
120+
121+ $traceId = $activity.TraceId
122+ $spanId = $activity.SpanId
123+ $traceFlags = $activity.TraceFlags
124+ $traceState = $activity.TraceStateString
125+
126+ $traceparent = " 00-$traceId -$spanId -$traceFlags "
127+
128+ $headers = @ {
129+ " traceparent" = $traceparent
130+ " tracestate" = $traceState
131+ }
132+
116133 $Uri =
117134 if ($DurableClient.rpcBaseUrl ) {
118135 # Fast local RPC path
@@ -124,10 +141,8 @@ function Start-DurableOrchestration {
124141 }
125142
126143 $Body = $InputObject | ConvertTo-Json - Compress - Depth 100
127-
128- $InvocationId = GetInvocationIdFromModulePrivateData
129144
130- $null = Invoke-RestMethod - Uri $Uri - Method ' POST' - ContentType ' application/json' - Body $Body
145+ $null = Invoke-RestMethod - Uri $Uri - Method ' POST' - ContentType ' application/json' - Body $Body - Headers $headers
131146
132147 return $instanceId
133148}
You can’t perform that action at this time.
0 commit comments