Loading

Tail-based sampling

Elastic Stack

Note

supported deployment methods

Most options on this page are supported by all APM Server deployment methods when writing to Elasticsearch. If you are using a different output, tail-based sampling is not supported.

Tail-based sampling configuration options.

Example config file:

apm-server:
  host: "localhost:8200"
  rum:
    enabled: true

output:
  elasticsearch:
    hosts: ElasticsearchAddress:9200

max_procs: 4

Configure and customize Fleet-managed APM settings directly in Kibana:

  1. In Kibana, find Fleet in the main menu or use the global search field.
  2. Under the Agent policies tab, select the policy you would like to configure.
  3. Find the Elastic APM integration and select Actions > Edit integration.
  4. Look for these options under Tail-based sampling.

See Tail-based sampling to learn more.

Set to true to enable tail based sampling. Disabled by default. (bool)

APM Server binary sampling.tail.enabled
Fleet-managed Enable tail-based sampling

Synchronization interval for multiple APM Servers. Should be in the order of tens of seconds or low minutes. Default: 1m (1 minute). (duration)

APM Server binary sampling.tail.interval
Fleet-managed Interval

Criteria used to match a root transaction to a sample rate.

Policies map trace events to a sample rate. Each policy must specify a sample rate. Trace events are matched to policies in the order specified. All policy conditions must be true for a trace event to match. Each policy list should conclude with a policy that only specifies a sample rate. This final policy is used to catch remaining trace events that don’t match a stricter policy. ([]policy)

APM Server binary sampling.tail.policies
Fleet-managed Policies

The amount of storage space allocated for trace events matching tail sampling policies. Caution: Setting this limit higher than the allowed space may cause APM Server to become unhealthy.

A value of 0GB (or equivalent) does not set a concrete limit, but rather allows the APM Server to align its disk usage with the disk size. APM server uses up to 80% of the disk size limit on the disk where the local tail-based sampling database is located. The last 20% of disk will not be used by APM Server. It is the recommended value as it automatically scales with the disk size.

If this is not desired, a concrete GB value can be set for the maximum amount of disk used for tail-based sampling.

If the configured storage limit is insufficient, it logs "configured limit reached". The event will bypass sampling and will always be indexed when storage limit is reached.

Default: 0GB. (text)

APM Server binary sampling.tail.storage_limit
Fleet-managed Storage limit

See Tail-based sampling to learn more.

The sample rate to apply to trace events matching this policy. Required in each policy.

The sample rate must be greater than or equal to 0 and less than or equal to 1. For example, a sample_rate of 0.01 means that 1% of trace events matching the policy will be sampled. A sample_rate of 1 means that 100% of trace events matching the policy will be sampled. (int)

The trace name for events to match a policy. A match occurs when the configured trace.name matches the transaction.name of the root transaction of a trace. A root transaction is any transaction without a parent.id. (string)

The trace outcome for events to match a policy. A match occurs when the configured trace.outcome matches a trace’s event.outcome field. Trace outcome can be success, failure, or unknown. (string)

The service name for events to match a policy. (string)

The service environment for events to match a policy. (string)