Skip to content

Commit acbaf09

Browse files
author
Timothy Mothra
authored
[AzureMonitorExporter] update test and readme (Azure#37021)
* update test and readme * meter provider
1 parent d80851c commit acbaf09

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests/DistroWebAppLiveTests.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
using Microsoft.Extensions.Logging;
1414
using NUnit.Framework;
1515
using OpenTelemetry.Logs;
16+
using OpenTelemetry.Metrics;
1617
using OpenTelemetry.Resources;
18+
using OpenTelemetry.Trace;
1719

1820
#if NET6_0_OR_GREATER
1921
namespace Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests
@@ -89,11 +91,13 @@ public async Task VerifyDistro()
8991
Assert.True(res.Equals("Response from Test Server"), "If this assert fails, the in-process test server is not running.");
9092

9193
// SHUTDOWN
94+
var tracerProvider = app.Services.GetRequiredService<TracerProvider>();
95+
tracerProvider.ForceFlush();
96+
tracerProvider.Shutdown();
9297

93-
// NOTE: If this test starts failing, Flushing may be necessary.
94-
//var tracerProvider = app.Services.GetRequiredService<TracerProvider>();
95-
//tracerProvider.ForceFlush();
96-
//tracerProvider.Shutdown();
98+
var meterProvider = app.Services.GetRequiredService<MeterProvider>();
99+
meterProvider.ForceFlush();
100+
meterProvider.Shutdown();
97101

98102
await app.StopAsync(); // shutdown to prevent collecting the log queries.
99103

sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/tests/Azure.Monitor.OpenTelemetry.AspNetCore.Integration.Tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To run these tests locally you must first create your test resources.
1717
2. Then run the New-TestResources cmd which will create the required test resources.
1818
1919
```powershell
20-
eng\common\TestResources\New-TestResources.ps1 -ServiceDirectory monitor
20+
eng\common\TestResources\New-TestResources.ps1 -ServiceDirectory monitor -SubscriptionId 'YOUR SUBSCRIPTION ID' -ResourceGroupName 'YOUR RESOURCE GROUP NAME'
2121
```
2222
2323
If this script fails, it should instruct you to install any missing dependencies.

0 commit comments

Comments
 (0)