{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/chronosphere/main/json-schema/chronosphere-configv1-update-sloresponse-schema.json", "title": "configv1UpdateSLOResponse", "x-generated": "2026-10-03", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/chronosphere-slo-api-openapi.yml#/components/schemas/configv1UpdateSLOResponse", "properties": { "slo": { "$ref": "#/$defs/configv1SLO" } }, "type": "object", "$defs": { "ConditionOp": { "enum": [ "GEQ", "GT", "LEQ", "LT", "EQ", "NEQ", "EXISTS", "NOT_EXISTS", "SIGNAL_NOT_EXISTS" ], "type": "string" }, "DefinitionBurnRateDefinition": { "properties": { "budget": { "description": "The amount of allowed errors during a given time window, expressed as a\npercentage of the error budget. Must be a value between `0.0` and `100.0`,\nexclusive.", "format": "double", "type": "number" }, "labels": { "additionalProperties": { "type": "string" }, "description": "Labels to attach when this burn rate triggers. If you add these labels to\n`signal_groupings`, you can route them in the notification policy, and can\nroute different burn rates to other notifiers.", "type": "object" }, "severity": { "description": "Defines the alert severity level, which can only be one of `critical` or\n`warn`.", "type": "string" }, "window": { "description": "Time window for the burn rate calculation.", "type": "string" } }, "required": [ "window" ], "type": "object" }, "DefinitionTimeWindow": { "properties": { "duration": { "description": "Time window that defines the evaluation period as a string, in the format\nlike `\"28d\"` (28 days) or `\"24h\"` (24 hours).", "type": "string" } }, "type": "object" }, "MonitorSignalGrouping": { "description": "SignalGrouping defines how the set of series from the query are split into signals.", "properties": { "label_names": { "description": "Set of label names used to split series into signals. Each unique combination\nof labels result in its own signal. For example, if `label_names` is\n`[\"service\", \"code\"]`, then all series including labels\n`{service=\"foo\",code=\"404\"}` will be grouped together in the same signal.\n\nCannot be used if `graphite_query` is set.", "items": { "type": "string" }, "type": "array" }, "signal_per_series": { "description": "If set to `true`, each series will have its own signal. Cannot be used with\n`label_names`.", "type": "boolean" } }, "type": "object" }, "SLICustomIndicatorConfig": { "description": "Configuration for error ratio SLIs. You can include these variables in PromQL\nqueries for SLIs:\n- `{{.Window}}`: Specifies the window of time that the PromQL query operates on.\n- `{{.GroupBy}}`: Specifies a comma-separated list of signal and dimension\n labels to group the results by.\n- `{{.AdditionalFilters}}`: Requires setting `additional_promql_filters`.", "properties": { "bad_query_template": { "description": "A PromQL query that measures the number of \"bad\" events for this SLI.\nEither this or `good_query_template` must be set.", "type": "string" }, "good_query_template": { "description": "A PromQL query that measures the number of \"good\" events for this SLI.\nEither this or `bad_query_template` must be set.", "type": "string" }, "total_query_template": { "description": "A PromQL query that measures the total number of events for this SLI.\nThis is required for all error ratio SLOs.", "type": "string" } }, "required": [ "total_query_template" ], "type": "object" }, "SLICustomTimeSliceIndicatorConfig": { "description": "Defines the configuration for time slice SLIs. Time slice SLIs are evaluated by\nrunning a PromQL query over a certain time window and comparing the result against\na condition. You can include these variables in PromQL queries for SLIs:\n- `{{.Window}}`: Specifies the window of time that the PromQL query operates on.\n- `{{.GroupBy}}`: Specifies a comma-separated list of signal and dimension labels\n to group the results by.\n- `{{.TimeSlice}}`: The time slice being evaluated, such as `1m` or `5m`.\n- `{{.AdditionalFilters}}`: Requires setting `additional_promql_filters`.", "properties": { "condition": { "allOf": [ { "$ref": "#/$defs/SLITimeSliceCondition" } ], "description": "The condition to use for the SLI." }, "query_template": { "description": "A PromQL query template for the time slice SLI.", "type": "string" }, "timeslice_size": { "allOf": [ { "$ref": "#/$defs/SLITimeSliceSize" } ], "description": "The size of the time slice to use for the SLI." } }, "type": "object" }, "SLISLOType": { "description": "What the SLO measures. No query generation depends on it: the queries are\nstill authored through `custom_indicator` or `custom_timeslice_indicator`,\nand this only records the intent behind them.", "enum": [ "ENDPOINT_AVAILABILITY", "LATENCY" ], "type": "string" }, "SLITimeSliceCondition": { "description": "Defines the condition for evaluating time slice SLIs.", "properties": { "op": { "allOf": [ { "$ref": "#/$defs/ConditionOp" } ], "description": "The comparison operation to use." }, "value": { "description": "The value to compare against.", "format": "double", "type": "number" } }, "type": "object" }, "SLITimeSliceSize": { "description": "Defines the supported time slice sizes for time slice SLIs.", "enum": [ "TIMESLICE_SIZE_ONE_MINUTE", "TIMESLICE_SIZE_FIVE_MINUTES" ], "type": "string" }, "SLODefinition": { "properties": { "burn_rate_alerting_config": { "description": "Provides the burn rate alert configuration for the SLO. If not provided, the\ndefault burn rates are used. The configuration is only valid if the\n`enable_burn_rate_alerting` flag is set to `true`.", "items": { "$ref": "#/$defs/DefinitionBurnRateDefinition" }, "type": "array" }, "enable_burn_rate_alerting": { "description": "If `true`, enables burn rate alerting.", "type": "boolean" }, "objective": { "description": "The SLO target percentage, which represents the availability of the SLO.", "format": "double", "type": "number" }, "time_window": { "allOf": [ { "$ref": "#/$defs/DefinitionTimeWindow" } ], "description": "Specifies the duration over which the SLO is evaluated. The SLO is considered\nbreached if the error budget is depleted in this window. Default: `4w` (4\nweeks)." } }, "type": "object" }, "commonPromQLMatcher": { "properties": { "name": { "description": "Prometheus label name for the matcher", "type": "string" }, "type": { "allOf": [ { "$ref": "#/$defs/commonPromQLMatcherType" } ], "description": "The type of match to be performed" }, "value": { "description": "Prometheus label value for the matcher", "type": "string" } }, "type": "object" }, "commonPromQLMatcherType": { "enum": [ "MatchEqual", "MatchRegexp", "MatchNotEqual", "MatchNotRegexp" ], "type": "string" }, "configv1CollectionReference": { "properties": { "slug": { "type": "string" }, "type": { "$ref": "#/$defs/configv1CollectionReferenceType" } }, "type": "object" }, "configv1CollectionReferenceType": { "enum": [ "SIMPLE", "SERVICE" ], "title": "Type values must match entitiespb.Collection.CollectionType.", "type": "string" }, "configv1SLI": { "properties": { "additional_promql_filters": { "description": "Specifies additional PromQL filters, which are made available to the SLO queries.\nUse these filters to reduce the number of metrics used by the SLO.", "items": { "$ref": "#/$defs/commonPromQLMatcher" }, "type": "array" }, "custom_dimension_labels": { "description": "Configures additional labels to export from the underlying queries. This feature\nprovides a logical budget to group unique combinations of dimensions. For\nexample, if you want to track a budget per endpoint, add the endpoint label as a\ndimension. These dimensions are provided on the top-level SLI so that SLOs will\nreceive them in the `.GroupBy` variable.", "items": { "type": "string" }, "type": "array" }, "custom_indicator": { "allOf": [ { "$ref": "#/$defs/SLICustomIndicatorConfig" } ], "description": "Indicates an error ratio SLI, which measures a count of events matching some\ncondition against a total number of events. For example, measuring a ratio of\nsuccessful requests against the total number of requests. Use `custom_indicator`\nto track error ratio SLOs. You can set only one of `custom_indicator` or\n`custom_timeslice_indicator`." }, "custom_timeslice_indicator": { "allOf": [ { "$ref": "#/$defs/SLICustomTimeSliceIndicatorConfig" } ], "description": "Indicates a TimeSlice SLI, which measures a count of time slices that meet a\ndefined condition, compared against the total number of time slices in a\nspecific time period. Use `custom_timeslice_indicator` to track TimeSlice SLOs.\nYou can set only one of `custom_indicator` or `custom_timeslice_indicator`." }, "latency_threshold_nanos": { "description": "Optional. The latency that requests are measured against, in nanoseconds:\n50000000 is the \"50ms\" in \"P99 < 50ms\". Required when `slo_type` is\n`LATENCY`, rejected otherwise.", "format": "int64", "type": "string" }, "slo_type": { "allOf": [ { "$ref": "#/$defs/SLISLOType" } ], "description": "Optional. Unset means the type was never declared, and consumers render\nthe SLO the same way they did before this field existed." } }, "type": "object" }, "configv1SLO": { "properties": { "annotations": { "additionalProperties": { "type": "string" }, "description": "Annotations are visible in notifications generated by this SLO.\nYou can template annotations with labels from notifications.", "type": "object" }, "collection_ref": { "$ref": "#/$defs/configv1CollectionReference" }, "created_at": { "description": "Timestamp of when the SLO was created. Cannot be set by clients.", "format": "date-time", "readOnly": true, "type": "string" }, "definition": { "allOf": [ { "$ref": "#/$defs/SLODefinition" } ], "description": "Defines the core criteria the SLO measures." }, "description": { "type": "string" }, "labels": { "additionalProperties": { "type": "string" }, "description": "Labels are visible in notifications generated by this SLO,\nand can be used to route alerts with notification overrides.", "type": "object" }, "name": { "description": "The name of the SLO. You can modify this value after the SLO is created.", "type": "string" }, "notification_policy_slug": { "description": "Optional. Slug of the notification policy to use for the SLO. If you don't\nspecify a value, then the collection or service this SLO belongs to must have a\nnotification policy. Required if alerting is enabled for this SLO.", "type": "string" }, "signal_grouping": { "$ref": "#/$defs/MonitorSignalGrouping" }, "sli": { "$ref": "#/$defs/configv1SLI" }, "slug": { "description": "The unique identifier of the SLO. If a `slug` isn't provided, one is generated based on the `name` field. You can't modify this field after the SLO is created.", "type": "string" }, "updated_at": { "description": "Timestamp of when the SLO was last updated. Cannot be set by clients.", "format": "date-time", "readOnly": true, "type": "string" } }, "required": [ "name" ], "type": "object" } } }