public async Task HttpClientStackTrace()
        {
            var(listener, payloadSender, _) = HttpDiagnosticListenerTest.RegisterListenerAndStartTransaction();

            using (listener)
                using (var localServer = new LocalServer(uri: "http://localhost:8083/"))
                {
                    var httpClient = new HttpClient();
                    var res        = await httpClient.GetAsync(localServer.Uri);

                    res.IsSuccessStatusCode.Should().BeTrue();
                }

            var stackFrames = payloadSender.FirstSpan?.StackTrace;

            stackFrames.Should().NotBeEmpty().And.Contain(frame => frame.LineNo != 0);
        }
示例#2
0
        public async Task HttpClientStackTrace()
        {
            var(listener, _, _) = HttpDiagnosticListenerTest.RegisterListenerAndStartTransaction();

            using (listener)
                using (var localServer = new LocalServer(uri: "http://localhost:8083/"))
                {
                    var httpClient = new HttpClient();
                    var res        = await httpClient.GetAsync(localServer.Uri);

                    Assert.True(res.IsSuccessStatusCode);
                }

            var stackFrames = (Agent.TransactionContainer.Transactions.Value.Spans[0] as Span)?.StackTrace;

            Assert.NotNull(stackFrames);
            Assert.Contains(stackFrames, frame => frame.LineNo != 0);
        }