Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1657866
first commit!
Mar 28, 2025
e60efe4
one small proto change
Mar 28, 2025
3d1efc8
fixed line endings, removed proto changes
Mar 31, 2025
ea9c3c8
trying to revert proto changes
Mar 31, 2025
d3b8f8b
line endings :(
Mar 31, 2025
3ae40dd
one more time?
Mar 31, 2025
22137f3
pushing what i have so far
Apr 14, 2025
1eed186
seems like everything is working and aligned with the new in-process …
Apr 14, 2025
fc19192
a very small change to create a trace regardless of calling or signal…
Apr 23, 2025
03f0f9b
added a start time to OperationResult
Apr 25, 2025
10339f1
Merge branch 'main' into stevosyan/distributed-tracing-for-entities-i…
May 8, 2025
c00278d
missed one file
May 8, 2025
a0e0b80
some stylistic updates per PR comments
May 10, 2025
0c0421e
super tiny style update
May 13, 2025
b7c7793
Merge branch 'main' into stevosyan/distributed-tracing-for-entities-i…
May 13, 2025
f09df53
changed startTime/endTime to startTimeUtc/endTimeUtc and made the req…
May 16, 2025
90f37ee
first commit
May 27, 2025
476f96f
trying different yml update
May 27, 2025
3a786d1
trying again
May 27, 2025
a7639fd
adding other yml files
May 27, 2025
333612d
trying to fix webapi project
May 27, 2025
cc7e343
fixing another sample csproj
May 27, 2025
834fb65
trying to not build the sample projects
May 27, 2025
fba3454
trying to exclude the sample projects from the yml
May 27, 2025
71e343f
updating the codeQL yml in the same way
May 27, 2025
958ec3a
Merge branch 'main' into stevosyan/distributed-tracing-for-entities-i…
May 28, 2025
a848f44
Merge branch 'stevosyan/distributed-tracing-for-entities-isolated' in…
May 28, 2025
1268479
adding new package version number
May 28, 2025
f98c316
reverting some unnecessary changes
May 28, 2025
e648516
updating path to nuget.config
May 30, 2025
9f56097
trying with a custom command
May 30, 2025
9e7f555
Merge branch 'main' into stevosyan/distributed-tracing-for-entities-i…
Jun 2, 2025
cf32735
Merge branch 'main' into stevosyan/distributed-tracing-for-entities-i…
Jun 4, 2025
faaeda3
Merge branch 'stevosyan/distributed-tracing-for-entities-isolated' in…
Jun 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/codeQL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
push:
branches: [ "main", "*" ] # TODO: remove development branch after approval
pull_request:
branches: [ "main", "*"] # TODO: remove development branch after approval
branches: [ "main", "stevosyan/distributed-tracing-for-entities-isolated", "*"] # TODO: remove development branch after approval
schedule:
- cron: '0 0 * * 1' # Weekly Monday run, needed for weekly reports
workflow_call: # allows to be invoked as part of a larger workflow
Expand Down Expand Up @@ -59,10 +59,12 @@ jobs:
global-json-file: global.json

- name: Restore dependencies
run: dotnet restore $solution
run: |
Get-ChildItem -Path src, test -Recurse -Filter *.csproj | ForEach-Object { dotnet restore $_.FullName }

- name: Build
run: dotnet build $solution #--configuration $config #--no-restore -p:FileVersionRevision=$GITHUB_RUN_NUMBER -p:ContinuousIntegrationBuild=true
run: |
Get-ChildItem -Path src, test -Recurse -Filter *.csproj | ForEach-Object { dotnet build $_.FullName }

# Run CodeQL analysis
- name: Perform CodeQL Analysis
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/validate-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
branches:
- main
- 'feature/**'
- stevosyan/distributed-tracing-for-entities-isolated
paths-ignore: [ '**.md' ]

env:
Expand All @@ -34,16 +35,20 @@ jobs:
global-json-file: global.json

- name: Restore dependencies
run: dotnet restore $env:solution
run: |
Get-ChildItem -Path src, test -Recurse -Filter *.csproj | ForEach-Object { dotnet restore $_.FullName }

- name: Build
run: dotnet build $env:solution --configuration $env:config --no-restore -p:FileVersionRevision=$env:GITHUB_RUN_NUMBER
run: |
Get-ChildItem -Path src, test -Recurse -Filter *.csproj | ForEach-Object { dotnet build --configuration $env:config --no-restore -p:FileVersionRevision=$env:GITHUB_RUN_NUMBER $_.FullName }

- name: Test
run: dotnet test $env:solution --configuration $env:config --no-build --verbosity normal

run: |
Get-ChildItem -Path src, test -Recurse -Filter *.csproj | ForEach-Object { dotnet test --configuration $env:config --no-build --verbosity normal $_.FullName }

- name: Pack
run: dotnet pack $env:solution --configuration $env:config --no-build
run: |
Get-ChildItem -Path src, test -Recurse -Filter *.csproj | ForEach-Object { dotnet pack --configuration $env:config --no-build $_.FullName }

- name: Upload
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<!-- DurableTask Packages -->
<ItemGroup>
<PackageVersion Include="Microsoft.Azure.DurableTask.Core" Version="3.1.0" />
<PackageVersion Include="Microsoft.Azure.DurableTask.Core" Version="3.2.0-test.1" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.2.2" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion eng/targets/Release.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</PropertyGroup>

<PropertyGroup>
<VersionPrefix>1.10.0</VersionPrefix>
<VersionPrefix>1.11.0-test.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
</PropertyGroup>

Expand Down
7 changes: 3 additions & 4 deletions eng/templates/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ jobs:
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
verbosityRestore: Minimal
command: custom
custom: restore
projects: $(project)
feedsToUse: config
nugetConfigPath: nuget.config
arguments: '-v m'

# Build source directory
- task: DotNetCoreCLI@2
Expand Down
22 changes: 16 additions & 6 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<?xml version="1.0" encoding="utf-8"?>

<configuration>
<packageSources>
<clear/>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="durabletask" value="https://azfunc.pkgs.visualstudio.com/public/_packaging/durabletask/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="durabletask">
<package pattern="Microsoft.Azure.DurableTask.Core" />
</packageSource>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
13 changes: 11 additions & 2 deletions src/Client/Grpc/GrpcDurableEntityClient.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Diagnostics;
using Microsoft.DurableTask.Client.Entities;
using Microsoft.DurableTask.Entities;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -54,8 +55,16 @@ public override async Task SignalEntityAsync(
RequestId = requestId.ToString(),
Name = operationName,
Input = this.dataConverter.Serialize(input),
ScheduledTime = scheduledTime?.ToTimestamp(),
};
ScheduledTime = scheduledTime?.ToTimestamp(),
RequestTime = DateTimeOffset.UtcNow.ToTimestamp(),
};

if (Activity.Current is { } activity)
{
request.ParentTraceContext ??= new P.TraceContext();
request.ParentTraceContext.TraceParent = activity.Id;
request.ParentTraceContext.TraceState = activity.TraceStateString;
}

// TODO this.logger.LogSomething
try
Expand Down
3 changes: 2 additions & 1 deletion src/Client/Grpc/GrpcDurableTaskClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Diagnostics;
Expand Down Expand Up @@ -95,6 +95,7 @@
Version = version,
InstanceId = options?.InstanceId ?? Guid.NewGuid().ToString("N"),
Input = this.DataConverter.Serialize(input),
RequestTime = DateTimeOffset.UtcNow.ToTimestamp(),
};

// Add tags to the collection
Expand All @@ -108,7 +109,7 @@

if (Activity.Current?.Id != null || Activity.Current?.TraceStateString != null)
{
if (request.ParentTraceContext == null)

Check warning on line 112 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 112 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 112 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 112 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.
{
request.ParentTraceContext = new P.TraceContext();
}
Expand All @@ -126,7 +127,7 @@

DateTimeOffset? startAt = options?.StartAt;
this.logger.SchedulingOrchestration(
request.InstanceId,

Check warning on line 130 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 130 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 130 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.

Check warning on line 130 in src/Client/Grpc/GrpcDurableTaskClient.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Dereference of a possibly null reference.
orchestratorName,
sizeInBytes: request.Input != null ? Encoding.UTF8.GetByteCount(request.Input) : 0,
startAt.GetValueOrDefault(DateTimeOffset.UtcNow));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Diagnostics;
using DurableTask.Core;
using DurableTask.Core.Entities;
using DurableTask.Core.Entities;
using DurableTask.Core.Tracing;
using Microsoft.DurableTask.Client.Entities;
using Microsoft.DurableTask.Entities;

Expand Down Expand Up @@ -90,7 +92,10 @@ public override async Task SignalEntityAsync(
EntityMessageEvent.GetCappedScheduledTime(
DateTime.UtcNow,
this.options.Entities.MaxSignalDelayTimeOrDefault,
scheduledTime?.UtcDateTime));
scheduledTime?.UtcDateTime),
Activity.Current is { } activity ? new DistributedTraceContext(activity.Id!, activity.TraceStateString) : null,
requestTime: DateTimeOffset.UtcNow,
createTrace: true);

await this.options.Client!.SendTaskOrchestrationMessageAsync(eventToSend.AsTaskMessage());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using DurableTask.Core;
using DurableTask.Core.History;
using DurableTask.Core.Query;
Expand Down Expand Up @@ -166,6 +168,16 @@ public override async Task<string> ScheduleNewOrchestrationInstanceAsync(
};

string? serializedInput = this.DataConverter.Serialize(input);

var tags = new Dictionary<string, string>();
if (options?.Tags != null)
{
tags = options.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
}

tags[OrchestrationTags.CreateTraceForNewOrchestration] = "true";
tags[OrchestrationTags.RequestTime] = DateTimeOffset.UtcNow.ToString(CultureInfo.InvariantCulture);

TaskMessage message = new()
{
OrchestrationInstance = instance,
Expand All @@ -175,7 +187,8 @@ public override async Task<string> ScheduleNewOrchestrationInstanceAsync(
Version = options?.Version ?? string.Empty,
OrchestrationInstance = instance,
ScheduledStartTime = options?.StartAt?.UtcDateTime,
Tags = options?.Tags != null ? options.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value) : null,
ParentTraceContext = Activity.Current is { } activity ? new Core.Tracing.DistributedTraceContext(activity.Id!, activity.TraceStateString) : null,
Tags = tags,
},
};

Expand Down
2 changes: 1 addition & 1 deletion src/Generators/Generators.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
Expand Down
12 changes: 12 additions & 0 deletions src/Grpc/orchestrator_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ message CreateInstanceRequest {
google.protobuf.StringValue executionId = 7;
map<string, string> tags = 8;
TraceContext parentTraceContext = 9;
google.protobuf.Timestamp requestTime = 10;
}

message OrchestrationIdReusePolicy {
Expand Down Expand Up @@ -490,6 +491,8 @@ message SignalEntityRequest {
google.protobuf.StringValue input = 3;
string requestId = 4;
google.protobuf.Timestamp scheduledTime = 5;
TraceContext parentTraceContext = 6;
google.protobuf.Timestamp requestTime = 7;
}

message SignalEntityResponse {
Expand Down Expand Up @@ -575,6 +578,7 @@ message OperationRequest {
string operation = 1;
string requestId = 2;
google.protobuf.StringValue input = 3;
TraceContext traceContext = 4;
}

message OperationResult {
Expand All @@ -591,10 +595,14 @@ message OperationInfo {

message OperationResultSuccess {
google.protobuf.StringValue result = 1;
google.protobuf.Timestamp startTimeUtc = 2;
google.protobuf.Timestamp endTimeUtc = 3;
}

message OperationResultFailure {
TaskFailureDetails failureDetails = 1;
google.protobuf.Timestamp startTimeUtc = 2;
google.protobuf.Timestamp endTimeUtc = 3;
}

message OperationAction {
Expand All @@ -610,6 +618,8 @@ message SendSignalAction {
string name = 2;
google.protobuf.StringValue input = 3;
google.protobuf.Timestamp scheduledTime = 4;
google.protobuf.Timestamp requestTime = 5;
TraceContext parentTraceContext = 6;
}

message StartNewOrchestrationAction {
Expand All @@ -618,6 +628,8 @@ message StartNewOrchestrationAction {
google.protobuf.StringValue version = 3;
google.protobuf.StringValue input = 4;
google.protobuf.Timestamp scheduledTime = 5;
google.protobuf.Timestamp requestTime = 6;
TraceContext parentTraceContext = 7;
}

message AbandonActivityTaskRequest {
Expand Down
4 changes: 2 additions & 2 deletions src/Grpc/versions.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# The following files were downloaded from branch main at 2025-04-23 23:27:00 UTC
https://raw.githubusercontent.com/microsoft/durabletask-protobuf/fbe5bb20835678099fc51a44993ed9b045dee5a6/protos/orchestrator_service.proto
# The following files were downloaded from branch stevosyan/distributed-tracing-for-entities-isolated at 2025-05-16 04:21:21 UTC
https://raw.githubusercontent.com/microsoft/durabletask-protobuf/23ed998d1813577d9821e51ea7909063eb677a1b/protos/orchestrator_service.proto
Loading
Loading