Application Insights直播

问题描述 投票:0回答:2

为了让Live Stream与.NET Core上的最新App Insights SDK(2.x)一起使用,您需要做的最小“简单”是什么?你需要部署appinsights.config文件吗?如果是这样,那里需要哪些元素?或者,您可以使用代码优先方法来实现,如果是,那么需要做什么?

azure azure-application-insights
2个回答
3
投票

http://apmtips.com/blog/2017/02/13/enable-application-insights-live-metrics-from-code/

TelemetryConfiguration configuration = new TelemetryConfiguration();
configuration.InstrumentationKey = "9d3ebb4f-7a11-4fb1-91ac-7ca8a17a27eb";

QuickPulseTelemetryProcessor processor = null;

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

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

0
投票

最新的.NET Core AI SDK上的应用程序应自动获得Live Stream。

如果它不工作则可能是一些配置错误。一种方法是打开一个github问题:https://github.com/Microsoft/ApplicationInsights-aspnetcore

© www.soinside.com 2019 - 2024. All rights reserved.