Tag: azure web sites拥有

如何在Azure上的Application Insights中将exception链接到请求?

我们在Azure上使用Owin来提供REST服务,并且必须直接向Application Insights报告。 我们想记录exception和请求。 现在我们有这个: using AppFunc = Func<IDictionary, Task>; public class InsightsReportMiddleware { readonly AppFunc next; readonly TelemetryClient telemetryClient; public InsightsReportMiddleware(AppFunc next, TelemetryClient telemetryClient) { if (next == null) { throw new ArgumentNullException(“next”); } this.telemetryClient = telemetryClient; this.next = next; } public async Task Invoke(IDictionary environment) { var sw = new Stopwatch(); sw.Start(); await next(environment); […]