From 009723acca1fe4e022d7c89fbd3c34ec369575c8 Mon Sep 17 00:00:00 2001 From: Przemek Maciolek <58699843+pmm-sumo@users.noreply.github.com> Date: Tue, 5 Jan 2021 13:08:15 +0100 Subject: [PATCH] Update README.md Clarify which span attributes are updated/added and `probablistic_filtering_ratio` behavior --- processor/cascadingfilterprocessor/README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/processor/cascadingfilterprocessor/README.md b/processor/cascadingfilterprocessor/README.md index 0877892663f6..78d7ee449ecb 100644 --- a/processor/cascadingfilterprocessor/README.md +++ b/processor/cascadingfilterprocessor/README.md @@ -11,13 +11,24 @@ The following configuration options should be configured as desired: - `policies` (no default): Policies used to make a sampling decision - `spans_per_second` (default = 1500): Maximum total number of emitted spans per second - `probabilistic_filtering_ratio` (default = 0.2): Ratio of spans that are always probabilistically filtered -(hence might be used for metrics calculation) +(hence might be used for metrics calculation). The ratio is specified as portion of output spans (defined by +`spans_per_second`) rather than input spans. So the default filtering rate of `0.2` and default max span rate of +`1500` produces at most `300` probabilistically sampled spans per second. The following configuration options can also be modified: - `decision_wait` (default = 30s): Wait time since the first span of a trace before making a filtering decision - `num_traces` (default = 50000): Number of traces kept in memory - `expected_new_traces_per_sec` (default = 0): Expected number of new traces (helps in allocating data structures) +## Updated span attributes + +The processor modifies each span attributes, by setting following two attributes: +- `sampling.rule`: describing if `probabilistic` or `filtered` policy was applied +- `sampling.probability`: describing the effective sampling rate in case of `probabilistic` rule. E.g. if there were `5000` +spans evaluated in a given second, with `1500` max total spans per second and `0.2` filtering ratio, at most `300` spans +would be selected by such rule. This would effect in having `sampling.probability=0.06` (`300/5000=0.6`). If such value is already +set by head-based (or other) sampling, it's multiplied by the calculated value. + ## Policy configuration Each defined policy is evaluated with order as specified in config. There are several properties: