365 lines
12 KiB
YAML
365 lines
12 KiB
YAML
apiVersion: apps.grafana.com/v1alpha2
|
|
kind: AppManifest
|
|
metadata:
|
|
name: alerting
|
|
spec:
|
|
appName: alerting
|
|
group: rules.alerting.grafana.app
|
|
versions:
|
|
- kinds:
|
|
- conversion: false
|
|
kind: AlertRule
|
|
plural: AlertRules
|
|
schemas:
|
|
AlertRule:
|
|
properties:
|
|
spec:
|
|
$ref: '#/components/schemas/spec'
|
|
status:
|
|
$ref: '#/components/schemas/status'
|
|
required:
|
|
- spec
|
|
DatasourceUID:
|
|
type: string
|
|
Expression:
|
|
additionalProperties: false
|
|
properties:
|
|
datasourceUID:
|
|
$ref: '#/components/schemas/DatasourceUID'
|
|
description: The UID of the datasource to run this expression against.
|
|
If omitted, the expression will be run against the `__expr__` datasource
|
|
model:
|
|
additionalProperties: {}
|
|
type: object
|
|
queryType:
|
|
description: The type of query if this is a query expression
|
|
type: string
|
|
relativeTimeRange:
|
|
$ref: '#/components/schemas/RelativeTimeRange'
|
|
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
|
|
ExpressionMap:
|
|
additionalProperties:
|
|
$ref: '#/components/schemas/Expression'
|
|
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
|
|
IntervalTrigger:
|
|
additionalProperties: false
|
|
properties:
|
|
interval:
|
|
$ref: '#/components/schemas/PromDuration'
|
|
required:
|
|
- interval
|
|
type: object
|
|
OperatorState:
|
|
additionalProperties: false
|
|
properties:
|
|
descriptiveState:
|
|
description: descriptiveState is an optional more descriptive state
|
|
field which has no requirements on format
|
|
type: string
|
|
details:
|
|
additionalProperties:
|
|
additionalProperties: {}
|
|
type: object
|
|
description: details contains any extra information that is operator-specific
|
|
type: object
|
|
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
|
|
PromDuration:
|
|
type: string
|
|
PromDurationWMillis:
|
|
type: string
|
|
RelativeTimeRange:
|
|
additionalProperties: false
|
|
properties:
|
|
from:
|
|
$ref: '#/components/schemas/PromDurationWMillis'
|
|
to:
|
|
$ref: '#/components/schemas/PromDurationWMillis'
|
|
required:
|
|
- from
|
|
- to
|
|
type: object
|
|
TemplateString:
|
|
type: string
|
|
TimeIntervalRef:
|
|
description: 'TODO(@moustafab): validate regex for time interval ref'
|
|
type: string
|
|
spec:
|
|
additionalProperties: false
|
|
properties:
|
|
annotations:
|
|
additionalProperties:
|
|
$ref: '#/components/schemas/TemplateString'
|
|
type: object
|
|
execErrState:
|
|
default: Error
|
|
type: string
|
|
expressions:
|
|
$ref: '#/components/schemas/ExpressionMap'
|
|
for:
|
|
type: string
|
|
keepFiringFor:
|
|
type: string
|
|
labels:
|
|
additionalProperties:
|
|
$ref: '#/components/schemas/TemplateString'
|
|
type: object
|
|
missingSeriesEvalsToResolve:
|
|
minimum: 0
|
|
type: integer
|
|
noDataState:
|
|
default: NoData
|
|
type: string
|
|
notificationSettings:
|
|
additionalProperties: false
|
|
properties:
|
|
activeTimeIntervals:
|
|
items:
|
|
$ref: '#/components/schemas/TimeIntervalRef'
|
|
type: array
|
|
groupBy:
|
|
items:
|
|
type: string
|
|
type: array
|
|
groupInterval:
|
|
$ref: '#/components/schemas/PromDuration'
|
|
groupWait:
|
|
$ref: '#/components/schemas/PromDuration'
|
|
muteTimeIntervals:
|
|
items:
|
|
$ref: '#/components/schemas/TimeIntervalRef'
|
|
type: array
|
|
receiver:
|
|
type: string
|
|
repeatInterval:
|
|
$ref: '#/components/schemas/PromDuration'
|
|
required:
|
|
- receiver
|
|
type: object
|
|
panelRef:
|
|
additionalProperties: false
|
|
properties:
|
|
dashboardUID:
|
|
minLength: 1
|
|
type: string
|
|
panelID:
|
|
exclusiveMinimum: true
|
|
minimum: 0
|
|
type: integer
|
|
required:
|
|
- dashboardUID
|
|
- panelID
|
|
type: object
|
|
paused:
|
|
type: boolean
|
|
title:
|
|
type: string
|
|
trigger:
|
|
$ref: '#/components/schemas/IntervalTrigger'
|
|
required:
|
|
- title
|
|
- trigger
|
|
- noDataState
|
|
- execErrState
|
|
- expressions
|
|
type: object
|
|
status:
|
|
additionalProperties: false
|
|
properties:
|
|
additionalFields:
|
|
additionalProperties:
|
|
additionalProperties: {}
|
|
type: object
|
|
description: additionalFields is reserved for future use
|
|
type: object
|
|
operatorStates:
|
|
additionalProperties:
|
|
$ref: '#/components/schemas/OperatorState'
|
|
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
|
|
scope: Namespaced
|
|
selectableFields:
|
|
- spec.title
|
|
- spec.paused
|
|
- spec.panelRef.dashboardUID
|
|
- spec.panelRef.panelID
|
|
- spec.notificationSettings.receiver
|
|
- conversion: false
|
|
kind: RecordingRule
|
|
plural: RecordingRules
|
|
schemas:
|
|
DatasourceUID:
|
|
type: string
|
|
Expression:
|
|
additionalProperties: false
|
|
properties:
|
|
datasourceUID:
|
|
$ref: '#/components/schemas/DatasourceUID'
|
|
description: The UID of the datasource to run this expression against.
|
|
If omitted, the expression will be run against the `__expr__` datasource
|
|
model:
|
|
additionalProperties: {}
|
|
type: object
|
|
queryType:
|
|
description: The type of query if this is a query expression
|
|
type: string
|
|
relativeTimeRange:
|
|
$ref: '#/components/schemas/RelativeTimeRange'
|
|
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
|
|
ExpressionMap:
|
|
additionalProperties:
|
|
$ref: '#/components/schemas/Expression'
|
|
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
|
|
IntervalTrigger:
|
|
additionalProperties: false
|
|
properties:
|
|
interval:
|
|
$ref: '#/components/schemas/PromDuration'
|
|
required:
|
|
- interval
|
|
type: object
|
|
OperatorState:
|
|
additionalProperties: false
|
|
properties:
|
|
descriptiveState:
|
|
description: descriptiveState is an optional more descriptive state
|
|
field which has no requirements on format
|
|
type: string
|
|
details:
|
|
additionalProperties:
|
|
additionalProperties: {}
|
|
type: object
|
|
description: details contains any extra information that is operator-specific
|
|
type: object
|
|
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
|
|
PromDuration:
|
|
type: string
|
|
PromDurationWMillis:
|
|
type: string
|
|
RecordingRule:
|
|
properties:
|
|
spec:
|
|
$ref: '#/components/schemas/spec'
|
|
status:
|
|
$ref: '#/components/schemas/status'
|
|
required:
|
|
- spec
|
|
RelativeTimeRange:
|
|
additionalProperties: false
|
|
properties:
|
|
from:
|
|
$ref: '#/components/schemas/PromDurationWMillis'
|
|
to:
|
|
$ref: '#/components/schemas/PromDurationWMillis'
|
|
required:
|
|
- from
|
|
- to
|
|
type: object
|
|
TemplateString:
|
|
type: string
|
|
spec:
|
|
additionalProperties: false
|
|
properties:
|
|
expressions:
|
|
$ref: '#/components/schemas/ExpressionMap'
|
|
labels:
|
|
additionalProperties:
|
|
$ref: '#/components/schemas/TemplateString'
|
|
type: object
|
|
metric:
|
|
type: string
|
|
paused:
|
|
type: boolean
|
|
targetDatasourceUID:
|
|
type: string
|
|
title:
|
|
type: string
|
|
trigger:
|
|
$ref: '#/components/schemas/IntervalTrigger'
|
|
required:
|
|
- title
|
|
- trigger
|
|
- metric
|
|
- expressions
|
|
- targetDatasourceUID
|
|
type: object
|
|
status:
|
|
additionalProperties: false
|
|
properties:
|
|
additionalFields:
|
|
additionalProperties:
|
|
additionalProperties: {}
|
|
type: object
|
|
description: additionalFields is reserved for future use
|
|
type: object
|
|
operatorStates:
|
|
additionalProperties:
|
|
$ref: '#/components/schemas/OperatorState'
|
|
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
|
|
scope: Namespaced
|
|
selectableFields:
|
|
- spec.title
|
|
- spec.paused
|
|
name: v0alpha1
|
|
served: true
|