Свойства контекста, не записанные из WPF в понимание приложения

Я пытаюсь записать телеметрию в Application Insights из приложения WPF. События и просмотры страниц регистрируются, но свойства контекста не регистрируются вместе с ними.

Я инициализировал клиента как:

    internal InsightsLogging(string instrumentationKey)
    {
        TelemetryConfiguration configuration = TelemetryConfiguration.Active;
        configuration.InstrumentationKey = instrumentationKey;

        QuickPulseTelemetryProcessor processor = null;
        configuration.TelemetryProcessorChainBuilder
            .Use((next) =>
            {
                processor = new QuickPulseTelemetryProcessor(next);
                return processor;
            })
            .Build();

        var QuickPulse = new QuickPulseTelemetryModule();
        QuickPulse.Initialize(configuration);
        QuickPulse.RegisterTelemetryProcessor(processor);

        Client = new TelemetryClient(configuration);
        Client.InstrumentationKey = instrumentationKey;
        Client.Context.Session.Id = Guid.NewGuid().ToString();
        Client.Context.Device.OperatingSystem = Environment.OSVersion.ToString();
        Client.Context.Device.Id = EnvironmentUtility.GetMACAddress();
        Client.Context.Component.Version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
        Client.Context.User.Id = LoggingDataProvider.User;
        Client.Context.User.AuthenticatedUserId = LoggingDataProvider.User;
        Client.Context.User.AccountId = LoggingDataProvider.Account;
        Client.Context.Component.Version = Assembly.GetEntryAssembly().GetName().Version.ToString();
        Client.Context.User.UserAgent = "App";
    }

В конечном итоге журналы выглядят так: бревна

Обратите внимание, что ни один из столбцов "user_*" не заполнен. И стоит отметить, что appName также неверно - это имя экземпляра приложения в Azure.

0 ответов

Другие вопросы по тегам