128 lines
4.5 KiB
YAML
128 lines
4.5 KiB
YAML
apiVersion: apiextensions.k8s.io/v1
|
|
kind: CustomResourceDefinition
|
|
metadata:
|
|
name: recordingrules.rules.alerting.grafana.app
|
|
spec:
|
|
group: rules.alerting.grafana.app
|
|
names:
|
|
kind: RecordingRule
|
|
plural: recordingrules
|
|
scope: Namespaced
|
|
versions:
|
|
- name: v0alpha1
|
|
schema:
|
|
openAPIV3Schema:
|
|
properties:
|
|
spec:
|
|
properties:
|
|
expressions:
|
|
additionalProperties:
|
|
properties:
|
|
datasourceUID:
|
|
type: string
|
|
model:
|
|
type: object
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
queryType:
|
|
description: The type of query if this is a query expression
|
|
type: string
|
|
relativeTimeRange:
|
|
properties:
|
|
from:
|
|
type: string
|
|
to:
|
|
type: string
|
|
required:
|
|
- from
|
|
- to
|
|
type: object
|
|
source:
|
|
description: |-
|
|
Used to mark the expression to be used as the final source for the rule evaluation
|
|
Only one expression in a rule can be marked as the source
|
|
For AlertRules, this is the expression that will be evaluated against the alerting condition
|
|
For RecordingRules, this is the expression that will be recorded
|
|
type: boolean
|
|
required:
|
|
- model
|
|
type: object
|
|
description: |-
|
|
TODO: validate that only one can specify source=true
|
|
& struct.MinFields(1) This doesn't work in Cue <v0.12.0 as per
|
|
type: object
|
|
labels:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
metric:
|
|
type: string
|
|
paused:
|
|
type: boolean
|
|
targetDatasourceUID:
|
|
type: string
|
|
title:
|
|
type: string
|
|
trigger:
|
|
properties:
|
|
interval:
|
|
type: string
|
|
required:
|
|
- interval
|
|
type: object
|
|
required:
|
|
- title
|
|
- trigger
|
|
- metric
|
|
- expressions
|
|
- targetDatasourceUID
|
|
type: object
|
|
status:
|
|
properties:
|
|
additionalFields:
|
|
description: additionalFields is reserved for future use
|
|
type: object
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
operatorStates:
|
|
additionalProperties:
|
|
properties:
|
|
descriptiveState:
|
|
description: descriptiveState is an optional more descriptive
|
|
state field which has no requirements on format
|
|
type: string
|
|
details:
|
|
description: details contains any extra information that is
|
|
operator-specific
|
|
type: object
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
lastEvaluation:
|
|
description: lastEvaluation is the ResourceVersion last evaluated
|
|
type: string
|
|
state:
|
|
description: |-
|
|
state describes the state of the lastEvaluation.
|
|
It is limited to three possible states for machine evaluation.
|
|
enum:
|
|
- success
|
|
- in_progress
|
|
- failed
|
|
type: string
|
|
required:
|
|
- lastEvaluation
|
|
- state
|
|
type: object
|
|
description: |-
|
|
operatorStates is a map of operator ID to operator state evaluations.
|
|
Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
|
type: object
|
|
type: object
|
|
required:
|
|
- spec
|
|
type: object
|
|
selectableFields:
|
|
- jsonPath: .spec.title
|
|
- jsonPath: .spec.paused
|
|
served: true
|
|
storage: true
|
|
subresources:
|
|
status: {}
|