Skip to content

.NET Core 3.1 & .NET 5 support

Pre-release
Pre-release
Compare
Choose a tag to compare
@cwe1ss cwe1ss released this 12 Dec 07:30
· 10 commits to master since this release

This is one last big change for this project that should hopefully bring it in a state that fixes the most pressing issues and should therefore make it reasonably useful until OpenTelemetry is GA.

The OpenTelemetry .NET library can be found at https://github.com/open-telemetry/opentelemetry-dotnet.

Changes:

  • Adds explicit support for .NET Core 2.1, .NET Core 3.1 & .NET 5.0.
    • Other versions of .NET Core & .NET framework are NOT supported!
    • There's separate samples for each .NET version in the samples-folder.
  • The library switched to Microsoft.SourceLink.GitHub for SourceLink-support. Please let us know if SourceLink does not work for you.
  • All *Options-types are now in the OpenTracing.Contrib.NetCore.Configuration namespace!
  • ASP.NET Core instrumentation:
    • Most MVC events are no longer added to the spans (BeforeOnActionExecution, BeforeOnActionExecuting, ...) to reduce noise. Call ConfigureAspNetCore(options => options.IgnoredEvents.Clear()) if you still want to see all events. You can also just remove certain events from that list.
    • Call ConfigureAspNetCore(options => options.LogEvents = false) if you don't want to have any ASP.NET Core related events added to your spans.
    • When ASP.NET Core is instrumented (AddAspNetCore()), all other areas are set to options.StartRootSpans = false (see below). This means that no spans are created if you ignore a request via options.IgnorePatterns.
    • Internal: Spans are now stored in HttpContext.items to reduce the coupling to AsyncLocal. This should prevent the code from finishing wrong spans in some scenarios.
  • CoreFx instrumentation
    • AddCoreFx() has been removed. Instead there's now separate methods for each instrumented feature:
      • AddHttpHandler()/ConfigureHttpHandler() for instrumenting System.Net.Http (HttpClient)
      • AddGenericDiagnostics()/ConfigureGenericDiagnostics() for instrumenting generic DiagnosticListeners.
    • The GenericEventOptions-type has been removed.
      • Use RemoveGenericDiagnostics() instead of GenericEventOptions.IgnoreAll to completely disable the tracing of generic DiagnosticListeners.
      • Use ConfigureGenericDiagnostics() to add certain IgnoredListenerNames and IgnoredEvents.
  • SqlClient instrumentation
    • The library now instruments System.Data.SqlClient and the newer Microsoft.Data.SqlClient. Use the corresponding AddSystemSqlClient()/ConfigureSystemSqlClient() & AddMicrosoftSqlClient()/ConfigureMicrosoftSqlClient() methods to configure the behavior.
    • If options.StartRootSpans equals true, spans for SqlClient will only be created if there is an active parent span. ASP.NET Core instrumentation enables this feature and will therefore NOT create any spans if the ASP.NET Core request itself is ignored.
    • Use options.LogEvents & options.IgnoredEvents to customize if & which events should be added to the spans.
  • Entity Framework Core instrumentation
    • Many EF Core events are no longer added as events to the spans to reduce noise. Use ConfigureEntityFrameworkCore(options => options.IgnoredEvents.Clear()) to trace all events or modify the IgnoredEvents-list to your liking. Set options.LogEvents = false to disable all events.
    • If options.StartRootSpans equals true, spans for EF Core will only be created if there is an active parent span. ASP.NET Core instrumentation enables this feature and will therefore NOT create any spans if the ASP.NET Core request itself is ignored.
    • Internal: Spans are now stored in a ConcurrentDictionary for correlation to reduce the coupling to AsyncLocal. This should prevent the code from finishing wrong spans in certain scenarios.
  • ILogger instrumentation
    • The minimum logging level for Microsoft.AspNetCore has been increased to Warning to reduce the amount of span events.

Changes for contributors

  • The project now requires the .NET SDK 5.0.101 and the following runtime versions to be installed for a successful build: 2.0.7, 2.1.23, 3.1.10.