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 2 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
10 changes: 5 additions & 5 deletions src/OpenTelemetry.Instrumentation.AspNetCore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ 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
cijothomas marked this conversation as resolved.
Show resolved Hide resolved
exception.

The following code snippet shows how to use `Filter` to filter out all POST
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 instrument HTTP GET requests
return httpContext.Request.Method.Equals("GET");
})
.AddJaegerExporter()
);
Expand Down