Changes to support W3C style IDs and propagation (dotnet/corefx#33207)
authorVance Morrison <vancem@microsoft.com>
Tue, 26 Feb 2019 15:51:19 +0000 (07:51 -0800)
committerGitHub <noreply@github.com>
Tue, 26 Feb 2019 15:51:19 +0000 (07:51 -0800)
commit12d86dca44cbe6537278e47fab5453bde36d9e62
tree4b7e2ef93d712211de07ff5864d642752d71d96c
parent19fc9cb9ed0dac6d020ef7d93419fb8bd4ece6d8
Changes to support W3C style IDs and propagation (dotnet/corefx#33207)

* First set of changes to support W3C style IDs and propagation

see https://w3c.github.io/trace-context

This is mostly for discussion purposes.

* Changed UseW3CFormat to be DefaultIdFormat

* Review feedback

* More comments.  Small Renames

* Added Sampling Support, Review feedback.

* Added placeholder for SetRecordingDesired

* Separated out the Sampling support into its own PR.

* Remove more sampling support

* Fix IsWC3Id -> IdFormat

* Added Sampling Support, Review feedback.

* Separated out the Sampling support into its own PR.

* Add ForceW3C option.

* Introduce ForceDefaultIdFormat

* Adding SpanId and TraceId support

* Change ulong->long in SpanID (probably temporary)

* Remove undesired file changes

* Fix up reference assembly.

Note complete because of questions about Span<byte>, but closer now.

* Turn on code that used Span<byte>

* Defer setting IDFormat until start.

This insures that the IDFormat property is either unknown or a given value (that never changes from there).

* More implementation, made the interface more uniform.

* Support to avoid using strings whenever possible

Basically Id, SpanId TraceId properties are set lazily and only converted lazily.

* Added some tests

* First round of testing (and bugfixes)

* More testing

* Added Equality operators

* Rename SpanId -> ActivitySpanId TraceId ->ActivityTraceId

* Add Comments

* Fix bad XML comment

* Review feedback

* Change AsBytes -> CopyTo

Lifetime issues prevent returning Span<T> (which is what AsBytes does.   Reverting to CopyTo instead.
Also added System.Memory ref in attempt to resolve build errors (that don't reproduce locally).

* Attempt to fix build break in netfx build

* Deal with Verification errors.

* Provide full namespace for SecuritySafeCriticalAttribute

* More securitySafeCritical annotations to fix test failures on desktop

* Another attempt on setting SecuritySafeCritical

* Remove the readonly ref (to avoid perf issue)

* Fix most  -buildAllConfigurations issues

* Tentative change to see if testing works if we ignore the older netstandard configs.

* Workaround package cycle involving DiagnosticSource and Memory

* Satisfy dangling System.Memory dangling reference in package tests

* Add notes to remove the workarounds when Unsafe is fixed.

* Review feedback

Uses Utf8 helpers where possible.

Commit migrated from https://github.com/dotnet/corefx/commit/fa07e4f0a8e564f33ef8e2de86dc9087a53bdf26
src/libraries/System.Diagnostics.DiagnosticSource/pkg/System.Diagnostics.DiagnosticSource.pkgproj
src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSource.csproj
src/libraries/System.Diagnostics.DiagnosticSource/ref/System.Diagnostics.DiagnosticSourceActivity.cs
src/libraries/System.Diagnostics.DiagnosticSource/src/System.Diagnostics.DiagnosticSource.csproj
src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs
src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs
src/libraries/System.Diagnostics.DiagnosticSource/tests/Configurations.props
src/libraries/external/netfx/netfx.depproj
src/libraries/pkg/test/packageSettings/System.Diagnostics.DiagnosticSource/workaroundMissingSystemMemory.targets [new file with mode: 0644]