Azure Uygulaması Insights Aracısı (eski adıyla Durum İzleyicisi v2) sorunlarını giderme

Bu makalede, Application Insights izleme etkinleştirildiğinde karşılaşabileceğiniz veri toplama sorunlarını çözmeye yardımcı olacak sorun giderme bilgileri sağlanır.

Bilinen sorunlar

Bir uygulamanın bin dizininde çakışan DLL'ler

Bu dinamik bağlantı kitaplıklarından (DLL) herhangi biri bölme dizininde varsa izleme başarısız olabilir:

  • Microsoft.ApplicationInsights.dll
  • Microsoft.AspNet.TelemetryCorrelation.dll
  • System.Diagnostics.DiagnosticSource.dll

Bu DLL'lerden bazıları, uygulamanız bunları kullanmasa bile Visual Studio varsayılan uygulama şablonlarına eklenir. Semptomatik davranışı görmek için aşağıdaki araçlar gibi sorun giderme araçlarını kullanabilirsiniz:

  • PerfView:

    ThreadID="7,500" 
    ProcessorNumber="0" 
    msg="Found 'System.Diagnostics.DiagnosticSource, Version=4.0.2.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' assembly, skipping attaching redfield binaries" 
    ExtVer="2.8.13.5972" 
    SubscriptionId="" 
    AppName="" 
    FormattedMessage="Found 'System.Diagnostics.DiagnosticSource, Version=4.0.2.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' assembly, skipping attaching redfield binaries" 
    
  • IISReset ve uygulama yükü (telemetri olmadan). Sysinternals ile araştırma (Handle.exe ve ListDLLs.exe):

    .\handle64.exe -p w3wp | findstr /I "InstrumentationEngine AI. ApplicationInsights"
    E54: File  (R-D)   C:\Program Files\WindowsPowerShell\Modules\Az.ApplicationMonitor\content\Runtime\Microsoft.ApplicationInsights.RedfieldIISModule.dll
    
    .\Listdlls64.exe w3wp | findstr /I "InstrumentationEngine AI ApplicationInsights"
    0x0000000009be0000  0x127000  C:\Program Files\WindowsPowerShell\Modules\Az.ApplicationMonitor\content\Instrumentation64\MicrosoftInstrumentationEngine_x64.dll
    0x0000000009b90000  0x4f000   C:\Program Files\WindowsPowerShell\Modules\Az.ApplicationMonitor\content\Instrumentation64\Microsoft.ApplicationInsights.ExtensionsHost_x64.dll
    0x0000000004d20000  0xb2000   C:\Program Files\WindowsPowerShell\Modules\Az.ApplicationMonitor\content\Instrumentation64\Microsoft.ApplicationInsights.Extensions.Base_x64.dll
    

PowerShell sürümleri

Bu ürün, PowerShell sürüm 5.1 kullanılarak yazıldı ve test edildi. Bu modül PowerShell sürüm 6 veya 7 ile uyumlu değildir. PowerShell 5.1'in yeni sürümler ile birlikte kullanılmasını öneririz. Daha fazla bilgi için bkz . PowerShell 7'yi PowerShell 5.1 ile yan yana kullanma.

IIS paylaşılan yapılandırmasıyla çakışma

Web sunucularından oluşan bir kümeniz varsa , paylaşılan bir yapılandırma kullanıyor olabilirsiniz. HttpModule bu paylaşılan yapılandırmaya eklenebilir. DLL'yi her sunucunun genel derleme önbelleğine (GAC) yüklemek için her web sunucusunda Etkinleştir komutunu çalıştırın.

Etkinleştir komutunu çalıştırdıktan sonra şu adımları tamamlayın:

  1. Paylaşılan yapılandırma dizinine gidin ve applicationHost.config dosyasını bulun.

  2. Bu XML kodunu <yapılandırmanızın modüller> bölümüne ekleyin:

    <modules>
        <!-- Registered global managed http module handler. The 'Microsoft.AppInsights.IIS.
        ManagedHttpModuleHelper.dll' must be installed in the GAC before this config is applied. -->
        <add name="ManagedHttpModuleHelper" type="Microsoft.AppInsights.IIS.ManagedHttpModuleHelper.
        ManagedHttpModuleHelper, Microsoft.AppInsights.IIS.ManagedHttpModuleHelper, Version=1.0.0.0, 
        Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" />
    </modules>
    

IIS iç içe uygulamalar

Internet Information Services'te (IIS) 1.0 sürümünde iç içe uygulamaları izlemeyiz.

Gelişmiş SDK yapılandırması kullanılamıyor

SDK yapılandırması sürüm 1.0'da son kullanıcıya sunulmaz.

PowerShell sorunlarını giderme

Hangi modüllerin kullanılabilir olduğunu belirleme

Hangi modüllerin Get-Module -ListAvailable yüklü olduğunu belirlemek için komutunu kullanabilirsiniz.

Modülü geçerli oturuma aktarma

Bir modül PowerShell oturumuna yüklenmediyse komutunu çalıştırarak Import-Module <path to psd1> modülü el ile yükleyebilirsiniz.

Application Insights Aracısı modülünün sorunlarını giderme

Application Insights Aracısı modülünde kullanılabilen komutları listeleme

Get-Command -Module Az.ApplicationMonitor Kullanılabilir komutları almak için komutunu çalıştırın:

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Cmdlet          Disable-ApplicationInsightsMonitoring              0.4.0      Az.ApplicationMonitor
Cmdlet          Disable-InstrumentationEngine                      0.4.0      Az.ApplicationMonitor
Cmdlet          Enable-ApplicationInsightsMonitoring               0.4.0      Az.ApplicationMonitor
Cmdlet          Enable-InstrumentationEngine                       0.4.0      Az.ApplicationMonitor
Cmdlet          Get-ApplicationInsightsMonitoringConfig            0.4.0      Az.ApplicationMonitor
Cmdlet          Get-ApplicationInsightsMonitoringStatus            0.4.0      Az.ApplicationMonitor
Cmdlet          Set-ApplicationInsightsMonitoringConfig            0.4.0      Az.ApplicationMonitor
Cmdlet          Start-ApplicationInsightsMonitoringTrace           0.4.0      Az.ApplicationMonitor

Application Insights Aracısı modülünün geçerli sürümünü belirleme

Get-ApplicationInsightsMonitoringStatus -PowerShellModule Modül hakkında aşağıdaki bilgileri görüntülemek için komutunu çalıştırın:

  • PowerShell modülü sürümü
  • Application Insights SDK sürümü
  • PowerShell modülünün dosya yolları

Bu cmdlet'in nasıl kullanılacağına ilişkin ayrıntılı bir açıklama için Get-ApplicationInsightsMonitoringStatus başvurusunu gözden geçirin.

Çalışan işlemlerin sorunlarını giderme

tüm DLL'lerin yüklenip yüklenmediğini ve ortam değişkenlerinin ayarlanıp ayarlanmadığını belirlemek için, izlemeli bilgisayardaki işlemleri inceleyebilirsiniz. İzleme çalışıyorsa en az 12 DLL yüklenmelidir.

  • DLL'leri Get-ApplicationInsightsMonitoringStatus -InspectProcess denetlemek için komutunu kullanın.
  • (Get-Process -id <process-identifier>).StartInfo.EnvironmentVariables Ortam değişkenlerini denetlemek için komutunu kullanın. Çalışan işleminde veya .NET Core işleminde aşağıdaki ortam değişkenleri ayarlanır:
COR_ENABLE_PROFILING=1
COR_PROFILER={324F817A-7420-4E6D-B3C1-143FBED6D855}
COR_PROFILER_PATH_32=<path-to-MicrosoftInstrumentationEngine_x86.dll>
COR_PROFILER_PATH_64=<path-to-MicrosoftInstrumentationEngine_x64.dll>
MicrosoftInstrumentationEngine_Host={CA487940-57D2-10BF-11B2-A3AD5A13CBC0}
MicrosoftInstrumentationEngine_HostPath_32=<path-to-Microsoft.ApplicationInsights.ExtensionsHost_x86.dll>
MicrosoftInstrumentationEngine_HostPath_64=<path-to-Microsoft.ApplicationInsights.ExtensionsHost_x64.dll>
MicrosoftInstrumentationEngine_ConfigPath32_Private=<path-to-Microsoft.InstrumentationEngine.Extensions.config>
MicrosoftInstrumentationEngine_ConfigPath64_Private=<path-to-Microsoft.InstrumentationEngine.Extensions.config>
MicrosoftAppInsights_ManagedHttpModulePath=<path-to-Microsoft.ApplicationInsights.RedfieldIISModule.dll>
MicrosoftAppInsights_ManagedHttpModuleType=Microsoft.ApplicationInsights.RedfieldIISModule.RedfieldIISModule
ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=Microsoft.ApplicationInsights.StartupBootstrapper
DOTNET_STARTUP_HOOKS=<path-to-Microsoft.ApplicationInsights.StartupHook.dll>

Bu cmdlet'in nasıl kullanılacağına ilişkin ayrıntılı bir açıklama için Get-ApplicationInsightsMonitoringStatus başvurusunu gözden geçirin.

PerfView kullanarak ETW günlüklerini toplama

Kurulum

  1. GitHub'danPerfView.exe indirin.

  2. PerfView.exeçalıştırın.

  3. Menü çubuğunda Topla'yı> seçin.

  4. Gelişmiş Seçenekler'i genişletin.

  5. Şu onay kutularını temizleyin:

    • Zip
    • Birleştirme
    • .NET Sembol Koleksiyonu
  6. Şu Ek Sağlayıcıları ayarlayın:

    *Microsoft-ApplicationInsights-AspNetCore,*Microsoft-ApplicationInsights-AspNetCore-AiHostingStartup,*Microsoft-ApplicationInsights-AspNetCore-StartupBootstrapper,*Microsoft-ApplicationInsights-AspNetCore-StartupHook,*Microsoft-ApplicationInsights-Core,*Microsoft-ApplicationInsights-Data,*Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Dependency,*Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Web,*Microsoft-ApplicationInsights-Extensibility-DependencyCollector,*Microsoft-ApplicationInsights-Extensibility-EventCounterCollector,*Microsoft-ApplicationInsights-Extensibility-EventSourceListener,*Microsoft-ApplicationInsights-Extensibility-HostingStartup,*Microsoft-ApplicationInsights-Extensibility-PerformanceCollector,*Microsoft-ApplicationInsights-Extensibility-PerformanceCollector-QuickPulse,*Microsoft-ApplicationInsights-Extensibility-Web,*Microsoft-ApplicationInsights-Extensibility-WindowsServer,*Microsoft-ApplicationInsights-FrameworkLightup,*Microsoft-ApplicationInsights-IIS-ManagedHttpModuleHelper,*Microsoft-ApplicationInsights-Java-IPA,*Microsoft-ApplicationInsights-LoggerProvider,*Microsoft-ApplicationInsights-Nodejs-IPA,*Microsoft-ApplicationInsights-RedfieldIISModule,*Microsoft-ApplicationInsights-SnapshotCollectorLightup,*Microsoft-ApplicationInsights-WindowsServer-Core,*Microsoft-ApplicationInsights-WindowsServer-TelemetryChannel,*Redfield-Microsoft-ApplicationInsights-AspNetCore,*Redfield-Microsoft-ApplicationInsights-Core,*Redfield-Microsoft-ApplicationInsights-Data,*Redfield-Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Dependency,*Redfield-Microsoft-ApplicationInsights-Extensibility-AppMapCorrelation-Web,*Redfield-Microsoft-ApplicationInsights-Extensibility-DependencyCollector,*Redfield-Microsoft-ApplicationInsights-Extensibility-EventCounterCollector,*Redfield-Microsoft-ApplicationInsights-Extensibility-EventSourceListener,*Redfield-Microsoft-ApplicationInsights-Extensibility-PerformanceCollector,*Redfield-Microsoft-ApplicationInsights-Extensibility-PerformanceCollector-QuickPulse,*Redfield-Microsoft-ApplicationInsights-Extensibility-Web,*Redfield-Microsoft-ApplicationInsights-Extensibility-WindowsServer,*Redfield-Microsoft-ApplicationInsights-LoggerProvider,*Redfield-Microsoft-ApplicationInsights-WindowsServer-TelemetryChannel

Günlükleri toplama

  1. Yönetici ayrıcalıklarına sahip bir komut konsolunda komutunu çalıştırarak iisreset /stop IIS'yi ve tüm web uygulamalarını kapatın.

  2. PerfView'da Koleksiyonu Başlat'ı seçin.

  3. Yönetici ayrıcalıklarına sahip bir komut konsolunda komutunu çalıştırarak iisreset /start IIS'yi başlatın.

  4. Uygulamanıza göz atmayı deneyin.

  5. Uygulamanız yüklendikten sonra PerfView'a dönün ve Koleksiyonu Durdur'u seçin.

Sonraki adımlar

  • Kaçırdığınız parametreler hakkında bilgi edinmek için API başvurusunu gözden geçirin.

Yardım için bize ulaşın

Sorularınız veya yardıma ihtiyacınız varsa bir destek isteği oluşturun veya Azure topluluk desteği isteyin. Ürün geri bildirimini Azure geri bildirim topluluğuna da gönderebilirsiniz.