Skip to content

Commit 24f85c8

Browse files
Add group all support for Prometheus Alertmanager (SchemaStore#5085)
* Add group all support for Prometheus Alertmanager * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 1cffa84 commit 24f85c8

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# yaml-language-server: $schema=../../schemas/json/prometheus-alertmanager.json
2+
3+
route:
4+
group_by: [..., cluster]
5+
routes:
6+
- matchers:
7+
- service=~"foo1|foo2|baz"
8+
group_by: [..., cluster]

src/schemas/json/prometheus-alertmanager.json

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,26 @@
241241
"type": "string"
242242
},
243243
"group_by": {
244-
"type": "array",
245-
"items": {
246-
"$ref": "#/definitions/labelname"
247-
},
248-
"description": "The labels by which incoming alerts are grouped together"
244+
"anyOf": [
245+
{
246+
"type": "array",
247+
"minItems": 1,
248+
"additionalItems": false,
249+
"description": "Group by all labels",
250+
"items": [
251+
{
252+
"enum": ["..."]
253+
}
254+
]
255+
},
256+
{
257+
"type": "array",
258+
"items": {
259+
"$ref": "#/definitions/labelname"
260+
},
261+
"description": "The labels by which incoming alerts are grouped together"
262+
}
263+
]
249264
},
250265
"continue": {
251266
"type": "boolean",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# yaml-language-server: $schema=../../schemas/json/prometheus-alertmanager.json
2+
3+
route:
4+
group_by: [...]
5+
routes:
6+
- matchers:
7+
- service=~"foo1|foo2|baz"
8+
group_by:
9+
- ...

0 commit comments

Comments
 (0)