C# Azure AppInsights未跟踪所有请求

C# Azure AppInsights未跟踪所有请求,c#,azure,azure-application-insights,C#,Azure,Azure Application Insights,我已经在构建期间使用nuget配置了appinsights,appinsights只跟踪我的请求一段特定的时间,然后停止跟踪我的请求,live stream也会复制相同的行为 如果我重新启动或发布该服务,它会再工作一段时间,然后就会停止 我是否需要配置任何设置以随时跟踪? appinsights是否仅适用于始终处于热模式的服务 我已在Global.asax文件中初始化遥测功能 my insights.config文件 你能分享一下你在哪个平台上运行你的服务吗?它是Azure Web应用程序还是您

我已经在构建期间使用nuget配置了appinsights,appinsights只跟踪我的请求一段特定的时间,然后停止跟踪我的请求,live stream也会复制相同的行为 如果我重新启动或发布该服务,它会再工作一段时间,然后就会停止 我是否需要配置任何设置以随时跟踪? appinsights是否仅适用于始终处于热模式的服务

我已在Global.asax文件中初始化遥测功能

my insights.config文件


你能分享一下你在哪个平台上运行你的服务吗?它是Azure Web应用程序还是您正在VM中运行的自定义服务?谢谢我正在azure webapp中部署c#代码。您能告诉我们更多关于您的web应用信息吗?您是否启用web应用程序的“始终打开”?看起来没有向您的web应用发送请求,因此应用程序指示灯不起作用。我建议当appinsights没有跟踪请求时,您可以首先检查直播流的在线服务器号。如下图所示:。@BrandoZhang MSFT hi,Always on已启用;每当我按照你的建议重新启动或部署服务时,live stream服务器的计数将为1,过了一段时间,它将变为无服务器在线,即使我不断地打电话给apiI,我很抱歉,我没有看到你更新全局文件。您的web应用程序是否有多个请求?如果您的应用程序发送大量数据,并且您正在使用ASP.NET 2.0.0-beta3版或更高版本的application Insights SDK,则自适应采样功能可能会运行并仅发送遥测数据的一部分。我建议您可以尝试关闭自适应采样,从applicationinsights配置中删除节点。
    <?xml version="1.0" encoding="utf-8"?>
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
  <TelemetryInitializers>
    <Add Type="Microsoft.ApplicationInsights.DependencyCollector.HttpDependenciesParsingTelemetryInitializer, Microsoft.AI.DependencyCollector" />
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer" />
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureWebAppRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer" />
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.BuildInfoConfigComponentVersionTelemetryInitializer, Microsoft.AI.WindowsServer" />
    <Add Type="Microsoft.ApplicationInsights.Web.WebTestTelemetryInitializer, Microsoft.AI.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.SyntheticUserAgentTelemetryInitializer, Microsoft.AI.Web">
      <Filters>search|spider|crawl|Bot|Monitor|AlwaysOn</Filters>
    </Add>
    <Add Type="Microsoft.ApplicationInsights.Web.ClientIpHeaderTelemetryInitializer, Microsoft.AI.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.OperationNameTelemetryInitializer, Microsoft.AI.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.OperationCorrelationTelemetryInitializer, Microsoft.AI.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.UserTelemetryInitializer, Microsoft.AI.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.AuthenticatedUserIdTelemetryInitializer, Microsoft.AI.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.AccountIdTelemetryInitializer, Microsoft.AI.Web" />
    <Add Type="Microsoft.ApplicationInsights.Web.SessionTelemetryInitializer, Microsoft.AI.Web" />
  </TelemetryInitializers>
  <TelemetryModules>
    <Add Type="Microsoft.ApplicationInsights.DependencyCollector.DependencyTrackingTelemetryModule, Microsoft.AI.DependencyCollector" />
    <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
    </Add>
    <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryModule, Microsoft.AI.PerfCounterCollector" />
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.DeveloperModeWithDebuggerAttachedTelemetryModule, Microsoft.AI.WindowsServer" />
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.UnhandledExceptionTelemetryModule, Microsoft.AI.WindowsServer" />
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.UnobservedExceptionTelemetryModule, Microsoft.AI.WindowsServer" />
    <Add Type="Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule, Microsoft.AI.Web">
      <Handlers>
        <Add>System.Web.Handlers.TransferRequestHandler</Add>
        <Add>Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.RequestDataHttpHandler</Add>
        <Add>System.Web.StaticFileHandler</Add>
        <Add>System.Web.Handlers.AssemblyResourceLoader</Add>
        <Add>System.Web.Optimization.BundleHandler</Add>
        <Add>System.Web.Script.Services.ScriptHandlerFactory</Add>
        <Add>System.Web.Handlers.TraceHandler</Add>
        <Add>System.Web.Services.Discovery.DiscoveryRequestHandler</Add>
        <Add>System.Web.HttpDebugHandler</Add>
      </Handlers>
    </Add>
    <Add Type="Microsoft.ApplicationInsights.Web.ExceptionTrackingTelemetryModule, Microsoft.AI.Web" />
   </TelemetryModules>
  <TelemetryProcessors>
    <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor, Microsoft.AI.PerfCounterCollector" />
    <Add Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
      <!--<MaxTelemetryItemsPerSecond>5</MaxTelemetryItemsPerSecond>-->
    </Add>
  </TelemetryProcessors>
  <TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel" />
 <!-- This key is for Application Insights resource 'trhyr' in resource group 'thytry' -->
  <!--<InstrumentationKey>dfgtdhfjtyujytjuti</InstrumentationKey>-->
</ApplicationInsights>
TelemetryConfiguration.Active.DisableTelemetry = false;
TelemetryConfiguration.Active.InstrumentationKey = Environment.GetEnvironmentVariable(TelemetryKey); //Fetched from Application Settings