VMware Aria Operations for Applications (formerly known as Tanzu Observability by Wavefront) uses intelligent sampling to reduce the volume of ingested traces. The goal of intelligent sampling is to retain traces that are likely to be informative. But sometimes intelligent sampling discards traces that you want to keep. You can create a sampling policy to fine-tune intelligent sampling and indicate that you want to keep certain spans. Creating a sampling policy affects your costs as you store more data.
You can create a sampling policy, edit, delete, restore, deactivate, and see the version history of the policy you created:
Let’s look at how you can create a sampling policy and get familiar with the policy expressions.
Create a Sampling Policy
To create a sampling policy:
- Log in to your service instance.
- From the toolbar, select Applications > Sampling Policies.
- Click Create Policy and enter the details:
UI Element Description Policy Name The name of the policy. The policy name is unique, and you cannot create another policy with the same name. Description Add a description to explain what the policy does. It helps administrators understand why the policy is in place. Policy Expression Define a policy expression indicate which spans you want to keep. This expression needs to be in the YAML format. See Add a Policy Expression for details. Sampling percentage Define the percentage of spans you want to retain by entering a value between 0 and 100. For example, 80 indicates that you want to keep 80% of the spans that meet the policy expression. Status The policy is in effect when it is in the active state. Once the policy is active, it affects your costs as you store more data.
To see the number of spans stored per second after a sampling policy is created, see Track the Volume of Stored Trace Data. - Click Create Policy.
Now, you see the policy you created listed under sampling policies.
Add a Policy Expression
When you create a sampling policy, you need to define a policy expression that specifies the spans you want to keep. This expression needs to be in the YAML format.
Let’s look at a policy expression that asks the Operations for Applications service to store traces if the application name is beachshirts.
Attribute | Description |
---|---|
Key |
You can pass the following values and any span tag key as a key:
|
Value |
Define the values as follows:
|
Operation |
Policy expressions can contain operations that are cases sensitive, and operations that are not case sensitive:
Operations that are case sensitive: These operations match only if the case is the same. For example, {{application}} = "beachshirts" is equal to beachshirts but not beachShirts .
Note:
For example:
|
Advanced Example
The following policy expression creates a sampling policy to keep all spans from the beachshirts
application where the operation starts with Shopping
, the source contains prod
, and the status code is 400
or 404
.
{{application}} = "beachshirts" and {{spanName}} startsWith "Shopping." and {{sourceName}} contains "prod" and {{http.status_code}} in ("400", "404")
Edit a Sampling Policy
To edit a sampling policy:
-
Click the vertical ellipsis next to the policy name and click Edit.
-
Update the details, and click Update Policy.
Delete a Sampling Policy
To delete a sampling policy, click the vertical ellipsis next to the policy name and click Delete.
To see the policies you deleted, click View Deleted Policies.
Restore a Sampling Policy
To restore a deleted policy:
- Click View Deleted Policies.
- Click the vertical ellipsis next to the policy name and click Restore.
Deactivate or Activate Sampling Policy
Deactivate a Sampling Policy
To deactivate a sampling policy, Click the vertical ellipsis next to the policy name and click Deactivate.
When the policy is deactivated, it changes to an inactive state. By default, you don’t see inactive policies. Enable the Show Inactive toggle to see the deactivate policies in the sampling policies list.
Example:
Activate a Sampling Policy
To activate a sampling policy:
- Enable the Show Inactive toggle to see the deactivate policies.
- Click the vertical ellipsis next to the inactive policy name, and click Activate.
Learn More
To learn more about our trace data sampling strategies, see Trace Sampling.