我是Azure Application Insight的新手,并尝试通过我的本地计算机发送TrackEvent . 但Azure Application Insight似乎没有收到任何东西 .
这是我的要求 . 规格 . 安装了应用程序洞察sdk nuget的示例asp.net框架控制台代码是通过Telemetry客户端和Instrumental Id配置来设置的 . 控制台运行后,Azure应用程序洞察应该按预期显示历史记录 . 但它没有显示任何东西 . 我错过了什么吗?
我简单的控制台代码
Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey = "c453fec7-ea68-4c06-83e4-2938eef1f124";
TelemetryClient telemetry = new TelemetryClient();
telemetry.Context.User.Id = "Test User Id.";
telemetry.Context.User.Id = "Test Device Id.";
telemetry.TrackEvent("Test TrackEvent");
InstrumentationKey是正确的 . Telemetry.TractEvent方法不会暴露异常 . Azure Application Insight Search(用于自定义事件)不显示历史记录 .
谢谢 .
1 回答
原因可能是由于以下原因之一:
2.在您的控制台代码中,您应该添加Flush()和sleep()方法 .
然后等一会儿,我可以在门户网站上看到自定义事件:
顺便说一句,我注意到你在代码中定义了两次
telemetry.Context.User.Id
,也许是一个错字 .