Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Changes to support W3C style IDs and propagation #33207

Merged
merged 42 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6bfeaed
First set of changes to support W3C style IDs and propagation
vancem Nov 1, 2018
53d54d4
Changed UseW3CFormat to be DefaultIdFormat
vancem Nov 2, 2018
15dc5d5
Review feedback
vancem Nov 2, 2018
69bc77f
More comments. Small Renames
vancem Nov 6, 2018
31fff39
Added Sampling Support, Review feedback.
vancem Nov 15, 2018
609818f
Added placeholder for SetRecordingDesired
vancem Nov 15, 2018
8bad357
Separated out the Sampling support into its own PR.
vancem Nov 19, 2018
541b94b
Remove more sampling support
vancem Nov 19, 2018
bde8866
Fix IsWC3Id -> IdFormat
vancem Nov 19, 2018
b2f1f8c
Add ForceW3C option.
vancem Nov 26, 2018
f9bcf9f
Introduce ForceDefaultIdFormat
vancem Nov 30, 2018
342bee9
Adding SpanId and TraceId support
vancem Nov 30, 2018
0fd6aca
Added Sampling Support, Review feedback.
vancem Nov 15, 2018
d9e162a
Separated out the Sampling support into its own PR.
vancem Nov 19, 2018
615754d
Change ulong->long in SpanID (probably temporary)
vancem Dec 4, 2018
f6fd630
Remove undesired file changes
vancem Jan 8, 2019
8824298
Fix up reference assembly.
vancem Jan 8, 2019
a41774c
Turn on code that used Span<byte>
vancem Jan 9, 2019
1458b48
Defer setting IDFormat until start.
vancem Jan 10, 2019
396a4da
More implementation, made the interface more uniform.
vancem Jan 24, 2019
e4c602f
Support to avoid using strings whenever possible
vancem Feb 5, 2019
25e50fd
Added some tests
vancem Feb 5, 2019
5c21ca2
First round of testing (and bugfixes)
vancem Feb 8, 2019
c074bb8
More testing
vancem Feb 8, 2019
08c33cf
Added Equality operators
vancem Feb 8, 2019
bf6b233
Rename SpanId -> ActivitySpanId TraceId ->ActivityTraceId
vancem Feb 8, 2019
fe05292
Add Comments
vancem Feb 8, 2019
f815f91
Fix bad XML comment
vancem Feb 9, 2019
3f97097
Review feedback
vancem Feb 11, 2019
1d35e00
Change AsBytes -> CopyTo
vancem Feb 11, 2019
32f18c7
Attempt to fix build break in netfx build
vancem Feb 12, 2019
8d25ba9
Deal with Verification errors.
vancem Feb 12, 2019
ef67c9a
Provide full namespace for SecuritySafeCriticalAttribute
vancem Feb 12, 2019
ab202ec
More securitySafeCritical annotations to fix test failures on desktop
vancem Feb 12, 2019
77f5244
Another attempt on setting SecuritySafeCritical
vancem Feb 12, 2019
c63f73f
Remove the readonly ref (to avoid perf issue)
vancem Feb 19, 2019
b673339
Fix most -buildAllConfigurations issues
vancem Feb 19, 2019
2be8254
Tentative change to see if testing works if we ignore the older netst…
vancem Feb 19, 2019
fe504bc
Workaround package cycle involving DiagnosticSource and Memory
ericstj Feb 21, 2019
a53d797
Satisfy dangling System.Memory dangling reference in package tests
ericstj Feb 21, 2019
6824111
Add notes to remove the workarounds when Unsafe is fixed.
vancem Feb 22, 2019
7e027e4
Review feedback
vancem Feb 25, 2019
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
3 changes: 3 additions & 0 deletions external/netfx/netfx.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
<PackageReference Include="$(TargetingPackNugetPackageId)">
<Version >$(_TargetingPackVersion)</Version>
</PackageReference>
<PackageReference Include="System.Memory" Condition="'$(TargetGroup)' == 'net45' OR '$(TargetGroup)' == 'net46'">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about other netfx versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a question for @joperezr or @ericstj.

<Version>4.5.2</Version>
</PackageReference>
<PackageReference Include="$(NETStandardSupportPackageId)" Condition="'$(AddNetStandardSupportPackage)' == 'true'">
<Version>$(NETStandardSupportPackageVersion)</Version>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>

<!-- This file is a work-around and should be removed by 6/2019 (by then a fixed version of System.Memory
should be available so that System.Memory does not reference NetStandard1.X)
See Eric St John for details. -->

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard1.')) OR $(TargetFramework.StartsWith('netcoreapp1.'))">
<PackageReference Include="System.Memory" Version="4.5.1" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why pick this version over 4.5.2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fix that @joperezr suggested when @ericstj was out. I don't have a strong opinion, but in general isn't it better to use the oldest version that works?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a temporary workaround in the package testing infra. It's nothing that persists into the product. You can tell folks to manually reference the latest.

</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,22 @@
<Value>.NETCoreApp;UAP</Value>
</ValidatePackageSuppression>
</ItemGroup>

<!-- This target is a work-around and should be removed by 6/2019 (by then a fixed version of System.Memory
should be available so that System.Memory does not reference NetStandard1.X)
See Eric St John for details. -->

<Target Name="RemoveSystemMemoryNetStandard1x" AfterTargets="GetNuGetPackageDependencies">
<!-- System.Memory is causing a cycle when used for netstandard1.x.
This is due to S.M referencing the NETStandard.Library metapackage for netstandard1.x
and that meta-package includes this package (System.Diagnostics.DiagnosticSource) in
its closure.
Remove the dependency for now until we can get a new build of System.Memory that doesn't
reference the NETStandard.Library metapackage. -->
<ItemGroup>
<Dependency Remove="@(Dependency)" Condition="'%(Identity)' == 'System.Memory' AND $([System.String]::new('%(TargetFramework)').StartsWith('netstandard1.'))" />
</ItemGroup>
</Target>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<ProjectGuid>{3DF9A5D5-3D4B-4378-9B55-CFA6AC0114D9}</ProjectGuid>
<Configurations>net45-Debug;net45-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;netstandard1.1-Debug;netstandard1.1-Release;netstandard1.3-Debug;netstandard1.3-Release</Configurations>
<CLSCompliant>false</CLSCompliant>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetGroup)' == 'net45' OR '$(TargetGroup)' == 'netfx'">
<DefineConstants>$(DefineConstants);ALLOW_PARTIALLY_TRUSTED_CALLERS</DefineConstants>
Expand All @@ -11,11 +12,20 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'netstandard1.1'">
<Compile Include="System.Diagnostics.DiagnosticSourceActivity.cs" />
<Reference Include="System.Memory" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'net45' OR '$(TargetGroup)' == 'netfx'">
<Reference Include="mscorlib" />
</ItemGroup>

<ItemGroup Condition="'$(TargetGroup)' == 'net45'">
<Reference Include="System.Runtime" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netfx'">
<Reference Include="netstandard" />
</ItemGroup>

<ItemGroup Condition="'$(TargetGroup)' == 'netstandard1.1' or '$(TargetGroup)' == 'netstandard1.3'">
<Reference Include="System.Runtime" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
// Changes to this file must follow the http://aka.ms/api-review process.
// ------------------------------------------------------------------------------

namespace System.Diagnostics
namespace System.Diagnostics
{
public partial class Activity
{
public partial class Activity
{
public Activity(string operationName) { }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> Baggage { get { throw null; } }
public static Activity Current
Expand All @@ -22,26 +22,80 @@ public static Activity Current
#endif
set { }
}
public static System.Diagnostics.ActivityIdFormat DefaultIdFormat { get { throw null; } set { } }
public System.TimeSpan Duration { get { throw null; } }
public static bool ForceDefaultIdFormat { get { throw null; } set { } }
public string Id { get { throw null; } }
public System.Diagnostics.ActivityIdFormat IdFormat { get { throw null; } }
public string OperationName { get { throw null; } }
public System.Diagnostics.Activity Parent { get { throw null; } }
public string ParentId { get { throw null; } }
public ref System.Diagnostics.ActivitySpanId ParentSpanId { get { throw null; } }
public string RootId { get { throw null; } }
public ref System.Diagnostics.ActivitySpanId SpanId { get { throw null; } }
public System.DateTime StartTimeUtc { get { throw null; } }
public System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> Tags { get { throw null; } }
public ref System.Diagnostics.ActivityTraceId TraceId { get { throw null; } }
public string TraceStateString { get { throw null; } set { } }
public System.Diagnostics.Activity AddBaggage(string key, string value) { throw null; }
public System.Diagnostics.Activity AddTag(string key, string value) { throw null; }
public string GetBaggageItem(string key) { throw null; }
public System.Diagnostics.Activity SetEndTime(System.DateTime endTimeUtc) { throw null; }
public System.Diagnostics.Activity SetParentId(in System.Diagnostics.ActivityTraceId traceId, in System.Diagnostics.ActivitySpanId spanId) { throw null; }
public System.Diagnostics.Activity SetParentId(string parentId) { throw null; }
public System.Diagnostics.Activity SetStartTime(System.DateTime startTimeUtc) { throw null; }
public System.Diagnostics.Activity Start() { throw null; }
public void Stop() { }
}
public abstract partial class DiagnosticSource
{
public Activity StartActivity(Activity activity, object args) {throw null;}
public void StopActivity(Activity activity, object args) {}
}
}
public enum ActivityIdFormat : byte
{
Hierarchical = (byte)1,
Unknown = (byte)0,
W3C = (byte)2,
}

#if ALLOW_PARTIALLY_TRUSTED_CALLERS
[System.Security.SecuritySafeCriticalAttribute]
#endif
public partial struct ActivitySpanId : IEquatable<ActivitySpanId>
{
private object _dummy;
private int _dummyPrimitive;
public ActivitySpanId(System.ReadOnlySpan<byte> idData, bool isUtf8Chars = false) { throw null; }
public ActivitySpanId(System.ReadOnlySpan<char> idData) { throw null; }
public string AsHexString { get { throw null; } }
public void CopyTo(System.Span<byte> destination) { }
public bool Equals(System.Diagnostics.ActivitySpanId spanId) { throw null; }
public override bool Equals(object obj) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Diagnostics.ActivitySpanId NewSpanId() { throw null; }
public static bool operator ==(in System.Diagnostics.ActivitySpanId spanId1, in System.Diagnostics.ActivitySpanId spandId2) { throw null; }
public static bool operator !=(in System.Diagnostics.ActivitySpanId spanId1, in System.Diagnostics.ActivitySpanId spandId2) { throw null; }
public override string ToString() { throw null; }
}

#if ALLOW_PARTIALLY_TRUSTED_CALLERS
[System.Security.SecuritySafeCriticalAttribute]
#endif
public partial struct ActivityTraceId : IEquatable<ActivityTraceId>
{
private object _dummy;
private int _dummyPrimitive;
public ActivityTraceId(System.ReadOnlySpan<byte> idData, bool isUtf8Chars = false) { throw null; }
public ActivityTraceId(System.ReadOnlySpan<char> idData) { throw null; }
public string AsHexString { get { throw null; } }
public void CopyTo(System.Span<byte> destination) { }
public bool Equals(System.Diagnostics.ActivityTraceId traceId) { throw null; }
public override bool Equals(object obj) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Diagnostics.ActivityTraceId NewTraceId() { throw null; }
public static bool operator ==(in System.Diagnostics.ActivityTraceId traceId1, in System.Diagnostics.ActivityTraceId traceId2) { throw null; }
public static bool operator !=(in System.Diagnostics.ActivityTraceId traceId1, in System.Diagnostics.ActivityTraceId traceId2) { throw null; }
public override string ToString() { throw null; }
}
public abstract partial class DiagnosticSource
{
public Activity StartActivity(Activity activity, object args) { throw null; }
public void StopActivity(Activity activity, object args) { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PackageTargetFramework Condition="'$(TargetGroup)' == 'netstandard1.1'">netstandard1.1;portable-net45+win8+wpa81</PackageTargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BlockReflectionAttribute>false</BlockReflectionAttribute>
<CLSCompliant>false</CLSCompliant>
<Configurations>net45-Debug;net45-Release;net46-Debug;net46-Release;netcoreapp-Debug;netcoreapp-Release;netfx-Debug;netfx-Release;netstandard-Debug;netstandard-Release;netstandard1.1-Debug;netstandard1.1-Release;netstandard1.3-Debug;netstandard1.3-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release</Configurations>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetGroup)' == 'netstandard1.1' OR '$(TargetGroup)' == 'net45'">
Expand All @@ -25,6 +26,7 @@
<ItemGroup Condition=" '$(TargetGroup)' != 'netstandard1.1'">
<Compile Include="System\Diagnostics\Activity.cs" />
<Compile Include="System\Diagnostics\DiagnosticSourceActivity.cs" />
<Reference Include="System.Memory" />
<None Include="ActivityUserGuide.md" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetGroup)' != 'net45' And '$(TargetGroup)' != 'netstandard1.1'">
Expand All @@ -41,13 +43,14 @@
<ItemGroup Condition="'$(TargetGroup)' == 'net45' OR '$(TargetGroup)' == 'net46' OR '$(TargetGroup)' == 'netfx'">
<Compile Include="System\Diagnostics\HttpHandlerDiagnosticListener.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'net46' AND '$(TargetGroup)' != 'netfx'">
<ItemGroup Condition="'$(TargetGroup)' != 'netfx'">
<Reference Include="System.Collections" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Diagnostics.Tracing" />
<Reference Include="System.Reflection" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Threading" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'net45' OR '$(TargetGroup)' == 'net46' OR '$(TargetGroup)' == 'netfx'">
Expand All @@ -56,4 +59,4 @@
<Reference Include="mscorlib" />
<Reference Include="System" />
</ItemGroup>
</Project>
</Project>
Loading