From 889f52c4236ce77f938be786e92d44d9d7474591 Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Fri, 15 Sep 2023 22:36:33 +0200 Subject: [PATCH] update WebMetric test for RC1 (#30350) --- .../metrics/samples/metric-tests/BasicTests.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/aspnetcore/log-mon/metrics/metrics/samples/metric-tests/BasicTests.cs b/aspnetcore/log-mon/metrics/metrics/samples/metric-tests/BasicTests.cs index 54ad4b025a..bf442a3c27 100644 --- a/aspnetcore/log-mon/metrics/metrics/samples/metric-tests/BasicTests.cs +++ b/aspnetcore/log-mon/metrics/metrics/samples/metric-tests/BasicTests.cs @@ -1,8 +1,7 @@ using Microsoft.AspNetCore.Mvc.Testing; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Diagnostics.Metrics; -using Microsoft.VisualStudio.TestPlatform.TestHost; using Microsoft.Extensions.Telemetry.Testing.Metering; +using System.Diagnostics.Metrics; // public class BasicTests : IClassFixture> @@ -17,7 +16,7 @@ public class BasicTests : IClassFixture> var client = _factory.CreateClient(); var meterFactory = _factory.Services.GetRequiredService(); var collector = new MetricCollector(meterFactory, - "Microsoft.AspNetCore.Hosting", "http-server-request-duration"); + "Microsoft.AspNetCore.Hosting", "http.server.request.duration"); // Act var response = await client.GetAsync("/"); @@ -29,9 +28,9 @@ public class BasicTests : IClassFixture> Assert.Collection(collector.GetMeasurementSnapshot(), measurement => { - Assert.Equal("http", measurement.Tags["scheme"]); - Assert.Equal("GET", measurement.Tags["method"]); - Assert.Equal("/", measurement.Tags["route"]); + Assert.Equal("http", measurement.Tags["url.scheme"]); + Assert.Equal("GET", measurement.Tags["http.request.method"]); + Assert.Equal("/", measurement.Tags["http.route"]); }); } }