Distributed systems generate large volumes of duplicate or low-value traces. Trace sampling reduces storage and compute costs by retaining only the traces you are most likely to investigate, such as errors, slow requests, and critical paths.
ARMS supports four sampling modes. Each mode targets different traffic patterns and cost goals.
| Sampling mode | How it works | Best for |
|---|---|---|
| Fixed-rate sampling | Retains a set percentage of all traces | Predictable traffic with stable volume |
| Adaptive sampling | Dynamically adjusts sampling across interfaces using multiple strategies | Heavy or highly variable traffic (recommended) |
| Basic Edition sampling | Free tier plus custom policies by interface | Basic Edition users managing costs |
| Sampling for failed or slow requests | Captures error and latency outlier spans | Catching issues without full-rate sampling |
Fixed-rate sampling
Fixed-rate sampling retains a set percentage of traces based on TraceId. At a 10% rate, one out of every 10 traces is recorded. Each trace is either fully retained or fully discarded -- partial traces do not occur.
Configure fixed-rate sampling
Log on to the ARMS console. In the left-side navigation pane, choose Application Monitoring > Application List.
Select a region in the top navigation bar and click the application.
NoteIcons in the Language column indicate the programming language:
: Java
: Go
: Python- (Hyphen): an application monitored in Managed Service for OpenTelemetry
In the left-side navigation pane, click Application Settings. On the page that appears, click the Custom Configuration tab.
In the Sampling rate setting section, set Sample rate model to Fixed sampling rate. In the Sampling Rate Settings field, enter a percentage value. For example, enter
10for a 10% sampling rate.NoteChanges take effect immediately without an application restart. The default value is 10. A higher sampling rate consumes more system resources. Keep the default unless your workload requires a higher rate.
Adaptive sampling
Adaptive sampling dynamically decides whether to sample each trace by combining three strategies. This mode balances low costs with comprehensive monitoring. Use it when traffic is heavy or fluctuates significantly.
| Strategy | Description | Configurable |
|---|---|---|
| Full sampling for specific interfaces | Specify interface names, prefixes, or suffixes to retain 100% of their traces. Enable this only for critical interfaces, because it increases the volume of collected data. | Yes |
| Sampling for top N requests | Uses the Least Frequently Used (LFU) algorithm to sample a subset of entries per interface. Prevents data volume from growing linearly with traffic. | No |
| Minimum sampling for all interfaces | Samples at least one trace per interface within each time window. Preserves visibility for low-traffic interfaces. | No |
Configure adaptive sampling
Log on to the ARMS console. In the left-side navigation pane, choose Application Monitoring > Application List.
Select a region in the top navigation bar and click the application.
NoteIcons in the Language column indicate the programming language:
: Java
: Go
: Python- (Hyphen): an application monitored in Managed Service for OpenTelemetry
In the left-side navigation pane, click Application Settings. On the page that appears, click the Custom Configuration tab.
In the Sampling rate setting section, set Sample rate model to Adaptive sampling. Specify the interface names, prefixes, or suffixes for full sampling.
NoteChanges take effect immediately without an application restart. Adaptive sampling requires ARMS agent V2.8.3 or later.
Basic Edition sampling
Basic Edition sampling is available only to Application Monitoring Basic Edition users. It provides a free sampling policy and supports custom sampling policies.
| Policy type | Description |
|---|---|
| Free sampling policy | Collects one trace per minute for each agent across all interfaces in your account, at no cost. |
| Custom sampling policy | Samples traces based on a fixed proportion or a fixed traffic limit. Each policy can target all interfaces or a specific interface. |
Add a custom sampling policy
Log on to the ARMS console. In the left-side navigation pane, choose Application Monitoring > Application List.
Select a region in the top navigation bar and click the application.
NoteIcons in the Language column indicate the programming language:
: Java
: Go
: Python- (Hyphen): an application monitored in Managed Service for OpenTelemetry
In the left-side navigation pane, click Application Settings. On the page that appears, click the Custom Configuration tab.
In the Sampling rate setting section, click Add Client Sampling Policy. Configure the following parameters and click OK.
Parameter Description Sampling Policy Name A name for the sampling policy. Sampling type and Sampling value Fixed proportion sampling: Samples traces at a specified ratio. Enter a percentage in Sampling value, such as 10%. Flow limit: Collects a specified number of traces per agent within a time interval. For example,5traces per agent every1second.Applicable interface The scope of the policy. Select Each interface to apply to all interfaces, or Specify Interface to target a single interface by name. To target multiple interfaces, create a separate policy for each one.
Sampling for failed or slow requests
This mode captures spans when a request meets any of the following conditions:
| Condition | Description |
|---|---|
| Error responses | The HTTP interface returns a status code other than 2xx or 3xx, or a service exception is thrown to the framework and caught by LocalRootSpan. |
| Latency outliers | The request duration exceeds the 99th percentile (p99) of historical durations for the same interface. The p99 threshold may have deviations due to bucket aggregations. |
| Method exceptions | An exception is thrown by a method within the request. Supported only by ARMS agent V4.1.x. |
This mode does not guarantee complete trace integrity. When sampling is triggered, only spans within the current application are saved. Spans from upstream or downstream services in the same trace may not be captured.
Throttling
The ARMS agent limits trace collection to 100 traces per second by default to prevent monitoring from affecting application performance under heavy traffic. This limit applies to both fixed-rate sampling and adaptive sampling.
To adjust this limit, modify the Throttling Threshold parameter on the Custom Configuration tab.
A higher throttling threshold consumes more system resources. Keep the default unless your monitoring setup requires more traces per second.
What's next
After traces are sampled, use filter conditions and aggregation dimensions to analyze trace data in real time with the trace explorer.