Beispiel #1
0
        public void ProcessEvent_IgnoresUnknownEvent()
        {
            var opts    = GetOptions();
            var tracing = new OpenTelemetryTracing(opts, null);
            var obs     = new AspNetCoreMvcActionObserver(opts, tracing);

            obs.ProcessEvent(string.Empty, new { HttpContext = GetHttpRequestMessage() });
        }
Beispiel #2
0
        public void ProcessEvent_IgnoresNulls()
        {
            var opts    = GetOptions();
            var tracing = new OpenTelemetryTracing(opts, null);
            var obs     = new AspNetCoreMvcActionObserver(opts, tracing);

            obs.ProcessEvent(null, null);
        }
Beispiel #3
0
        public void ProcessEvent_BeforeAction_NoArgs()
        {
            var opts    = GetOptions();
            var tracing = new OpenTelemetryTracing(opts, null);
            var obs     = new AspNetCoreMvcActionObserver(opts, tracing);
            var request = GetHttpRequestMessage();

            obs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_BEFOREACTION_EVENT, new { });
            var span = GetCurrentSpan(tracing.Tracer);

            Assert.Null(span);
            Assert.Null(obs.Active);
        }
        public void ProcessEvent_BeforeAction_NoArgs()
        {
            var opts = GetOptions();
            OpenCensusTracing tracing = new OpenCensusTracing(opts, null);
            var obs     = new AspNetCoreMvcActionObserver(opts, tracing);
            var request = GetHttpRequestMessage();

            obs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_BEFOREACTION_EVENT, new { });
            Span span = AsyncLocalContext.CurrentSpan as Span;

            Assert.Null(span);
            Assert.Null(obs.Active);
        }
Beispiel #5
0
        public void ProcessEvent_AfterAction_NoBeforeAction()
        {
            var opts    = GetOptions();
            var tracing = new OpenTelemetryTracing(opts, null);
            var obs     = new AspNetCoreMvcActionObserver(opts, tracing);
            var request = GetHttpRequestMessage();

            obs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_AFTERACTION_EVENT, new { httpContext = request });

            var span = GetCurrentSpan(tracing.Tracer);

            Assert.Null(span);

            var spanContext = obs.Active;

            Assert.Null(spanContext);
        }
        public void ProcessEvent_AfterAction_NoBeforeAction()
        {
            var opts = GetOptions();
            OpenCensusTracing tracing = new OpenCensusTracing(opts, null);
            var obs     = new AspNetCoreMvcActionObserver(opts, tracing);
            var request = GetHttpRequestMessage();

            obs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_AFTERACTION_EVENT, new { httpContext = request });

            Span span = AsyncLocalContext.CurrentSpan as Span;

            Assert.Null(span);

            var spanContext = obs.Active;

            Assert.Null(spanContext);
        }
        public void ProcessEvent_BeforeAction_NoCurrentSpan()
        {
            var opts = GetOptions();
            OpenCensusTracing tracing = new OpenCensusTracing(opts, null);
            var obs        = new AspNetCoreMvcActionObserver(opts, tracing);
            var request    = GetHttpRequestMessage();
            var descriptor = GetActionDescriptor();

            obs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_BEFOREACTION_EVENT, new { httpContext = request, actionDescriptor = descriptor });

            Span span = GetCurrentSpan(tracing.Tracer);

            Assert.Null(span);

            var spanContext = obs.Active;

            Assert.Null(spanContext);
        }
        public void ProcessEvent_BeforeAction()
        {
            var opts = GetOptions();
            OpenCensusTracing tracing = new OpenCensusTracing(opts, null);
            var hostobs = new AspNetCoreHostingObserver(opts, tracing);
            var request = GetHttpRequestMessage();

            hostobs.ProcessEvent(AspNetCoreHostingObserver.HOSTING_START_EVENT, new { HttpContext = request });

            Span hostspan = AsyncLocalContext.CurrentSpan as Span;

            Assert.NotNull(hostspan);
            var hostSpanContext = hostobs.Active;

            Assert.NotNull(hostSpanContext);
            Assert.Equal(hostspan, hostSpanContext.Active);
            Assert.Null(hostSpanContext.Previous);

            var actionobs  = new AspNetCoreMvcActionObserver(opts, tracing);
            var descriptor = GetActionDescriptor();

            actionobs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_BEFOREACTION_EVENT, new { httpContext = request, actionDescriptor = descriptor });

            Span actionspan = AsyncLocalContext.CurrentSpan as Span;

            Assert.NotNull(actionspan);
            Assert.NotEqual(hostspan, actionspan);
            var actionSpanContext = actionobs.Active;

            Assert.NotNull(actionSpanContext);
            Assert.Equal(actionspan, actionSpanContext.Active);
            Assert.Equal(actionspan.ParentSpanId, hostspan.Context.SpanId);
            Assert.NotNull(actionSpanContext.Previous);
            Assert.Equal(hostspan, actionSpanContext.Previous);

            Assert.Equal("action:" + descriptor.ControllerName + "/" + descriptor.ActionName, actionspan.Name);

            var actionSpanData   = actionspan.ToSpanData();
            var actionAttributes = actionSpanData.Attributes.AttributeMap;

            Assert.Equal(AttributeValue.StringAttributeValue(SpanAttributeConstants.ServerSpanKind), actionAttributes[SpanAttributeConstants.SpanKindKey]);
            Assert.Equal(AttributeValue.StringAttributeValue(descriptor.ControllerTypeInfo.FullName), actionAttributes[SpanAttributeConstants.MvcControllerClass]);
            Assert.Equal(AttributeValue.StringAttributeValue(descriptor.MethodInfo.ToString()), actionAttributes[SpanAttributeConstants.MvcControllerMethod]);
        }
Beispiel #9
0
        public void ExtractActionName()
        {
            var opts    = GetOptions();
            var tracing = new OpenTelemetryTracing(opts, null);
            var obs     = new AspNetCoreMvcActionObserver(opts, tracing);

            var cdesc    = GetActionDescriptor();
            var spanName = obs.ExtractActionName(cdesc);

            Assert.Equal(cdesc.MethodInfo.ToString(), spanName);

            var desc = new ActionDescriptor()
            {
                DisplayName = "foobar"
            };

            spanName = obs.ExtractActionName(desc);
            Assert.Equal("Unknown", spanName);
        }
Beispiel #10
0
        public void ExtractSpanName()
        {
            var opts    = GetOptions();
            var tracing = new OpenTelemetryTracing(opts, null);
            var obs     = new AspNetCoreMvcActionObserver(opts, tracing);

            var cdesc    = GetActionDescriptor();
            var spanName = obs.ExtractSpanName(cdesc);

            Assert.Equal("action:" + cdesc.ControllerName + "/" + cdesc.ActionName, spanName);

            var desc = new ActionDescriptor()
            {
                DisplayName = "foobar"
            };

            spanName = obs.ExtractSpanName(desc);
            Assert.Equal("action:" + desc.DisplayName, spanName);
        }
        public void ExtractControllerName()
        {
            var opts = GetOptions();
            OpenCensusTracing tracing = new OpenCensusTracing(opts, null);
            var obs = new AspNetCoreMvcActionObserver(opts, tracing);

            var cdesc    = GetActionDescriptor();
            var spanName = obs.ExtractControllerName(cdesc);

            Assert.Equal(cdesc.ControllerTypeInfo.FullName, spanName);

            var desc = new ActionDescriptor()
            {
                DisplayName = "foobar"
            };

            spanName = obs.ExtractControllerName(desc);
            Assert.Equal("Unknown", spanName);
        }
Beispiel #12
0
        public void ShouldIgnore_ReturnsExpected()
        {
            var opts    = GetOptions();
            var tracing = new OpenTelemetryTracing(opts, null);
            var obs     = new AspNetCoreMvcActionObserver(opts, tracing);

            Assert.True(obs.ShouldIgnoreRequest("/cloudfoundryapplication/info"));
            Assert.True(obs.ShouldIgnoreRequest("/cloudfoundryapplication/health"));
            Assert.True(obs.ShouldIgnoreRequest("/foo/bar/image.png"));
            Assert.True(obs.ShouldIgnoreRequest("/foo/bar/image.gif"));
            Assert.True(obs.ShouldIgnoreRequest("/favicon.ico"));
            Assert.True(obs.ShouldIgnoreRequest("/foo.js"));
            Assert.True(obs.ShouldIgnoreRequest("/foo.css"));
            Assert.True(obs.ShouldIgnoreRequest("/javascript/foo.js"));
            Assert.True(obs.ShouldIgnoreRequest("/css/foo.css"));
            Assert.True(obs.ShouldIgnoreRequest("/foo.html"));
            Assert.True(obs.ShouldIgnoreRequest("/html/foo.html"));
            Assert.False(obs.ShouldIgnoreRequest("/api/test"));
            Assert.False(obs.ShouldIgnoreRequest("/v2/apps"));
        }
Beispiel #13
0
        public void ProcessEvent_BeforeAction()
        {
            var opts    = GetOptions();
            var tracing = new OpenTelemetryTracing(opts, null);
            var hostobs = new AspNetCoreHostingObserver(opts, tracing);
            var request = GetHttpRequestMessage();

            hostobs.ProcessEvent(AspNetCoreHostingObserver.HOSTING_START_EVENT, new { HttpContext = request });

            var hostspan = GetCurrentSpan(tracing.Tracer);

            Assert.NotNull(hostspan);
            var hostSpanContext = hostobs.Active;

            Assert.NotNull(hostSpanContext);
            Assert.Equal(hostspan, hostSpanContext);

            var actionobs  = new AspNetCoreMvcActionObserver(opts, tracing);
            var descriptor = GetActionDescriptor();

            actionobs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_BEFOREACTION_EVENT, new { httpContext = request, actionDescriptor = descriptor });

            var actionspan = GetCurrentSpan(tracing.Tracer);

            Assert.NotNull(actionspan);
            Assert.NotEqual(hostspan, actionspan);
            var actionSpanContext = actionobs.Active;

            Assert.NotNull(actionSpanContext);
            Assert.Equal(actionspan, actionSpanContext);

            // Assert.Equal(actionspan.ParentSpanId, hostspan.Context.SpanId);
            Assert.Equal("action:" + descriptor.ControllerName + "/" + descriptor.ActionName, actionspan.ToSpanData().Name);

            var actionSpanData   = actionspan.ToSpanData();
            var actionAttributes = actionSpanData.Attributes.ToDictionary(kv => kv.Key, kv => kv.Value);

            Assert.Equal(SpanKind.Server, actionSpanData.Kind);
            Assert.Equal(descriptor.ControllerTypeInfo.FullName, actionAttributes[SpanAttributeConstants.MvcControllerClass]);
            Assert.Equal(descriptor.MethodInfo.ToString(), actionAttributes[SpanAttributeConstants.MvcControllerMethod]);
        }
        public void ProcessEvent_AfterView()
        {
            var opts = GetOptions();
            OpenCensusTracing tracing = new OpenCensusTracing(opts, null);
            var hostobs = new AspNetCoreHostingObserver(opts, tracing);
            var request = GetHttpRequestMessage();

            hostobs.ProcessEvent(AspNetCoreHostingObserver.HOSTING_START_EVENT, new { HttpContext = request });

            Span hostSpan = AsyncLocalContext.CurrentSpan as Span;

            Assert.NotNull(hostSpan);
            var hostspanContext = hostobs.Active;

            Assert.NotNull(hostspanContext);
            Assert.Equal(hostSpan, hostspanContext.Active);
            Assert.Null(hostspanContext.Previous);

            var actionobs  = new AspNetCoreMvcActionObserver(opts, tracing);
            var descriptor = GetActionDescriptor();

            actionobs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_BEFOREACTION_EVENT, new { httpContext = request, actionDescriptor = descriptor });

            Span actionSpan = AsyncLocalContext.CurrentSpan as Span;

            Assert.NotNull(actionSpan);
            Assert.NotEqual(hostSpan, actionSpan);
            var actionspanContext = actionobs.Active;

            Assert.NotNull(actionspanContext);
            Assert.Equal(actionSpan, actionspanContext.Active);
            Assert.Equal(actionSpan.ParentSpanId, hostSpan.Context.SpanId);
            Assert.NotNull(actionspanContext.Previous);
            Assert.Equal(hostSpan, actionspanContext.Previous);

            Assert.Equal("action:" + descriptor.ControllerName + "/" + descriptor.ActionName, actionSpan.Name);

            var viewobs = new AspNetCoreMvcViewObserver(opts, tracing);
            var ctx     = GetViewContext();

            viewobs.ProcessEvent(AspNetCoreMvcViewObserver.MVC_BEFOREVIEW_EVENT, new { viewContext = ctx });

            Span viewSpan = AsyncLocalContext.CurrentSpan as Span;

            Assert.NotNull(viewSpan);
            Assert.NotEqual(hostSpan, viewSpan);
            Assert.NotEqual(actionSpan, viewSpan);
            var viewSpanContext = viewobs.Active;

            Assert.NotNull(viewSpanContext);
            Assert.Equal(viewSpan, viewSpanContext.Active);
            Assert.Equal(actionSpan.Context.SpanId, viewSpan.ParentSpanId);
            Assert.NotNull(viewSpanContext.Previous);
            Assert.Equal(actionSpan, viewSpanContext.Previous);

            Assert.Equal("view:" + ctx.View.Path, viewSpan.Name);

            viewobs.ProcessEvent(AspNetCoreMvcViewObserver.MVC_AFTERVIEW_EVENT, new { });

            Assert.True(viewSpan.HasEnded);
            Assert.NotNull(AsyncLocalContext.CurrentSpan);
            Assert.Null(viewobs.Active);

            var viewSpanData   = viewSpan.ToSpanData();
            var viewAttributes = viewSpanData.Attributes.AttributeMap;

            Assert.Equal(AttributeValue.StringAttributeValue(SpanAttributeConstants.ServerSpanKind), viewAttributes[SpanAttributeConstants.SpanKindKey]);
            Assert.Equal(AttributeValue.StringAttributeValue(ctx.View.Path), viewAttributes[SpanAttributeConstants.MvcViewFilePath]);

            actionobs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_AFTERACTION_EVENT, new { httpContext = request });

            Span spanAfter = AsyncLocalContext.CurrentSpan as Span;

            Assert.NotNull(spanAfter);
            Assert.Equal(hostSpan, spanAfter);

            var actionSpanContextAfter = actionobs.Active;

            Assert.Null(actionSpanContextAfter);
            Assert.True(actionSpan.HasEnded);

            var actionSpanData   = actionSpan.ToSpanData();
            var actionAttributes = actionSpanData.Attributes.AttributeMap;

            Assert.Equal(AttributeValue.StringAttributeValue(SpanAttributeConstants.ServerSpanKind), actionAttributes[SpanAttributeConstants.SpanKindKey]);
            Assert.Equal(AttributeValue.StringAttributeValue(descriptor.ControllerTypeInfo.FullName), actionAttributes[SpanAttributeConstants.MvcControllerClass]);
            Assert.Equal(AttributeValue.StringAttributeValue(descriptor.MethodInfo.ToString()), actionAttributes[SpanAttributeConstants.MvcControllerMethod]);

            hostobs.ProcessEvent(AspNetCoreHostingObserver.HOSTING_STOP_EVENT, new { HttpContext = request });

            Assert.True(hostSpan.HasEnded);
            Assert.Null(AsyncLocalContext.CurrentSpan);
            Assert.Null(hostobs.Active);

            var hostSpanData   = hostSpan.ToSpanData();
            var hostAttributes = hostSpanData.Attributes.AttributeMap;

            Assert.Equal(AttributeValue.StringAttributeValue(SpanAttributeConstants.ServerSpanKind), hostAttributes[SpanAttributeConstants.SpanKindKey]);
            Assert.Equal(AttributeValue.StringAttributeValue("http://localhost:5555/"), hostAttributes[SpanAttributeConstants.HttpUrlKey]);
            Assert.Equal(AttributeValue.StringAttributeValue(HttpMethod.Get.ToString()), hostAttributes[SpanAttributeConstants.HttpMethodKey]);
            Assert.Equal(AttributeValue.StringAttributeValue("localhost:5555"), hostAttributes[SpanAttributeConstants.HttpHostKey]);
            Assert.Equal(AttributeValue.StringAttributeValue("/"), hostAttributes[SpanAttributeConstants.HttpPathKey]);
            Assert.Equal(AttributeValue.StringAttributeValue("Header"), hostAttributes["http.request.TEST"]);
            Assert.Equal(AttributeValue.StringAttributeValue("Header"), hostAttributes["http.response.TEST"]);
            Assert.Equal(AttributeValue.LongAttributeValue((long)HttpStatusCode.OK), hostAttributes[SpanAttributeConstants.HttpStatusCodeKey]);
        }
Beispiel #15
0
        public void ProcessEvent_AfterView()
        {
            var opts    = GetOptions();
            var tracing = new OpenTelemetryTracing(opts, null);
            var hostobs = new AspNetCoreHostingObserver(opts, tracing);
            var request = GetHttpRequestMessage();

            hostobs.ProcessEvent(AspNetCoreHostingObserver.HOSTING_START_EVENT, new { HttpContext = request });

            var hostSpan = GetCurrentSpan(tracing.Tracer);

            Assert.NotNull(hostSpan);
            var hostspanContext = hostobs.Active;

            Assert.NotNull(hostspanContext);
            Assert.Equal(hostSpan, hostspanContext);

            var actionobs  = new AspNetCoreMvcActionObserver(opts, tracing);
            var descriptor = GetActionDescriptor();

            actionobs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_BEFOREACTION_EVENT, new { httpContext = request, actionDescriptor = descriptor });

            var actionSpan = GetCurrentSpan(tracing.Tracer);

            Assert.NotNull(actionSpan);
            Assert.NotEqual(hostSpan, actionSpan);
            var actionspanContext = actionobs.Active;

            Assert.NotNull(actionspanContext);
            Assert.Equal(actionSpan, actionspanContext);

            // Assert.Equal(actionSpan.ParentSpanId, hostSpan.Context.SpanId);
            Assert.Equal("action:" + descriptor.ControllerName + "/" + descriptor.ActionName, actionSpan.ToSpanData().Name);

            var viewobs = new AspNetCoreMvcViewObserver(opts, tracing);
            var ctx     = GetViewContext();

            viewobs.ProcessEvent(AspNetCoreMvcViewObserver.MVC_BEFOREVIEW_EVENT, new { viewContext = ctx });

            var viewSpan = GetCurrentSpan(tracing.Tracer);

            Assert.NotNull(viewSpan);
            Assert.NotEqual(hostSpan, viewSpan);
            Assert.NotEqual(actionSpan, viewSpan);
            var viewSpanContext = viewobs.Active;

            Assert.NotNull(viewSpanContext);
            Assert.Equal(viewSpan, viewSpanContext);

            // Assert.Equal(actionSpan.Context.SpanId, viewSpan.ParentSpanId); TODO: Fix this
            Assert.Equal("view:" + ctx.View.Path, viewSpan.ToSpanData().Name);

            viewobs.ProcessEvent(AspNetCoreMvcViewObserver.MVC_AFTERVIEW_EVENT, new { });

            Assert.True(viewSpan.HasEnded());
            Assert.NotNull(GetCurrentSpan(tracing.Tracer));
            Assert.Null(viewobs.Active);

            var viewSpanData   = viewSpan.ToSpanData();
            var viewAttributes = viewSpanData.Attributes.ToDictionary(kv => kv.Key, kv => kv.Value);

            Assert.Equal(SpanKind.Server, viewSpanData.Kind);
            Assert.Equal(ctx.View.Path, viewAttributes[SpanAttributeConstants.MvcViewFilePath]);

            actionobs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_AFTERACTION_EVENT, new { httpContext = request });

            var spanAfter = GetCurrentSpan(tracing.Tracer);

            Assert.NotNull(spanAfter);
            Assert.Equal(hostSpan, spanAfter);

            var actionSpanContextAfter = actionobs.Active;

            Assert.Null(actionSpanContextAfter);
            Assert.True(actionSpan.HasEnded());

            var actionSpanData   = actionSpan.ToSpanData();
            var actionAttributes = actionSpanData.Attributes.ToDictionary(kv => kv.Key, kv => kv.Value);

            Assert.Equal(SpanKind.Server, actionSpanData.Kind);
            Assert.Equal(descriptor.ControllerTypeInfo.FullName, actionAttributes[SpanAttributeConstants.MvcControllerClass]);
            Assert.Equal(descriptor.MethodInfo.ToString(), actionAttributes[SpanAttributeConstants.MvcControllerMethod]);

            hostobs.ProcessEvent(AspNetCoreHostingObserver.HOSTING_STOP_EVENT, new { HttpContext = request });

            Assert.True(hostSpan.HasEnded());
            Assert.Null(GetCurrentSpan(tracing.Tracer));
            Assert.Null(hostobs.Active);

            var hostSpanData   = hostSpan.ToSpanData();
            var hostAttributes = hostSpanData.Attributes.ToDictionary(kv => kv.Key, kv => kv.Value);

            Assert.Equal(SpanKind.Server, hostSpanData.Kind);
            Assert.Equal("http://localhost:5555/", hostAttributes[SpanAttributeConstants.HttpUrlKey]);
            Assert.Equal(HttpMethod.Get.ToString(), hostAttributes[SpanAttributeConstants.HttpMethodKey]);
            Assert.Equal("localhost:5555", hostAttributes[SpanAttributeConstants.HttpHostKey]);
            Assert.Equal("/", hostAttributes[SpanAttributeConstants.HttpPathKey]);
            Assert.Equal("Header", hostAttributes["http.request.TEST"]);
            Assert.Equal("Header", hostAttributes["http.response.TEST"]);
            Assert.Equal((long)HttpStatusCode.OK, hostAttributes[SpanAttributeConstants.HttpStatusCodeKey]);
        }
Beispiel #16
0
        public void ProcessEvent_BeforeView()
        {
            var opts = GetOptions();
            OpenCensusTracing tracing = new OpenCensusTracing(opts, null);
            var hostobs = new AspNetCoreHostingObserver(opts, tracing);
            var request = GetHttpRequestMessage();

            hostobs.ProcessEvent(AspNetCoreHostingObserver.HOSTING_START_EVENT, new { HttpContext = request });

            Span hostSpan = GetCurrentSpan(tracing.Tracer);

            Assert.NotNull(hostSpan);
            var hostSpanContext = hostobs.Active;

            Assert.NotNull(hostSpanContext);
            Assert.Equal(hostSpan, hostSpanContext.Active);

            var actionobs  = new AspNetCoreMvcActionObserver(opts, tracing);
            var descriptor = GetActionDescriptor();

            actionobs.ProcessEvent(AspNetCoreMvcActionObserver.MVC_BEFOREACTION_EVENT, new { httpContext = request, actionDescriptor = descriptor });

            Span actionSpan = GetCurrentSpan(tracing.Tracer);

            Assert.NotNull(actionSpan);
            Assert.NotEqual(hostSpan, actionSpan);
            var actionContext = actionobs.Active;

            Assert.NotNull(actionContext);
            Assert.Equal(actionSpan, actionContext.Active);
            Assert.Equal(actionSpan.ParentSpanId, hostSpan.Context.SpanId);

            Assert.Equal("action:" + descriptor.ControllerName + "/" + descriptor.ActionName, actionSpan.Name);

            var actionSpanData   = actionSpan.ToSpanData();
            var actionAttributes = actionSpanData.Attributes.AttributeMap;

            Assert.Equal(SpanKind.Server, actionSpan.Kind);
            Assert.Equal(AttributeValue.StringAttributeValue(descriptor.ControllerTypeInfo.FullName), actionAttributes[SpanAttributeConstants.MvcControllerClass]);
            Assert.Equal(AttributeValue.StringAttributeValue(descriptor.MethodInfo.ToString()), actionAttributes[SpanAttributeConstants.MvcControllerMethod]);

            var viewobs = new AspNetCoreMvcViewObserver(opts, tracing);
            var ctx     = GetViewContext();

            viewobs.ProcessEvent(AspNetCoreMvcViewObserver.MVC_BEFOREVIEW_EVENT, new { viewContext = ctx });

            Span viewSpan = GetCurrentSpan(tracing.Tracer);

            Assert.NotNull(viewSpan);
            Assert.NotEqual(hostSpan, viewSpan);
            Assert.NotEqual(actionSpan, viewSpan);
            var viewSpanContext = viewobs.Active;

            Assert.NotNull(viewSpanContext);
            Assert.Equal(viewSpan, viewSpanContext.Active);
            Assert.Equal(actionSpan.Context.SpanId, viewSpan.ParentSpanId);

            Assert.Equal("view:" + ctx.View.Path, viewSpan.Name);

            var viewSpanData   = viewSpan.ToSpanData();
            var viewAttributes = viewSpanData.Attributes.AttributeMap;

            Assert.Equal(SpanKind.Server, viewSpan.Kind);
            Assert.Equal(AttributeValue.StringAttributeValue(ctx.View.Path), viewAttributes[SpanAttributeConstants.MvcViewFilePath]);
        }