The “Error Sampler” Odigos Action is a Global Action that supports error sampling by filtering out non-error traces.

Use Cases

Cost Reduction

  • Some vendors charge based on the amount of data ingested. For self hosted destinations, the cost is correlated to the use of cloud resources which grows with the based on the amount of data you process and store. By Reducing traces volumes, you can reduce the amount of data ingested and reduce costs.

System Optimization

  • Error traces are typically more informative for identifying and resolving issues. By focusing only on error traces, developers can quickly pinpoint and address problems, optimizing system performance and reducing the time and resources spent on debugging non-critical traces.

Basic Example

The following example demonstrates how to add an ErrorSampler that retains 100% of error traces and 50% of non-error traces.

Create a file named error-sampler.yaml with the following content:

apiVersion: actions.odigos.io/v1alpha1
kind: ErrorSampler
metadata:
  name: example-error-sampler
  namespace: odigos-system
spec:
  actionName: "configure-error-sampler"
  fallback_sampling_ratio: 50
  signals:
    - TRACES

Apply the action to the cluster:

kubectl apply -f error-sampler.yaml

Full Action Options

The full list of options available for the “ErrorSampler” action are:

  • fallback_sampling_ratio (required): Specifies the ratio of non-error traces you still want to retain. For instance, setting it to 50 ensures that 50% of the non-error traces will be retained.

  • signals (required): An array with the signals that the processor will act on (TRACES).

  • actionName (optional): Allows you to attach a meaningful name to the action for convenience. Odigos does not use or assume any meaning from this field.

  • notes (optional): A free-form text field that allows you to attach notes to the action for convenience. Odigos does not use or assume any meaning from this field.

  • disabled (optional): A boolean field that allows you to disable the action. When set to true, the action will not be executed. The default value is false.

Notes

  • Supports only traces.
  • All spans in a trace will be either entirely dropped or entirely sampled.
  • This action is a global action, meaning it applies to all traces in the system without filtering for specific services or endpoints.
  • Adding this action causes a 30-second delay in sending the data.
  • Traces with durations exceeding 30 seconds might not be sampled correctly.