{"id":12525,"date":"2018-03-22T07:12:38","date_gmt":"2018-03-22T14:12:38","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/?p=12525"},"modified":"2018-03-22T07:12:38","modified_gmt":"2018-03-22T14:12:38","slug":"asp-net-core-manageability-and-application-insights-improvements","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/asp-net-core-manageability-and-application-insights-improvements\/","title":{"rendered":"ASP.NET Core manageability and Application Insights improvements"},"content":{"rendered":"<p>There are many great investments on the\u202f<a href=\"https:\/\/blogs.msdn.microsoft.com\/webdev\/2018\/02\/02\/asp-net-core-2-1-roadmap\/\">ASP.NET Core 2.1 roadmap<\/a>. These investments make\u202fASP.NET\u202fCore applications easier to write, host, test, and make security and standards compliant. This blog post talks about areas of investments in manageability and monitoring space. It covers\u202fASP.NET\u202fCore, .NET, and Application Insights SDK for\u202fASP.NET Core features and spans beyond 2.1 milestone.<\/p>\n<p>The main themes of manageability improvements across the application stack are:<\/p>\n<ol>\n<li>Distributed tracing<\/li>\n<li>Cross platform features parity<\/li>\n<li>Runtime awareness<\/li>\n<li>Ease of enablement<\/li>\n<li>App framework self-reporting<\/li>\n<\/ol>\n<p>Let\u2019s dig into the improvements made and the roadmap ahead in these areas.<\/p>\n<h2>Distributed tracing<\/h2>\n<p>ASP.NET\u202fCore 2.0 applications are distributed tracing aware. The context required to track a distributed trace is automatically created or read from incoming HTTP requests and forwarded along with any outgoing out-of-process calls. Collection of distributed trace details does NOT require application code change. No need to register a middleware or install an agent. You can check out the <a href=\"https:\/\/docs.microsoft.com\/azure\/application-insights\/app-insights-transaction-diagnostics\">preview of end-to-end trace view<\/a> as shown on a picture below and more distributed tracing scenarios in Azure Application Insights.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2018\/03\/Untitled1.png\"><img decoding=\"async\" width=\"624\" height=\"257\" class=\"alignnone wp-image-12535 size-full\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2018\/03\/Untitled1-1.png\" \/><\/a><\/p>\n<p>ASP.NET\u202fCore 2.0 was shipped with the support of incoming http requests and outgoing\u202fHttpClient\u202frequests monitoring. Recently support was extended for outgoing calls made via\u202fSqlClient\u202ffor .NET Core, Azure\u202fEvent Hub, and the Azure\u202fService Bus\u202fSDKs. Libraries are instrumented with the\u202f<a href=\"https:\/\/github.com\/dotnet\/corefx\/blob\/master\/src\/System.Diagnostics.DiagnosticSource\/src\/ActivityUserGuide.md\">DiagnosticSource<\/a>\u202fcallbacks. It makes distributed tracing easy to consume by any APM or diagnostics tool.\u00a0More libraries plan to enable\u202fDiagnosticSource\u202fsupport to participate in distributed trace.<\/p>\n<p>Application Insights SDK for\u202fASP.NET\u202fCore <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.ApplicationInsights.AspNetCore\/2.2.1\">2.2.1<\/a> was shipped recently. It now automatically collects outgoing calls made using the libraries mentioned above.<\/p>\n<p>We are also working with the community to\u202f<a href=\"https:\/\/www.w3.org\/community\/trace-context\/\">standardize<\/a>\u202fdistributed tracing protocols. Accepted standard enables even wider adoption of distributed tracing. It also simplifies mixing components written in different languages as well as serverless cloud components in a single microservice environment. Our hope is that this standard will be in place for adoption by the next version of\u202fASP.NET\u202fCore.<\/p>\n<h2>Cross platform features parity<\/h2>\n<p>ASP.NET Core applications may target two .NET versions &#8211; .NET Framework and .NET Core. They can run on Windows and Linux. Many efforts are directed to bring feature parity between these runtime environments.<\/p>\n<p>There are framework investments for better manageability of ASP.NET Core application across runtime environments. For instance, <a href=\"https:\/\/www.nuget.org\/packages\/System.Diagnostics.PerformanceCounter\/\">System.Diagnostics.PerformanceCounter<\/a> package was recently released. It allows application to collect Performance Counters from .NET Core applications running on Windows. This package was only available for apps compiled for .NET Framework environment before.<\/p>\n<p>Low level manageability interfaces like Profiling API also getting to the feature parity on various runtime platforms.<\/p>\n<p>Recently more Application Insights features were ported from .NET Framework version to .NET Core. Application Insights SDK for ASP.NET Core <a href=\"https:\/\/github.com\/Microsoft\/ApplicationInsights-aspnetcore\/releases\/tag\/v2.2.1\">version 2.2.1<\/a> have live metrics support, hardened telemetry channel with more reliable data upload. And adaptive sampling feature to enable better control of telemetry volume and price.<\/p>\n<p>We are excited to announce the public preview for <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/application-insights\/app-insights-profiler\">Application Insights Profiler<\/a>\u00a0on ASP.NET core Linux web apps. Learn more at documentation page <a href=\"https:\/\/docs.microsoft.com\/azure\/application-insights\/app-insights-profiler-aspnetcore-linux\">Profile ASP.NET Core Azure Linux Web Apps with Application Insights Profiler<\/a>.<\/p>\n<p><a href=\"http:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2018\/03\/profiler-traces.png\"><img decoding=\"async\" width=\"879\" height=\"288\" class=\"alignnone wp-image-12605 size-large\" alt=\"\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2018\/03\/profiler-traces-1024x336-1.png\" \/><\/a><\/p>\n<h2>Runtime awareness<\/h2>\n<p>Variety of runtime platforms makes the job of monitoring tools harder. Application Insights SDK needs to be runtime aware. Team makes investments to natively understand platforms like Azure Web Apps or containers run by <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.ApplicationInsights.Kubernetes.HostingStartup\/\">Kubernetes<\/a>.<\/p>\n<p>Ability to associate infrastructure telemetry with application insights is important. Correlating container CPU and number of running instances with the request load and reliability of an application allows to get a full picture of application behavior. It allows to find out the root cause of the problem faster and apply remediations curated to the runtime environment.<\/p>\n<h2>Ease of enablement<\/h2>\n<p>When time comes to manageability and diagnostics \u2013 the last thing you want to do is to redeploy an application to enable additional data collection. Especially when application is running in production. There are set of investments teams making to simplify enablement of manageability, monitoring and diagnostics settings.<\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/application-insights\/app-insights-snapshot-debugger\">Snapshot Debugger<\/a> will be enabled by default for the ASP.NET Core applications running as Azure Web App.<\/p>\n<p>Another aspect of easier onboarding is Application Insights SDK <a href=\"https:\/\/github.com\/Microsoft\/ApplicationInsights-aspnetcore\/issues\/505\">configuration story ironing<\/a>. Today Application Insights predefine many monitoring settings. Those settings work great for majority of application. However, changing of them is not always easy and intuitive when needed.<\/p>\n<p>ASP.NET Core has many built-in self-reporting capabilities. Exposing them in a form that is easy to consume across runtime platforms is one of the goals of .NET team. There is a <a href=\"https:\/\/github.com\/dotnet\/designs\/pull\/26\">proposal<\/a> to expose many of manageability settings and monitoring data via http callbacks.<\/p>\n<h2>App framework self-reporting<\/h2>\n<p><a href=\"http:\/\/asp.net\/\">ASP.NET<\/a> framework improves manageability by exposing more internal app metrics. As a result of this <a href=\"https:\/\/github.com\/aspnet\/Logging\/issues\/708\">discussion<\/a> these metrics are exposed in a platform-independent way via EventCounters. Metrics exposed via EventCounters are available for in-process and out-of-process consumption.<\/p>\n<p>There is another example of a great improvement made in .NET for better manageability and monitoring. Stack traces became way more readable in .NET 2.1. This <a href=\"https:\/\/www.ageofascent.com\/2018\/01\/26\/stack-trace-for-exceptions-in-dotnet-core-2.1\/\">blog post<\/a> outlines few improvements made recently in this area.<\/p>\n<h2>Summary<\/h2>\n<p>There are many new manageability and monitoring features coming up. Some of them committed, some planned, and some are just proposals. You can help prioritizing features by commenting on GitHub for <a href=\"https:\/\/github.com\/aspnet\/home\">ASP.NET<\/a>, <a href=\"https:\/\/github.com\/Microsoft\/ApplicationInsights-aspnetcore\/issues\">Application Insights<\/a> and <a href=\"https:\/\/github.com\/dotnet\/corefx\/issues\">.NET<\/a>. You can also get live updates and participate in the conversation by watching the weekly ASP.NET Community Standup at <a href=\"https:\/\/live.asp.net\/\">https:\/\/live.asp.net<\/a>. Your feedback is welcome and appreciated!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are many great investments on the\u202fASP.NET Core 2.1 roadmap. These investments make\u202fASP.NET\u202fCore applications easier to write, host, test, and make security and standards compliant. This blog post talks about areas of investments in manageability and monitoring space. It covers\u202fASP.NET\u202fCore, .NET, and Application Insights SDK for\u202fASP.NET Core features and spans beyond 2.1 milestone. The main [&hellip;]<\/p>\n","protected":false},"author":397,"featured_media":21408,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197,7509],"tags":[7498,32,7552],"class_list":["post-12525","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","category-aspnetcore","tag-application-insights","tag-asp-net-core","tag-manageability"],"acf":[],"blog_post_summary":"<p>There are many great investments on the\u202fASP.NET Core 2.1 roadmap. These investments make\u202fASP.NET\u202fCore applications easier to write, host, test, and make security and standards compliant. This blog post talks about areas of investments in manageability and monitoring space. It covers\u202fASP.NET\u202fCore, .NET, and Application Insights SDK for\u202fASP.NET Core features and spans beyond 2.1 milestone. The main [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/12525","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/397"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=12525"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/12525\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/21408"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=12525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=12525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=12525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}