Esempio n. 1
0
        private static Dictionary <string, object> ProcessResponseAttributes(HttpResponse response)
        {
            var responseAttributes = new Dictionary <string, object>();

            int statusCode = (int)response.StatusCode;

            responseAttributes["status"] = statusCode;

            AgentUtil.MarkEntityFromStatus(statusCode);

            return(responseAttributes);
        }
        private static Dictionary <string, object> PopulateResponseAttributes(HttpResponse response)
        {
            var responseAttributes = new Dictionary <string, object>();

            int statusCode = (int)response.StatusCode;

            AgentUtil.MarkEntityFromStatus(statusCode);

            responseAttributes["status"] = statusCode;

            if (response.Headers.ContentLength != null)
            {
                responseAttributes["content_length"] = response.Headers.ContentLength;
            }

            return(responseAttributes);
        }
Esempio n. 3
0
        /// <summary>
        /// Process response
        /// </summary>
        private static void ProcessResponse(HttpStatusCode httpStatusCode, long?contentLength)
        {
            if (AWSXRayRecorder.Instance.IsTracingDisabled())
            {
                _logger.DebugFormat("Tracing is disabled. Not ending a subsegment on HTTP response.");
                return;
            }

            var statusCode = (int)httpStatusCode;

            var responseInformation = new Dictionary <string, object> {
                ["status"] = statusCode
            };

            AgentUtil.MarkEntityFromStatus(statusCode);

            responseInformation["content_length"] = contentLength;
            AWSXRayRecorder.Instance.AddHttpInformation("response", responseInformation);
        }