Created
June 24, 2024 21:57
-
-
Save antonfirsov/b990472b739a7bbac42f66eb1929b9fd to your computer and use it in GitHub Desktop.
ConnAct
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**** sending Request1 to example.com **** | |
Activity.TraceId: a204d84ced611be46da0dba9313ac4dc | |
Activity.SpanId: d3ffeb48a6f38d34 | |
Activity.TraceFlags: Recorded | |
Activity.ParentSpanId: 11607beab559707f | |
Activity.ActivitySourceName: System.Net.NameResolution | |
Activity.DisplayName: System.Net.NameResolution.DsnLookup | |
Activity.Kind: Client | |
Activity.StartTime: 2024-06-24T21:43:21.5808535Z | |
Activity.Duration: 00:00:00.0096843 | |
Resource associated with Activity: | |
service.name: ConnAct | |
service.instance.id: 4837473f-42e0-465a-8499-d4f7068209ea | |
telemetry.sdk.name: opentelemetry | |
telemetry.sdk.language: dotnet | |
telemetry.sdk.version: 1.8.1 | |
Activity.TraceId: a204d84ced611be46da0dba9313ac4dc | |
Activity.SpanId: cc9353cc8e73bea5 | |
Activity.TraceFlags: Recorded | |
Activity.ParentSpanId: 11607beab559707f | |
Activity.ActivitySourceName: System.Net.Sockets | |
Activity.DisplayName: System.Net.Sockets.Connect | |
Activity.Kind: Internal | |
Activity.StartTime: 2024-06-24T21:43:21.6541736Z | |
Activity.Duration: 00:00:00.1061170 | |
Resource associated with Activity: | |
service.name: ConnAct | |
service.instance.id: 4837473f-42e0-465a-8499-d4f7068209ea | |
telemetry.sdk.name: opentelemetry | |
telemetry.sdk.language: dotnet | |
telemetry.sdk.version: 1.8.1 | |
Activity.TraceId: a204d84ced611be46da0dba9313ac4dc | |
Activity.SpanId: 109ceb8401695e24 | |
Activity.TraceFlags: Recorded | |
Activity.ParentSpanId: 11607beab559707f | |
Activity.ActivitySourceName: System.Net.Security | |
Activity.DisplayName: System.Net.Security.TlsHandshake | |
Activity.Kind: Client | |
Activity.StartTime: 2024-06-24T21:43:21.7808276Z | |
Activity.Duration: 00:00:00.0378024 | |
Resource associated with Activity: | |
service.name: ConnAct | |
service.instance.id: 4837473f-42e0-465a-8499-d4f7068209ea | |
telemetry.sdk.name: opentelemetry | |
telemetry.sdk.language: dotnet | |
telemetry.sdk.version: 1.8.1 | |
Activity.TraceId: d71be2fb93e1bb022495ee2425d91504 | |
Activity.SpanId: f8a2fcc36f3beef2 | |
Activity.TraceFlags: Recorded | |
Activity.ActivitySourceName: System.Net.Http | |
Activity.DisplayName: System.Net.Http.HttpRequestOut | |
Activity.Kind: Client | |
Activity.StartTime: 2024-06-24T21:43:21.5295945Z | |
Activity.Duration: 00:00:00.6686304 | |
Activity.Links: | |
a204d84ced611be46da0dba9313ac4dc 11607beab559707f | |
Resource associated with Activity: | |
service.name: ConnAct | |
service.instance.id: 4837473f-42e0-465a-8499-d4f7068209ea | |
telemetry.sdk.name: opentelemetry | |
telemetry.sdk.language: dotnet | |
telemetry.sdk.version: 1.8.1 | |
**** Request1 done, sending Request2 to example.com **** | |
Activity.TraceId: 9125b1f5760cd27fe0337519d81009d2 | |
Activity.SpanId: 809c135695e3954f | |
Activity.TraceFlags: Recorded | |
Activity.ActivitySourceName: System.Net.Http | |
Activity.DisplayName: System.Net.Http.HttpRequestOut | |
Activity.Kind: Client | |
Activity.StartTime: 2024-06-24T21:43:22.2113173Z | |
Activity.Duration: 00:00:00.0997172 | |
Activity.Links: | |
a204d84ced611be46da0dba9313ac4dc 11607beab559707f | |
Resource associated with Activity: | |
service.name: ConnAct | |
service.instance.id: 4837473f-42e0-465a-8499-d4f7068209ea | |
telemetry.sdk.name: opentelemetry | |
telemetry.sdk.language: dotnet | |
telemetry.sdk.version: 1.8.1 | |
**** Request2 done, sending Request3 to httpbin.org **** | |
Activity.TraceId: 64998f9caacef878da248dae8577021e | |
Activity.SpanId: 7f0d0db6bafebf2b | |
Activity.TraceFlags: Recorded | |
Activity.ParentSpanId: c8381a338b093b38 | |
Activity.ActivitySourceName: System.Net.NameResolution | |
Activity.DisplayName: System.Net.NameResolution.DsnLookup | |
Activity.Kind: Client | |
Activity.StartTime: 2024-06-24T21:43:22.3135316Z | |
Activity.Duration: 00:00:00.0345648 | |
Resource associated with Activity: | |
service.name: ConnAct | |
service.instance.id: 4837473f-42e0-465a-8499-d4f7068209ea | |
telemetry.sdk.name: opentelemetry | |
telemetry.sdk.language: dotnet | |
telemetry.sdk.version: 1.8.1 | |
Activity.TraceId: 64998f9caacef878da248dae8577021e | |
Activity.SpanId: b9db618109415369 | |
Activity.TraceFlags: Recorded | |
Activity.ParentSpanId: c8381a338b093b38 | |
Activity.ActivitySourceName: System.Net.Sockets | |
Activity.DisplayName: System.Net.Sockets.Connect | |
Activity.Kind: Internal | |
Activity.StartTime: 2024-06-24T21:43:22.3502781Z | |
Activity.Duration: 00:00:00.0970132 | |
Resource associated with Activity: | |
service.name: ConnAct | |
service.instance.id: 4837473f-42e0-465a-8499-d4f7068209ea | |
telemetry.sdk.name: opentelemetry | |
telemetry.sdk.language: dotnet | |
telemetry.sdk.version: 1.8.1 | |
Activity.TraceId: 64998f9caacef878da248dae8577021e | |
Activity.SpanId: 8079afaae47de809 | |
Activity.TraceFlags: Recorded | |
Activity.ParentSpanId: c8381a338b093b38 | |
Activity.ActivitySourceName: System.Net.Security | |
Activity.DisplayName: System.Net.Security.TlsHandshake | |
Activity.Kind: Client | |
Activity.StartTime: 2024-06-24T21:43:22.4486381Z | |
Activity.Duration: 00:00:00.0015442 | |
Resource associated with Activity: | |
service.name: ConnAct | |
service.instance.id: 4837473f-42e0-465a-8499-d4f7068209ea | |
telemetry.sdk.name: opentelemetry | |
telemetry.sdk.language: dotnet | |
telemetry.sdk.version: 1.8.1 | |
Activity.TraceId: 9e309eea7ada0c1d9acddf40864d0e37 | |
Activity.SpanId: 5967c45147e1ba94 | |
Activity.TraceFlags: Recorded | |
Activity.ActivitySourceName: System.Net.Http | |
Activity.DisplayName: System.Net.Http.HttpRequestOut | |
Activity.Kind: Client | |
Activity.StartTime: 2024-06-24T21:43:22.3131607Z | |
Activity.Duration: 00:00:00.4827388 | |
Activity.Links: | |
64998f9caacef878da248dae8577021e c8381a338b093b38 | |
Resource associated with Activity: | |
service.name: ConnAct | |
service.instance.id: 4837473f-42e0-465a-8499-d4f7068209ea | |
telemetry.sdk.name: opentelemetry | |
telemetry.sdk.language: dotnet | |
telemetry.sdk.version: 1.8.1 | |
**** Request3 done, disposing HttpClient **** | |
Activity.TraceId: 64998f9caacef878da248dae8577021e | |
Activity.SpanId: c8381a338b093b38 | |
Activity.TraceFlags: Recorded | |
Activity.ActivitySourceName: System.Net.Http.Connections | |
Activity.DisplayName: System.Net.Http.Connections.HttpConnection | |
Activity.Kind: Internal | |
Activity.StartTime: 2024-06-24T21:43:22.3132843Z | |
Activity.Duration: 00:00:00.4874951 | |
Resource associated with Activity: | |
service.name: ConnAct | |
service.instance.id: 4837473f-42e0-465a-8499-d4f7068209ea | |
telemetry.sdk.name: opentelemetry | |
telemetry.sdk.language: dotnet | |
telemetry.sdk.version: 1.8.1 | |
Activity.TraceId: a204d84ced611be46da0dba9313ac4dc | |
Activity.SpanId: 11607beab559707f | |
Activity.TraceFlags: Recorded | |
Activity.ActivitySourceName: System.Net.Http.Connections | |
Activity.DisplayName: System.Net.Http.Connections.HttpConnection | |
Activity.Kind: Internal | |
Activity.StartTime: 2024-06-24T21:43:21.5636144Z | |
Activity.Duration: 00:00:01.2414474 | |
Resource associated with Activity: | |
service.name: ConnAct | |
service.instance.id: 4837473f-42e0-465a-8499-d4f7068209ea | |
telemetry.sdk.name: opentelemetry | |
telemetry.sdk.language: dotnet | |
telemetry.sdk.version: 1.8.1 | |
**** HttpClient disposed & all connections closed **** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using OpenTelemetry.Resources; | |
using OpenTelemetry; | |
using OpenTelemetry.Trace; | |
Console.WriteLine(typeof(object).Assembly.Location); | |
using var tracerProvider = Sdk.CreateTracerProviderBuilder() | |
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("ConnAct")) | |
.AddSource("System.Net.*") | |
.AddConsoleExporter() | |
.Build(); | |
Console.WriteLine("**** sending Request1 to example.com ****"); | |
using HttpClient client = new HttpClient(); | |
await client.GetStringAsync("https://example.com"); | |
Console.WriteLine("**** Request1 done, sending Request2 to example.com ****"); | |
await client.GetStringAsync("https://example.com"); | |
Console.WriteLine("**** Request2 done, sending Request3 to httpbin.org ****"); | |
await client.GetStringAsync("https://httpbin.org/get"); | |
Console.WriteLine("**** Request3 done, disposing HttpClient ****"); | |
client.Dispose(); | |
Console.WriteLine("**** HttpClient disposed & all connections closed ****"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment