Skip to content

Commit cea07e5

Browse files
committed
Update documentation
1 parent be41131 commit cea07e5

File tree

1 file changed

+50
-21
lines changed

1 file changed

+50
-21
lines changed

src/docs/components/processors.mdx

Lines changed: 50 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Processors'
33
description: |
44
Processors pre-process the data collected by the receivers before they are exported by exporters. Processors can modify, batch or
55
filter the data flowing through the pipeline.
6-
path: '/docs/components/kafka-receiver-exporter'
6+
path: '/docs/components/processors'
77
---
88

99
import SectionSeparator from "components/MdxSectionSeparator/sectionSeparator.jsx"
@@ -17,37 +17,43 @@ ADOT collector supports a selected list of processors.
1717

1818
The ADOT collector supports the following processors:
1919

20-
* [attributesprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/attributesprocessor#attributes-processor)
21-
* [batchprocessor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor#batch-processor)
22-
* [deltatorateprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/deltatorateprocessor#delta-to-rate-processor)
23-
* [filterprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor#filter-processor)
24-
* [groupbytraceprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/groupbytraceprocessor/README.md)
25-
* [memorylimiterprocessor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/memorylimiterprocessor#memory-limiter-processor)
26-
* [metricsgenerationprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/metricsgenerationprocessor#metrics-generation-processor)
27-
* [metricstransformprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/metricstransformprocessor#metrics-transform-processor)
28-
* [probabilisticsamplerprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/probabilisticsamplerprocessor#probabilistic-sampling-processor)
29-
* [resourcedetectionprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#resource-detection-processor)
30-
* [resourceprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourceprocessor#resource-processor)
31-
* [spanprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/spanprocessor#span-processor)
32-
* [tailsamplingprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor/README.md)
20+
* [Attributes processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/attributesprocessor#attributes-processor)
21+
* [Batch processor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor#batch-processor)
22+
* [Delta to Rate processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/deltatorateprocessor#delta-to-rate-processor)
23+
* [Filter processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor#filter-processor)
24+
* [Group by Trace processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/groupbytraceprocessor/README.md)
25+
* [Memory Limiter processor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/memorylimiterprocessor#memory-limiter-processor)
26+
* [Metrics Generation processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/metricsgenerationprocessor#metrics-generation-processor)
27+
* [Metrics Transform processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/metricstransformprocessor#metrics-transform-processor)
28+
* [Probabilistic Sampling processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/probabilisticsamplerprocessor#probabilistic-sampling-processor)
29+
* [Resource Detection processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor#resource-detection-processor)
30+
* [Resource processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourceprocessor#resource-processor)
31+
* [Span processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/spanprocessor#span-processor)
32+
* [Tail Sampling processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor/README.md)
3333

3434
## Notes on Group by Trace and Tail Sampling processors
3535

36-
In order to achieve the desired results when using the tailsampling processor and groupbytrace, **do not use a batch processor before these components in a pipeline**. Using a batch processor before these components might separate spans belonging to a same trace. It is important to pay attention to this detail because these components will try to group all the spans belonging to a trace. In the case of the tailsampling processor this will allow for a sampling decision to affect all spans of a trace, creating a full picture of the trace in case it is sampled. A batch processor immediately after these components does not cause any problems and is recommended to properly pre-process data for subsequent exporters.
36+
In order to achieve the desired results when using the Tail Sampling and Group by Trace processors, **do not use a Batch processor before these components in a pipeline**. Using a Batch processor before these components might separate spans belonging to a same trace. It is important to pay attention to this detail because these components will try to group all the spans belonging to a trace. In the case of the Tail Sampling processor this will allow for a sampling decision to affect all spans of a trace, creating a full picture of the trace in case it is sampled. A Batch processor immediately after these components does not cause any problems and is recommended to properly pre-process data for subsequent exporters.
3737

38-
Besides that, you have to tune the `wait_duration` parameter of the groupbytrace processor and `decision_wait` parameter of the tailsampling processor to be greater than or equal to the maximum expected latency of a trace in your system. Again, this will guarantee that spans of a same trace are processed in the same batch.
38+
Also, you need to make sure that all the spans for a trace are processed in the same collector instances. This is specially important for a collector running in gateway mode.
3939

40-
Finally to really limit the number of traces that should be kept in memory, we recommend that you use the groupbytrace processor before the tailsampling processor. The reason why is because the groupbytrace processor implements a limit for the number of traces to be kept in memory while this is not fully implemented in the tailsampling processor.
40+
Besides that, you have to tune the `wait_duration` parameter of the Group by Trace processor and `decision_wait` parameter of the Tail Sampling processor to be greater than or equal to the maximum expected latency of a trace in your system. Again, this will guarantee that spans of a same trace are processed in the same batch.
4141

42-
The groupbytrace processor will drop the oldest trace in case the `num_traces` limit is exceeded. `wait_duration` and `num_traces` should be scaled to consider the expected traffic in the monitored applications. For example, if the maximum expected latency for a request in your application is 10s and the maximum traffic in number of requests per second that your application can have is 1000 requests per second, `wait_duration` should be set to 10s and `num_traces` should be set to at least 10000 (10 * 1000 requests per second). It is highly recommended that you monitor the `otelcol_processor_groupbytrace_traces_evicted` metric from the collector [self telemetry](https://opentelemetry.io/docs/collector/configuration/#service). If the value in the metric is greater than zero, that means that the collector is receiving more traffic than it can handle and you should increase the `num_traces` accordingly.
42+
Finally to really limit the number of traces that should be kept in memory, we recommend that you use the Group by Trace processor before the Tail Sampling processor. The reason why is because the Group by Trace processor implements a limit for the number of traces to be kept in memory while this is not fully implemented in the Tail Sampling processor.
4343

44+
The Group by Trace processor will drop the oldest trace in case the `num_traces` limit is exceeded. `wait_duration` and `num_traces` should be scaled to consider the expected traffic in the monitored applications.
4445

45-
Example:
46-
```
46+
### Examples
47+
48+
If the maximum expected latency for a request in your application is 10s and the maximum traffic in number of requests per second that your application can have is 1000 requests per second, `wait_duration` should be set to 10s and `num_traces` should be set to at least 10000 (10 * 1000 requests per second). It is highly recommended that you monitor the `otelcol_processor_groupbytrace_traces_evicted` metric from the collector [self telemetry](https://opentelemetry.io/docs/collector/configuration/#service). If the value in the metric is greater than zero, that means that the collector is receiving more traffic than it can handle and you should increase the `num_traces` accordingly.
49+
50+
51+
Example from the description above:
52+
```yaml
4753
processors:
4854
groupbytrace:
4955
wait_duration: 10s
50-
num_traces: 20000 # Double the max expected traffic (10 * 1000 requests per second)
56+
num_traces: 20000 # Double the max expected traffic (2 * 10 * 1000 requests per second)
5157
tail_sampling:
5258
decision_wait: 1s # This value should be smaller than wait_duration
5359
policies:
@@ -65,3 +71,26 @@ service:
6571

6672
```
6773

74+
The Tail Sampling processor is very powerful. It is possible to create complex sampling policies by combining policies. For example, to sample traces from a specific path in case of errors you could use the following configuration:
75+
76+
```yaml
77+
processors:
78+
tail_sampling:
79+
decision_wait: 1s
80+
policies:
81+
- name: and-policy,
82+
type: and,
83+
and:
84+
and_sub_policy:
85+
- name: test-policy-9,
86+
type: string_attribute,
87+
string_attribute:
88+
key: http.url,
89+
values: ["\/users"]
90+
enabled_regex_matching: true
91+
- name: error-policy,
92+
type: status_code,
93+
status_code: {status_codes: [ERROR, UNSET]}
94+
```
95+
96+
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)