Manage SLOs¶
You can manage all SLO tasks on the Monitor > SLO page. The list displays their key metrics in real time (such as achievement rate and error budget), and supports operations such as enabling, editing, viewing events, exporting to dashboard, and importing and exporting SLO configurations.
List Fields¶
Field |
Description |
|---|---|
| Monitor | For Monitor type, displays the number of associated monitors; for Metric type, displays "Metric". |
| Target | The expected achievement rate set when creating the SLO. Monitor type evaluates the uptime percentage; Metric type evaluates the percentage of successful counts. |
| Evaluation Window | The time covered by the results of the current row. Monitor type displays the last 7 days by default; Metric type displays the 7-day or 30-day period configured for that SLO. |
| Achievement Rate | For Monitor type, calculated as the uptime percentage; for Metric type, calculated as success count ÷ total count × 100%. Displays orange when minimum target ≤ achievement rate < target, and red when below the minimum target. |
| Downtime | For Monitor type, the abnormal duration within the current evaluation window, that is, the consumed budget; Metric type displays -. |
| Error Budget | The remaining tolerable failure time for Monitor type. For example, with a 7-day target of 95%, the initial budget is 7 days × 5% = 8.4 hours, minus the abnormal duration that has already occurred. Displays green when the remaining budget is ≥ 0, and red when it is less than 0; Metric type displays -. |
Operations¶
- Search: Filter by SLO name;
- Batch: Enable, disable, delete, or export multiple selected SLOs;
- Individual SLO: Enable, disable, edit, or delete. The name, SLI type, target, and minimum target are fixed after saving; the evaluation period, detection frequency, description, tags, and alert policy can be edited. Monitor type can also adjust the associated SLI and grouping dimensions, while Metric type can modify the total count and success count queries;
- Delete: Remove the SLO and its detection tasks. Before deletion, check the charts and Status Page services that use this SLO and adjust the relevant associations;
- View related events: View the events generated by the detection associated with this SLO;
- Export to dashboard: Sync the SLO view to a dashboard.
For Monitor type, the dashboard view follows the dashboard time range by default; for Metric type, it is displayed according to the SLO's configured period. When comparing results from different locations, check the evaluation window first.
For Metric type, after creating, modifying queries, modifying the evaluation period, or re-enabling, you need to wait for a new round of valid detection results. Disabling pauses detection and alerting and retains the most recent results for the corresponding configuration before disabling. When there are no valid results, you can verify the data and query criteria in Details.
Import and Export¶
Members with SLO configuration management permissions can migrate SLOs and their associated configurations between workspaces using ZIP resource packages.
Export¶
- Export all: Click the settings button in the upper-right corner of the list and select Export all;
- Export selected: Select one or more SLOs and click Export in the batch operations bar. SLOs selected across pages are retained within the current export scope.
After the export task completes, the system opens a result popup showing the number of exported SLOs and associated resources. Click Download export package to obtain the ZIP file.
Possible export results:
- Full export: The selected SLOs and their associated resources are all exported;
- Partial export: The popup shows the exported count and lists the unexported resources and affected SLOs by Insufficient permissions and Other reasons; the generated resource package can still be downloaded;
- Nothing to export: The popup shows "No SLOs to export", and the download button is unavailable.
The SLO resource package includes, according to the actual configuration, SLI monitors, child monitors of composite monitors, alert policies, notification targets, custom notification dates, associated tags, and necessary security detection rules.
The Metric-type resource package includes configurations such as SLI type, evaluation period, and total count and success count queries. After import, detection is re-run using the metric data of the target workspace, and historical statistical results remain in the source workspace. Before migration, confirm that the target workspace already has the measurements, fields, and tags required by the queries.
If a required associated resource of an SLO cannot be exported, the system skips that SLO to avoid generating a configuration with incomplete dependencies.
Import¶
- Click the settings button in the upper-right corner of the list and select Import;
- Select a ZIP resource package exported by the system;
- When resources with duplicate names are detected, select Skip duplicates or Overwrite, and then confirm the import;
- Wait for the import to complete; the system refreshes the current SLO list.
When overwriting an existing SLO, the name, SLI type, target, and minimum target still follow the modification restrictions after saving.
If the cross-workspace monitors in the resource package have not been authorized in the target workspace, the import result displays the relevant monitors and the target workspace. After authorization is completed, you can re-import.
Retrieve Monitor-type SLOs Using DQL Expressions¶
The following query is used for abnormal duration statistics of Monitor-type SLOs.
slo_cost represents the deducted minutes; adding the values together gives the abnormal time. Replace slo_id with the ID of the target SLO:
To query the 7-day SLO value, the DQL expression is as follows:
eval((10080-A)/10080 *100, A="M::`slo`:(sum(`slo_cost`)) { `slo_id` = 'monitor_6bad2a76dd9b41d7894f21a76d44ae42'}")
Go to Shortcut > Query Tool, select DQL query, set the time range to the last 7 days, and run it. 10080 is the number of minutes in 7 days; when querying other periods, adjust the time range and the total minutes in the formula accordingly. For grouped SLOs, add the corresponding dimension filter conditions.
In the query tool, make sure the time range in the upper-right corner matches the evaluation period in the formula. The SLO ID can be found in the related event details:
