-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add gRPC span and correlate client and orchestrator functions for DF .NET Isolated Distributed Tracing #2998
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using System.Diagnostics; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.DurableTask; | ||
|
@@ -76,6 +77,12 @@ | |
StartOrchestrationOptions? options = null, | ||
CancellationToken cancellation = default) | ||
{ | ||
Activity? currActivity = Activity.Current; | ||
if (options == null && options?.ParentTraceId == null && currActivity != null) | ||
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / Analyze (csharp)
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / Analyze (csharp)
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / Analyze (csharp)
Check failure on line 81 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / Analyze (csharp)
|
||
{ | ||
options = new StartOrchestrationOptions(ParentTraceId: currActivity?.Id?.ToString()); | ||
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / build
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / Analyze (csharp)
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / Analyze (csharp)
Check failure on line 83 in src/Worker.Extensions.DurableTask/FunctionsDurableTaskClient.cs GitHub Actions / Analyze (csharp)
|
||
} | ||
Comment on lines
+80
to
+84
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the |
||
|
||
return this.inner.ScheduleNewOrchestrationInstanceAsync(orchestratorName, input, options, cancellation); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, the source name is "DurableTask.WebJobs" because we load the
DurableTelemetryModule
and it looks for sources that start with "DurableTask" (related code link). I'm working on updating the listeners to add a new one ("WebJobs.Extensions.DurableTask") when we initialize the module so we can remove this "DurableTask.WebJobs" that's just used to test for now.