private static void LogTelemetryEvent()

in RESTProxy/Models/ProxyManager.cs [390:424]


        private static void LogTelemetryEvent(
            string userName,
            string pathAndQuery,
            HttpMethod method,
            string tenantId,
            string tenantName,
            string clientId,
            EndpointType endpointType,
            HttpStatusCode statusCode,
            string correlationId,
            string requestId,
            string clientRequestId,
            double duration)
        {
            ProxyManager.telemetryClient.Context.Session.Id = System.Guid.NewGuid().ToString();
            ProxyManager.telemetryClient.Context.Component.Version = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            Dictionary<string, string> properties = new Dictionary<string, string>();
            properties.Add("UserName", userName);
            properties.Add("PathAndQuery", pathAndQuery);
            properties.Add("Method", method.ToString());
            properties.Add("StatusCode", statusCode.ToString());
            properties.Add("CorrelationId", correlationId);
            properties.Add("RequestId", requestId);
            properties.Add("ClientRequestId", clientRequestId);
            properties.Add("EndpointType", endpointType.ToString());
            properties.Add("TenantId", tenantId);
            properties.Add("TenantFriendlyName", tenantName);
            properties.Add("ClientId", clientId);

            Dictionary<string, double> metrics = new Dictionary<string, double>();
            metrics.Add("Duration", duration);

            ProxyManager.telemetryClient.TrackEvent("ProxyRequest", properties, metrics);
        }