Delen via


Problemen met Azure-toepassing Insights Agent (voorheen Status Monitor v2) oplossen

Dit artikel bevat informatie over het oplossen van problemen met het verzamelen van gegevens die kunnen optreden wanneer Microsoft Azure-toepassing Insights-bewaking is ingeschakeld.

Bekende problemen

Conflicterende DLL's in de bin-map

Als een van deze dynamic-link-bibliotheken (DLL's) aanwezig is in de bin-map van de app, kan bewaking mislukken:

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

Sommige van deze DLL's zijn opgenomen in de standaard-app-sjablonen van Visual Studio, zelfs als de app deze niet gebruikt. U kunt hulpprogramma's voor probleemoplossing, zoals de volgende hulpprogramma's, gebruiken om symptomatisch gedrag te zien:

  • 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 en app-belasting (zonder telemetrie). Onderzoek met sysinternals (Handle.exe en 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-versies

Dit product is geschreven en getest met PowerShell versie 5.1. Deze module is niet compatibel met PowerShell-versies 6 of 7. U wordt aangeraden PowerShell 5.1 naast nieuwere versies te gebruiken. Zie PowerShell 7 naast PowerShell 5.1 gebruiken voor meer informatie.

Conflict in gedeelde IIS-configuratie

Als u een cluster webservers hebt, gebruikt u mogelijk een gedeelde configuratie. De HTTP-module kan niet worden opgenomen in deze gedeelde configuratie. Voer de opdracht Inschakelen op elke webserver uit om het DLL-bestand te installeren in de algemene assemblycache (GAC) van elke server.

Nadat u de opdracht Inschakelen hebt uitgevoerd, voert u de volgende stappen uit:

  1. Ga naar de gedeelde configuratiemap en zoek het bestand ApplicationHost.config .

  2. Voeg de volgende XML-code toe aan de <> modulesectie van uw configuratie:

    <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>
    

Geneste IIS-toepassingen

In versie 1.0 van de Application Insights-agent instrumenteren we geen geneste toepassingen in IIS (Internet Information Services).

Klassieke IIS-pijplijnmodus

We instrumenteren geen toepassingen die worden gehost in toepassingsgroepen als ze zijn geconfigureerd voor het gebruik van de klassieke pijplijnmodus.

Geavanceerde SDK-configuratie is niet beschikbaar

De SDK-configuratie wordt niet weergegeven voor de eindgebruiker in versie 1.0.

Problemen met PowerShell oplossen

Bepalen welke modules beschikbaar zijn

Voer de Get-Module -ListAvailable cmdlet uit om te bepalen welke modules zijn geïnstalleerd.

Een module importeren in de huidige sessie

Als een module niet in een PowerShell-sessie is geladen, kunt u deze handmatig laden door de Import-Module <path-to-psd1> cmdlet uit te voeren.

Problemen met de Application Insights Agent-module oplossen

De cmdlets weergeven die beschikbaar zijn in de Application Insights Agent-module

Voer de Get-Command -Module Az.ApplicationMonitor cmdlet uit om de cmdlets te zien die beschikbaar zijn in de Application Insights Agent-module:

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

De huidige versie van de Application Insights Agent-module bepalen

Voer de Get-ApplicationInsightsMonitoringStatus -PowerShellModule cmdlet uit om de volgende informatie over de module weer te geven:

  • PowerShell-moduleversie
  • Application Insights SDK-versie
  • Bestandspaden van de PowerShell-module

Raadpleeg de naslaginformatie get-ApplicationInsightsMonitoringStatus voor een gedetailleerde beschrijving van het gebruik van deze cmdlet.

Problemen met actieve processen oplossen

U kunt de processen op de geïnstrueerde computer controleren om te bepalen of alle DLL's zijn geladen en omgevingsvariabelen zijn ingesteld. Als bewaking werkt, moeten ten minste 12 DLL's worden geladen.

  • Voer de Get-ApplicationInsightsMonitoringStatus -InspectProcess cmdlet uit om de DLL's te controleren.
  • Voer de (Get-Process -id <process-identifier>).StartInfo.EnvironmentVariables cmdlet uit om de omgevingsvariabelen te controleren. De volgende omgevingsvariabelen worden ingesteld in het werkproces of het .NET Core-proces:
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>

Raadpleeg de naslaginformatie get-ApplicationInsightsMonitoringStatus voor een gedetailleerde beschrijving van het gebruik van deze cmdlet.

ETW-logboeken verzamelen met Behulp van PerfView

Instellingen

  1. Download PerfView.exe van GitHub.

  2. Voer PerfView.exe uit.

  3. Selecteer Verzamelen in> de menubalk.

  4. Vouw Geavanceerde opties uit.

  5. Schakel de volgende selectievakjes uit:

    • Zip
    • Samenvoegen
    • .NET-symboolverzameling
  6. Stel de volgende extra providers in:

    *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

Logboeken verzamelen

  1. Voer in een beheeropdrachtprompt de iisreset /stop opdracht uit om IIS en alle web-apps uit te schakelen.

  2. Selecteer Verzameling starten in PerfView.

  3. Voer in een beheeropdrachtprompt de iisreset /start opdracht uit om IIS te starten.

  4. Blader naar uw app.

  5. Nadat uw app is geladen, gaat u terug naar PerfView en selecteert u Verzameling stoppen.

Volgende stappen

  • Raadpleeg de API-verwijzing voor meer informatie over parameters die u mogelijk hebt gemist.

Contact met ons opnemen voor ondersteuning

Als u vragen hebt of hulp nodig hebt, maakt u een ondersteuningsaanvraag of stelt u ondersteuning voor de Azure-community. U kunt ook productfeedback verzenden naar de Azure-feedbackcommunity.