Skip to content

Commit 9a4442b

Browse files
committed
Update documentation to add more examples
Signed-off-by: Raphael Silva <[email protected]>
1 parent cea07e5 commit 9a4442b

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

src/docs/components/processors.mdx

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,41 @@ processors:
7878
tail_sampling:
7979
decision_wait: 1s
8080
policies:
81-
- name: and-policy,
82-
type: and,
81+
- name: and-policy
82+
type: and
8383
and:
8484
and_sub_policy:
85-
- name: test-policy-9,
86-
type: string_attribute,
85+
- name: path-policy
86+
type: string_attribute
8787
string_attribute:
88-
key: http.url,
88+
key: http.url
8989
values: ["\/users"]
9090
enabled_regex_matching: true
91-
- name: error-policy,
92-
type: status_code,
93-
status_code: {status_codes: [ERROR, UNSET]}
91+
- name: error-policy
92+
type: status_code
93+
status_code:
94+
status_codes: ["ERROR", "UNSET"]
95+
```
96+
97+
In the next example we will sample 20% of the spans that present an error:
98+
99+
```yaml
100+
processors:
101+
tail_sampling:
102+
decision_wait: 1s
103+
policies:
104+
- name: and-policy
105+
type: and
106+
and:
107+
and_sub_policy:
108+
- name: error-policy
109+
type: status_code
110+
status_code:
111+
status_codes: ["ERROR", "UNSET"]
112+
- name: probabilistic-policy
113+
type: probabilistic
114+
probabilistic:
115+
sampling_percentage: 20
94116
```
95117
96118
It is highly recommended that you take a look into the [README](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor/README.md) of this component to understand all the available policies.

0 commit comments

Comments
 (0)