예제 #1
0
        public void ExtractRequestSize()
        {
            var opts    = GetOptions();
            var tracing = new OpenTelemetryTracing(opts, null);
            var obs     = new AspNetCoreHostingObserver(opts, tracing);

            var request = GetHttpRequestMessage();

            request.Request.Body.WriteByte(1);
            request.Request.Body.WriteByte(2);

            var result = obs.ExtractRequestSize(request);

            Assert.NotNull(result);
            Assert.Equal(2, result.Value);
        }