Sampling Actions Introduction
This feature is in beta. It may be subject to changes and improvements based on user feedback.
Sampling Actions allow you to configure various types of sampling methods before exporting traces to your Odigos Destinations.
Actions Scope Categories
Odigos Sampling actions are divided into three main categories, each representing the action’s scope. The action scope defines the range that the sampler covers. The categories are:
- Global Actions: These actions sample all data without specificity. All traces flowing through Odigos will be sampled regardless of their source. For example, ErrorSampler.
- Service Actions: These sample actions are applied only to traces coming from a specified service.
- Endpoint Actions: These sample actions are applied to traces coming from a specific service and a specific endpoint. For example, LatencySampler.
Relation Between Actions
When multiple sampling actions are configured, the most specific rule applies. For example:
-
If two rules are configured: an Endpoint action for
Service: Frontend, Endpoint: /buy
with a latency threshold of 1 second and a fallback of 50%, and a Global ErrorSampler with a fallback of 20%:- Error traces will always be sampled due to the Global ErrorSampler, regardless of any Service or Endpoint rule.
- Traces from
Frontend /buy
below 1 second latency will fall under the Endpoint action’s fallback and retain 50% of these traces. - Traces from
Frontend /buy
above 1 second latency will always be retained. - Any other non-error traces that are not from
Frontend /buy
will be sampled at 20%.
Each rule ensures you get the specified sampling behavior for your conditions.
Actions
Odigos comes with a set of sampling actions that you can use out of the box:
- Probabilistic Sampler: Add a random sample of your data based on a specified probability.
- Error Sampler: Sample traces with status code ERROR.
- Latency Sampler: Sample based on the duration of a trace.