/// <summary> /// Initializes the default performance counters. /// </summary> public void Initialize(TelemetryConfiguration configuration) { // TODO: Add tracing. if (!this.WebAppRunningInAzure()) { return; } CounterFactory factory = new CounterFactory(); foreach (var counter in this.Counters) { try { string reportAs = this.SanitizeReportAs(counter.ReportAs, counter.PerformanceCounter); reportAs = GetCounterReportAsName(counter.PerformanceCounter, reportAs); ICounterValue c = factory.GetCounter(counter.PerformanceCounter, reportAs); configuration.RegisterCounter(c); } catch { // TODO: Add tracing. } } }