You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation for the recently added [drop policy
type](open-telemetry#39668).
The examples replace the use of invert_match. I attempted to make as few
changes as necessary at this time. I intended to add further
documentation while deprecating the top-level invert_match
logic/decisions in a separate pull-request.
Signed-off-by: Sean Porter <[email protected]>
Copy file name to clipboardExpand all lines: processor/tailsamplingprocessor/README.md
+46-26Lines changed: 46 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -36,8 +36,9 @@ Multiple policies exist today and it is straight forward to add more. These incl
36
36
-`span_count`: Sample based on the minimum and/or maximum number of spans, inclusive. If the sum of all spans in the trace is outside the range threshold, the trace will not be sampled.
37
37
-`boolean_attribute`: Sample based on boolean attribute (resource and record).
38
38
-`ottl_condition`: Sample based on given boolean OTTL condition (span and span event).
39
-
-`and`: Sample based on multiple policies, creates an AND policy
40
-
-`composite`: Sample based on a combination of above samplers, with ordering and rate allocation per sampler. Rate allocation allocates certain percentages of spans per policy order.
39
+
-`and`: Sample based on multiple policies, creates an AND policy
40
+
-`drop`: Drop (not sample) based on multiple policies, creates a DROP policy
41
+
-`composite`: Sample based on a combination of above samplers, with ordering and rate allocation per sampler. Rate allocation allocates certain percentages of spans per policy order.
41
42
For example if we have set max_total_spans_per_second as 100 then we can set rate_allocation as follows
42
43
1. test-composite-policy-1 = 50 % of max_total_spans_per_second = 50 spans_per_second
43
44
2. test-composite-policy-2 = 25 % of max_total_spans_per_second = 25 spans_per_second
@@ -53,7 +54,7 @@ The following configuration options can also be modified:
53
54
Additionally, if using, configure this as much greater than `num_traces` so decisions for trace IDs are kept
54
55
longer than the span data for the trace.
55
56
-`sampled_cache_size` (default = 0): Configures amount of trace IDs to be kept in an LRU cache,
56
-
persisting the "keep" decisions for traces that may have already been released from memory.
57
+
persisting the "keep" decisions for traces that may have already been released from memory.
57
58
By default, the size is 0 and the cache is inactive.
58
59
-`non_sampled_cache_size` (default = 0) Configures amount of trace IDs to be kept in an LRU cache,
59
60
persisting the "drop" decisions for traces that may have already been released from memory.
@@ -62,6 +63,7 @@ The following configuration options can also be modified:
62
63
63
64
Each policy will result in a decision, and the processor will evaluate them to make a final decision:
64
65
66
+
- When there's a "drop" decision, the trace is not sampled;
65
67
- When there's an "inverted not sample" decision, the trace is not sampled;
66
68
- When there's a "sample" decision, the trace is sampled;
67
69
- When there's a "inverted sample" decision and no "not sample" decisions, the trace is sampled;
@@ -442,7 +462,7 @@ The [probabilistic sampling processor][probabilistic_sampling_processor] and the
442
462
443
463
As a rule of thumb, if you want to add probabilistic sampling and...
444
464
445
-
...you are not using the tail sampling processor already: use the [probabilistic sampling processor][probabilistic_sampling_processor]. Running the probabilistic sampling processor is more efficient than the tail sampling processor. The probabilistic sampling policy makes decision based upon the trace ID, so waiting until more spans have arrived will not influence its decision.
465
+
...you are not using the tail sampling processor already: use the [probabilistic sampling processor][probabilistic_sampling_processor]. Running the probabilistic sampling processor is more efficient than the tail sampling processor. The probabilistic sampling policy makes decision based upon the trace ID, so waiting until more spans have arrived will not influence its decision.
446
466
447
467
...you are already using the tail sampling processor: add the probabilistic sampling policy. You are already incurring the cost of running the tail sampling processor, adding the probabilistic policy will be negligible. Additionally, using the policy within the tail sampling processor will ensure traces that are sampled by other policies will not be dropped.
448
468
@@ -457,7 +477,7 @@ As a rule of thumb, if you want to add probabilistic sampling and...
457
477
option allows, some will have to be dropped before they can be sampled. Increasing the value of `num_traces` can
458
478
help resolve this error, at the expense of increased memory usage.
459
479
460
-
## Monitoring and Tuning
480
+
## Monitoring and Tuning
461
481
462
482
See [documentation.md][documentation_md] for the full list metrics available for this component and their descriptions.
463
483
@@ -494,7 +514,7 @@ It's therefore recommended to consume this component's output with components th
494
514
A span's arrival is considered "late" if it arrives after its trace's sampling decision is made. Late spans can cause different sampling decisions for different parts of the trace.
495
515
496
516
There are two scenarios for late arriving spans:
497
-
- Scenario 1: While the sampling decision of the trace remains in the circular buffer of `num_traces` length, the late spans inherit that decision. That means late spans do not influence the trace's sampling decision.
517
+
- Scenario 1: While the sampling decision of the trace remains in the circular buffer of `num_traces` length, the late spans inherit that decision. That means late spans do not influence the trace's sampling decision.
498
518
- Scenario 2: (Default, no decision cache configured) After the sampling decision is removed from the buffer, it's as if this component has never seen the trace before: The late spans are buffered for `decision_wait` seconds and then a new sampling decision is made.
499
519
- Scenario 3: (Decision cache is configured) When a "keep" decision is made on a trace, the trace ID is cached. The component will remember which trace IDs it sampled even after it releases the span data from memory. Unless it has been evicted from the cache after some time, it will remember the same "keep trace" decision.
500
520
@@ -511,10 +531,10 @@ It may also be useful to:
511
531
512
532
**Sampled Frequency**
513
533
514
-
To track the percentage of traces that were actually sampled, use:
534
+
To track the percentage of traces that were actually sampled, use:
To see how often each policy votes to sample a trace, use:
524
544
525
545
```
526
-
sum (otelcol_processor_tail_sampling_count_traces_sampled{sampled="true"}) by (policy) /
527
-
sum (otelcol_processor_tail_sampling_count_traces_sampled) by (policy)
546
+
sum (otelcol_processor_tail_sampling_count_traces_sampled{sampled="true"}) by (policy) /
547
+
sum (otelcol_processor_tail_sampling_count_traces_sampled) by (policy)
528
548
```
529
549
530
550
As a reminder, a policy voting to sample the trace does not guarantee sampling; an "inverted not" decision from another policy would still discard the trace.
0 commit comments