Skip to content

Commit 119d653

Browse files
authored
feat: get alerting schemas from foundation-sdk (#210)
* feat: get alerting schemas from foundation-sdk This also updates the generator code: - pin to a specific version of the foundation-sdk (in `generator/jsonnetfile.lock.json`) - use `jrsonnet` consistently (increase performance of generation process) * chore: run make -B generate * chore: remove unused patch
1 parent 144f6cb commit 119d653

40 files changed

+399
-1549
lines changed

docs/API/alerting/contactPoint.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ PARAMETERS:
2828
* **value** (`boolean`)
2929
- default value: `true`
3030

31-
31+
EmbeddedContactPoint is the contact point type that is used
32+
by grafanas embedded alertmanager implementation.
3233
### fn withName
3334

3435
```jsonnet
@@ -39,8 +40,8 @@ PARAMETERS:
3940

4041
* **value** (`string`)
4142

42-
Name is used as grouping key in the UI. Contact points with the
43-
same name will be grouped in the UI.
43+
EmbeddedContactPoint is the contact point type that is used
44+
by grafanas embedded alertmanager implementation.
4445
### fn withProvenance
4546

4647
```jsonnet
@@ -51,7 +52,8 @@ PARAMETERS:
5152

5253
* **value** (`string`)
5354

54-
55+
EmbeddedContactPoint is the contact point type that is used
56+
by grafanas embedded alertmanager implementation.
5557
### fn withSettings
5658

5759
```jsonnet
@@ -85,7 +87,8 @@ PARAMETERS:
8587
* **value** (`string`)
8688
- valid values: `"alertmanager"`, `" dingding"`, `" discord"`, `" email"`, `" googlechat"`, `" kafka"`, `" line"`, `" opsgenie"`, `" pagerduty"`, `" pushover"`, `" sensugo"`, `" slack"`, `" teams"`, `" telegram"`, `" threema"`, `" victorops"`, `" webhook"`, `" wecom"`
8789

88-
90+
EmbeddedContactPoint is the contact point type that is used
91+
by grafanas embedded alertmanager implementation.
8992
### fn withUid
9093

9194
```jsonnet
@@ -96,5 +99,5 @@ PARAMETERS:
9699

97100
* **value** (`string`)
98101

99-
UID is the unique identifier of the contact point. The UID can be
100-
set by the user.
102+
EmbeddedContactPoint is the contact point type that is used
103+
by grafanas embedded alertmanager implementation.

docs/API/alerting/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ grafonnet.alerting
55
## Subpackages
66

77
* [contactPoint](contactPoint.md)
8-
* [messageTemplate](messageTemplate.md)
98
* [muteTiming](muteTiming/index.md)
109
* [notificationPolicy](notificationPolicy/index.md)
10+
* [notificationTemplate](notificationTemplate.md)
1111
* [ruleGroup](ruleGroup/index.md)

docs/API/alerting/notificationPolicy/index.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ PARAMETERS:
3434

3535
* **value** (`string`)
3636

37-
37+
A Route is a node that contains definitions of how to handle alerts. This is modified
38+
from the upstream alertmanager in that it adds the ObjectMatchers property.
3839
### fn withContinue
3940

4041
```jsonnet
@@ -46,7 +47,8 @@ PARAMETERS:
4647
* **value** (`boolean`)
4748
- default value: `true`
4849

49-
50+
A Route is a node that contains definitions of how to handle alerts. This is modified
51+
from the upstream alertmanager in that it adds the ObjectMatchers property.
5052
### fn withGroupBy
5153

5254
```jsonnet
@@ -57,7 +59,8 @@ PARAMETERS:
5759

5860
* **value** (`array`)
5961

60-
62+
A Route is a node that contains definitions of how to handle alerts. This is modified
63+
from the upstream alertmanager in that it adds the ObjectMatchers property.
6164
### fn withGroupByMixin
6265

6366
```jsonnet
@@ -68,7 +71,8 @@ PARAMETERS:
6871

6972
* **value** (`array`)
7073

71-
74+
A Route is a node that contains definitions of how to handle alerts. This is modified
75+
from the upstream alertmanager in that it adds the ObjectMatchers property.
7276
### fn withGroupInterval
7377

7478
```jsonnet
@@ -79,7 +83,8 @@ PARAMETERS:
7983

8084
* **value** (`string`)
8185

82-
86+
A Route is a node that contains definitions of how to handle alerts. This is modified
87+
from the upstream alertmanager in that it adds the ObjectMatchers property.
8388
### fn withGroupWait
8489

8590
```jsonnet
@@ -90,7 +95,8 @@ PARAMETERS:
9095

9196
* **value** (`string`)
9297

93-
98+
A Route is a node that contains definitions of how to handle alerts. This is modified
99+
from the upstream alertmanager in that it adds the ObjectMatchers property.
94100
### fn withMatchers
95101

96102
```jsonnet
@@ -127,7 +133,8 @@ PARAMETERS:
127133

128134
* **value** (`array`)
129135

130-
136+
A Route is a node that contains definitions of how to handle alerts. This is modified
137+
from the upstream alertmanager in that it adds the ObjectMatchers property.
131138
### fn withMuteTimeIntervalsMixin
132139

133140
```jsonnet
@@ -138,7 +145,8 @@ PARAMETERS:
138145

139146
* **value** (`array`)
140147

141-
148+
A Route is a node that contains definitions of how to handle alerts. This is modified
149+
from the upstream alertmanager in that it adds the ObjectMatchers property.
142150
### fn withPolicy
143151

144152
```jsonnet
@@ -149,7 +157,8 @@ PARAMETERS:
149157

150158
* **value** (`array`)
151159

152-
160+
A Route is a node that contains definitions of how to handle alerts. This is modified
161+
from the upstream alertmanager in that it adds the ObjectMatchers property.
153162
### fn withPolicyMixin
154163

155164
```jsonnet
@@ -160,7 +169,8 @@ PARAMETERS:
160169

161170
* **value** (`array`)
162171

163-
172+
A Route is a node that contains definitions of how to handle alerts. This is modified
173+
from the upstream alertmanager in that it adds the ObjectMatchers property.
164174
### fn withRepeatInterval
165175

166176
```jsonnet
@@ -171,3 +181,5 @@ PARAMETERS:
171181

172182
* **value** (`string`)
173183

184+
A Route is a node that contains definitions of how to handle alerts. This is modified
185+
from the upstream alertmanager in that it adds the ObjectMatchers property.

docs/API/alerting/notificationPolicy/matcher.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PARAMETERS:
3232
* **value** (`string`)
3333
- valid values: `"="`, `"!="`, `"=~"`, `"!~"`
3434

35-
MatchType is an enum for label matching types.
35+
3636
### fn withValue
3737

3838
```jsonnet
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# messageTemplate
1+
# notificationTemplate
22

3-
grafonnet.alerting.messageTemplate
3+
grafonnet.alerting.notificationTemplate
44

55
## Index
66

77
* [`fn withName(value)`](#fn-withname)
8+
* [`fn withProvenance(value)`](#fn-withprovenance)
89
* [`fn withTemplate(value)`](#fn-withtemplate)
910

1011
## Fields
@@ -20,6 +21,17 @@ PARAMETERS:
2021
* **value** (`string`)
2122

2223

24+
### fn withProvenance
25+
26+
```jsonnet
27+
withProvenance(value)
28+
```
29+
30+
PARAMETERS:
31+
32+
* **value** (`string`)
33+
34+
2335
### fn withTemplate
2436

2537
```jsonnet

docs/API/alerting/ruleGroup/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ PARAMETERS:
3737

3838
* **value** (`integer`)
3939

40-
40+
Duration in seconds.
4141
### fn withName
4242

4343
```jsonnet

docs/API/alerting/ruleGroup/rule/data.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PARAMETERS:
2727

2828
* **value** (`string`)
2929

30-
Grafana data source unique identifier; it should be '__expr__' for a Server Side Expression operation.
30+
3131
### fn withModel
3232

3333
```jsonnet
@@ -38,7 +38,7 @@ PARAMETERS:
3838

3939
* **value** (`object`)
4040

41-
JSON is the raw JSON query and includes the above properties as well as custom properties.
41+
4242
### fn withModelMixin
4343

4444
```jsonnet
@@ -49,7 +49,7 @@ PARAMETERS:
4949

5050
* **value** (`object`)
5151

52-
JSON is the raw JSON query and includes the above properties as well as custom properties.
52+
5353
### fn withQueryType
5454

5555
```jsonnet
@@ -60,8 +60,7 @@ PARAMETERS:
6060

6161
* **value** (`string`)
6262

63-
QueryType is an optional identifier for the type of query.
64-
It can be used to distinguish different types of queries.
63+
6564
### fn withRefId
6665

6766
```jsonnet
@@ -72,7 +71,7 @@ PARAMETERS:
7271

7372
* **value** (`string`)
7473

75-
RefID is the unique identifier of the query, set by the frontend call.
74+
7675
### fn withRelativeTimeRange
7776

7877
```jsonnet
@@ -110,9 +109,7 @@ PARAMETERS:
110109

111110
* **value** (`integer`)
112111

113-
A Duration represents the elapsed time between two instants
114-
as an int64 nanosecond count. The representation limits the
115-
largest representable duration to approximately 290 years.
112+
Duration in seconds.
116113
#### fn relativeTimeRange.withTo
117114

118115
```jsonnet
@@ -123,6 +120,4 @@ PARAMETERS:
123120

124121
* **value** (`integer`)
125122

126-
A Duration represents the elapsed time between two instants
127-
as an int64 nanosecond count. The representation limits the
128-
largest representable duration to approximately 290 years.
123+
Duration in seconds.

docs/API/alerting/ruleGroup/rule/index.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,10 @@ withFor(value)
112112

113113
PARAMETERS:
114114

115-
* **value** (`integer`)
115+
* **value** (`string`)
116116

117-
A Duration represents the elapsed time between two instants
118-
as an int64 nanosecond count. The representation limits the
119-
largest representable duration to approximately 290 years.
117+
The amount of time, in seconds, for which the rule must be breached for the rule to be considered to be Firing.
118+
Before this time has elapsed, the rule is only considered to be Pending.
120119
### fn withIsPaused
121120

122121
```jsonnet

gen/grafonnet-v11.0.0/alerting.libsonnet

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen/grafonnet-v11.0.0/clean/alerting/contactPoint.libsonnet

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)