10 is dropped first, and a priority of 1 is dropped last.
Priorities are evaluated in match order, and the first priority to match is applied.
All other priorities are ignored. Use the default_priority field to set the
priority on requests that don’t match any defined priorities.
Threshold types
Budgets can include thresholds, which help manage both anomalous spikes in data and slow data growth over time, depending on the type. Although configuring thresholds is optional, Chronosphere strongly recommends setting thresholds to protect budgets and avoid overspending. Use different threshold types depending on the use case.Anomalous spikes in real time
To detect data spikes in real time and react accordingly, configure either an instant-rate threshold or a rolling threshold. These thresholds implement shorter time windows that are more responsive, but can result in more noise. Instant-rate thresholds limit the rate of incoming data in bytes per second, specified as fixed values. With an instant rate threshold, the configured action (such as sending an alert) triggers when consumption exceeds the configured rate threshold. For example, if a threshold is exceeded, Observability Platform can send an alert to notify the team who owns the budget for the offending partition. Alternatively, you can start dropping data when a threshold value is met so that the budget isn’t exceeded, which would otherwise impact your persisted data limit. Rolling thresholds help to detect and manage anomalous spikes in data over a short period, such as one to three hours.Slow growth over time
To help detect and manage gradual data growth over a longer period (which can be daily, weekly, or monthly), use fixed volume-based thresholds. These thresholds implement longer time windows that are less responsive, but are also less noisy than instant-rate or rolling thresholds. Fixed volume-based thresholds set a limit over a fixed, non-overlapping period, such as one day. The configured action (such as dropping data) triggers when consumption over the specified time period exceeds the configured threshold. For example, dropping data on a daily basis if a budget for a service exceeds a fixed value threshold of a configured number of bytes.Drop data with thresholds
When certain thresholds with a drop action are exceeded, Observability Platform drops data according to the length of the time window and the threshold type:- Fixed volume-based thresholds: Observability Platform drops data until the end of the time window. For example, a daily volume-based threshold that’s configured to drop data at 12:00 AM drops data until 11:59 PM.
- Rolling thresholds: Observability Platform drops data until the data in the affected budget naturally ages out of the rolling window, and your tenant consumption is under the configured threshold.
Budgeting order
If you attach multiple budgets to every level of your partition hierarchy, a single request must pass through multiple thresholds before being accepted. Budgets are evaluated in order, from the most-specific partition that you created, to the least-specific partition (the global partition). If a budget drops a request, then data isn’t counted in the received rates of any parent budgets. For example, consider the following partitions and budgets:- A partition for
global/team-ahas aninstant_ratethreshold of 2 MB per second. - A partition for
global/team-a/service-1has an instant rate threshold of 1 MB per second.
global/team-a/service-1 receives a huge data spike of 1 GB
per second, then 999 MB of that overage is dropped before it’s counted against
the budget for global/team-a. Therefore, the global/team-a partition receives
only 1 MB per second, and won’t be impacted by data drops.
This budget hierarchy ensures that drop data from the global/team-a/service-1
partition only, and not from global/team-a. The budget that’s configured on the
individual service ensures that the team budget isn’t impacted. This behavior allows
you to penalize bad actors and not impact the upstream partitions.
View budgets
Select from one of the following methods to view budgets for log partitions.- Chronoctl
- API
To use Chronoctl to return all budgets, use the
To filter for a specific budget, use the Replace
chronoctl consumption-budgets list command:chronoctl consumption-budgets read
command:SLUG with the slug of the budget you want to display.Create budgets
Log budgets require the following information:- Include the slug of the partition that the budget applies to.
- Specify an alert notification policy to use for routing alerts.
- Define thresholds and actions to take if a threshold is exceeded.
- Apply priorities for each of the query conditions that match.
Prerequisites
Before creating budgets, define log partitions. Use the slug or ID of your partition to assign budgets. Because budgets use Chronosphere alerts to send notifications when thresholds are exceeded, you need to define notification policies to reference in your budgets.Create partition budgets
Use one of the following methods to create budgets for partitions.- Chronoctl
- Terraform
- API
To use Chronoctl to create a budget, use the
chronoctl consumption-budgets create command:-
Run the following command to generate a sample budget configuration you can use as
a template:
In the template,
kind: ConsumptionBudgetdefines an individual budget. You can redirect the results (using the redirection operator>) to a file for editing. -
With a completed definition, submit it with:
Replace
FILE_NAMEwith the name of the YAML definition file you want to use.
Next steps
After creating budgets, use the Logging License Consumption dashboard to monitor and analyze consumption for the budget you added to your partition:- Review relative consumption trends: Use the Volume Thresholds and Instant Rate Thresholds panel groups to view consumption trends across different time periods to understand what’s driving data growth.
- Detect budgets approaching thresholds: Use the Consumed Per Second panel to view data matching the selected partition against either the maximum consumption rate set in your contract for the global partition, or a custom threshold for custom partitions.
- Observe drops from rate-limiting thresholds per partition: Use the Dropped Per Second panel to view the rate at which data was dropped by a threshold for the selected partition, broken down by priority (if configured).
- Debug the source of consumption: In the Explore panel group, click the Logs Explorer link to investigate source of consumption by various fields.
Chronoctl budget example
The following Terraform example adds a budget for the Ordering Service, which is included in the partition hierarchy diagram. See the Chronoctl example that implements a partition for this service. This budget is scoped to the parent partitionglobal/ordering-service, and defines
the following thresholds:
- An alert warning (
ALERT_WARN) with a threshold of 4,500 bytes per second. - A critical warning (
ALERT_CRITICAL) with a threshold of 5,000 bytes per second. - A drop action (
DROP) with a threshold of 5,000 bytes per second. - A drop action (
DROP) for daily volume, with a threshold of 90,9997 bytes.
priority controls which data gets dropped first when the DROP action
triggers. Higher priority values are dropped first, and lower priority values are
dropped last:
- The query
"env = 'dev'"has a priority of10, so it’s dropped first. - The query
"env = 'staging'"has a priority of5, so it’s dropped next. - The query
"env = 'prod'"has a priority of1, so it’s dropped last.
Terraform budget example
The following Terraform example adds a budget for the Ordering Service, which is included in the partition hierarchy diagram. See the Terraform example that implements a partition for this service. This budget is scoped to the parent partitionglobal/ordering-service, and defines
two thresholds:
- An alert warning (
ALERT_WARN) with a threshold of 4,500 bytes per second. - A critical warning (
ALERT_CRITICAL) with a threshold of 5,000 bytes per second. - A drop action (
DROP) with a threshold of 5,000 bytes per second. - A drop action (
DROP) for daily volume, with a threshold of 90,9997 bytes.
priority controls which data gets dropped first when the DROP action
triggers. Higher priority values are dropped first, and lower priority values are
dropped last:
- The query
"env = 'dev'"has a priority of10, so it’s dropped first. - The query
"env = 'staging'"has a priority of5, so it’s dropped next. - The query
"env = 'prod'"has a priority of1, so it’s dropped last.
Update budgets
Select from one of the following methods to update budgets for available log partitions.- Chronoctl
- Terraform
- API
To update budgets with Chronoctl, use the
consumption-budgets update command:Delete budgets
Select from one of the following methods to delete budgets for log partitions.Users can modify Terraform-managed resources only by using Terraform.
Learn more.
- Chronoctl
- Terraform
- API
To delete budgets with Chronoctl, use the
consumption-budgets delete command: