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

[collector] Use ottl in filterprocessor example #4145

Merged
merged 5 commits into from
Mar 13, 2024
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
39 changes: 18 additions & 21 deletions content/en/docs/collector/transforming-telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,35 @@
**Processor**:
[filter processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor)

The filter processor allows users to filter telemetry based on `include` or
`exclude` rules. Include rules are used for defining "allow lists" where
anything that does _not_ match include rules is dropped from the collector.
Exclude rules are used for defining "deny lists" where telemetry that matches
rules is dropped from the collector.
The filter processor allows users to filter telemetry using
[OTTL](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/ottl/README.md).

Check warning on line 27 in content/en/docs/collector/transforming-telemetry.md

View workflow job for this annotation

GitHub Actions / SPELLING check

Unknown word (OTTL)
svrnm marked this conversation as resolved.
Show resolved Hide resolved
Telemetry that matches any condition is dropped.

For example, to _only_ allow span data from services app1, app2, and app3 and
drop data from all other services:

```yaml
processors:
filter/allowlist:
spans:
include:
match_type: strict
services:
- app1
- app2
- app3
filter/ottl:
error_mode: ignore
traces:
span:
- |
resource.attributes["service.name"] != "app1" and
resource.attributes["service.name"] != "app2" and
resource.attributes["service.name"] != "app2"
```

To only block spans from a service called development while allowing all other
spans, an exclude rule is used:
To only drop spans from a service called development while keeping all other
TylerHelmuth marked this conversation as resolved.
Show resolved Hide resolved
spans:

```yaml
processors:
filter/denylist:
spans:
exclude:
match_type: strict
services:
- development
filter/ottl:
error_mode: ignore
traces:
span:
- resource.attributes["service.name"] == "development"
TylerHelmuth marked this conversation as resolved.
Show resolved Hide resolved
```

The
Expand Down
Loading