-
Notifications
You must be signed in to change notification settings - Fork 140
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
Use DiagnosticSource to instrument ASP.NET Core #611
Use DiagnosticSource to instrument ASP.NET Core #611
Conversation
676f2f5
to
d5a83e4
Compare
5a1c5a7
to
f70826c
Compare
9fb14c8
to
537dfcc
Compare
537dfcc
to
ccfde7a
Compare
4dfccb5
to
f97a423
Compare
…e the startup hook is executed on ASP.NET Core
…apture exceptions in ASP.NET Core (not MVC)
… now have Microsoft.AspNetCore.Diagnostics.UnhandledException
@@ -7,10 +7,12 @@ | |||
<Version>1.11.1-prerelease</Version> | |||
<Title>Datadog APM - ClrProfiler</Title> | |||
<Description>OBSOLETE. This package is deprecated and exists only for backwards compatibility. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this package is obsolete, should we continue releasing new versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly I just wanted to update the description text. It causes confusion among users. For example, see #609, #619, and some conversations on public Slack.
But we may need to keep updating it anyway to keep the version in sync with the installers for users who haven't realized that they should remove the package.
(edit: grammar)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they are upgrading, wouldn't that be when we want them to stop including it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, yes, but we don't have a way from stopping a user from upgrading blindly without reading the new package description. And if a user updates the installer and keep the older NuGet package (because we stop updating it), then the non-matching versions causes other issues.
I think it's little effort for us to keep bumping the version here for now so we don't break users who are using this package. We can drop it entirely when we make other big breaking changes (2.0?).
Keep in mind that users were using this packages for 3 different use cases:
- manual instrumentation (because it includes
Datadog.Trace
) - ASP.NET integration (before it moves to
Datadog.Trace.AspNet
) - auto-instrumentation on .NET Core (before the assemblies were moved into the installer)
|
||
public virtual bool IsSubscriberEnabled() | ||
{ | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any plans to make this config based?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should! This is left-over from the project I based these changes on. I can remove it or we can leave it as a placeholder for "future feature". I have no strong feelings either way.
…erly validate the http status code and http method, and fix the tags for http status code and http method
d3efb89
to
7287ee6
Compare
* clean up env vars, project properties, and unused references * update 3rd-party license file * changes to IScope, ISpan, and IDatadogTracer interfaces * disable current AspNetCoreMvc2 and AspNetCoreMvc3 integrations * add minimal solution * subscribe to DiagnosticSource events from Tracer if enabled * add startup hook * add Datadog.Trace.DiagnosticListeners * add DiagnosticSource configuration * fix URLs to moved repositories * update notes in deprecated NuGet package * fix nuget package comment * remove redundant null coalescing operator * use System.Net.Http from the GAC when targeting net4*, use the nuget package when targeting netstandard2.0 * support ASP.NET Core running on .NET Framework * add logs * remove the build dependency on Datadog.Trace.dll and Datadog.Trace.ClrProfiler.Managed.dll in sample app * fix comment * don't try to write to stderr * remove tailing whitespace * call Tracer.StartDiagnosticObservers from the auto-instrumentation startup hook * stop previous observers when starting new ones in StartDiagnosticObservers() * convert GetListenerName() to property ListenerName * check if there is a parent span earlier to avoid extra work * reorder methods into expected execution order * reference System.Diagnostics.DiagnosticSource 4.4.1, the version used by Microsoft.AspNetCore.* 2.0.0 * move the check for available System.Diagnostics.DiagnosticSource into Tracer * remove remaning sample apps and solution items from the "minimal" solution * remove integration tests for deleted integrations * add missing System.Net.Http references * fix aspnet core mvc integration tests * always save moduel metadata for Microsoft.AspNetCore.Hosting to ensure the startup hook is executed on ASP.NET Core * handle Microsoft.AspNetCore.Diagnostics.UnhandledException event to capture exceptions in ASP.NET Core (not MVC) * use ordinal string compare * stop handling Microsoft.AspNetCore.Mvc.AfterOnActionExecuted since we now have Microsoft.AspNetCore.Diagnostics.UnhandledException * add test app for "pure" ASP.NET Core 3.1 (no MVC) * optimize Log.IsEnabled() calls (only cache the result if it will be used very often) * add checks for error flag and error type in AspNetCoreMvc integration tests * rethrow exceptions in SubmitRequest() so tests fail * add missing netcoreapp3.1 targets in Windows * rename SpanExpectation.Detail() to ToString() and other code clean up * fix WebServerSpanExpectation and AspNetCoreMvcSpanExpectation to properly validate the http status code and http method, and fix the tags for http status code and http method * rewrite SubmitRequest() to use HttpClient instead of WebRequest * stop EntityFramework6x.MdTokenLookupFailure from including Test.Common.props * change wording in sample app * target netcoreapp3.1 in PrepareRelease (resolves nuget restore error) * don't configure an exception handler * add test for 404 * change the default values to unbreak the GraphQL tests
* clean up env vars, project properties, and unused references * update 3rd-party license file * changes to IScope, ISpan, and IDatadogTracer interfaces * disable current AspNetCoreMvc2 and AspNetCoreMvc3 integrations * add minimal solution * subscribe to DiagnosticSource events from Tracer if enabled * add startup hook * add Datadog.Trace.DiagnosticListeners * add DiagnosticSource configuration * fix URLs to moved repositories * update notes in deprecated NuGet package * fix nuget package comment * remove redundant null coalescing operator * use System.Net.Http from the GAC when targeting net4*, use the nuget package when targeting netstandard2.0 * support ASP.NET Core running on .NET Framework * add logs * remove the build dependency on Datadog.Trace.dll and Datadog.Trace.ClrProfiler.Managed.dll in sample app * fix comment * don't try to write to stderr * remove tailing whitespace * call Tracer.StartDiagnosticObservers from the auto-instrumentation startup hook * stop previous observers when starting new ones in StartDiagnosticObservers() * convert GetListenerName() to property ListenerName * check if there is a parent span earlier to avoid extra work * reorder methods into expected execution order * reference System.Diagnostics.DiagnosticSource 4.4.1, the version used by Microsoft.AspNetCore.* 2.0.0 * move the check for available System.Diagnostics.DiagnosticSource into Tracer * remove remaning sample apps and solution items from the "minimal" solution * remove integration tests for deleted integrations * add missing System.Net.Http references * fix aspnet core mvc integration tests * always save moduel metadata for Microsoft.AspNetCore.Hosting to ensure the startup hook is executed on ASP.NET Core * handle Microsoft.AspNetCore.Diagnostics.UnhandledException event to capture exceptions in ASP.NET Core (not MVC) * use ordinal string compare * stop handling Microsoft.AspNetCore.Mvc.AfterOnActionExecuted since we now have Microsoft.AspNetCore.Diagnostics.UnhandledException * add test app for "pure" ASP.NET Core 3.1 (no MVC) * optimize Log.IsEnabled() calls (only cache the result if it will be used very often) * add checks for error flag and error type in AspNetCoreMvc integration tests * rethrow exceptions in SubmitRequest() so tests fail * add missing netcoreapp3.1 targets in Windows * rename SpanExpectation.Detail() to ToString() and other code clean up * fix WebServerSpanExpectation and AspNetCoreMvcSpanExpectation to properly validate the http status code and http method, and fix the tags for http status code and http method * rewrite SubmitRequest() to use HttpClient instead of WebRequest * stop EntityFramework6x.MdTokenLookupFailure from including Test.Common.props * change wording in sample app * target netcoreapp3.1 in PrepareRelease (resolves nuget restore error) * don't configure an exception handler * add test for 404 * change the default values to unbreak the GraphQL tests
* clean up env vars, project properties, and unused references * update 3rd-party license file * changes to IScope, ISpan, and IDatadogTracer interfaces * disable current AspNetCoreMvc2 and AspNetCoreMvc3 integrations * add minimal solution * subscribe to DiagnosticSource events from Tracer if enabled * add startup hook * add Datadog.Trace.DiagnosticListeners * add DiagnosticSource configuration * fix URLs to moved repositories * update notes in deprecated NuGet package * fix nuget package comment * remove redundant null coalescing operator * use System.Net.Http from the GAC when targeting net4*, use the nuget package when targeting netstandard2.0 * support ASP.NET Core running on .NET Framework * add logs * remove the build dependency on Datadog.Trace.dll and Datadog.Trace.ClrProfiler.Managed.dll in sample app * fix comment * don't try to write to stderr * remove tailing whitespace * call Tracer.StartDiagnosticObservers from the auto-instrumentation startup hook * stop previous observers when starting new ones in StartDiagnosticObservers() * convert GetListenerName() to property ListenerName * check if there is a parent span earlier to avoid extra work * reorder methods into expected execution order * reference System.Diagnostics.DiagnosticSource 4.4.1, the version used by Microsoft.AspNetCore.* 2.0.0 * move the check for available System.Diagnostics.DiagnosticSource into Tracer * remove remaning sample apps and solution items from the "minimal" solution * remove integration tests for deleted integrations * add missing System.Net.Http references * fix aspnet core mvc integration tests * always save moduel metadata for Microsoft.AspNetCore.Hosting to ensure the startup hook is executed on ASP.NET Core * handle Microsoft.AspNetCore.Diagnostics.UnhandledException event to capture exceptions in ASP.NET Core (not MVC) * use ordinal string compare * stop handling Microsoft.AspNetCore.Mvc.AfterOnActionExecuted since we now have Microsoft.AspNetCore.Diagnostics.UnhandledException * add test app for "pure" ASP.NET Core 3.1 (no MVC) * optimize Log.IsEnabled() calls (only cache the result if it will be used very often) * add checks for error flag and error type in AspNetCoreMvc integration tests * rethrow exceptions in SubmitRequest() so tests fail * add missing netcoreapp3.1 targets in Windows * rename SpanExpectation.Detail() to ToString() and other code clean up * fix WebServerSpanExpectation and AspNetCoreMvcSpanExpectation to properly validate the http status code and http method, and fix the tags for http status code and http method * rewrite SubmitRequest() to use HttpClient instead of WebRequest * stop EntityFramework6x.MdTokenLookupFailure from including Test.Common.props * change wording in sample app * target netcoreapp3.1 in PrepareRelease (resolves nuget restore error) * don't configure an exception handler * add test for 404 * change the default values to unbreak the GraphQL tests
This PR rewrites the ASP.NET Core integration to subscribe to the built-in
DiagnosticSource
events instead of replacing method calls.