Skip to content
代码片段 群组 项目
未验证 提交 93d88ac0 编辑于 作者: James Newton-King's avatar James Newton-King 提交者: GitHub
浏览文件

Include DefaultHttpContext.HttpContext for diagnostic activities (#42591)

上级 7650c58e
No related branches found
No related tags found
无相关合并请求
...@@ -426,6 +426,8 @@ internal sealed class HostingApplicationDiagnostics ...@@ -426,6 +426,8 @@ internal sealed class HostingApplicationDiagnostics
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(QueryString))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(QueryString))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(HostString))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(HostString))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(PathString))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(PathString))]
// OpenTelemetry gets the context from the context using the DefaultHttpContext.HttpContext property.
[DynamicDependency(nameof(DefaultHttpContext.HttpContext), typeof(DefaultHttpContext))]
private Activity StartActivity(Activity activity, HttpContext httpContext) private Activity StartActivity(Activity activity, HttpContext httpContext)
{ {
activity.Start(); activity.Start();
...@@ -438,6 +440,8 @@ internal sealed class HostingApplicationDiagnostics ...@@ -438,6 +440,8 @@ internal sealed class HostingApplicationDiagnostics
[DynamicDependency(nameof(HttpContext.Response), typeof(HttpContext))] [DynamicDependency(nameof(HttpContext.Response), typeof(HttpContext))]
[DynamicDependency(nameof(HttpResponse.StatusCode), typeof(HttpResponse))] [DynamicDependency(nameof(HttpResponse.StatusCode), typeof(HttpResponse))]
[DynamicDependency(nameof(HttpResponse.Headers), typeof(HttpResponse))] [DynamicDependency(nameof(HttpResponse.Headers), typeof(HttpResponse))]
// OpenTelemetry gets the context from the context using the DefaultHttpContext.HttpContext property.
[DynamicDependency(nameof(DefaultHttpContext.HttpContext), typeof(DefaultHttpContext))]
private void StopActivity(Activity activity, HttpContext httpContext) private void StopActivity(Activity activity, HttpContext httpContext)
{ {
// Stop sets the end time if it was unset, but we want it set before we issue the write // Stop sets the end time if it was unset, but we want it set before we issue the write
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册