File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
src/Modules/Microsoft.Azure.Functions.PowerShellWorker Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -132,9 +132,25 @@ function Start-DurableOrchestration {
132132 }
133133
134134 $Body = $InputObject | ConvertTo-Json - Compress
135+
136+ try {
137+ $activity = Start-FunctionsOpenTelemetrySpan
138+ $traceID = $activity.activity.TraceId
139+ # Do whatever you need to do with the trace information using the activity here
140+ } catch {
141+ # Do something better - correctly handle errors when the OTel SDK is not available
142+ # Output errors from this command in a reasonable way
143+ # Detect if calling Stop-FunctionsOpenTelemetrySpan is necessary and change that logic too
144+ }
135145
136146 $null = Invoke-RestMethod - Uri $Uri - Method ' POST' - ContentType ' application/json' - Body $Body
137-
147+
148+ try {
149+ Stop-FunctionsOpenTelemetrySpan - Activity $activity
150+ } catch {
151+ # Do something better here
152+ }
153+
138154 return $instanceId
139155}
140156
You can’t perform that action at this time.
0 commit comments