Copy"jsonSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Default Healthrule Configuration Schema Definition",
"description": "Specification for a configuration of kind health rule template.",
"type": "object",
"required": [
"namespace",
"kind",
"name",
"displayName",
"waitTimeAfterViolation",
"evaluationObjects"
],
"properties": {
"namespace": {
"type": "object",
"required": [
"name",
"version"
],
"properties": {
"name": {
"type": "string",
"description": "Specifies the kind of the type being defined."
},
"version": {
"type": "integer",
"description": "A major version of the namespace."
}
},
"additionalProperties": false
},
"kind": {
"type": "string",
"description": "Specifies the kind of the configuration being defined.",
"const": "healthRuleTemplate"
},
"name": {
"type": "string",
"pattern": "^[a-z]+[a-z0-9_]{0,64}$",
"description": "A configuration name that is unique with this namespace."
},
"displayName": {
"type": "string",
"description": "Display name of the configuration.",
"minLength": 1,
"maxLength": 512
},
"description": {
"type": "string",
"description": "Description of the configuration.",
"minLength": 1,
"maxLength": 2048
},
"enabled": {
"type": "boolean",
"description": "Whether health rule is enabled for evaluation."
},
"scheduleName": {
"type": "string",
"description": "The name of schedule configuration for health rule. By default it is enabled always. `Always` is system defined schedule name to evaluation on regular granularity interval ",
"minLength": 1,
"examples": [
"Always",
]
},
"waitTimeAfterViolation": {
"type": "string",
"description": "The health rule wait time setting lets you control how often an event is generated while the conditions found to violate a health rule continue. The default and the only allowed unit is minutes(m). Specifying the unit is optional.",
"examples": [
"30m"
]
},
"evaluationObjects": {
"type": "object",
"description": "The evaluation objects for healthrule.",
"required": [
"topologyExpression"
],
"properties": {
"topologyExpression": {
"type": "string",
"description": "The evaluation expression for healthrule.",
"examples": [
"entities(k8s:pod)[attributes("k8s.pod.status")='Running']",
"entities(k8s:deployment).out.to(k8s:pod)"
]
},
"evaluationEntityType": {
"type": "string",
"description": "The evaluation entity type.",
"examples": [
"apm:service"
]
}
},
"additionalProperties": false
},
"warningCriteria": {
"$ref": "#/definitions/criteria"
},
"criticalCriteria": {
"$ref": "#/definitions/criteria"
},
"rollupHealthConfig": {
"$ref": "#/definitions/rollupConfig"
},
"expressionVersion": {
"description": "The version of the expression language used. Set this property to v2. Note that v1 is no longer supported.",
"enum": ["v1", "v2"]
},
"definitions": {
"criteria": {
"type": "object",
"description": "The criteria configuration for the health rule evaluation",
"required": [
"criteriaExpression",
"conditions"
],
"properties": {
"criteriaExpression": {
"type": "string",
"description": "Boolean expression on condition labels.",
"minLength": 1,
"examples": [
"A OR (B AND C)"
]
},
"conditions": {
"type": "array",
"description": "Array of conditions for health rule.",
"items": {
"type": "object",
"required": [
"name",
"label",
"conditionExpression"
],
"properties": {
"name": {
"type": "string",
"description": "The condition name.",
"minLength": 1,
"examples": [
"CPU usage of pods"
]
},
"label": {
"type": "string",
"description": "The label of condition. Used for combining condition names.",
"minLength": 1,
"examples": [
"A"
]
},
"conditionExpression": {
"type": "string",
"description": "The conditionExpression to be evaluated.",
"minLength": 1,
"examples": [
"metric:apm:cpu.cval(30m) > 80"
]
},
"evaluateToTrueOnNoData": {
"type": "boolean",
"description": "Whether the condition should evaluate to true if a required metric data is not available."
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"rollupConfig": {
"type": "object",
"required": [
"rollupTo",
"criteria"
],
"properties": {
"rollupTo": {
"type": "string",
"description": "The rollup entity based on evaluationExpression",
"examples": [
"apm:service"
]
},
"criteria": {
"type": "object",
"required": [
"threshold",
"thresholdType"
],
"properties": {
"threshold": {
"type": "string",
"description": "The health rollup to the parent object happens when the threshold condition(combination of threshold and threshold type) of participating child objects are met.",
"examples": [
"40",
"50"
]
},
"thresholdType": {
"type": "string",
"description": "The rollup threshold type used with threshold",
"enum": [
"COUNT",
"PERCENTAGE"
]
}
}
},
"rollupHealthConfig": {
"$ref": "#/definitions/rollupConfig"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}