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

[Core] Upgrading dependency on System.Diagnostics.DiagnosticSource #37418

Merged
merged 8 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<PackageReference Update="System.Memory.Data" Version="1.0.2" />
<PackageReference Update="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Update="System.Net.Http" Version="4.3.4" />
<PackageReference Update="System.Diagnostics.DiagnosticSource" Version="4.6.0" />
<PackageReference Update="System.Diagnostics.DiagnosticSource" Version="6.0.1" />
<PackageReference Update="System.Reflection.TypeExtensions" Version="4.7.0" />
<PackageReference Update="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<PackageReference Update="System.Threading.Tasks.Extensions" Version="4.5.4" />
Expand Down
11 changes: 9 additions & 2 deletions sdk/core/Azure.Core/src/Azure.Core.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>
<Description>This is the implementation of the Azure Client Pipeline</Description>
<AssemblyTitle>Microsoft Azure Client Pipeline</AssemblyTitle>
Expand All @@ -23,9 +23,16 @@
<SupportedPlatform Include="browser" />
</ItemGroup>

<!-- Keep System.Diagnostics.DiagnosticSource 5.0.0 for netcoreapp2.1 support. -->
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
m-redding marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Include="System.Diagnostics.DiagnosticSource" VersionOverride="5.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp2.1' ">
m-redding marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Include="System.Diagnostics.DiagnosticSource" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" />
<PackageReference Include="System.Numerics.Vectors" />
<PackageReference Include="System.Threading.Tasks.Extensions" />
<PackageReference Include="System.Text.Json" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ public void InstrumentMessage(IDictionary<string, object> properties, string act
DiagnosticScope.ActivityKind.Producer);
messageScope.Start();

Activity activity = Activity.Current;
Activity? activity = Activity.Current;
if (activity != null)
{
traceparent = activity.Id;
traceparent = activity!.Id!;
m-redding marked this conversation as resolved.
Show resolved Hide resolved
properties[DiagnosticIdAttribute] = traceparent;
if (ActivityExtensions.SupportsActivitySource())
{
Expand All @@ -192,4 +192,4 @@ public void InstrumentMessage(IDictionary<string, object> properties, string act
}
}
}
}
}