public void EndRequest([Property] HttpContext httpContext)
        {
            var httpRequestSpan = ConcurrentContextManager.ActiveSpan(Activity.Current.Id);

            if (httpRequestSpan == null)
            {
                return;
            }

            var statusCode = httpContext.Response.StatusCode;

            if (statusCode >= 400)
            {
                httpRequestSpan.ErrorOccurred();
            }

            Tags.StatusCode.Set(httpRequestSpan, statusCode.ToString());
            httpRequestSpan.Log(DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
                                new Dictionary <string, object>
            {
                { "event", "AspNetCore Hosting EndRequest" },
                { "message", $"Request finished {httpContext.Response.StatusCode} {httpContext.Response.ContentType}" }
            });
            ConcurrentContextManager.StopSpan(httpRequestSpan, Activity.Current.Id);
        }
 public void AfterExecuteCommand()
 {
     if (ConcurrentContextManager.ContextProperties.ContainsKey(TRACE_ORM))
     {
         return;
     }
     ConcurrentContextManager.StopSpan(Activity.Current.Id);
 }
        public void HttpResponse([Property(Name = "Response")] HttpResponseMessage response, [Property(Name = "RequestTaskStatus")] TaskStatus taskStatus)
        {
            var span = ConcurrentContextManager.ActiveSpan(Activity.Current.Id);

            if (span != null && response != null)
            {
                Tags.StatusCode.Set(span, response.StatusCode.ToString());
            }

            ConcurrentContextManager.StopSpan(Activity.Current.Id);
        }