From 228e3e1696d36202d9d8b4e3e73ee182045edcb6 Mon Sep 17 00:00:00 2001 From: kevinmckinley Date: Mon, 23 Nov 2020 22:40:06 -0800 Subject: [PATCH 1/5] Set Filter description to describe what the filter allows instead of what is filtered out --- src/OpenTelemetry.Instrumentation.AspNetCore/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md index 5e822fcd80d..b1d74bee021 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md @@ -61,9 +61,8 @@ This instrumentation can be configured to change the default behavior by using This instrumentation by default collects all the incoming http requests. It allows filtering of requests by using `Filter` function in -`AspNetCoreInstrumentationOptions`. This can be used to filter out any requests -based on some condition. The Filter receives the `HttpContext` of the incoming -request, and filters out the request if the Filter returns false or throws +`AspNetCoreInstrumentationOptions`. This defines the condition for allowable requests. The Filter receives the `HttpContext` of the incoming +request, and does not instrument the request if the Filter returns false or throws exception. The following code snippet shows how to use `Filter` to filter out all POST @@ -76,8 +75,8 @@ services.AddOpenTelemetryTracing( opt => opt.Filter = (httpContext) => { - // filter out all HTTP POST requests. - return !httpContext.Request.Method.Equals("POST"); + // only instrument HTTP GET requests + return httpContext.Request.Method.Equals("GET"); }) .AddJaegerExporter() ); From 989bc876f48e75394038d329baad8aa771937e4d Mon Sep 17 00:00:00 2001 From: kevinmckinley Date: Mon, 23 Nov 2020 23:53:04 -0800 Subject: [PATCH 2/5] adjust line length --- src/OpenTelemetry.Instrumentation.AspNetCore/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md index b1d74bee021..dc20bd8f750 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md @@ -61,7 +61,8 @@ This instrumentation can be configured to change the default behavior by using This instrumentation by default collects all the incoming http requests. It allows filtering of requests by using `Filter` function in -`AspNetCoreInstrumentationOptions`. This defines the condition for allowable requests. The Filter receives the `HttpContext` of the incoming +`AspNetCoreInstrumentationOptions`. This defines the condition for allowable +requests. The Filter receives the `HttpContext` of the incoming request, and does not instrument the request if the Filter returns false or throws exception. From df086ac51a6fc24d9c448419dfd749499bc1c216 Mon Sep 17 00:00:00 2001 From: kevinmckinley Date: Tue, 24 Nov 2020 17:02:06 -0800 Subject: [PATCH 3/5] clarify: it doesn't collect telemetry for request --- 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 dc20bd8f750..6c02e1af4a7 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md @@ -63,7 +63,7 @@ This instrumentation by default collects all the incoming http requests. It allows filtering of requests by using `Filter` function in `AspNetCoreInstrumentationOptions`. This defines the condition for allowable requests. The Filter receives the `HttpContext` of the incoming -request, and does not instrument the request if the Filter returns false or throws +request, and does not collect telemetry about the request if the Filter returns false or throws exception. The following code snippet shows how to use `Filter` to filter out all POST From d084ac8dba3fec01db97c732ac94061517ce3a2f Mon Sep 17 00:00:00 2001 From: kevinmckinley Date: Wed, 25 Nov 2020 08:54:01 -0800 Subject: [PATCH 4/5] clarify example comment --- 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 6c02e1af4a7..f5206ac5323 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md @@ -76,7 +76,7 @@ services.AddOpenTelemetryTracing( opt => opt.Filter = (httpContext) => { - // only instrument HTTP GET requests + // only collect telemetry about HTTP GET requests return httpContext.Request.Method.Equals("GET"); }) .AddJaegerExporter() From 5cd391dcef91690972a1498005ccdaa896600536 Mon Sep 17 00:00:00 2001 From: kevinmckinley Date: Wed, 25 Nov 2020 09:02:57 -0800 Subject: [PATCH 5/5] adjust line length --- src/OpenTelemetry.Instrumentation.AspNetCore/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md index f5206ac5323..51fdba53c58 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/README.md +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/README.md @@ -63,8 +63,8 @@ This instrumentation by default collects all the incoming http requests. It allows filtering of requests by using `Filter` function in `AspNetCoreInstrumentationOptions`. This defines the condition for allowable requests. The Filter receives the `HttpContext` of the incoming -request, and does not collect telemetry about the request if the Filter returns false or throws -exception. +request, and does not collect telemetry about the request if the Filter +returns false or throws exception. The following code snippet shows how to use `Filter` to filter out all POST requests.