From 2db2712320ca57e76f393db986a5c407ad11cfc8 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Wed, 22 Nov 2023 15:16:43 -0800 Subject: [PATCH 1/4] [HttpClient & ASP.NET Core] Document request durations --- .../README.md | 17 +++++++++++++++++ .../README.md | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md index 5f32153a444..19f002bdd31 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md @@ -136,6 +136,23 @@ newer versions. recommended buckets by default for `http.server.request.duration`. This applies to all targeted frameworks. +## Activity and http.server.request.duration details + +`Activity.Duration` and `http.client.request.duration` values represents the +time used to handle an inbound HTTP request as measured at the hosting layer of +ASP.NET Core. The time measurement starts once the underlying web host has: + +* Sufficiently parsed the HTTP request headers on the inbound network stream to + identify the new request. +* Initialized the context data structures such as the + [HttpContext](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.httpcontext). + +The time ends when: + +* The ASP.NET Core handler pipeline is finished executing. +* All response data has been sent. +* The context data structures for the request are being disposed. + ## Advanced configuration This instrumentation can be configured to change the default behavior by using diff --git a/src/OpenTelemetry.Instrumentation.Http/README.md b/src/OpenTelemetry.Instrumentation.Http/README.md index 8e502ad7968..a8a3e2b8595 100644 --- a/src/OpenTelemetry.Instrumentation.Http/README.md +++ b/src/OpenTelemetry.Instrumentation.Http/README.md @@ -145,6 +145,13 @@ newer versions. recommended buckets by default for `http.client.request.duration`. This applies to all targeted frameworks. +## Activity and http.client.request.duration when using HttpClient + +`Activity.Duration` and `http.client.request.duration` values represents the +time the underlying client handler takes to complete the request. Completing the +request includes the time up to reading response headers from the network +stream. It doesn't include the time spent reading the response body. + ## Advanced configuration This instrumentation can be configured to change the default behavior by using From 26a473b173a15576399d8f437eed9c7b371f3926 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Wed, 22 Nov 2023 15:20:24 -0800 Subject: [PATCH 2/4] fix heading --- src/OpenTelemetry.Instrumentation.AspNetCore/README.md | 2 +- src/OpenTelemetry.Instrumentation.Http/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md index 19f002bdd31..2541f502f7c 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md @@ -136,7 +136,7 @@ newer versions. recommended buckets by default for `http.server.request.duration`. This applies to all targeted frameworks. -## Activity and http.server.request.duration details +## Activity Duration and http.server.request.duration metric details `Activity.Duration` and `http.client.request.duration` values represents the time used to handle an inbound HTTP request as measured at the hosting layer of diff --git a/src/OpenTelemetry.Instrumentation.Http/README.md b/src/OpenTelemetry.Instrumentation.Http/README.md index a8a3e2b8595..d06840fc7fa 100644 --- a/src/OpenTelemetry.Instrumentation.Http/README.md +++ b/src/OpenTelemetry.Instrumentation.Http/README.md @@ -145,7 +145,7 @@ newer versions. recommended buckets by default for `http.client.request.duration`. This applies to all targeted frameworks. -## Activity and http.client.request.duration when using HttpClient +## Activity Duration and http.client.request.duration metric details `Activity.Duration` and `http.client.request.duration` values represents the time the underlying client handler takes to complete the request. Completing the From 7b0272072219dc1a393b3af95deac3691711a66a Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Tue, 28 Nov 2023 14:03:33 -0800 Subject: [PATCH 3/4] re-arrange --- .../README.md | 34 +++++++++---------- .../README.md | 14 ++++---- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md index 2541f502f7c..ee74c22bf22 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md @@ -136,23 +136,6 @@ newer versions. recommended buckets by default for `http.server.request.duration`. This applies to all targeted frameworks. -## Activity Duration and http.server.request.duration metric details - -`Activity.Duration` and `http.client.request.duration` values represents the -time used to handle an inbound HTTP request as measured at the hosting layer of -ASP.NET Core. The time measurement starts once the underlying web host has: - -* Sufficiently parsed the HTTP request headers on the inbound network stream to - identify the new request. -* Initialized the context data structures such as the - [HttpContext](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.httpcontext). - -The time ends when: - -* The ASP.NET Core handler pipeline is finished executing. -* All response data has been sent. -* The context data structures for the request are being disposed. - ## Advanced configuration This instrumentation can be configured to change the default behavior by using @@ -252,6 +235,23 @@ This instrumentation automatically sets Activity Status to Error if an unhandled exception is thrown. Additionally, `RecordException` feature may be turned on, to store the exception to the Activity itself as ActivityEvent. +## Activity Duration and http.server.request.duration metric calculation + +`Activity.Duration` and `http.client.request.duration` values represents the +time used to handle an inbound HTTP request as measured at the hosting layer of +ASP.NET Core. The time measurement starts once the underlying web host has: + +* Sufficiently parsed the HTTP request headers on the inbound network stream to + identify the new request. +* Initialized the context data structures such as the + [HttpContext](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.httpcontext). + +The time ends when: + +* The ASP.NET Core handler pipeline is finished executing. +* All response data has been sent. +* The context data structures for the request are being disposed. + ## Troubleshooting This component uses an diff --git a/src/OpenTelemetry.Instrumentation.Http/README.md b/src/OpenTelemetry.Instrumentation.Http/README.md index d06840fc7fa..b3e60eac41e 100644 --- a/src/OpenTelemetry.Instrumentation.Http/README.md +++ b/src/OpenTelemetry.Instrumentation.Http/README.md @@ -145,13 +145,6 @@ newer versions. recommended buckets by default for `http.client.request.duration`. This applies to all targeted frameworks. -## Activity Duration and http.client.request.duration metric details - -`Activity.Duration` and `http.client.request.duration` values represents the -time the underlying client handler takes to complete the request. Completing the -request includes the time up to reading response headers from the network -stream. It doesn't include the time spent reading the response body. - ## Advanced configuration This instrumentation can be configured to change the default behavior by using @@ -319,6 +312,13 @@ This instrumentation automatically sets Activity Status to Error if the Http StatusCode is >= 400. Additionally, `RecordException` feature may be turned on, to store the exception to the Activity itself as ActivityEvent. +## Activity Duration and http.client.request.duration metric calculation + +`Activity.Duration` and `http.client.request.duration` values represents the +time the underlying client handler takes to complete the request. Completing the +request includes the time up to reading response headers from the network +stream. It doesn't include the time spent reading the response body. + ## Troubleshooting This component uses an From 5f83b03b273ff8502a77b397ab167ffa449bdaa0 Mon Sep 17 00:00:00 2001 From: Vishwesh Bankwar Date: Tue, 28 Nov 2023 14:32:05 -0800 Subject: [PATCH 4/4] Update src/OpenTelemetry.Instrumentation.AspNetCore/README.md Co-authored-by: Anton Firszov --- src/OpenTelemetry.Instrumentation.AspNetCore/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md index ee74c22bf22..c21322a9726 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md @@ -237,7 +237,7 @@ to store the exception to the Activity itself as ActivityEvent. ## Activity Duration and http.server.request.duration metric calculation -`Activity.Duration` and `http.client.request.duration` values represents the +`Activity.Duration` and `http.server.request.duration` values represents the time used to handle an inbound HTTP request as measured at the hosting layer of ASP.NET Core. The time measurement starts once the underlying web host has: