public async Task Trace_Exception(Action <IWebHostBuilder> testServerConfigurator)
        {
            var uri           = $"/Trace/{nameof(TraceController.ThrowException)}/{_testId}";
            var childSpanName = EntryData.GetMessage(nameof(TraceController.ThrowException), _testId);

            using var server = GetTestServer <TraceTestNoBufferHighQpsApplication>(testServerConfigurator);
            using var client = server.CreateClient();
            await Assert.ThrowsAnyAsync <Exception>(() => client.GetAsync(uri));

            var trace = _polling.GetTrace(uri, _startTime);

            TraceEntryVerifiers.AssertParentChildSpan(trace, uri, childSpanName);
            TraceEntryVerifiers.AssertContainsStackTrace(trace.Spans.First(s => s.Name == uri),
                                                         nameof(TraceController), nameof(TraceController.ThrowException));
        }
Example #2
0
        public async Task Trace_StackTrace()
        {
            var uri           = $"/Trace/{nameof(TraceController.TraceStackTrace)}/{_testId}";
            var childSpanName = EntryData.GetMessage(nameof(TraceController.TraceStackTrace), _testId);

            using var server = GetTestServer <TraceTestNoBufferHighQpsApplication>();
            using var client = server.CreateClient();
            await client.GetAsync(uri);

            var trace = _polling.GetTrace(uri, _startTime);

            TraceEntryVerifiers.AssertParentChildSpan(trace, uri, childSpanName);
            TraceEntryVerifiers.AssertContainsStackTrace(trace.Spans.First(s => s.Name == childSpanName),
                                                         nameof(TraceController), nameof(TraceController.TraceStackTrace),
                                                         nameof(TraceEntryData), nameof(TraceEntryData.CreateStackTrace));
        }
Example #3
0
        public async Task Trace_WebServerHosted_StackTrace()
        {
            var service       = $"/api/Trace/TraceStackTrace/{_testId}";
            var childSpanName = EntryData.GetMessage("TraceStackTrace", _testId);

            using (HttpClient httpClient = new HttpClient())
            {
                httpClient.BaseAddress = PublishedServiceBaseAddress;
                await httpClient.GetAsync(service);
            }

            var trace = _polling.GetTrace(service, _startTime);

            TraceEntryVerifiers.AssertParentChildSpan(trace, service, childSpanName);
            TraceEntryVerifiers.AssertContainsStackTrace(trace.Spans.First(s => s.Name == childSpanName),
                                                         "TraceController", "TraceStackTrace",
                                                         nameof(TraceEntryData), nameof(TraceEntryData.CreateStackTrace));
        }