You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

咨询ASP.NET Core下Application Insights实时指标流对应的.NET Core包

Answer to Your .NET Core Live Metric Stream Package Question

Absolutely, there's a dedicated solution for enabling Live Metric Stream in .NET Core applications—you don't need to rely on the .NET Framework-only Microsoft.ApplicationInsights.Web package.

Here's what you need to know:

  • The official, .NET Core-compatible package is Microsoft.ApplicationInsights.AspNetCore. This is the core SDK for integrating Application Insights into ASP.NET Core apps, and it includes built-in support for Live Metric Stream out of the box.
  • For non-ASP.NET Core .NET Core apps (like console services or background workers), you can use the base Microsoft.ApplicationInsights package, then configure telemetry settings to enable Live Metrics (setup is a bit more manual compared to web apps, but fully supported).

Quick Setup for ASP.NET Core Apps:

  1. Install the package via NuGet:
    Install-Package Microsoft.ApplicationInsights.AspNetCore
    # Or use .NET CLI
    dotnet add package Microsoft.ApplicationInsights.AspNetCore
    
  2. Configure Application Insights in your code:
    • For .NET 6+ (top-level statements in Program.cs):
      var builder = WebApplication.CreateBuilder(args);
      // Add Application Insights telemetry
      builder.Services.AddApplicationInsightsTelemetry();
      // Rest of your app configuration...
      
    • For older .NET Core versions (using Startup.cs):
      public void ConfigureServices(IServiceCollection services)
      {
          services.AddApplicationInsightsTelemetry(Configuration["ApplicationInsights:InstrumentationKey"]);
          // Other service setups...
      }
      
  3. Once configured, Live Metric Stream will be enabled by default. You can access it directly from your Application Insights resource in the Azure portal—no extra packages or complex tweaks required.

A key point to note: Live Metric Stream in .NET Core supports all the core features you'd get with the .NET Framework version, including real-time request rates, exception tracking, and custom metric streaming.

内容的提问来源于stack exchange,提问作者Thomas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:31:00