public override void OnActionExecuting(HttpActionContext actionContext)
        {
            var traceProvider = AspNetTracing.GetProvider(HttpContext.Current);
            var requestTrace  = traceProvider?.CurrentTrace;

            if (requestTrace == null)
            {
                return;
            }

            requestTrace.SetTag(TraceTagNames.Operation, actionContext.ControllerContext.RouteData.Route.RouteTemplate);
            traceProvider.StartActionTrace(m_serviceName, actionContext.ControllerContext.ControllerDescriptor.ControllerName, actionContext.ActionDescriptor.ActionName);

            base.OnActionExecuting(actionContext);
        }
Beispiel #2
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            var traceProvider = AspNetTracing.GetProvider(filterContext.HttpContext);
            var requestTrace  = traceProvider?.CurrentTrace;

            if (requestTrace == null)
            {
                return;
            }

            var routeData = filterContext.Controller.ControllerContext.RouteData;

            if (routeData.Route is Route route)
            {
                requestTrace.SetTag(TraceTagNames.Operation, route.Url);
            }

            traceProvider.StartActionTrace(m_serviceName, (string)routeData.Values["controller"], (string)routeData.Values["action"]);

            base.OnActionExecuting(filterContext);
        }
Beispiel #3
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            var provider    = AspNetTracing.GetProvider(filterContext.HttpContext);
            var requestSpan = provider?.CurrentSpan;

            if (requestSpan == null)
            {
                return;
            }

            var routeData = filterContext.Controller.ControllerContext.RouteData;

            if (routeData.Route is Route route && !filterContext.IsChildAction)
            {
                requestSpan.SetTag(SpanTagNames.Operation, route.Url);
            }

            provider.StartActionSpan(m_serviceName, (string)routeData.Values["controller"], (string)routeData.Values["action"]);

            base.OnActionExecuting(filterContext);
        }
Beispiel #4
0
 public static ITraceProvider GetProvider(HttpContext httpContext) => AspNetTracing.GetProvider(httpContext) ?? NullTraceProvider.Instance;
 public static ITraceProvider GetProvider(HttpContext context) => AspNetTracing.GetProvider(context);
Beispiel #6
0
 public override void OnActionExecuted(ActionExecutedContext filterContext)
 {
     AspNetTracing.GetProvider(filterContext.HttpContext)?.FinishActionTrace();
     base.OnActionExecuted(filterContext);
 }
 public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
 {
     AspNetTracing.GetProvider(HttpContext.Current)?.FinishActionTrace();
     base.OnActionExecuted(actionExecutedContext);
 }