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 {
113
113
$InstanceId = (New-Guid ).Guid
114
114
}
115
115
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
+
116
133
$Uri =
117
134
if ($DurableClient.rpcBaseUrl ) {
118
135
# Fast local RPC path
@@ -124,10 +141,8 @@ function Start-DurableOrchestration {
124
141
}
125
142
126
143
$Body = $InputObject | ConvertTo-Json - Compress - Depth 100
127
-
128
- $InvocationId = GetInvocationIdFromModulePrivateData
129
144
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
131
146
132
147
return $instanceId
133
148
}
You can’t perform that action at this time.
0 commit comments