Skip to content
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

Merge Correlation branch into master #422

Merged
merged 52 commits into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
13b6d4c
Distributed Tracing (#261)
TsuyoshiUshio Jan 30, 2020
5fcb969
Update System.DiagnosticSource (#371)
TsuyoshiUshio Feb 27, 2020
9e7c0e1
Enabling Extended Session Distributed Tracing (#373)
TsuyoshiUshio Mar 10, 2020
22a289f
fix:missing link (#375)
TsuyoshiUshio Mar 10, 2020
7365422
Distributed Tracing (#261)
TsuyoshiUshio Jan 30, 2020
c45a71c
Update System.DiagnosticSource (#371)
TsuyoshiUshio Feb 27, 2020
da12c4d
Enabling Extended Session Distributed Tracing (#373)
TsuyoshiUshio Mar 10, 2020
2e2d1ad
fix:missing link (#375)
TsuyoshiUshio Mar 10, 2020
23f996b
remove unnecessary lines
TsuyoshiUshio Mar 21, 2020
0a79c6e
Release for Telemetry 1.7.4-alpha
TsuyoshiUshio Mar 31, 2020
a1f9631
remove unnecesary lines
TsuyoshiUshio Mar 31, 2020
b442898
Add PublishProfiles to gitignore
TsuyoshiUshio Apr 11, 2020
addd50e
Prepare Durable Functions tracing alpha release
Apr 15, 2020
dbc1d4a
minor improvements on correlation docs (#391)
reyang Jun 5, 2020
15345fb
Merge branch 'master' into correlation
cgillum Jul 12, 2020
8baab9a
Merge branch 'master' into correlation
cgillum Jul 16, 2020
39a959d
Merge branch 'master' into correlation
cgillum Jul 16, 2020
ef8d541
Reverted package name and version changes
cgillum Jul 17, 2020
40022b2
Update MS test adapter and add net451 support
TsuyoshiUshio Jul 28, 2020
6429ca9
Merged latest from master
cgillum Aug 6, 2020
0439dd2
Fix build breaks after merge
cgillum Aug 6, 2020
5a1c77b
Typo: behaviro -> behavior
davidmrdavid Oct 30, 2020
799af0e
Fix: correlation test fail except for external event with extended se…
TsuyoshiUshio Nov 2, 2020
e31981e
merge w/ master
davidmrdavid Nov 2, 2020
5444860
PR feedback
davidmrdavid Nov 2, 2020
f8cada0
tests for netstandard instead of netcoreapp
davidmrdavid Nov 2, 2020
06e0f57
revert test config change
davidmrdavid Nov 2, 2020
e10a5c6
adding back reference in AzureStorage tests
davidmrdavid Nov 2, 2020
a4d8553
reverting DurableTask.Core csproj to old state
davidmrdavid Nov 2, 2020
eb44c62
PackageVersion ->Version
davidmrdavid Nov 2, 2020
8b1668c
revert subtyping removal in csproj
davidmrdavid Nov 2, 2020
49859e7
removed empty space in csproj
davidmrdavid Nov 2, 2020
68d1432
removing assemblyInfo changes of durabletask.core
davidmrdavid Nov 2, 2020
1e42cf4
some pr feedback, reverted assembly change
davidmrdavid Nov 2, 2020
1059a03
added service to csproj
davidmrdavid Nov 3, 2020
6007c94
disabled correlation, to test CI
davidmrdavid Nov 3, 2020
28dde66
enabled correlation proj
davidmrdavid Nov 3, 2020
3e119b8
adding MSBUILD command on top of correlation samples proj
davidmrdavid Nov 3, 2020
bdc114b
samples csproj - removed MSBuild command, removed test imports
davidmrdavid Nov 3, 2020
9b3571f
removed bad dep
davidmrdavid Nov 3, 2020
fed5499
removed dep on visualstudio
davidmrdavid Nov 3, 2020
0a7187f
added samples.test back in
davidmrdavid Nov 3, 2020
0e1129f
moved Correlation.Sample.Tests to the /tests/ dir
davidmrdavid Nov 3, 2020
7f1cb6a
found bug in SetActivityToCurrent
davidmrdavid Nov 3, 2020
82979f3
moved Sample.Tests back to samples
davidmrdavid Nov 4, 2020
c6d702b
do not build correlation.samples.test
davidmrdavid Nov 4, 2020
99a65b4
EventRaised now gets its parentTraceContext after all messages are pr…
davidmrdavid Nov 10, 2020
e3eb873
moved correlation tests to test folder
davidmrdavid Nov 11, 2020
9119132
changed corr-samples-test csproj to be more like redis tests
davidmrdavid Nov 11, 2020
9bcc103
removed old correlation.sample.test project, replaced it with new one…
davidmrdavid Nov 11, 2020
f40050d
removed dummy test project, something is wrong with CI test project d…
davidmrdavid Nov 11, 2020
535784a
moved corr-sample-test into an existing test project
davidmrdavid Nov 11, 2020
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ Icon?
ehthumbs.db
Thumbs.db
.vs/

# Publish Web output #
######################
PublishProfiles/
22 changes: 22 additions & 0 deletions DurableTask.sln
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DurableTask.SqlServer", "sr
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DurableTask.SqlServer.Tests", "test\DurableTask.SqlServer.Tests\DurableTask.SqlServer.Tests.csproj", "{B835BFA6-D9BB-47C4-8594-38EAE0157BBA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Correlation.Samples", "samples\Correlation.Samples\Correlation.Samples.csproj", "{5F88FF6A-E908-4341-89D6-FA530793077A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Correlation.Sample.Tests", "samples\Correlation.Sample.Tests\Correlation.Sample.Tests.csproj", "{54D2FA7E-E3A4-443F-9A62-DA4B0D044EDD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -239,6 +243,22 @@ Global
{B835BFA6-D9BB-47C4-8594-38EAE0157BBA}.Release|Any CPU.Build.0 = Release|Any CPU
{B835BFA6-D9BB-47C4-8594-38EAE0157BBA}.Release|x64.ActiveCfg = Release|Any CPU
{B835BFA6-D9BB-47C4-8594-38EAE0157BBA}.Release|x64.Build.0 = Release|Any CPU
{5F88FF6A-E908-4341-89D6-FA530793077A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F88FF6A-E908-4341-89D6-FA530793077A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F88FF6A-E908-4341-89D6-FA530793077A}.Debug|x64.ActiveCfg = Debug|Any CPU
{5F88FF6A-E908-4341-89D6-FA530793077A}.Debug|x64.Build.0 = Debug|Any CPU
{5F88FF6A-E908-4341-89D6-FA530793077A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F88FF6A-E908-4341-89D6-FA530793077A}.Release|Any CPU.Build.0 = Release|Any CPU
{5F88FF6A-E908-4341-89D6-FA530793077A}.Release|x64.ActiveCfg = Release|Any CPU
{5F88FF6A-E908-4341-89D6-FA530793077A}.Release|x64.Build.0 = Release|Any CPU
{54D2FA7E-E3A4-443F-9A62-DA4B0D044EDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{54D2FA7E-E3A4-443F-9A62-DA4B0D044EDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{54D2FA7E-E3A4-443F-9A62-DA4B0D044EDD}.Debug|x64.ActiveCfg = Debug|Any CPU
{54D2FA7E-E3A4-443F-9A62-DA4B0D044EDD}.Debug|x64.Build.0 = Debug|Any CPU
{54D2FA7E-E3A4-443F-9A62-DA4B0D044EDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{54D2FA7E-E3A4-443F-9A62-DA4B0D044EDD}.Release|Any CPU.Build.0 = Release|Any CPU
{54D2FA7E-E3A4-443F-9A62-DA4B0D044EDD}.Release|x64.ActiveCfg = Release|Any CPU
{54D2FA7E-E3A4-443F-9A62-DA4B0D044EDD}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -266,6 +286,8 @@ Global
{1D52F94E-933C-411F-96C4-4960B423586F} = {C53918E6-667A-4930-837C-0018C5D6E374}
{C9F84589-3F2B-4D58-A995-BC169D16217F} = {DBCD161C-D409-48E5-924E-9B7FA1C36B84}
{B835BFA6-D9BB-47C4-8594-38EAE0157BBA} = {95C69A06-7F62-4652-A480-207B614C2869}
{5F88FF6A-E908-4341-89D6-FA530793077A} = {AF4E71A6-B16E-4488-B22D-2761101A601A}
{54D2FA7E-E3A4-443F-9A62-DA4B0D044EDD} = {95C69A06-7F62-4652-A480-207B614C2869}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EnterpriseLibraryConfigurationToolBinariesPath = packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4
Expand Down
17 changes: 17 additions & 0 deletions samples/Correlation.Sample.Tests/Correlation.Sample.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
davidmrdavid marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Correlation.Samples\Correlation.Samples.csproj" />
</ItemGroup>

</Project>
50 changes: 50 additions & 0 deletions samples/Correlation.Sample.Tests/StringExtensionsTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// ----------------------------------------------------------------------------------
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

namespace Correlation.Sample.Tests
{
using System;
using Correlation.Samples;
using Microsoft.VisualStudio.TestTools.UnitTesting;

[TestClass]
public class StringExtensionsTest
{
[TestMethod]
public void TestParseTraceParent()
{
var traceparentString = "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01";
ConnorMcMahon marked this conversation as resolved.
Show resolved Hide resolved
var traceparent = traceparentString.ToTraceParent();
Assert.AreEqual("00", traceparent.Version);
Assert.AreEqual("4bf92f3577b34da6a3ce929d0e0e4736", traceparent.TraceId);
Assert.AreEqual("00f067aa0ba902b7", traceparent.SpanId);
Assert.AreEqual("01", traceparent.TraceFlags);
}

[TestMethod]
public void TestParseTraceParentThrowsException()
{
var wrongTraceparentString = "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7";
Assert.ThrowsException<ArgumentException>(
() => { wrongTraceparentString.ToTraceParent(); });
}

[TestMethod]
public void TestParseTraceParenWithNull()
{
string someString = null;
var result = someString?.ToTraceParent();
Assert.IsNull(result);
}
}
}
53 changes: 53 additions & 0 deletions samples/Correlation.Samples/ContinueAsNewOrchestration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// ----------------------------------------------------------------------------------
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

namespace Correlation.Samples
{
using System;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using DurableTask.Core;

[KnownType(typeof(HelloActivity))]
internal class ContinueAsNewOrchestration : TaskOrchestration<string, string>
{
static int counter = 0;

public override async Task<string> RunTask(OrchestrationContext context, string input)
{
string result = await context.ScheduleTask<string>(typeof(HelloActivity), input);
result = input + ":" + result;
if (counter < 3)
{
counter++;
context.ContinueAsNew(result);
}

return result;
}
}

internal class HelloActivity : TaskActivity<string, string>
{
protected override string Execute(TaskContext context, string input)
{
if (string.IsNullOrEmpty(input))
{
throw new ArgumentNullException(nameof(input));
}

Console.WriteLine($"Activity: Hello {input}");
return $"Hello, {input}!";
}
}
}
32 changes: 32 additions & 0 deletions samples/Correlation.Samples/CorrelatedExceptionExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// ----------------------------------------------------------------------------------
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

namespace Correlation.Samples
{
using System;
using System.Collections.Generic;
using System.Text;
using DurableTask.Core;
using Microsoft.ApplicationInsights.DataContracts;

public static class CorrelatedExceptionExtensions
{
public static ExceptionTelemetry CreateExceptionTelemetry(this CorrelatedExceptionDetails e)
{
var exceptionTelemetry = new ExceptionTelemetry(e.Exception);
exceptionTelemetry.Context.Operation.Id = e.OperationId;
exceptionTelemetry.Context.Operation.ParentId = e.ParentId;
return exceptionTelemetry;
}
}
}
34 changes: 34 additions & 0 deletions samples/Correlation.Samples/Correlation.Samples.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.WindowsAzure.ConfigurationManager" version="3.2.1" />
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\DurableTask.AzureStorage\DurableTask.AzureStorage.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Configuration" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.12.0" />
</ItemGroup>

<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading