Saltar al contenido principal

AlertPolicy

RecursoAlertPolicypor espacio de trabajo

AlertPolicy says when a tenant hears about its flows, and where.

At a glance​

PropiedadValor
apiVersionlumen.ai/v1alpha1
kindAlertPolicy
Resource namealertpolicies
ScopeNamespaced (lives in a workspace's namespace)

Spec​

Fields under spec:. Nested fields are indented under their parent.

CampoTipoValor por defectoDescripción
flowsobject-Flows selects by label; empty selects every flow in the namespace.
flows.matchExpressionslist of object-matchExpressions is a list of label selector requirements. The requirements are ANDed.
flows.matchExpressions[].keyobligatoriostring-key is the label key that the selector applies to.
flows.matchExpressions[].operatorobligatoriostring-operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
flows.matchExpressions[].valueslist of string-values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
flows.matchLabelsmap of string-matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
notifyobligatoriolist of object-minItems 1
notify[].connectorRefobject-LocalObjectReference names an object in the same namespace.
notify[].connectorRef.nameobligatoriostring-minLength 1
notify[].emailstring-
whenobligatorioobject-AlertCondition is a discriminated union on type.Regla: costOver is set exactly when type is CostOverRegla: anomaly is set exactly when type is Anomaly
when.anomalyobject-
when.anomaly.sensitivitystring"medium"Sensitivity is the z-score threshold.one of low, medium, high
when.costOverobject-
when.costOver.amountUSDobligatoriostring-USD is a non-negative decimal amount in US dollars, as a string because floats do not round-trip through the Kubernetes API.pattern `^[0-9]+(\.[0-9]{1,6})?$`
when.costOver.windowobligatoriostring-Window is a Prometheus duration, e.g. 1h, 1d.pattern `^[0-9]+(m|h|d)$`
when.typeobligatoriostring-one of RunFailed, CostOver, Anomaly

Status​

Written by Lumen; do not set it. Only the phase and the conditions are described here.

CampoTipoValor por defectoDescripción
conditionslist of object-
conditions[].lastTransitionTimeobligatoriostring-lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
conditions[].messageobligatoriostring-message is a human readable message indicating details about the transition. This may be an empty string.maxLength 32768
conditions[].observedGenerationinteger-observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.minimum 0
conditions[].reasonobligatoriostring-reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.minLength 1; maxLength 1024; pattern `^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$`
conditions[].statusobligatoriostring-status of the condition, one of True, False, Unknown.one of True, False, Unknown
conditions[].typeobligatoriostring-type of condition in CamelCase or in foo.example.com/CamelCase.maxLength 316; pattern `^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$`

kubectl columns​

ColumnTypeJSONPath
Whenstring.spec.when.type
Readystring.status.conditions[?(@.type=="Ready")].status
Agedate.metadata.creationTimestamp

Example​

alertpolicy.yaml
apiVersion: lumen.ai/v1alpha1
kind: AlertPolicy
metadata:
name: invoice-failures
namespace: tenant-acme
spec:
flows:
matchLabels: {lumen.ai/owner: git}
when:
type: RunFailed
notify:
- email: ops@acme.example