Skip to content

Commit 3f1a09e

Browse files
Update Demo with HttpClient (Azure#34680)
1 parent 3458752 commit 3f1a09e

File tree

1 file changed

+5
-0
lines changed
  • sdk/monitor/Azure.Monitor.OpenTelemetry/tests/Azure.Monitor.OpenTelemetry.Demo

1 file changed

+5
-0
lines changed

sdk/monitor/Azure.Monitor.OpenTelemetry/tests/Azure.Monitor.OpenTelemetry.Demo/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#if NET6_0_OR_GREATER
55
using System.Diagnostics;
6+
using System.Net.Http;
67
using Azure.Monitor.OpenTelemetry;
78
using Microsoft.AspNetCore.Builder;
89
using Microsoft.Extensions.Logging;
@@ -31,6 +32,10 @@
3132
app.MapGet("/", () =>
3233
{
3334
app.Logger.LogInformation("Hello World!");
35+
36+
using var client = new HttpClient();
37+
var response = client.GetAsync("https://www.bing.com/").Result;
38+
3439
return $"Hello World! OpenTelemetry Trace: {Activity.Current?.Id}";
3540
});
3641

0 commit comments

Comments
 (0)