Configure sampling on a stream
Send a share of a stream's events with Data Stream sampling, in Azion Console or with the Azion API, and check which streams stay active.
You can configure sampling on a Data Stream stream from Azion Console or with the Azion API. To limit a stream to the workloads you choose, which leaves the other streams active, refer to Associate workloads with a stream instead.
Sampling sends a percentage of the events a stream collects, picked at random. A lower rate reduces the volume, and the cost, of the data you collect and analyze. A stream with sampling covers every workload on the account, including workloads created later. For the bounds of each field, refer to Stream settings.
Prerequisites
Console
- A stream on your Azion account. To create one, refer to the Data Stream quickstart.
- The Edit Data Stream permission. For details, refer to Stream settings.
- Access to Azion Console. To sign in, refer to Access Azion Console.
- An account with fewer than 3,000 workloads. At 3,000 workloads or more, the Console blocks the stream forms, and you manage streams through the API only.
Set the sampling rate
The rate is a whole number from 1 to 100: the percentage of events the stream sends. A rate of 100 sends every event, and it still counts as sampling.
Console
To set the sampling rate in Azion Console:
Access Azion Console > Data Stream.
In the list, select the row of the stream. The create form, opened with + Stream, has the same Transform section.
In the Transform section, set Option to All Current and Future Workloads. The Sampling switch shows only with this option.
If Sampling is off, turn it on. Sampling Rate (%) appears.
In Sampling Rate (%), enter the percentage of events to send, for example 60.
The Attention dialog shows After activating and saving these settings, all other Data Streams will be disabled. Select Confirm.
The Console shows Your data stream has been updated.
Data Stream picks the sampled events at random. The Attention dialog also states Sampling percentage is statistical and not absolutely precise. When multiple Data Streams have different sampling rates, the system uses the lowest percentage.
A change of active stream takes effect after one to two minutes, and other edits take a few minutes to propagate. During that window, a stream that the save deactivated can keep sending.
Check which streams are active
After the save, the stream with sampling is the only active stream on the account. Wait two minutes, then check the status of each stream.
Console
To check the streams in Azion Console:
Access Azion Console > Data Stream.
The stream you saved reads Active. Every other stream reads Inactive.
Select the row of the stream. Sampling Rate (%) shows the stored rate.
Only the sampled stream is Active, at the rate you set.
To see what the stream sends, read its sends in Real-Time Events. Each send is recorded with the status code of the endpoint and the number of log lines it carried.