Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create PR locally from fork for PR# 997 #1026

Merged
merged 6 commits into from
Dec 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Prometheus Rules",
"description": "Prometheus rules file",
"type": "object",
"$id": "https://json.schemastore.org/prometheus.rules.json",
"additionalProperties": false,
"properties": {
"groups": {
"type": "array",
"items": {
"$ref": "#/definitions/prometheus_rules_group"
}
}
},
"definitions": {
"duration": {
"type": "string",
"pattern": "^([0-9]+y)?([0-9]+w)?([0-9]+d)?([0-9]+h)?([0-9]+m)?([0-9]+s)?([0-9]+ms)?$",
"type": [
"string",
"null"
],
"pattern": "^((([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?|0)$",
"minLength": 1
},
"label_name": {
Expand All @@ -26,61 +19,33 @@
"type": "string"
},
"labels": {
"type": "object",
"description": "Labels.",
"type": [
"object",
"null"
],
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
"$ref": "#/definitions/label_value"
}
},
"additionalProperties": false
},
"template_string": {
"tmpl_string": {
"description": "A string which is template-expanded before usage.",
"type": "string"
},
"annotations": {
"type": "object",
"type": [
"object",
"null"
],
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_]*$": {
"$ref": "#/definitions/template_string"
"$ref": "#/definitions/tmpl_string"
}
},
"additionalProperties": false
},
"prometheus_rules_group": {
"type": "object",
"properties": {
"name": {
"description": "The name of the group. Must be unique within a file.",
"type": "string"
},
"interval": {
"description": "How often rules in the group are evaluated.",
"$ref": "#/definitions/duration"
},
"limit": {
"description": "Limit the number of alerts an alerting rule and series a recording rule can produce. 0 is no limit.",
"type": "integer",
"default": 0
},
"rules": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "#/definitions/recording_rule"
},
{
"$ref": "#/definitions/alerting_rule"
}
]
}
}
},
"required": ["name"],
"additionalProperties": false
},
"recording_rule": {
"type": "object",
"properties": {
Expand All @@ -90,14 +55,24 @@
},
"expr": {
"description": "The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and the result recorded as a new set of time series with the metric name as given by 'record'.",
"type": "string"
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"labels": {
"description": "Labels to add or overwrite before storing the result.",
"$ref": "#/definitions/labels"
"$ref": "#/definitions/labels",
"description": "Labels to add or overwrite before storing the result."
}
},
"required": ["record", "expr"],
"required": [
"record",
"expr"
],
"additionalProperties": false
},
"alerting_rule": {
Expand All @@ -109,23 +84,92 @@
},
"expr": {
"description": "The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts.",
"type": "string"
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"for": {
"description": "Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending.",
"$ref": "#/definitions/duration"
"$ref": "#/definitions/duration",
"description": "Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending."
},
"keep_firing_for": {
"$ref": "#/definitions/duration",
"description": "How long an alert will continue firing after the condition that triggered it has cleared."
},
"labels": {
"description": "Labels to add or overwrite for each alert.",
"$ref": "#/definitions/labels"
"$ref": "#/definitions/labels",
"description": "Labels to add or overwrite for each alert."
},
"annotations": {
"description": "Annotations to add to each alert.",
"$ref": "#/definitions/annotations"
"$ref": "#/definitions/annotations",
"description": "Annotations to add to each alert."
}
},
"required": ["alert", "expr"],
"required": [
"alert",
"expr"
],
"additionalProperties": false
}
}
},
"description": "Prometheus rules file",
"properties": {
"groups": {
"type": [
"array",
"null"
],
"items": {
"type": "object",
"properties": {
"name": {
"description": "The name of the group. Must be unique within a file.",
"type": "string"
},
"interval": {
"$ref": "#/definitions/duration",
"description": "How often rules in the group are evaluated."
},
"limit": {
"description": "Limit the number of alerts an alerting rule and series a recording rule can produce. 0 is no limit.",
"type": [
"integer",
"null"
],
"default": 0
},
"rules": {
"type": [
"array",
"null"
],
"items": {
"oneOf": [
{
"$ref": "#/definitions/recording_rule"
},
{
"$ref": "#/definitions/alerting_rule"
}
]
}
}
},
"required": [
"name"
],
"additionalProperties": false
}
}
},
"title": "Prometheus Rules",
"type": [
"object",
"null"
]
}
Loading