0

.NET 4.8 WPF アプリケーションで作業しようとしているアプリケーション インサイト構成があります。すべてが正常に送信されているように見えますが (ライブ メトリック データを含む)、残念ながら、EntityFramework6 によって実行されている依存関係情報と共に SQL クエリをシステムに送信させることができません。

次のリンクで参照していることに注意してください

ASP.NET アプリケーションの場合、バイト コード インストルメンテーションを使用して完全な SQL クエリ テキストを収集します。これには、インストルメンテーション エンジンを使用するか、System.Data.SqlClient ライブラリの代わりに Microsoft.Data.SqlClient NuGet パッケージを使用する必要があります。

EntityFramework (System.Data.SqlClient に依存する) を使用していることを考えると、明らかにこれは私には不可能です (そうは思いませんか?) が、Microsoft.ApplicationInsights.Agent_** をインストールしました。上記のリンクが示唆しています。

さらに、Azure で提供されているデータを見ると、それが rddf:2.17.0-32 としてマークされていることに気付きました。これは、エージェントが正しく機能していないことを示唆しています。

ここに画像の説明を入力

私の初期化コードは次のようになります。

public static TelemetryConfiguration CreateConfig(string instrumentationKey, string authenticationApiKey)
{
    var config = new TelemetryConfiguration()
    {
        ConnectionString = $"InstrumentationKey={instrumentationKey};IngestionEndpoint=https://australiaeast-0.in.applicationinsights.azure.com/",
        TelemetryChannel = new ServerTelemetryChannel()
        {
            DeveloperMode = true
        },
               
    };

    var dependencyTrackingModule = new DependencyTrackingTelemetryModule()
    {
        EnableSqlCommandTextInstrumentation = true
    };

    // prevent Correlation Id to be sent to certain endpoints. You may add other domains as needed.
    dependencyTrackingModule.ExcludeComponentCorrelationHttpHeadersOnDomains.Add("core.windows.net");

    // enable known dependency tracking, note that in future versions, we will extend this list. 
    dependencyTrackingModule.IncludeDiagnosticSourceActivities.Add("Microsoft.Azure.ServiceBus");
    dependencyTrackingModule.IncludeDiagnosticSourceActivities.Add("Microsoft.Azure.EventHubs");

    // initialize the module
    dependencyTrackingModule.Initialize(config);

    QuickPulseTelemetryProcessor quickPulseProcessor = null;
    config.DefaultTelemetrySink.TelemetryProcessorChainBuilder
        .Use((next) =>
        {
            quickPulseProcessor = new QuickPulseTelemetryProcessor(next);
            return quickPulseProcessor;
        })
        .Build();

    var quickPulseModule = new QuickPulseTelemetryModule()
    {
        AuthenticationApiKey = authenticationApiKey
    };

    quickPulseModule.Initialize(config);
    quickPulseModule.RegisterTelemetryProcessor(quickPulseProcessor);

    config.TelemetryInitializers.Add(new HttpDependenciesParsingTelemetryInitializer());
    config.TelemetryInitializers.Add(new BuildInfoConfigComponentVersionTelemetryInitializer());

    return config;
}

私が間違っている可能性があることについて、誰かが何か意見を提供できますか?

4

1 に答える 1