Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Filter description to describe what the filter allows instead of … #1615

Merged
merged 7 commits into from
Nov 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/OpenTelemetry.Instrumentation.AspNetCore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ 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
exception.
`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.

The following code snippet shows how to use `Filter` to filter out all POST
requests.
Expand All @@ -76,8 +76,8 @@ services.AddOpenTelemetryTracing(
opt => opt.Filter =
(httpContext) =>
{
// filter out all HTTP POST requests.
return !httpContext.Request.Method.Equals("POST");
// only collect telemetry about HTTP GET requests
return httpContext.Request.Method.Equals("GET");
})
.AddJaegerExporter()
);
Expand Down