private void SetUpTelemetryCallbacks()
        {
            CorrelationTraceClient.SetUp(
                (TraceContextBase requestTraceContext) =>
            {
                requestTraceContext.Stop();

                var requestTelemetry = requestTraceContext.CreateRequestTelemetry();
                this.telemetryClient.TrackRequest(requestTelemetry);
            },
                (TraceContextBase dependencyTraceContext) =>
            {
                dependencyTraceContext.Stop();
                var dependencyTelemetry = dependencyTraceContext.CreateDependencyTelemetry();
                this.telemetryClient.TrackDependency(dependencyTelemetry);
            },
                (Exception e) =>
            {
                this.telemetryClient.TrackException(e);
            });
        }
示例#2
0
        private void SetUpTelemetryCallbacks()
        {
            var resolvedSiteName = this.nameResolver?.Resolve("WEBSITE_SITE_NAME")?.ToLower() ?? string.Empty;

            CorrelationTraceClient.SetUp(
                (TraceContextBase requestTraceContext) =>
            {
                requestTraceContext.Stop();

                var requestTelemetry = requestTraceContext.CreateRequestTelemetry(resolvedSiteName);
                this.telemetryClient.TrackRequest(requestTelemetry);
            },
                (TraceContextBase dependencyTraceContext) =>
            {
                dependencyTraceContext.Stop();
                var dependencyTelemetry = dependencyTraceContext.CreateDependencyTelemetry();
                this.telemetryClient.TrackDependency(dependencyTelemetry);
            },
                (Exception e) =>
            {
                this.telemetryClient.TrackException(e);
            });
        }