Service Mesh (ASM) lets you define service level objectives (SLOs) and alert rules declaratively through a ServiceLevelObjective custom resource definition (CRD).
The field reference below is organized by hierarchy: metadata > spec > slos[] > sli / alerting.
YAML example
The following manifest defines an availability SLO for the httpbin service in the default namespace. The objective is 99.9% and the SLO takes effect over a 30-day period, with both page-level and ticket-level alerts.
The following table summarizes the key fields. For complete field descriptions, see CRD field reference.
|
Field |
Description |
|
|
Namespace of the custom resource. Must match the namespace of the target service. |
|
|
Target service name. |
|
|
Period of time during which the SLO takes effect. Valid values: |
|
|
Target percentage as a string. Valid range: (0, 100]. |
|
|
Defines the SLI type and options. Set |
CRD field reference
metadata fields
|
Field |
Type |
Required |
Description |
Example |
|
|
String |
Yes |
Custom resource name. Format: |
|
|
|
String |
Yes |
Custom resource namespace. Must match the namespace of the target service. |
|
|
|
Object |
No |
Auto-populated by the backend. Do not set manually. The system adds two labels: |
|
spec fields
|
Field |
Type |
Required |
Description |
Example |
|
|
String |
Yes |
Target service name. |
|
|
|
String |
Yes |
Period of time during which the SLO takes effect. Valid values: |
|
|
|
Object |
No |
Global label. Propagated to the |
|
|
|
Array |
Yes |
One or more SLO definitions. At least one entry is required. |
- |
slos[] fields
Each entry in the slos array defines a single SLO with its objective, SLI configuration, and alerting rules.
|
Field |
Type |
Required |
Description |
Example |
|
|
String |
Yes |
SLO name. |
|
|
|
String |
Yes |
Target percentage as a string parsable to a floating-point number. Valid range: (0, 100]. |
|
|
|
Object |
No |
SLO-level label. Propagated to the |
|
|
|
Object |
Yes |
Service level indicator (SLI) configuration. See |
- |
|
|
Object |
Yes |
Alert rule configuration. See |
- |
sli fields
The sli object contains a single field: plugin.
|
Field |
Type |
Required |
Description |
Example |
|
|
Object |
Yes |
Plugin configuration that defines how the SLI is measured. See Plugin fields. |
- |
Plugin fields
The plugin determines the SLI measurement type. Set id to select the plugin, then configure the corresponding options.
|
Field |
Type |
Required |
Description |
Example |
|
|
String |
Yes |
Plugin type. Valid values: |
|
|
|
Map |
Conditional |
Plugin options. Required when the selected plugin has required fields. For example, |
|
Options for availability
When id is set to availability, the following options are available:
|
Field |
Type |
Required |
Description |
Example |
|
|
String |
No |
PromQL label filter. Prometheus calculates metrics only for requests that match this filter. |
|
Options for latency
When id is set to latency, the following options are available:
|
Field |
Type |
Required |
Description |
Example |
|
|
String |
Yes |
Latency objective, as a string parsable to an integer. |
|
|
|
String |
No |
PromQL label filter. Prometheus calculates metrics only for requests that match this filter. |
|
|
|
Boolean |
No |
Whether to exclude error requests from latency calculations. Default: |
|
alerting fields
|
Field |
Type |
Required |
Description |
Example |
|
|
String |
Yes |
Alert rule name. |
|
|
|
Map |
No |
Labels attached to the alert rule. |
|
|
|
Map |
No |
Annotations attached to the alert rule. |
|
|
|
Object |
No |
Page-level high-severity alert configuration. See |
- |
|
|
Object |
No |
Ticket-level low-severity alert configuration. See |
- |
pageAlert fields
|
Field |
Type |
Required |
Description |
Example |
|
|
Boolean |
No |
Whether to enable this alert. Default: |
|
|
|
Map |
No |
Labels attached to this alert. |
|
|
|
Map |
No |
Annotations attached to this alert. |
|
ticketAlert fields
|
Field |
Type |
Required |
Description |
Example |
|
|
Boolean |
No |
Whether to enable this alert. Default: |
|
|
|
Map |
No |
Labels attached to this alert. |
|
|
|
Map |
No |
Annotations attached to this alert. |
|