Compare commits
916 Commits
release-11
...
leeoniya/n
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b24b24fd2 | ||
|
|
9240cf1930 | ||
|
|
64c93217ff | ||
|
|
97347a1f94 | ||
|
|
4f095bcd65 | ||
|
|
d5cbb9fdc4 | ||
|
|
39fe0b29ff | ||
|
|
c6f85579db | ||
|
|
19844c4ba8 | ||
|
|
54cc666aa0 | ||
|
|
8375fcd350 | ||
|
|
28ad9684e9 | ||
|
|
af31ae0593 | ||
|
|
0b84d8afe7 | ||
|
|
a983e8254c | ||
|
|
0e4bfefd37 | ||
|
|
b23fdd63a6 | ||
|
|
b820fc0111 | ||
|
|
09fa80a7cb | ||
|
|
6abe99efd6 | ||
|
|
c865958292 | ||
|
|
dd3bbbe317 | ||
|
|
ba3a0d897b | ||
|
|
6300591c6b | ||
|
|
093f99ad75 | ||
|
|
144c1b0c9d | ||
|
|
e886079d4c | ||
|
|
369d0a6aca | ||
|
|
4051df1f6c | ||
|
|
6a8755a8af | ||
|
|
c8aaefd54a | ||
|
|
192423956b | ||
|
|
324503ee8b | ||
|
|
c8a5be0bb3 | ||
|
|
c023b441f5 | ||
|
|
1d4b336f26 | ||
|
|
bd0ee50e7c | ||
|
|
64047be78c | ||
|
|
14d868a791 | ||
|
|
a8ab82c80f | ||
|
|
7a414a04a0 | ||
|
|
9233ad6462 | ||
|
|
98caf47b22 | ||
|
|
1911256fbb | ||
|
|
5115247818 | ||
|
|
c5320e2ae7 | ||
|
|
ad3fc95755 | ||
|
|
7038bbe318 | ||
|
|
bfecce320a | ||
|
|
9e408f842c | ||
|
|
30b9f3e22a | ||
|
|
7bfaf2a7bf | ||
|
|
16330e4113 | ||
|
|
19c04168c3 | ||
|
|
7ecdad5a2d | ||
|
|
20fa35f931 | ||
|
|
82fdd4f03f | ||
|
|
85caabf8e4 | ||
|
|
ed707098e1 | ||
|
|
0459a1eb80 | ||
|
|
d9b87ef987 | ||
|
|
1129647039 | ||
|
|
6db8aa2d40 | ||
|
|
092b2ef5d2 | ||
|
|
29ee90bc26 | ||
|
|
924b0d0863 | ||
|
|
3e9033c3bc | ||
|
|
94762d1e10 | ||
|
|
f0c57622f8 | ||
|
|
33b4c71cb2 | ||
|
|
f5bd4d078b | ||
|
|
483a6c7fe2 | ||
|
|
c28c8f920f | ||
|
|
8eff84661a | ||
|
|
aacce9e5f7 | ||
|
|
ba836dec63 | ||
|
|
275ee55e8f | ||
|
|
acf57aa556 | ||
|
|
f83f7332a1 | ||
|
|
750a0bed71 | ||
|
|
9f02acd4ca | ||
|
|
68db1c6e68 | ||
|
|
580d073b96 | ||
|
|
d4d9d56e9d | ||
|
|
01d2376782 | ||
|
|
e9956f2345 | ||
|
|
7f99e943a6 | ||
|
|
6414bcb6aa | ||
|
|
1fcc0a8454 | ||
|
|
29bcf7dbe9 | ||
|
|
e1533ff39b | ||
|
|
1c25d2ac2b | ||
|
|
7b3364cbc9 | ||
|
|
eaa6ba81cf | ||
|
|
9e1812dc3e | ||
|
|
1e001451bd | ||
|
|
108d611205 | ||
|
|
ec32f47db3 | ||
|
|
2e687a1090 | ||
|
|
3a6858cf26 | ||
|
|
6e7de36a67 | ||
|
|
ae95a6158f | ||
|
|
095be20f8e | ||
|
|
f3a3ce7691 | ||
|
|
f4e91da6b1 | ||
|
|
749f59b3e3 | ||
|
|
9df0f8a98d | ||
|
|
70b7453f78 | ||
|
|
06f2f62223 | ||
|
|
ed623f52db | ||
|
|
d07977d366 | ||
|
|
265342fbae | ||
|
|
69a38c634c | ||
|
|
b9beb14da0 | ||
|
|
c3494614e3 | ||
|
|
c3571752b6 | ||
|
|
7f675cd218 | ||
|
|
be7a1d8805 | ||
|
|
6fa06a1406 | ||
|
|
8a1bbe7517 | ||
|
|
7090fd5b34 | ||
|
|
db6422c8a3 | ||
|
|
7812cb83e9 | ||
|
|
35572c9731 | ||
|
|
44d206c272 | ||
|
|
2f58311eea | ||
|
|
fde9ddfc8c | ||
|
|
a2c998ba1d | ||
|
|
3b7c793c37 | ||
|
|
b14d58a890 | ||
|
|
cc9cdbe82d | ||
|
|
ab813cb601 | ||
|
|
8d74296b6c | ||
|
|
7eb4b974e0 | ||
|
|
d2aca99d38 | ||
|
|
4c0dde6f2f | ||
|
|
477326b9c3 | ||
|
|
754351273b | ||
|
|
4f24a91484 | ||
|
|
c8f3173f2c | ||
|
|
fa498e4836 | ||
|
|
de6a37e1c5 | ||
|
|
2799e5aa75 | ||
|
|
b1fb581ab1 | ||
|
|
27a0491f30 | ||
|
|
6bd1865749 | ||
|
|
e8241636b8 | ||
|
|
3a242d8274 | ||
|
|
1dcce86cce | ||
|
|
b9f8e66806 | ||
|
|
cbe8b8a290 | ||
|
|
ca04cf780b | ||
|
|
9f66843915 | ||
|
|
19bed65d9b | ||
|
|
436f8db3e3 | ||
|
|
a459f648b5 | ||
|
|
e5519161f2 | ||
|
|
c7b6822a5e | ||
|
|
8148f0c3bb | ||
|
|
5bce96e8e7 | ||
|
|
3012d4c043 | ||
|
|
c7aef6a375 | ||
|
|
4f433ada14 | ||
|
|
7112a79b35 | ||
|
|
154a2e0d06 | ||
|
|
a1de4cc5fc | ||
|
|
ee7f521c08 | ||
|
|
c04236b60d | ||
|
|
787f3b8d6c | ||
|
|
e22deeac04 | ||
|
|
c0de407fee | ||
|
|
b1c5aa0929 | ||
|
|
b4644580cf | ||
|
|
66f0d97aad | ||
|
|
8d3faabc90 | ||
|
|
f93fd77c9c | ||
|
|
3f81f0d145 | ||
|
|
5a143be653 | ||
|
|
2458329f4f | ||
|
|
4a362d41a6 | ||
|
|
95692b3d68 | ||
|
|
7bb1b352e1 | ||
|
|
d92e17ee55 | ||
|
|
acf119a12c | ||
|
|
40637a221e | ||
|
|
b5e636b126 | ||
|
|
9525891455 | ||
|
|
ea0a6a1f7f | ||
|
|
b953190328 | ||
|
|
bd53fa9580 | ||
|
|
c972ec9737 | ||
|
|
d9dfa3ece3 | ||
|
|
3dfbae7331 | ||
|
|
910ec7e7dc | ||
|
|
86bc087257 | ||
|
|
e86283e8b1 | ||
|
|
741aa91e6f | ||
|
|
f0a5b444e3 | ||
|
|
9b0644e5c8 | ||
|
|
0b06dca472 | ||
|
|
4e318e6285 | ||
|
|
a5bef386ad | ||
|
|
00c3c17035 | ||
|
|
d023cb5931 | ||
|
|
1fdc48faba | ||
|
|
f2998037e5 | ||
|
|
ac88461fe6 | ||
|
|
d5cde0b60a | ||
|
|
6638dd9a83 | ||
|
|
4cc204affe | ||
|
|
4d0a7637b2 | ||
|
|
21ba507bcb | ||
|
|
ff2f612412 | ||
|
|
8c41137bcf | ||
|
|
8956400498 | ||
|
|
6bfb24c7b0 | ||
|
|
a45deafc96 | ||
|
|
b9b5445090 | ||
|
|
b2af163dc5 | ||
|
|
05dda7f0a1 | ||
|
|
3d51ca7377 | ||
|
|
7fa4a979e3 | ||
|
|
1e58747a39 | ||
|
|
a415c0b831 | ||
|
|
6c9afba607 | ||
|
|
b87c76ad21 | ||
|
|
5722569676 | ||
|
|
e55100fa90 | ||
|
|
bee29c14c6 | ||
|
|
df8b6e6862 | ||
|
|
c151021b16 | ||
|
|
8ffc25784c | ||
|
|
df4a5aeaf1 | ||
|
|
cd3a71e7cb | ||
|
|
3dbeacfebc | ||
|
|
b6596db75e | ||
|
|
3877537dc0 | ||
|
|
4ce1abc6f9 | ||
|
|
70c21a2e4d | ||
|
|
fbbb4463f8 | ||
|
|
af513964c8 | ||
|
|
f41f0eac80 | ||
|
|
c565e9869e | ||
|
|
b85b18288a | ||
|
|
0629a34ae4 | ||
|
|
aaa4f4a23e | ||
|
|
26b0e8f105 | ||
|
|
a279220d74 | ||
|
|
06bdfe8e96 | ||
|
|
290612e366 | ||
|
|
52f4bd64e0 | ||
|
|
8d765cfba1 | ||
|
|
9d4a087d77 | ||
|
|
d225e0a95c | ||
|
|
70223b2e3d | ||
|
|
a80517d6fe | ||
|
|
3311df6e3d | ||
|
|
86ef3c916d | ||
|
|
f15f6022de | ||
|
|
3c1a5ab439 | ||
|
|
f8ae71e458 | ||
|
|
0007ede9de | ||
|
|
2bfdee73e3 | ||
|
|
228bf711f9 | ||
|
|
058b28aaad | ||
|
|
70e05c6a3a | ||
|
|
ab974ddf14 | ||
|
|
7f560c13e4 | ||
|
|
ed52515ae3 | ||
|
|
280c27507c | ||
|
|
c125ead121 | ||
|
|
9a1e7de79d | ||
|
|
1feaf6df99 | ||
|
|
cd9fcd08aa | ||
|
|
6d8ee5fde0 | ||
|
|
78c5fe61df | ||
|
|
ef4640abfb | ||
|
|
da1a5426d0 | ||
|
|
a8578484bb | ||
|
|
04d71068d1 | ||
|
|
a3d3af35da | ||
|
|
82ac9e2bb6 | ||
|
|
c7a7f7dce5 | ||
|
|
6fd3620d50 | ||
|
|
bfa1f03315 | ||
|
|
c05bfdf71f | ||
|
|
ef29ce5b85 | ||
|
|
af6ddad058 | ||
|
|
3c8d29fa46 | ||
|
|
91088d1f56 | ||
|
|
34991f5b44 | ||
|
|
e6353dcd68 | ||
|
|
0fae3579e8 | ||
|
|
34269a03c0 | ||
|
|
f075662696 | ||
|
|
7e34c015ee | ||
|
|
facca37f4d | ||
|
|
2b370d6e27 | ||
|
|
bcdcb1f74b | ||
|
|
297ccfc52c | ||
|
|
2485286c03 | ||
|
|
a43ba7bd44 | ||
|
|
517a1bef08 | ||
|
|
4452d0932a | ||
|
|
305123df91 | ||
|
|
ede0b7e9ed | ||
|
|
68aefc73b6 | ||
|
|
ddf766567b | ||
|
|
85c696c4ad | ||
|
|
aacc83be5c | ||
|
|
b4012b6ac8 | ||
|
|
bd8da0cf25 | ||
|
|
2c57ecc085 | ||
|
|
e43bec2cd8 | ||
|
|
0802ebcd1a | ||
|
|
afcd620d21 | ||
|
|
9d937725ad | ||
|
|
c490b29d34 | ||
|
|
7fd4f220b8 | ||
|
|
fe6ec1258f | ||
|
|
986c024dd7 | ||
|
|
3bcbf231ee | ||
|
|
8a0c920106 | ||
|
|
d3a3e53354 | ||
|
|
003b2f14db | ||
|
|
c5178807be | ||
|
|
d0ba4f18d3 | ||
|
|
403b60723d | ||
|
|
620fb87fb8 | ||
|
|
3deffe58f6 | ||
|
|
eb781dd46d | ||
|
|
5f4944117c | ||
|
|
0eb7b755e2 | ||
|
|
c548a2357b | ||
|
|
30b1e3b289 | ||
|
|
2ba1740698 | ||
|
|
9c16622160 | ||
|
|
c29ed503db | ||
|
|
f3bdf4455c | ||
|
|
85ee91aa77 | ||
|
|
3adc7c8771 | ||
|
|
6f74c19d75 | ||
|
|
f8a5813573 | ||
|
|
f539a70d6d | ||
|
|
9f5258717e | ||
|
|
ada6249280 | ||
|
|
9f43724b57 | ||
|
|
76b43267c8 | ||
|
|
b42c34070a | ||
|
|
d77fc50198 | ||
|
|
6c45f7f556 | ||
|
|
8f2893edd3 | ||
|
|
35697381d2 | ||
|
|
0261e8fe80 | ||
|
|
dfa8f786d2 | ||
|
|
4e1f0dadbd | ||
|
|
a93de5f0d8 | ||
|
|
2bcc46c338 | ||
|
|
7619d9cb11 | ||
|
|
b1157dbd7a | ||
|
|
841a87c978 | ||
|
|
f7e9aeac6e | ||
|
|
bf6056f2fa | ||
|
|
e40b19c7a6 | ||
|
|
69bda0b803 | ||
|
|
d2d7ae2e86 | ||
|
|
2b0a439ad3 | ||
|
|
3c8bfb539d | ||
|
|
a2755117ac | ||
|
|
55bcbcef83 | ||
|
|
acebe9bee5 | ||
|
|
db5f893ea6 | ||
|
|
08e880a823 | ||
|
|
fe4f44723d | ||
|
|
048ba14c34 | ||
|
|
777979965d | ||
|
|
90d2f4659e | ||
|
|
f0391e31d2 | ||
|
|
0bd0dc374a | ||
|
|
3034bcaa72 | ||
|
|
1f70aa8f80 | ||
|
|
092a1813ef | ||
|
|
87c2bc44b2 | ||
|
|
9b773b8501 | ||
|
|
6fcfd132e5 | ||
|
|
c5bad9f843 | ||
|
|
5673fafbfb | ||
|
|
a20c9db6b7 | ||
|
|
50a6069532 | ||
|
|
af1a732821 | ||
|
|
a115d5db03 | ||
|
|
7fa0ae48c5 | ||
|
|
995128d1db | ||
|
|
189802d3c3 | ||
|
|
d480900a9b | ||
|
|
952957248f | ||
|
|
261b4a5564 | ||
|
|
6be787dd47 | ||
|
|
03715f062b | ||
|
|
55afbdc6be | ||
|
|
3e1046ee2e | ||
|
|
61929b785a | ||
|
|
0ef08ca737 | ||
|
|
fe74dfcb77 | ||
|
|
985b390a46 | ||
|
|
f062c66f89 | ||
|
|
1d8f8178ee | ||
|
|
2b867d9850 | ||
|
|
fb51a5e21f | ||
|
|
eae83609b8 | ||
|
|
97027834a1 | ||
|
|
9b91be739d | ||
|
|
2f40fd6741 | ||
|
|
c8238c7914 | ||
|
|
4508d6c143 | ||
|
|
9f2da249fd | ||
|
|
097fa053e4 | ||
|
|
337f2a0a8b | ||
|
|
c9abe04d46 | ||
|
|
5717cb5055 | ||
|
|
bac7fb6c32 | ||
|
|
39d0db05f3 | ||
|
|
32c43f3f06 | ||
|
|
b2b169c666 | ||
|
|
d6efd6d606 | ||
|
|
d68b5d222a | ||
|
|
8f0c8778b4 | ||
|
|
abee323789 | ||
|
|
5533b30135 | ||
|
|
e0163c93c2 | ||
|
|
7b5c84f366 | ||
|
|
865be67dd1 | ||
|
|
ba2d004161 | ||
|
|
6f888720de | ||
|
|
209dbcf894 | ||
|
|
c7cdaedd6f | ||
|
|
55673e2f41 | ||
|
|
f6a5e03bfb | ||
|
|
47b8379194 | ||
|
|
c9984cbb7a | ||
|
|
5a0ef46280 | ||
|
|
fedcf47702 | ||
|
|
4a13580a2f | ||
|
|
69f185b459 | ||
|
|
187111368a | ||
|
|
712974b26c | ||
|
|
5cf86c981f | ||
|
|
4a4ad66210 | ||
|
|
ed1ad34f9b | ||
|
|
39d53e65a7 | ||
|
|
16b9cf07f4 | ||
|
|
0880329796 | ||
|
|
fd99b82f78 | ||
|
|
b0e116c5fa | ||
|
|
b2de69d741 | ||
|
|
6f4a9eb07b | ||
|
|
4e6a7121ed | ||
|
|
cc1976693b | ||
|
|
94bbc081c8 | ||
|
|
2788817107 | ||
|
|
97c0ff2ae4 | ||
|
|
bdab0bc8c0 | ||
|
|
fd4fc106d9 | ||
|
|
bdbe12e980 | ||
|
|
e894b19c1a | ||
|
|
d0e124e2f9 | ||
|
|
d1a00540dd | ||
|
|
69f888e296 | ||
|
|
b1e1297bb3 | ||
|
|
226dcdde0f | ||
|
|
5ee5c7af7b | ||
|
|
beaac3c885 | ||
|
|
f5ed2f52f7 | ||
|
|
67b3848fd9 | ||
|
|
5e3e7cca0e | ||
|
|
ecebaf1bdf | ||
|
|
2deced7d40 | ||
|
|
fb0221d561 | ||
|
|
0d272a3b9c | ||
|
|
2f965a07ab | ||
|
|
59f5c1edfb | ||
|
|
b8b7c7901c | ||
|
|
257aca5340 | ||
|
|
f379329127 | ||
|
|
0c73403e00 | ||
|
|
967b9ed22c | ||
|
|
0b842eb48e | ||
|
|
f5bd197cdb | ||
|
|
5fb1c7f512 | ||
|
|
06e826d3af | ||
|
|
d0d0d86880 | ||
|
|
152b83b3fb | ||
|
|
77b8b505ad | ||
|
|
2a65de8aaa | ||
|
|
ef253c99d8 | ||
|
|
9ec48075ee | ||
|
|
c42f42223a | ||
|
|
f671ad51fe | ||
|
|
5cb4be8c9b | ||
|
|
762c7dc3a5 | ||
|
|
9ae3d049a3 | ||
|
|
a2868fdb14 | ||
|
|
26fab52086 | ||
|
|
37f82dab49 | ||
|
|
4a9ba41f81 | ||
|
|
142797032b | ||
|
|
5c9071a6c6 | ||
|
|
b0250cf027 | ||
|
|
3523289e98 | ||
|
|
5fc07abef1 | ||
|
|
58f180d58b | ||
|
|
5a9de531d2 | ||
|
|
7fe710b141 | ||
|
|
2d27703955 | ||
|
|
830600dab0 | ||
|
|
f7fcc14f69 | ||
|
|
2ffb88b0ee | ||
|
|
d89235aa8c | ||
|
|
66c728d26b | ||
|
|
c84b6b783c | ||
|
|
aa0dc36143 | ||
|
|
a0ae08d774 | ||
|
|
8780fc554f | ||
|
|
23aca476c9 | ||
|
|
7359e0bcba | ||
|
|
b23b6d228a | ||
|
|
3f47621065 | ||
|
|
78a00d09cd | ||
|
|
0872eb2791 | ||
|
|
15de8a5433 | ||
|
|
77cb47773f | ||
|
|
61b9ffd324 | ||
|
|
008c51b5b1 | ||
|
|
022297f359 | ||
|
|
f6354339ef | ||
|
|
3b37e20df6 | ||
|
|
b68b69c2b4 | ||
|
|
9ab064bfc5 | ||
|
|
b1a1e7ce61 | ||
|
|
b512e7be0a | ||
|
|
8bb7475e4f | ||
|
|
2573cbec08 | ||
|
|
a5ae8959e3 | ||
|
|
2cf6a6388b | ||
|
|
813632dff1 | ||
|
|
3103776892 | ||
|
|
01b75828ba | ||
|
|
567a3803c5 | ||
|
|
5f8af8860f | ||
|
|
2a5afd0d1a | ||
|
|
32d224223e | ||
|
|
b700de8122 | ||
|
|
1dbbbd9ca7 | ||
|
|
6f7528f896 | ||
|
|
5e924f3a27 | ||
|
|
e33573d786 | ||
|
|
a03652494c | ||
|
|
1696ac8ea5 | ||
|
|
3a719a2cfd | ||
|
|
d9bc4f7395 | ||
|
|
b189743ca0 | ||
|
|
8072286daf | ||
|
|
26162a53e6 | ||
|
|
4e725f2f74 | ||
|
|
60915e7fe6 | ||
|
|
75a28bc367 | ||
|
|
9763199b53 | ||
|
|
12cc312920 | ||
|
|
7aeb1adff2 | ||
|
|
6e802e6809 | ||
|
|
9a7ec04f90 | ||
|
|
d325184287 | ||
|
|
9fb956f57f | ||
|
|
77bf3f5bab | ||
|
|
25abd57029 | ||
|
|
8f0ccf3362 | ||
|
|
b2e53997e2 | ||
|
|
3ec178ae44 | ||
|
|
06a0890c2e | ||
|
|
15340a27ef | ||
|
|
4aad44e848 | ||
|
|
25e85f8947 | ||
|
|
112763594a | ||
|
|
63b5e65eb3 | ||
|
|
e709de603d | ||
|
|
986bd2f9f8 | ||
|
|
b1d846d7e8 | ||
|
|
0e0e11cdd1 | ||
|
|
3f5483b79f | ||
|
|
0704ae734f | ||
|
|
229658ad83 | ||
|
|
4308edb593 | ||
|
|
3bf3290340 | ||
|
|
5a4b051a91 | ||
|
|
71d04a326b | ||
|
|
d722a25084 | ||
|
|
5b1d99b8c4 | ||
|
|
94f5e21493 | ||
|
|
059c5a4d02 | ||
|
|
3270a9c959 | ||
|
|
200c613672 | ||
|
|
dd7ad4c3d6 | ||
|
|
bef9ff3b1a | ||
|
|
b420fbe940 | ||
|
|
d0481bb568 | ||
|
|
cfc40b23d7 | ||
|
|
bda27ec8c6 | ||
|
|
cab4288b88 | ||
|
|
34d1a75ab0 | ||
|
|
c94468339c | ||
|
|
594e9b1b73 | ||
|
|
5c06bbf8cf | ||
|
|
2614607d60 | ||
|
|
8d598ba5f8 | ||
|
|
81a3245190 | ||
|
|
c3c1f6ac27 | ||
|
|
b7e658c5c3 | ||
|
|
53a0c3488e | ||
|
|
89c215a9ff | ||
|
|
f3a93a0303 | ||
|
|
ce917e97f7 | ||
|
|
07df148400 | ||
|
|
53142aed07 | ||
|
|
20a33632bf | ||
|
|
8abfcdbb78 | ||
|
|
9d1f8fbdb0 | ||
|
|
fb9cfd0d1b | ||
|
|
40f0a72db0 | ||
|
|
4f8f82f5f1 | ||
|
|
b475b8f648 | ||
|
|
19a1d9d188 | ||
|
|
b43425b527 | ||
|
|
f5078547d2 | ||
|
|
2974ab634f | ||
|
|
885eb00fc3 | ||
|
|
b4366ebed2 | ||
|
|
db06a5a5d3 | ||
|
|
f92fe82b24 | ||
|
|
669669f093 | ||
|
|
324063eb3d | ||
|
|
cc99e7b164 | ||
|
|
180e82992b | ||
|
|
975e3acc68 | ||
|
|
2ce5f78cdd | ||
|
|
dd7f24dfbd | ||
|
|
593ab4559d | ||
|
|
532cee2ee3 | ||
|
|
640bc0de97 | ||
|
|
cbce49b163 | ||
|
|
e0446fc557 | ||
|
|
836881b713 | ||
|
|
98e5048370 | ||
|
|
d608668335 | ||
|
|
388023a172 | ||
|
|
3a7096d0a6 | ||
|
|
0920e8bcc6 | ||
|
|
5700b4b13a | ||
|
|
00bb3215cb | ||
|
|
672d5f92f2 | ||
|
|
3438196010 | ||
|
|
fd5f351a6f | ||
|
|
053a806ab1 | ||
|
|
2baf4883cc | ||
|
|
d4546630df | ||
|
|
bbc4dc3867 | ||
|
|
a44f718c09 | ||
|
|
65ce173d3f | ||
|
|
54c500cd94 | ||
|
|
a72c89bd6e | ||
|
|
5548e5976b | ||
|
|
b64a5848aa | ||
|
|
bbe7029d0a | ||
|
|
75fe42876a | ||
|
|
a82d01214d | ||
|
|
1ec68b6917 | ||
|
|
afeb0fc792 | ||
|
|
ea71201ddc | ||
|
|
cbe1e7d63f | ||
|
|
42016dc359 | ||
|
|
34bb959835 | ||
|
|
0b804e720f | ||
|
|
22d5efba25 | ||
|
|
3e1f5559a6 | ||
|
|
9125f0df20 | ||
|
|
0d70dbe730 | ||
|
|
4c15266a77 | ||
|
|
8f7352e862 | ||
|
|
125b7c2fd8 | ||
|
|
221e640264 | ||
|
|
d7ee3ea086 | ||
|
|
37c54b4403 | ||
|
|
5fecfe9d53 | ||
|
|
2fd4fe40f0 | ||
|
|
c12a662f9f | ||
|
|
0ff7783745 | ||
|
|
a52d0ca5a6 | ||
|
|
be0d8b4f19 | ||
|
|
5fe5e8a5a6 | ||
|
|
c062389f66 | ||
|
|
27e005c4c4 | ||
|
|
3d715840f1 | ||
|
|
8673c757a5 | ||
|
|
ccedc41c57 | ||
|
|
b2036ffcbf | ||
|
|
f248a55576 | ||
|
|
beac7de4df | ||
|
|
1860737117 | ||
|
|
95ad094438 | ||
|
|
4083b2208e | ||
|
|
a50507e645 | ||
|
|
1051561154 | ||
|
|
8f5edb09ef | ||
|
|
cf08f6762d | ||
|
|
8b9bb2acf6 | ||
|
|
4e93b0f467 | ||
|
|
dca881289a | ||
|
|
4c5483ee15 | ||
|
|
a46ff09bf9 | ||
|
|
573b40ab98 | ||
|
|
3457f219be | ||
|
|
1b8b1d6c7a | ||
|
|
ce3da025cc | ||
|
|
c6eeb2d845 | ||
|
|
ba6829f4a7 | ||
|
|
b4a804776f | ||
|
|
241dca57cf | ||
|
|
f9ba4e3e5d | ||
|
|
3c23ab5428 | ||
|
|
2cea7af2f5 | ||
|
|
96893aef2a | ||
|
|
e462974359 | ||
|
|
e8f23bb2cf | ||
|
|
c77c81fc1a | ||
|
|
17eff37104 | ||
|
|
44282134da | ||
|
|
bd321216db | ||
|
|
50a635bc7e | ||
|
|
c4f906f7fa | ||
|
|
4a60f29709 | ||
|
|
dfe2d5eb98 | ||
|
|
9f78fd94d7 | ||
|
|
ca1fd028a2 | ||
|
|
cc9881343e | ||
|
|
3990db3a16 | ||
|
|
cfb46c8003 | ||
|
|
65fc7cf004 | ||
|
|
3e9dd1239a | ||
|
|
cd35cf7982 | ||
|
|
0a255ac5fb | ||
|
|
7fba9ba522 | ||
|
|
bfbbdf5efb | ||
|
|
384562e1ad | ||
|
|
9dc2ccdbfd | ||
|
|
a5022d9dc6 | ||
|
|
b4234cb06e | ||
|
|
644a16048f | ||
|
|
a1434a98a3 | ||
|
|
1f39692d9b | ||
|
|
2a6b73ca5f | ||
|
|
6e39ea5e46 | ||
|
|
89da7d6fe5 | ||
|
|
9f1b584c85 | ||
|
|
47115c714a | ||
|
|
7a2edd35d5 | ||
|
|
ced5497ba1 | ||
|
|
87b57a1b25 | ||
|
|
2226225309 | ||
|
|
4b72c159d8 | ||
|
|
e5795c7b6d | ||
|
|
ba3629c01c | ||
|
|
7104782a74 | ||
|
|
9e50866356 | ||
|
|
b28085110d | ||
|
|
4a3c6325a4 | ||
|
|
9adba8537f | ||
|
|
22a3c9976f | ||
|
|
940a9e0144 | ||
|
|
0841497cad | ||
|
|
016dea1143 | ||
|
|
f97f489c2c | ||
|
|
284c2d6f71 | ||
|
|
aaba5a43bd | ||
|
|
ef805f271e | ||
|
|
081ec57443 | ||
|
|
5fb685dcc6 | ||
|
|
36c38b5310 | ||
|
|
bfd3506549 | ||
|
|
4d8d916434 | ||
|
|
a8c1c15235 | ||
|
|
bcf62612f3 | ||
|
|
e48351fbd3 | ||
|
|
d5fe9ce87f | ||
|
|
2867f92974 | ||
|
|
97258ca1eb | ||
|
|
517975a4b3 | ||
|
|
fcfa4aa777 | ||
|
|
981aad6b77 | ||
|
|
2f3c539d9b | ||
|
|
a69ee676ba | ||
|
|
67cbbf84ca | ||
|
|
00af0afe52 | ||
|
|
e746f55126 | ||
|
|
77effa6d90 | ||
|
|
fb5fb76ad1 | ||
|
|
235f7db967 | ||
|
|
97037580df | ||
|
|
9811725c59 | ||
|
|
1830820363 | ||
|
|
fa330900ff | ||
|
|
65bcd72484 | ||
|
|
0dd5373e4a | ||
|
|
19a9a79467 | ||
|
|
18e66d22b1 | ||
|
|
0ed94dc71e | ||
|
|
20b94ea92f | ||
|
|
9abadcbdb4 | ||
|
|
64bb94cc62 | ||
|
|
4d08f44667 | ||
|
|
a5d72e264d | ||
|
|
9d182986f1 | ||
|
|
6787e2f108 | ||
|
|
992186c88f | ||
|
|
8a3508a547 | ||
|
|
62738dd5c8 | ||
|
|
01897edccd | ||
|
|
1596acbd3b | ||
|
|
0a4e6ff86b | ||
|
|
e2672021bc | ||
|
|
95afb3a112 | ||
|
|
7ef38bd6c1 | ||
|
|
7c79f8f7a5 | ||
|
|
032d0669cd | ||
|
|
67ee40ce12 | ||
|
|
64a00aff6e | ||
|
|
b91b9a1e38 | ||
|
|
029b5bc2d0 | ||
|
|
f08de95630 | ||
|
|
773030f15c | ||
|
|
d999b415df | ||
|
|
0bd3ad1d5a | ||
|
|
4092741f24 | ||
|
|
3d59d3b40f | ||
|
|
4eab10eaa1 | ||
|
|
f8748f0724 | ||
|
|
27c44f4709 | ||
|
|
75d42d82a3 | ||
|
|
0418a7bc0a | ||
|
|
79614eabdf | ||
|
|
d96baaa878 | ||
|
|
ce857c2680 | ||
|
|
4600bd2e77 | ||
|
|
516e0cf7e2 | ||
|
|
e32caccc15 | ||
|
|
e642e1a804 | ||
|
|
5c03c14b25 | ||
|
|
21d26de4d8 | ||
|
|
e30c398087 | ||
|
|
a112c9487b | ||
|
|
a268a56acb | ||
|
|
42eb033b03 | ||
|
|
86fc8da703 | ||
|
|
315778227b | ||
|
|
c872cad879 | ||
|
|
747cdf938e | ||
|
|
c41c8c2026 | ||
|
|
844023ad92 | ||
|
|
088cb66635 | ||
|
|
8e667c4165 | ||
|
|
32845704ac | ||
|
|
be48906257 | ||
|
|
011978e81b | ||
|
|
bf9e5ae056 | ||
|
|
f18b3ca340 | ||
|
|
e38c4c26ae | ||
|
|
4e790ca240 | ||
|
|
074831153a | ||
|
|
f6abde3328 | ||
|
|
152f70a6a4 | ||
|
|
3c376f137a | ||
|
|
636d17c111 | ||
|
|
6dbd324ef9 | ||
|
|
419598c745 | ||
|
|
9ece88d585 | ||
|
|
bc7386e815 | ||
|
|
97249d15d1 | ||
|
|
e0217c37a1 | ||
|
|
0201e8e8fb | ||
|
|
97de44b0c2 | ||
|
|
0a7b731242 | ||
|
|
c6c93a02aa | ||
|
|
4a800eda9f | ||
|
|
8349db4947 | ||
|
|
612b864772 | ||
|
|
1f9562ea72 | ||
|
|
e8bcc5e831 | ||
|
|
d5ff74ebac | ||
|
|
c86c4ca65a | ||
|
|
bf75e1fbf4 | ||
|
|
2a7319809a | ||
|
|
748bfff601 | ||
|
|
ace177f20a | ||
|
|
322dccdb4d | ||
|
|
55d970ef9a | ||
|
|
38827e5a16 | ||
|
|
97a90591ca | ||
|
|
5f26fd87c7 | ||
|
|
5f61266931 | ||
|
|
4a3ce66193 | ||
|
|
08d03cc315 | ||
|
|
380ce19b1a | ||
|
|
84d580179d | ||
|
|
38f57d270a | ||
|
|
3924751827 | ||
|
|
c183a8930b | ||
|
|
9491ab9a93 | ||
|
|
be7b293b79 |
1600
.betterer.results
1600
.betterer.results
File diff suppressed because it is too large
Load Diff
89
.betterer.ts
89
.betterer.ts
@@ -1,8 +1,6 @@
|
||||
import { BettererFileTest } from '@betterer/betterer';
|
||||
import { promises as fs } from 'fs';
|
||||
import { ESLint, Linter } from 'eslint';
|
||||
import path from 'path';
|
||||
import { glob } from 'glob';
|
||||
import { promises as fs } from 'fs';
|
||||
|
||||
// Why are we ignoring these?
|
||||
// They're all deprecated/being removed so doesn't make sense to fix types
|
||||
@@ -82,14 +80,8 @@ function countEslintErrors() {
|
||||
}
|
||||
|
||||
const { baseDirectory } = resolver;
|
||||
const cli = new ESLint({ cwd: baseDirectory });
|
||||
|
||||
// Get the base config to set up parsing etc correctly
|
||||
// this is by far the slowest part of this code. It takes eslint about 2 seconds just to find the config
|
||||
const baseConfig = await cli.calculateConfigForFile(filePaths[0]);
|
||||
|
||||
const baseRules: Partial<Linter.RulesRecord> = {
|
||||
'@emotion/syntax-preference': [2, 'object'],
|
||||
'@typescript-eslint/no-explicit-any': 'error',
|
||||
'@grafana/no-aria-label-selectors': 'error',
|
||||
'no-restricted-imports': [
|
||||
@@ -106,57 +98,52 @@ function countEslintErrors() {
|
||||
],
|
||||
};
|
||||
|
||||
const config: Linter.Config = {
|
||||
...baseConfig,
|
||||
rules: baseRules,
|
||||
|
||||
// Be careful when specifying overrides for the same rules as in baseRules - it will... override
|
||||
// the same rule, not merge them with different configurations
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
excludedFiles: ['*.{test,spec}.{ts,tsx}', '**/__mocks__/**', '**/public/test/**'],
|
||||
rules: {
|
||||
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }],
|
||||
},
|
||||
const config: Linter.Config[] = [
|
||||
{
|
||||
files: ['**/*.{js,jsx,ts,tsx}'],
|
||||
rules: baseRules,
|
||||
},
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
ignores: ['**/*.{test,spec}.{ts,tsx}', '**/__mocks__/**', '**/public/test/**'],
|
||||
rules: {
|
||||
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }],
|
||||
},
|
||||
|
||||
{
|
||||
files: ['public/app/**/*.{ts,tsx}'],
|
||||
rules: {
|
||||
'no-barrel-files/no-barrel-files': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['public/app/**/*.{ts,tsx}'],
|
||||
rules: {
|
||||
'no-barrel-files/no-barrel-files': 'error',
|
||||
},
|
||||
{
|
||||
files: ['public/**/*.tsx', 'packages/grafana-ui/**/*.tsx'],
|
||||
excludedFiles: [
|
||||
'public/app/plugins/**',
|
||||
'*.story.tsx',
|
||||
'*.{test,spec}.{ts,tsx}',
|
||||
'**/__mocks__/**',
|
||||
'public/test/**',
|
||||
],
|
||||
rules: {
|
||||
'@grafana/no-untranslated-strings': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['public/**/*.tsx', 'packages/grafana-ui/**/*.tsx'],
|
||||
ignores: [
|
||||
'public/app/plugins/**',
|
||||
'**/*.story.tsx',
|
||||
'**/*.{test,spec}.{ts,tsx}',
|
||||
'**/__mocks__/',
|
||||
'public/test',
|
||||
],
|
||||
rules: {
|
||||
'@grafana/no-untranslated-strings': 'error',
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
];
|
||||
|
||||
const runner = new ESLint({
|
||||
baseConfig: config,
|
||||
useEslintrc: false,
|
||||
overrideConfig: config,
|
||||
cwd: baseDirectory,
|
||||
warnIgnored: false,
|
||||
});
|
||||
|
||||
const lintResults = await runner.lintFiles(Array.from(filePaths));
|
||||
lintResults
|
||||
.filter((lintResult) => lintResult.source)
|
||||
.forEach(({ messages, filePath }) => {
|
||||
const file = fileTestResult.addFile(filePath, '');
|
||||
messages.forEach((message, index) => {
|
||||
file.addIssue(0, 0, message.message, `${index}`);
|
||||
});
|
||||
|
||||
lintResults.forEach(({ messages, filePath }) => {
|
||||
const file = fileTestResult.addFile(filePath, '');
|
||||
messages.forEach((message, index) => {
|
||||
file.addIssue(0, 0, message.message, `${index}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ watch_exts = [".go", ".ini", ".toml", ".template.html"]
|
||||
ignore_files = [".*_gen.go"]
|
||||
build_delay = 1500
|
||||
cmds = [
|
||||
["GO_BUILD_DEV=1", "make", "build-go"],
|
||||
["GO_BUILD_DEV=1", "make", "build-go-fast"],
|
||||
["make", "gen-jsonnet"],
|
||||
["./bin/grafana", "server", "-profile", "-profile-addr=127.0.0.1", "-profile-port=6000", "-profile-block-rate=1", "-profile-mutex-rate=5", "-packaging=dev", "cfg:app_mode=development"]
|
||||
]
|
||||
|
||||
13
.drone.star
13
.drone.star
@@ -18,18 +18,10 @@ load(
|
||||
"publish_packages_pipeline",
|
||||
)
|
||||
load("scripts/drone/events/rrc-patch.star", "rrc_patch_pipelines")
|
||||
load(
|
||||
"scripts/drone/pipelines/ci_images.star",
|
||||
"publish_ci_windows_test_image_pipeline",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/publish_images.star",
|
||||
"publish_image_pipelines_public",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/pipelines/windows.star",
|
||||
"windows_test_backend",
|
||||
)
|
||||
load(
|
||||
"scripts/drone/rgm.star",
|
||||
"rgm",
|
||||
@@ -46,12 +38,7 @@ def main(_ctx):
|
||||
publish_npm_pipelines() +
|
||||
publish_packages_pipeline() +
|
||||
rgm() +
|
||||
[windows_test_backend({
|
||||
"event": ["promote"],
|
||||
"target": ["test-windows"],
|
||||
}, "oss", "testing")] +
|
||||
integration_test_pipelines() +
|
||||
publish_ci_windows_test_image_pipeline() +
|
||||
cronjobs() +
|
||||
secrets()
|
||||
)
|
||||
|
||||
599
.drone.yml
599
.drone.yml
@@ -71,18 +71,10 @@ steps:
|
||||
- echo $DRONE_RUNNER_NAME
|
||||
image: alpine:3.20.3
|
||||
name: identify-runner
|
||||
- commands:
|
||||
- go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd
|
||||
depends_on: []
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
image: golang:1.23.1-alpine
|
||||
name: compile-build-cmd
|
||||
- commands:
|
||||
- go install github.com/bazelbuild/buildtools/buildifier@latest
|
||||
- buildifier --lint=warn -mode=check -r .
|
||||
depends_on:
|
||||
- compile-build-cmd
|
||||
depends_on: []
|
||||
image: golang:1.23.1-alpine
|
||||
name: lint-starlark
|
||||
trigger:
|
||||
@@ -547,7 +539,7 @@ steps:
|
||||
name: identify-runner
|
||||
- commands:
|
||||
- mkdir -p bin
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.53/grabpl
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.1.1/grabpl
|
||||
- chmod +x bin/grabpl
|
||||
image: byrnedo/alpine-curl:0.1.8
|
||||
name: grabpl
|
||||
@@ -577,13 +569,6 @@ steps:
|
||||
depends_on: []
|
||||
image: golang:1.23.1-alpine
|
||||
name: verify-gen-jsonnet
|
||||
- commands:
|
||||
- apk add --update make
|
||||
- make gen-go
|
||||
depends_on:
|
||||
- verify-gen-cue
|
||||
image: golang:1.23.1-alpine
|
||||
name: wire-install
|
||||
- commands:
|
||||
- yarn install --immutable || yarn install --immutable
|
||||
depends_on: []
|
||||
@@ -614,9 +599,16 @@ steps:
|
||||
token:
|
||||
from_secret: drone_token
|
||||
- commands:
|
||||
- docker run --privileged --rm tonistiigi/binfmt --install all
|
||||
- /src/grafana-build artifacts -a targz:grafana:linux/amd64 -a targz:grafana:linux/arm64
|
||||
-a targz:grafana:linux/arm/v7 --go-version=1.23.1 --yarn-cache=$$YARN_CACHE_FOLDER
|
||||
--build-id=$$DRONE_BUILD_NUMBER --grafana-dir=$$PWD > packages.txt
|
||||
-a targz:grafana:linux/arm/v7 -a docker:grafana:linux/amd64 -a docker:grafana:linux/amd64:ubuntu
|
||||
-a docker:grafana:linux/arm64 -a docker:grafana:linux/arm64:ubuntu -a docker:grafana:linux/arm/v7
|
||||
-a docker:grafana:linux/arm/v7:ubuntu --go-version=1.23.1 --yarn-cache=$$YARN_CACHE_FOLDER
|
||||
--build-id=$$DRONE_BUILD_NUMBER --ubuntu-base=ubuntu:22.04 --alpine-base=alpine:3.20.3
|
||||
--tag-format='{{ .version_base }}-{{ .buildID }}-{{ .arch }}' --ubuntu-tag-format='{{
|
||||
.version_base }}-{{ .buildID }}-ubuntu-{{ .arch }}' --verify='false' --grafana-dir=$$PWD
|
||||
> packages.txt
|
||||
- find ./dist -name '*docker*.tar.gz' -type f | xargs -n1 docker load -i
|
||||
depends_on:
|
||||
- yarn-install
|
||||
environment:
|
||||
@@ -628,6 +620,27 @@ steps:
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
- commands:
|
||||
- ./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana
|
||||
depends_on:
|
||||
- rgm-package
|
||||
environment:
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
DOCKER_USER:
|
||||
from_secret: docker_username
|
||||
GITHUB_APP_ID:
|
||||
from_secret: delivery-bot-app-id
|
||||
GITHUB_APP_INSTALLATION_ID:
|
||||
from_secret: delivery-bot-app-installation-id
|
||||
GITHUB_APP_PRIVATE_KEY:
|
||||
from_secret: delivery-bot-app-private-key
|
||||
failure: ignore
|
||||
image: google/cloud-sdk:431.0.0
|
||||
name: publish-images-grafana
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
- commands:
|
||||
- yarn e2e:plugin:build
|
||||
depends_on:
|
||||
@@ -863,47 +876,6 @@ steps:
|
||||
failure: always
|
||||
image: grafana/docker-puppeteer:1.1.0
|
||||
name: test-a11y-frontend
|
||||
- commands:
|
||||
- docker run --privileged --rm tonistiigi/binfmt --install all
|
||||
- /src/grafana-build artifacts -a docker:grafana:linux/amd64 -a docker:grafana:linux/amd64:ubuntu
|
||||
-a docker:grafana:linux/arm64 -a docker:grafana:linux/arm64:ubuntu -a docker:grafana:linux/arm/v7
|
||||
-a docker:grafana:linux/arm/v7:ubuntu --yarn-cache=$$YARN_CACHE_FOLDER --build-id=$$DRONE_BUILD_NUMBER
|
||||
--go-version=1.23.1 --ubuntu-base=ubuntu:22.04 --alpine-base=alpine:3.20.3 --tag-format='{{
|
||||
.version_base }}-{{ .buildID }}-{{ .arch }}' --grafana-dir=$$PWD --ubuntu-tag-format='{{
|
||||
.version_base }}-{{ .buildID }}-ubuntu-{{ .arch }}' > docker.txt
|
||||
- find ./dist -name '*docker*.tar.gz' -type f | xargs -n1 docker load -i
|
||||
depends_on:
|
||||
- yarn-install
|
||||
environment:
|
||||
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN:
|
||||
from_secret: dagger_token
|
||||
image: grafana/grafana-build:main
|
||||
name: rgm-build-docker
|
||||
pull: always
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
- commands:
|
||||
- ./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana
|
||||
depends_on:
|
||||
- rgm-build-docker
|
||||
environment:
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
DOCKER_USER:
|
||||
from_secret: docker_username
|
||||
GITHUB_APP_ID:
|
||||
from_secret: delivery-bot-app-id
|
||||
GITHUB_APP_INSTALLATION_ID:
|
||||
from_secret: delivery-bot-app-installation-id
|
||||
GITHUB_APP_PRIVATE_KEY:
|
||||
from_secret: delivery-bot-app-private-key
|
||||
failure: ignore
|
||||
image: google/cloud-sdk:431.0.0
|
||||
name: publish-images-grafana
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
trigger:
|
||||
event:
|
||||
- pull_request
|
||||
@@ -970,8 +942,9 @@ services:
|
||||
path: /var/lib/mysql
|
||||
- commands:
|
||||
- /bin/mimir -target=backend -alertmanager.grafana-alertmanager-compatibility-enabled
|
||||
-alertmanager.utf8-strict-mode-enabled
|
||||
environment: {}
|
||||
image: grafana/mimir-alpine:r304-3872ccb
|
||||
image: grafana/mimir-alpine:r316-55f47f8
|
||||
name: mimir_backend
|
||||
- environment: {}
|
||||
image: redis:6.2.11-alpine
|
||||
@@ -1003,7 +976,7 @@ steps:
|
||||
name: clone-enterprise
|
||||
- commands:
|
||||
- mkdir -p bin
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.53/grabpl
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.1.1/grabpl
|
||||
- chmod +x bin/grabpl
|
||||
image: byrnedo/alpine-curl:0.1.8
|
||||
name: grabpl
|
||||
@@ -1278,13 +1251,6 @@ platform:
|
||||
os: linux
|
||||
services: []
|
||||
steps:
|
||||
- commands:
|
||||
- go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd
|
||||
depends_on: []
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
image: golang:1.23.1-alpine
|
||||
name: compile-build-cmd
|
||||
- commands:
|
||||
- apt-get update -yq && apt-get install shellcheck
|
||||
- shellcheck -e SC1071 -e SC2162 scripts/**/*.sh
|
||||
@@ -1418,8 +1384,9 @@ services:
|
||||
path: /var/lib/mysql
|
||||
- commands:
|
||||
- /bin/mimir -target=backend -alertmanager.grafana-alertmanager-compatibility-enabled
|
||||
-alertmanager.utf8-strict-mode-enabled
|
||||
environment: {}
|
||||
image: grafana/mimir-alpine:r304-3872ccb
|
||||
image: grafana/mimir-alpine:r316-55f47f8
|
||||
name: mimir_backend
|
||||
- environment: {}
|
||||
image: redis:6.2.11-alpine
|
||||
@@ -1972,7 +1939,7 @@ steps:
|
||||
name: identify-runner
|
||||
- commands:
|
||||
- mkdir -p bin
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.53/grabpl
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.1.1/grabpl
|
||||
- chmod +x bin/grabpl
|
||||
image: byrnedo/alpine-curl:0.1.8
|
||||
name: grabpl
|
||||
@@ -2002,13 +1969,6 @@ steps:
|
||||
depends_on: []
|
||||
image: golang:1.23.1-alpine
|
||||
name: verify-gen-jsonnet
|
||||
- commands:
|
||||
- apk add --update make
|
||||
- make gen-go
|
||||
depends_on:
|
||||
- verify-gen-cue
|
||||
image: golang:1.23.1-alpine
|
||||
name: wire-install
|
||||
- commands:
|
||||
- yarn install --immutable || yarn install --immutable
|
||||
depends_on: []
|
||||
@@ -2038,9 +1998,16 @@ steps:
|
||||
image: node:20.9.0-alpine
|
||||
name: build-frontend-packages
|
||||
- commands:
|
||||
- docker run --privileged --rm tonistiigi/binfmt --install all
|
||||
- /src/grafana-build artifacts -a targz:grafana:linux/amd64 -a targz:grafana:linux/arm64
|
||||
-a targz:grafana:linux/arm/v7 --go-version=1.23.1 --yarn-cache=$$YARN_CACHE_FOLDER
|
||||
--build-id=$$DRONE_BUILD_NUMBER --grafana-dir=$$PWD > packages.txt
|
||||
-a targz:grafana:linux/arm/v7 -a docker:grafana:linux/amd64 -a docker:grafana:linux/amd64:ubuntu
|
||||
-a docker:grafana:linux/arm64 -a docker:grafana:linux/arm64:ubuntu -a docker:grafana:linux/arm/v7
|
||||
-a docker:grafana:linux/arm/v7:ubuntu --go-version=1.23.1 --yarn-cache=$$YARN_CACHE_FOLDER
|
||||
--build-id=$$DRONE_BUILD_NUMBER --ubuntu-base=ubuntu:22.04 --alpine-base=alpine:3.20.3
|
||||
--tag-format='{{ .version_base }}-{{ .buildID }}-{{ .arch }}' --ubuntu-tag-format='{{
|
||||
.version_base }}-{{ .buildID }}-ubuntu-{{ .arch }}' --verify='false' --grafana-dir=$$PWD
|
||||
> packages.txt
|
||||
- find ./dist -name '*docker*.tar.gz' -type f | xargs -n1 docker load -i
|
||||
depends_on:
|
||||
- update-package-json-version
|
||||
environment:
|
||||
@@ -2052,6 +2019,31 @@ steps:
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
- commands:
|
||||
- ./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana
|
||||
depends_on:
|
||||
- rgm-package
|
||||
environment:
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
DOCKER_USER:
|
||||
from_secret: docker_username
|
||||
GCP_KEY:
|
||||
from_secret: gcp_grafanauploads
|
||||
GITHUB_APP_ID:
|
||||
from_secret: delivery-bot-app-id
|
||||
GITHUB_APP_INSTALLATION_ID:
|
||||
from_secret: delivery-bot-app-installation-id
|
||||
GITHUB_APP_PRIVATE_KEY:
|
||||
from_secret: delivery-bot-app-private-key
|
||||
image: google/cloud-sdk:431.0.0
|
||||
name: publish-images-grafana
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
when:
|
||||
repo:
|
||||
- grafana/grafana
|
||||
- commands:
|
||||
- yarn e2e:plugin:build
|
||||
depends_on:
|
||||
@@ -2323,55 +2315,10 @@ steps:
|
||||
when:
|
||||
repo:
|
||||
- grafana/grafana
|
||||
- commands:
|
||||
- docker run --privileged --rm tonistiigi/binfmt --install all
|
||||
- /src/grafana-build artifacts -a docker:grafana:linux/amd64 -a docker:grafana:linux/amd64:ubuntu
|
||||
-a docker:grafana:linux/arm64 -a docker:grafana:linux/arm64:ubuntu -a docker:grafana:linux/arm/v7
|
||||
-a docker:grafana:linux/arm/v7:ubuntu --yarn-cache=$$YARN_CACHE_FOLDER --build-id=$$DRONE_BUILD_NUMBER
|
||||
--go-version=1.23.1 --ubuntu-base=ubuntu:22.04 --alpine-base=alpine:3.20.3 --tag-format='{{
|
||||
.version_base }}-{{ .buildID }}-{{ .arch }}' --grafana-dir=$$PWD --ubuntu-tag-format='{{
|
||||
.version_base }}-{{ .buildID }}-ubuntu-{{ .arch }}' > docker.txt
|
||||
- find ./dist -name '*docker*.tar.gz' -type f | xargs -n1 docker load -i
|
||||
depends_on:
|
||||
- update-package-json-version
|
||||
environment:
|
||||
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN:
|
||||
from_secret: dagger_token
|
||||
image: grafana/grafana-build:main
|
||||
name: rgm-build-docker
|
||||
pull: always
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
- commands:
|
||||
- ./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana
|
||||
depends_on:
|
||||
- rgm-build-docker
|
||||
environment:
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
DOCKER_USER:
|
||||
from_secret: docker_username
|
||||
GCP_KEY:
|
||||
from_secret: gcp_grafanauploads
|
||||
GITHUB_APP_ID:
|
||||
from_secret: delivery-bot-app-id
|
||||
GITHUB_APP_INSTALLATION_ID:
|
||||
from_secret: delivery-bot-app-installation-id
|
||||
GITHUB_APP_PRIVATE_KEY:
|
||||
from_secret: delivery-bot-app-private-key
|
||||
image: google/cloud-sdk:431.0.0
|
||||
name: publish-images-grafana
|
||||
volumes:
|
||||
- name: docker
|
||||
path: /var/run/docker.sock
|
||||
when:
|
||||
repo:
|
||||
- grafana/grafana
|
||||
- commands:
|
||||
- ./bin/grabpl artifacts docker publish --dockerhub-repo grafana/grafana-oss
|
||||
depends_on:
|
||||
- rgm-build-docker
|
||||
- rgm-package
|
||||
environment:
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
@@ -2394,7 +2341,7 @@ steps:
|
||||
repo:
|
||||
- grafana/grafana
|
||||
- commands:
|
||||
- apk add --update bash
|
||||
- apk add --update bash git
|
||||
- ./scripts/publish-npm-packages.sh --dist-tag 'canary' --registry 'https://registry.npmjs.org'
|
||||
depends_on:
|
||||
- end-to-end-tests-dashboards-suite
|
||||
@@ -2416,10 +2363,7 @@ steps:
|
||||
- commands:
|
||||
- ./bin/build upload-packages --edition oss
|
||||
depends_on:
|
||||
- end-to-end-tests-dashboards-suite
|
||||
- end-to-end-tests-panels-suite
|
||||
- end-to-end-tests-smoke-tests-suite
|
||||
- end-to-end-tests-various-suite
|
||||
- rgm-package
|
||||
environment:
|
||||
GCP_KEY:
|
||||
from_secret: gcp_grafanauploads_base64
|
||||
@@ -2433,7 +2377,7 @@ steps:
|
||||
- commands:
|
||||
- ./bin/build upload-cdn --edition oss
|
||||
depends_on:
|
||||
- grafana-server
|
||||
- rgm-package
|
||||
environment:
|
||||
GCP_KEY:
|
||||
from_secret: gcp_grafanauploads
|
||||
@@ -2513,8 +2457,9 @@ services:
|
||||
path: /var/lib/mysql
|
||||
- commands:
|
||||
- /bin/mimir -target=backend -alertmanager.grafana-alertmanager-compatibility-enabled
|
||||
-alertmanager.utf8-strict-mode-enabled
|
||||
environment: {}
|
||||
image: grafana/mimir-alpine:r304-3872ccb
|
||||
image: grafana/mimir-alpine:r316-55f47f8
|
||||
name: mimir_backend
|
||||
- environment: {}
|
||||
image: redis:6.2.11-alpine
|
||||
@@ -2525,7 +2470,7 @@ services:
|
||||
steps:
|
||||
- commands:
|
||||
- mkdir -p bin
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.53/grabpl
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.1.1/grabpl
|
||||
- chmod +x bin/grabpl
|
||||
image: byrnedo/alpine-curl:0.1.8
|
||||
name: grabpl
|
||||
@@ -2707,53 +2652,6 @@ volumes:
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on:
|
||||
- main-test-frontend
|
||||
- main-test-backend
|
||||
- main-build-e2e-publish
|
||||
- main-integration-tests
|
||||
environment:
|
||||
EDITION: oss
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
kind: pipeline
|
||||
name: main-windows
|
||||
platform:
|
||||
arch: amd64
|
||||
os: windows
|
||||
version: "1809"
|
||||
services: []
|
||||
steps:
|
||||
- commands:
|
||||
- echo $env:DRONE_RUNNER_NAME
|
||||
image: mcr.microsoft.com/windows:1809
|
||||
name: identify-runner
|
||||
- commands:
|
||||
- $$ProgressPreference = "SilentlyContinue"
|
||||
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.53/windows/grabpl.exe
|
||||
-OutFile grabpl.exe
|
||||
image: grafana/ci-wix:0.1.1
|
||||
name: windows-init
|
||||
trigger:
|
||||
branch: main
|
||||
event:
|
||||
- push
|
||||
paths:
|
||||
exclude:
|
||||
- '*.md'
|
||||
- docs/**
|
||||
- latest.json
|
||||
repo:
|
||||
- grafana/grafana
|
||||
type: docker
|
||||
volumes:
|
||||
- host:
|
||||
path: //./pipe/docker_engine/
|
||||
name: docker
|
||||
---
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on:
|
||||
- main-build-e2e-publish
|
||||
- main-integration-tests
|
||||
environment:
|
||||
@@ -2805,7 +2703,6 @@ depends_on:
|
||||
- main-test-backend
|
||||
- main-build-e2e-publish
|
||||
- main-integration-tests
|
||||
- main-windows
|
||||
kind: pipeline
|
||||
name: main-notify
|
||||
platform:
|
||||
@@ -3145,8 +3042,9 @@ services:
|
||||
path: /var/lib/mysql
|
||||
- commands:
|
||||
- /bin/mimir -target=backend -alertmanager.grafana-alertmanager-compatibility-enabled
|
||||
-alertmanager.utf8-strict-mode-enabled
|
||||
environment: {}
|
||||
image: grafana/mimir-alpine:r304-3872ccb
|
||||
image: grafana/mimir-alpine:r316-55f47f8
|
||||
name: mimir_backend
|
||||
- environment: {}
|
||||
image: redis:6.2.11-alpine
|
||||
@@ -3157,7 +3055,7 @@ services:
|
||||
steps:
|
||||
- commands:
|
||||
- mkdir -p bin
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.53/grabpl
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.1.1/grabpl
|
||||
- chmod +x bin/grabpl
|
||||
image: byrnedo/alpine-curl:0.1.8
|
||||
name: grabpl
|
||||
@@ -3402,7 +3300,7 @@ steps:
|
||||
name: identify-runner
|
||||
- commands:
|
||||
- mkdir -p bin
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.53/grabpl
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.1.1/grabpl
|
||||
- chmod +x bin/grabpl
|
||||
image: byrnedo/alpine-curl:0.1.8
|
||||
name: grabpl
|
||||
@@ -3434,31 +3332,32 @@ steps:
|
||||
- |2-
|
||||
|
||||
bash -c '
|
||||
IMAGE_TAG=$(echo "$${TAG}" | sed -e "s/+/-/g")
|
||||
debug=
|
||||
if [[ -n $${DRY_RUN} ]]; then debug=echo; fi
|
||||
docker login -u $${DOCKER_USER} -p $${DOCKER_PASSWORD}
|
||||
|
||||
# Push the grafana-image-tags images
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-amd64
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-arm64
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-armv7
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-amd64
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-arm64
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-armv7
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-amd64
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-arm64
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-armv7
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-amd64
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-arm64
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-armv7
|
||||
|
||||
# Create the grafana manifests
|
||||
$$debug docker manifest create grafana/grafana:${TAG} grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7
|
||||
$$debug docker manifest create grafana/grafana:$${IMAGE_TAG} grafana/grafana-image-tags:$${IMAGE_TAG}-amd64 grafana/grafana-image-tags:$${IMAGE_TAG}-arm64 grafana/grafana-image-tags:$${IMAGE_TAG}-armv7
|
||||
|
||||
$$debug docker manifest create grafana/grafana:${TAG}-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7
|
||||
$$debug docker manifest create grafana/grafana:$${IMAGE_TAG}-ubuntu grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-armv7
|
||||
|
||||
# Push the grafana manifests
|
||||
$$debug docker manifest push grafana/grafana:$${TAG}
|
||||
$$debug docker manifest push grafana/grafana:$${TAG}-ubuntu
|
||||
$$debug docker manifest push grafana/grafana:$${IMAGE_TAG}
|
||||
$$debug docker manifest push grafana/grafana:$${IMAGE_TAG}-ubuntu
|
||||
|
||||
# if LATEST is set, then also create & push latest
|
||||
if [[ -n $${LATEST} ]]; then
|
||||
$$debug docker manifest create grafana/grafana:latest grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7
|
||||
$$debug docker manifest create grafana/grafana:latest-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7
|
||||
$$debug docker manifest create grafana/grafana:latest grafana/grafana-image-tags:$${IMAGE_TAG}-amd64 grafana/grafana-image-tags:$${IMAGE_TAG}-arm64 grafana/grafana-image-tags:$${IMAGE_TAG}-armv7
|
||||
$$debug docker manifest create grafana/grafana:latest-ubuntu grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-armv7
|
||||
|
||||
$$debug docker manifest push grafana/grafana:latest
|
||||
$$debug docker manifest push grafana/grafana:latest-ubuntu
|
||||
@@ -3533,7 +3432,7 @@ steps:
|
||||
name: identify-runner
|
||||
- commands:
|
||||
- mkdir -p bin
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.53/grabpl
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.1.1/grabpl
|
||||
- chmod +x bin/grabpl
|
||||
image: byrnedo/alpine-curl:0.1.8
|
||||
name: grabpl
|
||||
@@ -3565,31 +3464,32 @@ steps:
|
||||
- |2-
|
||||
|
||||
bash -c '
|
||||
IMAGE_TAG=$(echo "$${TAG}" | sed -e "s/+/-/g")
|
||||
debug=
|
||||
if [[ -n $${DRY_RUN} ]]; then debug=echo; fi
|
||||
docker login -u $${DOCKER_USER} -p $${DOCKER_PASSWORD}
|
||||
|
||||
# Push the grafana-image-tags images
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-amd64
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-arm64
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-armv7
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-amd64
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-arm64
|
||||
$$debug docker push grafana/grafana-image-tags:$${TAG}-ubuntu-armv7
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-amd64
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-arm64
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-armv7
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-amd64
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-arm64
|
||||
$$debug docker push grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-armv7
|
||||
|
||||
# Create the grafana manifests
|
||||
$$debug docker manifest create grafana/grafana:${TAG} grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7
|
||||
$$debug docker manifest create grafana/grafana:$${IMAGE_TAG} grafana/grafana-image-tags:$${IMAGE_TAG}-amd64 grafana/grafana-image-tags:$${IMAGE_TAG}-arm64 grafana/grafana-image-tags:$${IMAGE_TAG}-armv7
|
||||
|
||||
$$debug docker manifest create grafana/grafana:${TAG}-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7
|
||||
$$debug docker manifest create grafana/grafana:$${IMAGE_TAG}-ubuntu grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-armv7
|
||||
|
||||
# Push the grafana manifests
|
||||
$$debug docker manifest push grafana/grafana:$${TAG}
|
||||
$$debug docker manifest push grafana/grafana:$${TAG}-ubuntu
|
||||
$$debug docker manifest push grafana/grafana:$${IMAGE_TAG}
|
||||
$$debug docker manifest push grafana/grafana:$${IMAGE_TAG}-ubuntu
|
||||
|
||||
# if LATEST is set, then also create & push latest
|
||||
if [[ -n $${LATEST} ]]; then
|
||||
$$debug docker manifest create grafana/grafana:latest grafana/grafana-image-tags:$${TAG}-amd64 grafana/grafana-image-tags:$${TAG}-arm64 grafana/grafana-image-tags:$${TAG}-armv7
|
||||
$$debug docker manifest create grafana/grafana:latest-ubuntu grafana/grafana-image-tags:$${TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${TAG}-ubuntu-armv7
|
||||
$$debug docker manifest create grafana/grafana:latest grafana/grafana-image-tags:$${IMAGE_TAG}-amd64 grafana/grafana-image-tags:$${IMAGE_TAG}-arm64 grafana/grafana-image-tags:$${IMAGE_TAG}-armv7
|
||||
$$debug docker manifest create grafana/grafana:latest-ubuntu grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-amd64 grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-arm64 grafana/grafana-image-tags:$${IMAGE_TAG}-ubuntu-armv7
|
||||
|
||||
$$debug docker manifest push grafana/grafana:latest
|
||||
$$debug docker manifest push grafana/grafana:latest-ubuntu
|
||||
@@ -3681,7 +3581,8 @@ steps:
|
||||
image: golang:1.23.1-alpine
|
||||
name: compile-build-cmd
|
||||
- commands:
|
||||
- ./bin/build artifacts packages --tag $${DRONE_TAG} --src-bucket $${PRERELEASE_BUCKET}
|
||||
- ./bin/build artifacts packages --artifacts-editions=oss --tag $${DRONE_TAG} --src-bucket
|
||||
$${PRERELEASE_BUCKET}
|
||||
depends_on:
|
||||
- compile-build-cmd
|
||||
environment:
|
||||
@@ -3691,19 +3592,6 @@ steps:
|
||||
from_secret: prerelease_bucket
|
||||
image: grafana/grafana-ci-deploy:1.3.3
|
||||
name: publish-artifacts
|
||||
- commands:
|
||||
- ./bin/build artifacts static-assets --tag ${DRONE_TAG} --static-asset-editions=grafana-oss
|
||||
depends_on:
|
||||
- compile-build-cmd
|
||||
environment:
|
||||
GCP_KEY:
|
||||
from_secret: gcp_grafanauploads_base64
|
||||
PRERELEASE_BUCKET:
|
||||
from_secret: prerelease_bucket
|
||||
STATIC_ASSET_EDITIONS:
|
||||
from_secret: static_asset_editions
|
||||
image: grafana/grafana-ci-deploy:1.3.3
|
||||
name: publish-static-assets
|
||||
- commands:
|
||||
- ./bin/build artifacts storybook --tag ${DRONE_TAG}
|
||||
depends_on:
|
||||
@@ -3723,7 +3611,6 @@ steps:
|
||||
-f latest=$${LATEST} --repo=grafana/grafana release-pr.yml
|
||||
depends_on:
|
||||
- publish-artifacts
|
||||
- publish-static-assets
|
||||
environment:
|
||||
GH_CLI_URL: https://github.com/cli/cli/releases/download/v2.50.0/gh_2.50.0_linux_amd64.tar.gz
|
||||
GITHUB_TOKEN:
|
||||
@@ -3855,6 +3742,7 @@ platform:
|
||||
services: []
|
||||
steps:
|
||||
- commands:
|
||||
- export version=$(echo ${TAG} | sed -e "s/+security-/-/g")
|
||||
- 'echo "Step 1: Updating package lists..."'
|
||||
- apt-get update >/dev/null 2>&1
|
||||
- 'echo "Step 2: Installing prerequisites..."'
|
||||
@@ -3870,7 +3758,7 @@ steps:
|
||||
- 'echo "Step 5: Installing Grafana..."'
|
||||
- for i in $(seq 1 60); do
|
||||
- ' if apt-get update >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get
|
||||
install -yq grafana=${TAG} >/dev/null 2>&1; then'
|
||||
install -yq grafana=$version >/dev/null 2>&1; then'
|
||||
- ' echo "Command succeeded on attempt $i"'
|
||||
- ' break'
|
||||
- ' else'
|
||||
@@ -3884,10 +3772,10 @@ steps:
|
||||
- ' fi'
|
||||
- done
|
||||
- 'echo "Step 6: Verifying Grafana installation..."'
|
||||
- 'if dpkg -s grafana | grep -q "Version: ${TAG}"; then'
|
||||
- ' echo "Successfully verified Grafana version ${TAG}"'
|
||||
- 'if dpkg -s grafana | grep -q "Version: $version"; then'
|
||||
- ' echo "Successfully verified Grafana version $version"'
|
||||
- else
|
||||
- ' echo "Failed to verify Grafana version ${TAG}"'
|
||||
- ' echo "Failed to verify Grafana version $version"'
|
||||
- ' exit 1'
|
||||
- fi
|
||||
- echo "Verification complete."
|
||||
@@ -3915,11 +3803,12 @@ steps:
|
||||
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
|
||||
' > /etc/yum.repos.d/grafana.repo
|
||||
- 'echo "Step 5: Checking RPM repository..."'
|
||||
- dnf list available grafana-${TAG}
|
||||
- export version=$(echo "${TAG}" | sed -e "s/+security-/^security_/g")
|
||||
- dnf list available grafana-$version
|
||||
- if [ $? -eq 0 ]; then
|
||||
- ' echo "Grafana package found in repository. Installing from repo..."'
|
||||
- for i in $(seq 1 60); do
|
||||
- ' if dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1; then'
|
||||
- ' if dnf install -y --nogpgcheck grafana-$version >/dev/null 2>&1; then'
|
||||
- ' echo "Command succeeded on attempt $i"'
|
||||
- ' break'
|
||||
- ' else'
|
||||
@@ -3936,16 +3825,16 @@ steps:
|
||||
- ' rpm --import https://rpm.grafana.com/gpg.key'
|
||||
- ' rpm -qa gpg-pubkey* | xargs rpm -qi | grep -i grafana'
|
||||
- else
|
||||
- ' echo "Grafana package version ${TAG} not found in repository."'
|
||||
- ' echo "Grafana package version $version not found in repository."'
|
||||
- ' dnf repolist'
|
||||
- ' dnf list available grafana*'
|
||||
- ' exit 1'
|
||||
- fi
|
||||
- 'echo "Step 6: Verifying Grafana installation..."'
|
||||
- if rpm -q grafana | grep -q "${TAG}"; then
|
||||
- ' echo "Successfully verified Grafana version ${TAG}"'
|
||||
- if rpm -q grafana | grep -q "$verison"; then
|
||||
- ' echo "Successfully verified Grafana version $version"'
|
||||
- else
|
||||
- ' echo "Failed to verify Grafana version ${TAG}"'
|
||||
- ' echo "Failed to verify Grafana version $version"'
|
||||
- ' exit 1'
|
||||
- fi
|
||||
- echo "Verification complete."
|
||||
@@ -4032,6 +3921,7 @@ steps:
|
||||
from_secret: packages_service_account
|
||||
target_bucket: grafana-packages
|
||||
- commands:
|
||||
- export version=$(echo ${TAG} | sed -e "s/+security-/-/g")
|
||||
- 'echo "Step 1: Updating package lists..."'
|
||||
- apt-get update >/dev/null 2>&1
|
||||
- 'echo "Step 2: Installing prerequisites..."'
|
||||
@@ -4047,7 +3937,7 @@ steps:
|
||||
- 'echo "Step 5: Installing Grafana..."'
|
||||
- for i in $(seq 1 60); do
|
||||
- ' if apt-get update >/dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive apt-get
|
||||
install -yq grafana=${TAG} >/dev/null 2>&1; then'
|
||||
install -yq grafana=$version >/dev/null 2>&1; then'
|
||||
- ' echo "Command succeeded on attempt $i"'
|
||||
- ' break'
|
||||
- ' else'
|
||||
@@ -4061,10 +3951,10 @@ steps:
|
||||
- ' fi'
|
||||
- done
|
||||
- 'echo "Step 6: Verifying Grafana installation..."'
|
||||
- 'if dpkg -s grafana | grep -q "Version: ${TAG}"; then'
|
||||
- ' echo "Successfully verified Grafana version ${TAG}"'
|
||||
- 'if dpkg -s grafana | grep -q "Version: $version"; then'
|
||||
- ' echo "Successfully verified Grafana version $version"'
|
||||
- else
|
||||
- ' echo "Failed to verify Grafana version ${TAG}"'
|
||||
- ' echo "Failed to verify Grafana version $version"'
|
||||
- ' exit 1'
|
||||
- fi
|
||||
- echo "Verification complete."
|
||||
@@ -4093,11 +3983,12 @@ steps:
|
||||
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
|
||||
' > /etc/yum.repos.d/grafana.repo
|
||||
- 'echo "Step 5: Checking RPM repository..."'
|
||||
- dnf list available grafana-${TAG}
|
||||
- export version=$(echo "${TAG}" | sed -e "s/+security-/^security_/g")
|
||||
- dnf list available grafana-$version
|
||||
- if [ $? -eq 0 ]; then
|
||||
- ' echo "Grafana package found in repository. Installing from repo..."'
|
||||
- for i in $(seq 1 60); do
|
||||
- ' if dnf install -y --nogpgcheck grafana-${TAG} >/dev/null 2>&1; then'
|
||||
- ' if dnf install -y --nogpgcheck grafana-$version >/dev/null 2>&1; then'
|
||||
- ' echo "Command succeeded on attempt $i"'
|
||||
- ' break'
|
||||
- ' else'
|
||||
@@ -4114,16 +4005,16 @@ steps:
|
||||
- ' rpm --import https://rpm.grafana.com/gpg.key'
|
||||
- ' rpm -qa gpg-pubkey* | xargs rpm -qi | grep -i grafana'
|
||||
- else
|
||||
- ' echo "Grafana package version ${TAG} not found in repository."'
|
||||
- ' echo "Grafana package version $version not found in repository."'
|
||||
- ' dnf repolist'
|
||||
- ' dnf list available grafana*'
|
||||
- ' exit 1'
|
||||
- fi
|
||||
- 'echo "Step 6: Verifying Grafana installation..."'
|
||||
- if rpm -q grafana | grep -q "${TAG}"; then
|
||||
- ' echo "Successfully verified Grafana version ${TAG}"'
|
||||
- if rpm -q grafana | grep -q "$verison"; then
|
||||
- ' echo "Successfully verified Grafana version $version"'
|
||||
- else
|
||||
- ' echo "Failed to verify Grafana version ${TAG}"'
|
||||
- ' echo "Failed to verify Grafana version $version"'
|
||||
- ' exit 1'
|
||||
- fi
|
||||
- echo "Verification complete."
|
||||
@@ -4287,51 +4178,6 @@ volumes:
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on: []
|
||||
environment:
|
||||
EDITION: oss
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
kind: pipeline
|
||||
name: release-whatsnew-checker
|
||||
node:
|
||||
type: no-parallel
|
||||
platform:
|
||||
arch: amd64
|
||||
os: linux
|
||||
services: []
|
||||
steps:
|
||||
- commands:
|
||||
- go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd
|
||||
depends_on: []
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
||||
image: golang:1.23.1-alpine
|
||||
name: compile-build-cmd
|
||||
- commands:
|
||||
- ./bin/build whatsnew-checker
|
||||
depends_on:
|
||||
- compile-build-cmd
|
||||
image: golang:1.23.1-alpine
|
||||
name: whats-new-checker
|
||||
trigger:
|
||||
event:
|
||||
exclude:
|
||||
- promote
|
||||
ref:
|
||||
exclude:
|
||||
- refs/tags/*-cloud*
|
||||
include:
|
||||
- refs/tags/v*
|
||||
type: docker
|
||||
volumes:
|
||||
- host:
|
||||
path: /var/run/docker.sock
|
||||
name: docker
|
||||
---
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on: []
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
@@ -4402,53 +4248,34 @@ volumes:
|
||||
---
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on:
|
||||
- rgm-tag-prerelease
|
||||
depends_on: []
|
||||
environment:
|
||||
EDITION: oss
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
kind: pipeline
|
||||
name: rgm-tag-prerelease-windows
|
||||
name: release-whatsnew-checker
|
||||
node:
|
||||
type: no-parallel
|
||||
platform:
|
||||
arch: amd64
|
||||
os: windows
|
||||
version: "1809"
|
||||
os: linux
|
||||
services: []
|
||||
steps:
|
||||
- commands:
|
||||
- echo $env:DRONE_RUNNER_NAME
|
||||
image: mcr.microsoft.com/windows:1809
|
||||
name: identify-runner
|
||||
- commands:
|
||||
- $$ProgressPreference = "SilentlyContinue"
|
||||
- Invoke-WebRequest https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.53/windows/grabpl.exe
|
||||
-OutFile grabpl.exe
|
||||
image: grafana/ci-wix:0.1.1
|
||||
name: windows-init
|
||||
- commands:
|
||||
- $$gcpKey = $$env:GCP_KEY
|
||||
- '[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($$gcpKey))
|
||||
> gcpkey.json'
|
||||
- dos2unix gcpkey.json
|
||||
- gcloud auth activate-service-account --key-file=gcpkey.json
|
||||
- rm gcpkey.json
|
||||
- cp C:\App\nssm-2.24.zip .
|
||||
- .\grabpl.exe windows-installer --target gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/grafana-${DRONE_TAG:1}.windows-amd64.zip
|
||||
--edition oss ${DRONE_TAG}
|
||||
- $$fname = ((Get-Childitem grafana*.msi -name) -split "`n")[0]
|
||||
- gsutil cp $$fname gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/
|
||||
- gsutil cp "$$fname.sha256" gs://grafana-prerelease/artifacts/downloads/${DRONE_TAG}/oss/release/
|
||||
depends_on:
|
||||
- windows-init
|
||||
- go build -o ./bin/build -ldflags '-extldflags -static' ./pkg/build/cmd
|
||||
depends_on: []
|
||||
environment:
|
||||
GCP_KEY:
|
||||
from_secret: gcp_grafanauploads_base64
|
||||
GITHUB_TOKEN:
|
||||
from_secret: github_token
|
||||
PRERELEASE_BUCKET:
|
||||
from_secret: prerelease_bucket
|
||||
image: grafana/ci-wix:0.1.1
|
||||
name: build-windows-installer
|
||||
CGO_ENABLED: 0
|
||||
image: golang:1.23.1-alpine
|
||||
name: compile-build-cmd
|
||||
- commands:
|
||||
- ./bin/build whatsnew-checker
|
||||
depends_on:
|
||||
- compile-build-cmd
|
||||
image: golang:1.23.1-alpine
|
||||
name: whats-new-checker
|
||||
trigger:
|
||||
event:
|
||||
exclude:
|
||||
@@ -4461,14 +4288,13 @@ trigger:
|
||||
type: docker
|
||||
volumes:
|
||||
- host:
|
||||
path: //./pipe/docker_engine/
|
||||
path: /var/run/docker.sock
|
||||
name: docker
|
||||
---
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on:
|
||||
- rgm-tag-prerelease
|
||||
- rgm-tag-prerelease-windows
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
@@ -5104,59 +4930,6 @@ volumes:
|
||||
path: /var/run/docker.sock
|
||||
name: docker
|
||||
---
|
||||
clone:
|
||||
disable: true
|
||||
depends_on: []
|
||||
environment:
|
||||
EDITION: oss
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
kind: pipeline
|
||||
name: testing-test-backend-windows
|
||||
platform:
|
||||
arch: amd64
|
||||
os: windows
|
||||
version: "1809"
|
||||
services: []
|
||||
steps:
|
||||
- commands:
|
||||
- git clone "https://$$env:GITHUB_TOKEN@github.com/$$env:DRONE_REPO.git" .
|
||||
- git checkout -f $$env:DRONE_COMMIT
|
||||
environment:
|
||||
GITHUB_TOKEN:
|
||||
from_secret: github_token
|
||||
image: grafana/ci-wix:0.1.1
|
||||
name: clone
|
||||
- commands: []
|
||||
depends_on:
|
||||
- clone
|
||||
image: golang:1.23.1-windowsservercore-1809
|
||||
name: windows-init
|
||||
- commands:
|
||||
- go install github.com/google/wire/cmd/wire@v0.5.0
|
||||
- wire gen -tags oss ./pkg/server
|
||||
depends_on:
|
||||
- windows-init
|
||||
image: golang:1.23.1-windowsservercore-1809
|
||||
name: wire-install
|
||||
- commands:
|
||||
- go test -short -covermode=atomic -timeout=5m ./pkg/...
|
||||
depends_on:
|
||||
- wire-install
|
||||
image: golang:1.23.1-windowsservercore-1809
|
||||
name: test-backend
|
||||
trigger:
|
||||
event:
|
||||
- promote
|
||||
target:
|
||||
- test-windows
|
||||
type: docker
|
||||
volumes:
|
||||
- host:
|
||||
path: //./pipe/docker_engine/
|
||||
name: docker
|
||||
---
|
||||
clone:
|
||||
retries: 3
|
||||
depends_on: []
|
||||
@@ -5209,8 +4982,9 @@ services:
|
||||
path: /var/lib/mysql
|
||||
- commands:
|
||||
- /bin/mimir -target=backend -alertmanager.grafana-alertmanager-compatibility-enabled
|
||||
-alertmanager.utf8-strict-mode-enabled
|
||||
environment: {}
|
||||
image: grafana/mimir-alpine:r304-3872ccb
|
||||
image: grafana/mimir-alpine:r316-55f47f8
|
||||
name: mimir_backend
|
||||
- environment: {}
|
||||
image: redis:6.2.11-alpine
|
||||
@@ -5221,7 +4995,7 @@ services:
|
||||
steps:
|
||||
- commands:
|
||||
- mkdir -p bin
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.0.53/grabpl
|
||||
- curl -fL -o bin/grabpl https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v3.1.1/grabpl
|
||||
- chmod +x bin/grabpl
|
||||
image: byrnedo/alpine-curl:0.1.8
|
||||
name: grabpl
|
||||
@@ -5386,55 +5160,6 @@ volumes:
|
||||
temp:
|
||||
medium: memory
|
||||
---
|
||||
clone:
|
||||
disable: true
|
||||
depends_on: []
|
||||
image_pull_secrets:
|
||||
- gcr
|
||||
- gar
|
||||
kind: pipeline
|
||||
name: publish-ci-windows-test-image
|
||||
platform:
|
||||
arch: amd64
|
||||
os: windows
|
||||
version: "1809"
|
||||
services: []
|
||||
steps:
|
||||
- commands:
|
||||
- git clone "https://$$env:GITHUB_TOKEN@github.com/grafana/grafana-ci-sandbox.git"
|
||||
.
|
||||
- git checkout -f $$env:DRONE_COMMIT
|
||||
environment:
|
||||
GITHUB_TOKEN:
|
||||
from_secret: github_token
|
||||
image: grafana/ci-wix:0.1.1
|
||||
name: clone
|
||||
- commands:
|
||||
- cd scripts\build\ci-windows-test
|
||||
- docker login -u $$env:DOCKER_USERNAME -p $$env:DOCKER_PASSWORD
|
||||
- docker build -t grafana/grafana-ci-windows-test:$$env:TAG .
|
||||
- docker push grafana/grafana-ci-windows-test:$$env:TAG
|
||||
environment:
|
||||
DOCKER_PASSWORD:
|
||||
from_secret: docker_password
|
||||
DOCKER_USERNAME:
|
||||
from_secret: docker_username
|
||||
image: docker:windowsservercore-1809
|
||||
name: build-and-publish
|
||||
volumes:
|
||||
- name: docker
|
||||
path: //./pipe/docker_engine/
|
||||
trigger:
|
||||
event:
|
||||
- promote
|
||||
target:
|
||||
- ci-windows-test-image
|
||||
type: docker
|
||||
volumes:
|
||||
- host:
|
||||
path: //./pipe/docker_engine/
|
||||
name: docker
|
||||
---
|
||||
clone:
|
||||
retries: 3
|
||||
kind: pipeline
|
||||
@@ -5731,7 +5456,7 @@ steps:
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM plugins/slack
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM python:3.8
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM postgres:12.3-alpine
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/mimir-alpine:r304-3872ccb
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM grafana/mimir-alpine:r316-55f47f8
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM mysql:5.7.39
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM mysql:8.0.32
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM redis:6.2.11-alpine
|
||||
@@ -5745,6 +5470,7 @@ steps:
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM jwilder/dockerize:0.6.1
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM koalaman/shellcheck:stable
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM rockylinux:9
|
||||
- trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM scottyhardy/docker-wine:stable-9.0
|
||||
depends_on:
|
||||
- authenticate-gcr
|
||||
image: aquasec/trivy:0.21.0
|
||||
@@ -5768,7 +5494,7 @@ steps:
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL plugins/slack
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL python:3.8
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL postgres:12.3-alpine
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL grafana/mimir-alpine:r304-3872ccb
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL grafana/mimir-alpine:r316-55f47f8
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL mysql:5.7.39
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL mysql:8.0.32
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL redis:6.2.11-alpine
|
||||
@@ -5782,6 +5508,7 @@ steps:
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL jwilder/dockerize:0.6.1
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL koalaman/shellcheck:stable
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL rockylinux:9
|
||||
- trivy --exit-code 1 --severity HIGH,CRITICAL scottyhardy/docker-wine:stable-9.0
|
||||
depends_on:
|
||||
- authenticate-gcr
|
||||
environment:
|
||||
@@ -6013,6 +5740,6 @@ kind: secret
|
||||
name: gcr_credentials
|
||||
---
|
||||
kind: signature
|
||||
hmac: e618274ea7a8bfbf3d5e151d459348aa9382fe63fe7fef76c997db3cba74779f
|
||||
hmac: bb28bcd274c9d2ce724db12659ed6e3dcc461f8a07ae0eb9385a64ca5daad4de
|
||||
|
||||
...
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
.git
|
||||
.github
|
||||
.yarn
|
||||
build
|
||||
compiled
|
||||
/data
|
||||
deployment_tools_config.json
|
||||
/devenv
|
||||
dist
|
||||
/e2e/tmp
|
||||
node_modules
|
||||
/pkg
|
||||
/public/lib/monaco
|
||||
/scripts/grafana-server/tmp
|
||||
vendor
|
||||
e2e/test-plugins
|
||||
playwright-report
|
||||
|
||||
# TS generate from cue by cuetsy
|
||||
**/*.gen.ts
|
||||
|
||||
# Auto-generated internationalization files
|
||||
/public/locales/_build/
|
||||
/public/locales/**/*.js
|
||||
|
||||
# Auto-generated icon file
|
||||
/packages/grafana-ui/src/components/Icon/iconBundle.ts
|
||||
162
.eslintrc
162
.eslintrc
@@ -1,162 +0,0 @@
|
||||
{
|
||||
"extends": ["@grafana/eslint-config", "plugin:react/jsx-runtime"],
|
||||
"root": true,
|
||||
"plugins": [
|
||||
"@emotion",
|
||||
"lodash",
|
||||
"jest",
|
||||
"import",
|
||||
"jsx-a11y",
|
||||
"@grafana",
|
||||
"no-barrel-files",
|
||||
// Included so betterer doesn't fail when processing all files,
|
||||
// as other parts of the code use testing-library plugin
|
||||
"testing-library",
|
||||
],
|
||||
"settings": {
|
||||
"import/internal-regex": "^(app/)|(@grafana)",
|
||||
"import/external-module-folders": ["node_modules", ".yarn"],
|
||||
},
|
||||
"rules": {
|
||||
"@grafana/no-border-radius-literal": "error",
|
||||
"@grafana/no-unreduced-motion": "error",
|
||||
"react/prop-types": "off",
|
||||
// need to ignore emotion's `css` prop, see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md#rule-options
|
||||
"react/no-unknown-property": ["error", { "ignore": ["css"] }],
|
||||
"@emotion/jsx-import": "error",
|
||||
"lodash/import-scope": [2, "member"],
|
||||
"jest/no-focused-tests": "error",
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
"groups": [["builtin", "external"], "internal", "parent", "sibling", "index"],
|
||||
"newlines-between": "always",
|
||||
"alphabetize": { "order": "asc" },
|
||||
},
|
||||
],
|
||||
"no-restricted-imports": [
|
||||
"error",
|
||||
{
|
||||
"paths": [
|
||||
{
|
||||
"name": "react-redux",
|
||||
"importNames": ["useDispatch", "useSelector"],
|
||||
"message": "Please import from app/types instead.",
|
||||
},
|
||||
{
|
||||
"name": "react-i18next",
|
||||
"importNames": ["Trans", "t"],
|
||||
"message": "Please import from app/core/internationalization instead",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
// Use typescript's no-redeclare for compatibility with overrides
|
||||
"no-redeclare": "off",
|
||||
"@typescript-eslint/no-redeclare": ["error"],
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["packages/grafana-ui/src/components/uPlot/**/*.{ts,tsx}"],
|
||||
"rules": {
|
||||
"react-hooks/rules-of-hooks": "off",
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": ["packages/grafana-ui/src/components/ThemeDemos/**/*.{ts,tsx}"],
|
||||
"rules": {
|
||||
"@emotion/jsx-import": "off",
|
||||
"react/jsx-uses-react": "off",
|
||||
"react/react-in-jsx-scope": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": ["public/dashboards/scripted*.js"],
|
||||
"rules": {
|
||||
"no-redeclare": "error",
|
||||
"@typescript-eslint/no-redeclare": "off",
|
||||
},
|
||||
},
|
||||
{
|
||||
"extends": ["plugin:jsx-a11y/recommended"],
|
||||
"files": ["**/*.tsx"],
|
||||
"excludedFiles": ["**/*.{spec,test}.tsx"],
|
||||
"rules": {
|
||||
// rules marked "off" are those left in the recommended preset we need to fix
|
||||
// we should remove the corresponding line and fix them one by one
|
||||
// any marked "error" contain specific overrides we'll need to keep
|
||||
"jsx-a11y/no-autofocus": [
|
||||
"error",
|
||||
{
|
||||
"ignoreNonDOM": true,
|
||||
},
|
||||
],
|
||||
"jsx-a11y/label-has-associated-control": [
|
||||
"error",
|
||||
{
|
||||
"controlComponents": ["NumberInput"],
|
||||
"depth": 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"public/app/plugins/datasource/azuremonitor/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/azuremonitor/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/cloud-monitoring/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/cloud-monitoring/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/elasticsearch/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/elasticsearch/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/grafana-postgresql-datasource/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/grafana-postgresql-datasource/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/grafana-pyroscope-datasource/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/grafana-pyroscope-datasource/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/grafana-testdata-datasource/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/grafana-testdata-datasource/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/jaeger/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/jaeger/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/loki/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/loki/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/mysql/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/mysql/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/parca/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/parca/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/tempo/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/tempo/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/loki/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/loki/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/elasticsearch/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/elasticsearch/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/cloudwatch/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/cloudwatch/**/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/zipkin/*.{ts,tsx}",
|
||||
"public/app/plugins/datasource/zipkin/**/*.{ts,tsx}",
|
||||
],
|
||||
"settings": {
|
||||
"import/resolver": {
|
||||
"node": {
|
||||
"extensions": [".ts", ".tsx"],
|
||||
},
|
||||
},
|
||||
},
|
||||
"rules": {
|
||||
"import/no-restricted-paths": [
|
||||
"error",
|
||||
{
|
||||
"zones": [
|
||||
{
|
||||
"target": "./public/app/plugins",
|
||||
"from": "./public",
|
||||
"except": ["./app/plugins"],
|
||||
"message": "Core plugins are not allowed to depend on Grafana core packages",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
103
.github/CODEOWNERS
vendored
103
.github/CODEOWNERS
vendored
@@ -12,8 +12,8 @@
|
||||
# This should make it easy to add new rules without breaking existing ones.
|
||||
|
||||
# Documentation
|
||||
/.changelog-archive @grafana/grafana-release-guild
|
||||
/CHANGELOG.md @grafana/grafana-release-guild
|
||||
/.changelog-archive @grafana/grafana-developer-enablement-squad
|
||||
/CHANGELOG.md @grafana/grafana-developer-enablement-squad
|
||||
/CODE_OF_CONDUCT.md @grafana/grafana-community-support
|
||||
/CONTRIBUTING.md @grafana/grafana-community-support
|
||||
/GOVERNANCE.md @RichiH
|
||||
@@ -38,17 +38,11 @@
|
||||
/docs/.codespellignore @grafana/docs-tooling
|
||||
/docs/sources/ @irenerl24
|
||||
|
||||
/docs/sources/administration/ @jdbaldry
|
||||
/docs/sources/alerting/ @brendamuir
|
||||
/docs/sources/dashboards/ @imatwawana
|
||||
/docs/sources/datasources/ @jdbaldry
|
||||
/docs/sources/explore/ @grafana/explore-squad @lwandz13
|
||||
/docs/sources/fundamentals @irenerl24
|
||||
/docs/sources/getting-started/ @irenerl24
|
||||
/docs/sources/introduction/ @irenerl24
|
||||
/docs/sources/panels-visualizations/ @imatwawana
|
||||
/docs/sources/release-notes/ @Eve832 @GrafanaWriter
|
||||
/docs/sources/setup-grafana/ @irenerl24
|
||||
/docs/sources/release-notes/ @irenerl24 @GrafanaWriter
|
||||
/docs/sources/upgrade-guide/ @imatwawana
|
||||
/docs/sources/whatsnew/ @imatwawana
|
||||
|
||||
@@ -78,6 +72,7 @@
|
||||
/pkg/apis/ @grafana/grafana-app-platform-squad
|
||||
/pkg/apis/alerting_notifications @grafana/grafana-app-platform-squad @grafana/alerting-backend @grafana/alerting-frontend
|
||||
/pkg/apis/query @grafana/grafana-datasources-core-services
|
||||
/pkg/apis/userstorage @grafana/grafana-app-platform-squad @grafana/plugins-platform-backend
|
||||
/pkg/bus/ @grafana/grafana-search-and-storage
|
||||
/pkg/cmd/ @grafana/grafana-backend-group
|
||||
/pkg/cmd/grafana-cli/commands/install_command.go @grafana/plugins-platform-backend
|
||||
@@ -165,6 +160,7 @@
|
||||
/pkg/setting/ @grafana/grafana-backend-services-squad
|
||||
/pkg/tests/ @grafana/grafana-backend-services-squad
|
||||
/pkg/tests/apis/ @grafana/grafana-app-platform-squad
|
||||
/pkg/tests/apis/query @grafana/grafana-datasources-core-services
|
||||
/pkg/tests/apis/alerting @grafana/grafana-app-platform-squad @grafana/alerting-backend
|
||||
/pkg/tests/api/correlations/ @grafana/explore-squad
|
||||
/pkg/tsdb/grafanads/ @grafana/grafana-backend-group
|
||||
@@ -194,6 +190,7 @@
|
||||
/devenv/dev-dashboards-without-uid/ @grafana/dashboards-squad
|
||||
/devenv/dev-dashboards/ @grafana/dashboards-squad
|
||||
/devenv/docker/blocks/alert_webhook_listener/ @grafana/alerting-backend
|
||||
/devenv/docker/blocks/caddy_tls/ @grafana/alerting-backend
|
||||
/devenv/docker/blocks/clickhouse/ @grafana/partner-datasources
|
||||
/devenv/docker/blocks/collectd/ @grafana/observability-metrics
|
||||
/devenv/docker/blocks/etcd @grafana/grafana-app-platform-squad
|
||||
@@ -240,8 +237,8 @@
|
||||
/devenv/docker/loadtest/ @grafana/grafana-backend-services-squad
|
||||
/devenv/docker/rpmtest/ @grafana/grafana-backend-services-squad
|
||||
/devenv/jsonnet/ @grafana/dataviz-squad
|
||||
/devenv/local_cdn/ @grafana/frontend-ops
|
||||
/devenv/local-npm/ @grafana/frontend-ops
|
||||
/devenv/vscode/ @grafana/frontend-ops
|
||||
/devenv/setup.sh @grafana/grafana-backend-services-squad
|
||||
/devenv/plugins.yaml @grafana/plugins-platform-frontend
|
||||
|
||||
@@ -253,15 +250,15 @@
|
||||
|
||||
|
||||
# Continuous Integration
|
||||
.drone.yml @grafana/grafana-release-guild
|
||||
.drone.star @grafana/grafana-release-guild
|
||||
/scripts/drone/ @grafana/grafana-release-guild
|
||||
/pkg/build/ @grafana/grafana-release-guild
|
||||
/.dockerignore @grafana/grafana-release-guild
|
||||
/Dockerfile @grafana/grafana-release-guild
|
||||
/Makefile @grafana/grafana-release-guild
|
||||
/scripts/build/ @grafana/grafana-release-guild
|
||||
/scripts/list-release-artifacts.sh @grafana/grafana-release-guild
|
||||
.drone.yml @grafana/grafana-developer-enablement-squad
|
||||
.drone.star @grafana/grafana-developer-enablement-squad
|
||||
/scripts/drone/ @grafana/grafana-developer-enablement-squad
|
||||
/pkg/build/ @grafana/grafana-developer-enablement-squad
|
||||
/.dockerignore @grafana/grafana-developer-enablement-squad
|
||||
/Dockerfile @grafana/grafana-developer-enablement-squad
|
||||
/Makefile @grafana/grafana-developer-enablement-squad
|
||||
/scripts/build/ @grafana/grafana-developer-enablement-squad
|
||||
/scripts/list-release-artifacts.sh @grafana/grafana-developer-enablement-squad
|
||||
/.trivyignore @grafana/grafana-backend-services-squad
|
||||
|
||||
# OSS Plugin Partnerships backend code
|
||||
@@ -280,6 +277,7 @@
|
||||
# OSS Big Tent backend code
|
||||
/pkg/tsdb/mysql/ @grafana/oss-big-tent
|
||||
/pkg/tsdb/grafana-postgresql-datasource/ @grafana/oss-big-tent
|
||||
/pkg/tsdb/zipkin/ @grafana/oss-big-tent
|
||||
|
||||
# Partner Datasources backend code
|
||||
/pkg/tsdb/mssql/ @grafana/partner-datasources
|
||||
@@ -386,7 +384,7 @@
|
||||
/.nxignore @grafana/frontend-ops
|
||||
/tsconfig.json @grafana/frontend-ops
|
||||
/.editorconfig @grafana/frontend-ops
|
||||
/.eslintignore @grafana/frontend-ops
|
||||
/eslint.config.js @grafana/frontend-ops
|
||||
/.gitattributes @grafana/frontend-ops
|
||||
/.gitignore @grafana/frontend-ops
|
||||
/.nvmrc @grafana/frontend-ops
|
||||
@@ -396,7 +394,6 @@
|
||||
/yarn.lock @grafana/frontend-ops
|
||||
/lerna.json @grafana/frontend-ops
|
||||
/.prettierrc.js @grafana/frontend-ops
|
||||
/.eslintrc @grafana/frontend-ops
|
||||
/.vim @zoltanbedi
|
||||
/jest.config.js @grafana/frontend-ops
|
||||
/latest.json @grafana/frontend-ops
|
||||
@@ -475,6 +472,7 @@ playwright.config.ts @grafana/plugins-platform-frontend
|
||||
/public/app/features/users/ @grafana/access-squad
|
||||
/public/app/features/variables/ @grafana/dashboards-squad
|
||||
/public/app/features/preferences/ @grafana/grafana-frontend-platform
|
||||
/public/app/features/bookmarks/ @grafana/grafana-frontend-platform
|
||||
/public/app/plugins/panel/alertlist/ @grafana/alerting-frontend
|
||||
/public/app/plugins/panel/annolist/ @grafana/grafana-frontend-platform
|
||||
/public/app/plugins/panel/barchart/ @grafana/dataviz-squad
|
||||
@@ -553,27 +551,27 @@ playwright.config.ts @grafana/plugins-platform-frontend
|
||||
|
||||
/scripts/benchmark-access-control.sh @grafana/access-squad
|
||||
/scripts/check-breaking-changes.sh @grafana/plugins-platform-frontend
|
||||
/scripts/ci-* @grafana/grafana-release-guild
|
||||
/scripts/circle-* @grafana/grafana-release-guild
|
||||
/scripts/publish-npm-packages.sh @grafana/grafana-release-guild @grafana/plugins-platform-frontend
|
||||
/scripts/validate-npm-packages.sh @grafana/grafana-release-guild @grafana/plugins-platform-frontend
|
||||
/scripts/ci-* @grafana/grafana-developer-enablement-squad
|
||||
/scripts/circle-* @grafana/grafana-developer-enablement-squad
|
||||
/scripts/publish-npm-packages.sh @grafana/grafana-developer-enablement-squad @grafana/plugins-platform-frontend
|
||||
/scripts/validate-npm-packages.sh @grafana/grafana-developer-enablement-squad @grafana/plugins-platform-frontend
|
||||
/scripts/ci-frontend-metrics.sh @grafana/grafana-frontend-platform @grafana/plugins-platform-frontend @grafana/dataviz-squad
|
||||
/scripts/cli/ @grafana/grafana-frontend-platform
|
||||
/scripts/clean-git-or-error.sh @grafana/grafana-as-code
|
||||
/scripts/grafana-server/ @grafana/grafana-frontend-platform
|
||||
/scripts/helpers/ @grafana/grafana-release-guild
|
||||
/scripts/helpers/ @grafana/grafana-developer-enablement-squad
|
||||
/scripts/import_many_dashboards.sh @torkelo
|
||||
/scripts/mixin-check.sh @bergquist
|
||||
/scripts/openapi3/ @grafana/grafana-operator-experience-squad
|
||||
/scripts/prepare-packagejson.js @grafana/frontend-ops
|
||||
/scripts/protobuf-check.sh @grafana/plugins-platform-backend
|
||||
/scripts/stripnulls.sh @grafana/grafana-as-code
|
||||
/scripts/tag_release.sh @grafana/grafana-release-guild
|
||||
/scripts/trigger_docker_build.sh @grafana/grafana-release-guild
|
||||
/scripts/trigger_grafana_packer.sh @grafana/grafana-release-guild
|
||||
/scripts/trigger_windows_build.sh @grafana/grafana-release-guild
|
||||
/scripts/tag_release.sh @grafana/grafana-developer-enablement-squad
|
||||
/scripts/trigger_docker_build.sh @grafana/grafana-developer-enablement-squad
|
||||
/scripts/trigger_grafana_packer.sh @grafana/grafana-developer-enablement-squad
|
||||
/scripts/trigger_windows_build.sh @grafana/grafana-developer-enablement-squad
|
||||
/scripts/cleanup-husky.sh @grafana/frontend-ops
|
||||
/scripts/verify-repo-update/ @grafana/grafana-release-guild
|
||||
/scripts/verify-repo-update/ @grafana/grafana-developer-enablement-squad
|
||||
/scripts/generate-icon-bundle.js @grafana/plugins-platform-frontend @grafana/grafana-frontend-platform
|
||||
/scripts/generate-rtk-apis.ts @grafana/grafana-frontend-platform
|
||||
/scripts/generate-alerting-rtk-apis.ts @grafana/alerting-frontend
|
||||
@@ -632,7 +630,7 @@ playwright.config.ts @grafana/plugins-platform-frontend
|
||||
/pkg/services/rendering/ @grafana/sharing-squad
|
||||
|
||||
# SSE - Server Side Expressions
|
||||
/pkg/expr/ @grafana/observability-metrics
|
||||
/pkg/expr/ @grafana/grafana-datasources-core-services
|
||||
|
||||
# Cloud middleware
|
||||
/grafana-mixin/ @grafana/grafana-backend-services-squad
|
||||
@@ -680,6 +678,7 @@ embed.go @grafana/grafana-as-code
|
||||
/pkg/registry/apis/ @grafana/grafana-app-platform-squad
|
||||
/pkg/registry/apis/alerting @grafana/grafana-app-platform-squad @grafana/alerting-backend
|
||||
/pkg/registry/apis/query @grafana/grafana-datasources-core-services
|
||||
/pkg/registry/apis/userstorage @grafana/grafana-app-platform-squad @grafana/plugins-platform-backend
|
||||
/pkg/codegen/ @grafana/grafana-as-code
|
||||
/pkg/codegen/generators @grafana/grafana-as-code
|
||||
/pkg/kinds/*/*_gen.go @grafana/grafana-as-code
|
||||
@@ -696,44 +695,43 @@ embed.go @grafana/grafana-as-code
|
||||
/.github/dependabot.yml @grafana/frontend-ops
|
||||
/.github/issue-opened.json @grafana/grafana-community-support
|
||||
/.github/metrics-collector.json @torkelo
|
||||
/.github/pr-checks.json @marefr
|
||||
/.github/pr-commands.json @marefr
|
||||
/.github/pr-checks.json @tolzhabayev
|
||||
/.github/pr-commands.json @tolzhabayev
|
||||
/.github/renovate.json5 @grafana/frontend-ops
|
||||
/.github/teams.yml @armandgrillet
|
||||
/.github/workflows/alerting-swagger-gen.yml @grafana/alerting-backend
|
||||
/.github/workflows/auto-milestone.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/backport.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/bump-version.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/close-milestone.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/release-pr.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/release-comms.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/auto-milestone.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/backport.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/bump-version.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/close-milestone.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/release-pr.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/release-comms.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/codeowners-validator.yml @tolzhabayev
|
||||
/.github/workflows/codeql-analysis.yml @DanCech
|
||||
/.github/workflows/commands.yml @torkelo
|
||||
/.github/workflows/community-release.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/community-release.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/detect-breaking-changes-* @grafana/plugins-platform-frontend
|
||||
/.github/workflows/doc-validator.yml @grafana/docs-tooling
|
||||
/.github/workflows/epic-add-to-platform-ux-parent-project.yml @meanmina
|
||||
/.github/workflows/github-release.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/github-release.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/issue-labeled.yml @armandgrillet
|
||||
/.github/workflows/issue-opened.yml @grafana/grafana-community-support
|
||||
/.github/workflows/metrics-collector.yml @torkelo
|
||||
/.github/workflows/milestone.yml @marefr
|
||||
/.github/workflows/pr-checks.yml @marefr
|
||||
/.github/workflows/milestone.yml @tolzhabayev
|
||||
/.github/workflows/pr-checks.yml @tolzhabayev
|
||||
/.github/workflows/pr-codeql-analysis-go.yml @DanCech
|
||||
/.github/workflows/pr-codeql-analysis-javascript.yml @DanCech
|
||||
/.github/workflows/pr-codeql-analysis-python.yml @DanCech
|
||||
/.github/workflows/pr-commands.yml @marefr
|
||||
/.github/workflows/pr-patch-check.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/sync-mirror.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/pr-commands.yml @tolzhabayev
|
||||
/.github/workflows/pr-patch-check.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/sync-mirror.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/publish-technical-documentation-next.yml @grafana/docs-tooling
|
||||
/.github/workflows/publish-technical-documentation-release.yml @grafana/docs-tooling
|
||||
/.github/workflows/remove-milestone.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/remove-milestone.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/sbom-report.yml @grafana/security-team
|
||||
/.github/workflows/scripts/json-file-to-job-output.js @grafana/plugins-platform-frontend
|
||||
/.github/workflows/scripts/pr-get-job-link.js @grafana/plugins-platform-frontend
|
||||
/.github/workflows/stale.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/update-changelog.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/stale.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/update-changelog.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/update-make-docs.yml @grafana/docs-tooling
|
||||
/.github/workflows/scripts/kinds/verify-kinds.go @grafana/platform-cat
|
||||
/.github/workflows/publish-kinds-next.yml @grafana/platform-cat
|
||||
@@ -741,11 +739,12 @@ embed.go @grafana/grafana-as-code
|
||||
/.github/workflows/verify-kinds.yml @grafana/platform-cat
|
||||
/.github/workflows/dashboards-issue-add-label.yml @grafana/dashboards-squad
|
||||
/.github/workflows/ephemeral-instances-pr-comment.yml @grafana/grafana-backend-services-squad
|
||||
/.github/workflows/create-security-patch-from-security-mirror.yml @grafana/grafana-release-guild
|
||||
/.github/workflows/create-security-patch-from-security-mirror.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/core-plugins-build-and-release.yml @grafana/plugins-platform-frontend @grafana/plugins-platform-backend
|
||||
/.github/workflows/i18n-crowdin-upload.yml @grafana/grafana-frontend-platform
|
||||
/.github/workflows/i18n-crowdin-download.yml @grafana/grafana-frontend-platform
|
||||
/.github/workflows/pr-go-workspace-check.yml @grafana/grafana-app-platform-squad
|
||||
/.github/workflows/pr-dependabot-update-go-workspace.yml @grafana/grafana-app-platform-squad
|
||||
/.github/workflows/pr-k8s-codegen-check.yml @grafana/grafana-app-platform-squad
|
||||
/.github/workflows/go_lint.yml @grafana/grafana-backend-services-squad
|
||||
/.github/workflows/trivy-scan.yml @grafana/grafana-backend-services-squad
|
||||
|
||||
32
.github/commands.json
vendored
32
.github/commands.json
vendored
@@ -59,14 +59,6 @@
|
||||
"url": "https://github.com/orgs/grafana/projects/76"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "type/docs",
|
||||
"action": "addToProject",
|
||||
"addToProject": {
|
||||
"url": "https://github.com/orgs/grafana/projects/69"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "datasource/Azure",
|
||||
@@ -539,6 +531,14 @@
|
||||
"url": "https://github.com/orgs/grafana/projects/599"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "area/provisioning/datasources",
|
||||
"action": "addToProject",
|
||||
"addToProject": {
|
||||
"url": "https://github.com/orgs/grafana/projects/76"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "area/scenes",
|
||||
@@ -603,14 +603,6 @@
|
||||
"url": "https://github.com/orgs/grafana/projects/660"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "area/expressions",
|
||||
"action": "addToProject",
|
||||
"addToProject": {
|
||||
"url": "https://github.com/orgs/grafana/projects/112"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "area/backend/api",
|
||||
@@ -1202,5 +1194,13 @@
|
||||
"addToProject": {
|
||||
"url": "https://github.com/orgs/grafana/projects/736"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "label",
|
||||
"name": "area/expressions",
|
||||
"action": "addToProject",
|
||||
"addToProject": {
|
||||
"url": "https://github.com/orgs/grafana/projects/699"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
19
.github/dependabot.yml
vendored
19
.github/dependabot.yml
vendored
@@ -5,6 +5,21 @@ updates:
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/"
|
||||
directories:
|
||||
- "/"
|
||||
- "/apps/playlist"
|
||||
- "/pkg/aggregator"
|
||||
- "/pkg/apimachinery"
|
||||
- "/pkg/apiserver"
|
||||
- "/pkg/build"
|
||||
- "/pkg/build/wire"
|
||||
- "/pkg/promlib"
|
||||
- "/pkg/semconv"
|
||||
- "/pkg/storage/unified/apistore"
|
||||
- "/pkg/storage/unified/resource"
|
||||
- "/pkg/util/xorm"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
interval: "daily"
|
||||
time: "02:00"
|
||||
timezone: Etc/UTC
|
||||
open-pull-requests-limit: 10
|
||||
|
||||
113
.github/renovate.json5
vendored
113
.github/renovate.json5
vendored
@@ -1,9 +1,7 @@
|
||||
{
|
||||
"extends": [
|
||||
"config:base"
|
||||
],
|
||||
"enabledManagers": ["npm"],
|
||||
"ignoreDeps": [
|
||||
extends: ["config:recommended"],
|
||||
enabledManagers: ["npm"],
|
||||
ignoreDeps: [
|
||||
"@types/history", // this can be removed entirely when we upgrade history since v5 exposes types directly
|
||||
"history", // we should bump this together with react-router-dom (see https://github.com/grafana/grafana/issues/76744)
|
||||
"react-router-dom", // we should bump this together with history (see https://github.com/grafana/grafana/issues/76744)
|
||||
@@ -14,84 +12,71 @@
|
||||
"slate", // we don't want to continue using this on the long run, use Monaco editor instead of Slate
|
||||
"slate-react", // we don't want to continue using this on the long run, use Monaco editor instead of Slate
|
||||
"@types/slate-react", // we don't want to continue using this on the long run, use Monaco editor instead of Slate
|
||||
"@types/slate" // we don't want to continue using this on the long run, use Monaco editor instead of Slate
|
||||
"@types/slate", // we don't want to continue using this on the long run, use Monaco editor instead of Slate
|
||||
|
||||
// Temporarily pause updating lerna and nx until we resolve build issues
|
||||
"lerna",
|
||||
"nx"
|
||||
],
|
||||
"includePaths": ["package.json", "packages/**", "public/app/plugins/**"],
|
||||
"ignorePaths": ["emails/**", "plugins-bundled/**", "**/mocks/**"],
|
||||
"labels": ["area/frontend", "dependencies", "no-changelog"],
|
||||
"postUpdateOptions": ["yarnDedupeHighest"],
|
||||
"packageRules": [
|
||||
includePaths: ["package.json", "packages/**", "public/app/plugins/**"],
|
||||
ignorePaths: ["emails/**", "plugins-bundled/**", "**/mocks/**"],
|
||||
labels: ["area/frontend", "dependencies", "no-changelog"],
|
||||
postUpdateOptions: ["yarnDedupeHighest"],
|
||||
packageRules: [
|
||||
{
|
||||
"automerge": true,
|
||||
"matchCurrentVersion": "!/^0/",
|
||||
"matchUpdateTypes": ["patch"],
|
||||
"excludePackagePatterns": ["^@?storybook", "^@locker"]
|
||||
automerge: true,
|
||||
matchCurrentVersion: "!/^0/",
|
||||
matchUpdateTypes: ["patch"],
|
||||
matchPackageNames: ["!/^@?storybook/", "!/^@locker/"],
|
||||
},
|
||||
{
|
||||
"matchPackagePatterns": ["^@?storybook"],
|
||||
"extends": ["schedule:monthly"],
|
||||
"groupName": "Storybook updates"
|
||||
extends: ["schedule:monthly"],
|
||||
groupName: "Storybook updates",
|
||||
matchPackageNames: ["/^@?storybook/"],
|
||||
},
|
||||
{
|
||||
"groupName": "React Aria",
|
||||
"matchPackagePrefixes": [
|
||||
"@react-aria/",
|
||||
"@react-stately/"
|
||||
]
|
||||
groupName: "React Aria",
|
||||
matchPackageNames: ["@react-aria/{/,}**", "@react-stately/{/,}**"],
|
||||
},
|
||||
{
|
||||
"groupName": "Moveable",
|
||||
"matchPackageNames": [
|
||||
"moveable",
|
||||
"react-moveable"
|
||||
]
|
||||
groupName: "Moveable",
|
||||
matchPackageNames: ["moveable", "react-moveable"],
|
||||
},
|
||||
{
|
||||
"groupName": "Slate",
|
||||
"matchPackageNames": [
|
||||
"@types/slate",
|
||||
"@types/slate-react",
|
||||
"slate",
|
||||
"slate-react"
|
||||
]
|
||||
groupName: "Slate",
|
||||
matchPackageNames: ["@types/slate", "@types/slate-react", "slate", "slate-react"],
|
||||
},
|
||||
{
|
||||
"groupName": "d3",
|
||||
"matchPackagePrefixes": [
|
||||
"d3",
|
||||
"@types/d3"
|
||||
]
|
||||
groupName: "d3",
|
||||
matchPackageNames: ["d3{/,}**", "@types/d3{/,}**"],
|
||||
},
|
||||
{
|
||||
"groupName": "visx",
|
||||
"matchPackagePrefixes": [
|
||||
"@visx/"
|
||||
]
|
||||
groupName: "scenes",
|
||||
matchPackageNames: ["@grafana/scenes", "@grafana/scenes-react"],
|
||||
},
|
||||
{
|
||||
"groupName": "uLibraries",
|
||||
"matchPackageNames": [
|
||||
"@leeoniya/ufuzzy",
|
||||
"uplot"
|
||||
],
|
||||
"reviewers": ["leeoniya"],
|
||||
groupName: "visx",
|
||||
matchPackageNames: ["@visx/{/,}**"],
|
||||
},
|
||||
{
|
||||
"groupName": "locker",
|
||||
"matchPackagePrefixes": [
|
||||
"@locker/"
|
||||
],
|
||||
"reviewers": ["team:grafana/plugins-platform-frontend"],
|
||||
groupName: "uLibraries",
|
||||
matchPackageNames: ["@leeoniya/ufuzzy", "uplot"],
|
||||
reviewers: ["leeoniya"],
|
||||
},
|
||||
{
|
||||
groupName: "locker",
|
||||
reviewers: ["team:grafana/plugins-platform-frontend"],
|
||||
matchPackageNames: ["@locker/{/,}**"],
|
||||
},
|
||||
],
|
||||
"pin": {
|
||||
"enabled": false
|
||||
pin: {
|
||||
enabled: false,
|
||||
},
|
||||
prConcurrentLimit: 10,
|
||||
rebaseWhen: "conflicted",
|
||||
reviewers: ["team:grafana/frontend-ops"],
|
||||
separateMajorMinor: false,
|
||||
vulnerabilityAlerts: {
|
||||
addLabels: ["area/security"],
|
||||
},
|
||||
"prConcurrentLimit": 10,
|
||||
"rebaseWhen": "conflicted",
|
||||
"reviewers": ["team:grafana/frontend-ops"],
|
||||
"separateMajorMinor": false,
|
||||
"vulnerabilityAlerts": {
|
||||
"addLabels": ["area/security"]
|
||||
}
|
||||
}
|
||||
|
||||
42
.github/workflows/dashboards-issue-add-label.yml
vendored
42
.github/workflows/dashboards-issue-add-label.yml
vendored
@@ -3,8 +3,11 @@ on:
|
||||
issues:
|
||||
types: [opened, closed, edited, reopened, assigned, unassigned, labeled, unlabeled]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.ISSUE_COMMANDS_TOKEN }}
|
||||
ORGANIZATION: ${{ github.repository_owner }}
|
||||
REPO: ${{ github.event.repository.name }}
|
||||
TARGET_PROJECT: 202
|
||||
@@ -13,27 +16,28 @@ env:
|
||||
concurrency:
|
||||
group: issue-label-when-in-project-${{ github.event.number }}
|
||||
jobs:
|
||||
config:
|
||||
runs-on: "ubuntu-latest"
|
||||
outputs:
|
||||
has-secrets: ${{ steps.check.outputs.has-secrets }}
|
||||
steps:
|
||||
- name: "Check for secrets"
|
||||
id: check
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -n "${{ (secrets.ISSUE_COMMANDS_TOKEN != '') || '' }}" ]; then
|
||||
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
main:
|
||||
needs: config
|
||||
if: needs.config.outputs.has-secrets
|
||||
if: github.repository == 'grafana/grafana'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: log in
|
||||
run: gh api user -q .login
|
||||
- name: "Get vault secrets"
|
||||
id: vault-secrets
|
||||
uses: grafana/shared-workflows/actions/get-vault-secrets@main
|
||||
with:
|
||||
# Secrets placed in the ci/repo/grafana/grafana/plugins_platform_issue_commands_github_bot path in Vault
|
||||
repo_secrets: |
|
||||
GH_APP_ID=plugins_platform_issue_commands_github_bot:app_id
|
||||
GH_APP_PEM=plugins_platform_issue_commands_github_bot:app_pem
|
||||
|
||||
- name: "Generate token"
|
||||
id: generate_token
|
||||
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
||||
with:
|
||||
app_id: ${{ env.GH_APP_ID }}
|
||||
private_key: ${{ env.GH_APP_PEM }}
|
||||
- name: Check if issue is in target project
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||
run: |
|
||||
gh api graphql -f query='
|
||||
query($org: String!, $repo: String!) {
|
||||
@@ -62,6 +66,8 @@ jobs:
|
||||
done
|
||||
- name: Add label to issue
|
||||
if: env.IN_TARGET_PROJ
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||
run: |
|
||||
gh api graphql -f query='
|
||||
mutation ($labelableId: ID!, $labelIds: [ID!]!) {
|
||||
|
||||
@@ -6,6 +6,10 @@ concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
@@ -154,26 +158,16 @@ jobs:
|
||||
project_id: 'grafanalabs-global'
|
||||
install_components: 'bq'
|
||||
|
||||
- name: Get link for the Github Action job
|
||||
id: job
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const name = 'Detect breaking changes';
|
||||
const script = require('./.github/workflows/scripts/pr-get-job-link.js')
|
||||
await script({name, github, context, core})
|
||||
|
||||
- name: Detect breaking changes
|
||||
id: breaking-changes
|
||||
run: ./scripts/check-breaking-changes.sh
|
||||
env:
|
||||
FORCE_COLOR: 3
|
||||
GITHUB_JOB_LINK: ${{ steps.job.outputs.link }}
|
||||
|
||||
- name: Persisting the check output
|
||||
run: |
|
||||
mkdir -p ./levitate
|
||||
echo "{ \"exit_code\": ${{ steps.breaking-changes.outputs.is_breaking }}, \"message\": \"${{ steps.breaking-changes.outputs.message }}\", \"job_link\": \"${{ steps.job.outputs.link }}#step:${GITHUB_STEP_NUMBER}:1\", \"pr_number\": \"${{ github.event.pull_request.number }}\" }" > ./levitate/result.json
|
||||
echo "{ \"exit_code\": ${{ steps.breaking-changes.outputs.is_breaking }}, \"message\": \"${{ steps.breaking-changes.outputs.message }}\", \"pr_number\": \"${{ github.event.pull_request.number }}\" }" > ./levitate/result.json
|
||||
|
||||
- name: Upload check output as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -219,15 +213,12 @@ jobs:
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
with:
|
||||
script: |
|
||||
const { data } = await github.rest.issues.listLabelsOnIssue({
|
||||
issue_number: process.env.PR_NUMBER,
|
||||
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
});
|
||||
const labels = data.map(({ name }) => name);
|
||||
const doesExist = labels.includes('levitate breaking change');
|
||||
|
||||
return doesExist ? 1 : 0;
|
||||
return labels.some(label => label.name === 'levitate breaking change') ? 1 : 0
|
||||
|
||||
# put the markdown into a variable
|
||||
- name: Levitate Markdown
|
||||
@@ -271,23 +262,41 @@ jobs:
|
||||
delete: true
|
||||
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||
|
||||
# Posts a notification to Slack if a PR has a breaking change and it did not have a breaking change before
|
||||
- name: Post to Slack
|
||||
- name: Send Slack Message via Payload
|
||||
id: slack
|
||||
if: steps.levitate-run.outputs.exit_code == 1 && steps.does-label-exist.outputs.result == 0 && env.HAS_SECRETS
|
||||
uses: slackapi/slack-github-action@v1.26.0
|
||||
if: steps.levitate-run.outputs.exit_code == 1 && steps.does-label-exist.outputs.result == 0 && github.repository == 'grafana/grafana'
|
||||
uses: grafana/shared-workflows/actions/send-slack-message@main
|
||||
with:
|
||||
payload: |
|
||||
channel-id: "C031SLFH6G0"
|
||||
payload: |
|
||||
{
|
||||
"pr_link": "https://github.com/grafana/grafana/pull/${{ steps.levitate-run.outputs.pr_number }}",
|
||||
"pr_number": "${{ steps.levitate-run.outputs.pr_number }}",
|
||||
"job_link": "${{ steps.levitate-run.outputs.job_link }}",
|
||||
"reporting_job_link": "${{ github.event.workflow_run.html_url }}",
|
||||
"message": "${{ steps.levitate-run.outputs.message }}"
|
||||
"channel": "C031SLFH6G0",
|
||||
"text": ":warning: Possible breaking changes detected in *PR:* <${{ github.event.pull_request.html_url }}|#${{ github.event.pull_request.number }} :warning:",
|
||||
"icon_emoji": ":grot:",
|
||||
"username": "Levitate Bot",
|
||||
"blocks": [
|
||||
{
|
||||
"type": "section",
|
||||
"text": {
|
||||
"type": "mrkdwn",
|
||||
"text": "*grafana/grafana* repository has possible breaking changes"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "section",
|
||||
"fields": [
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "*PR:* <${{ github.event.pull_request.html_url }}|#${{ github.event.pull_request.number }}>"
|
||||
},
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "*Job:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Job>"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_LEVITATE_WEBHOOK_URL }}
|
||||
HAS_SECRETS: ${{ (github.repository == 'grafana/grafana' || secrets.SLACK_LEVITATE_WEBHOOK_URL != '') || '' }}
|
||||
|
||||
# Add the label
|
||||
- name: Add "levitate breaking change" label
|
||||
|
||||
21
.github/workflows/doc-validator.yml
vendored
21
.github/workflows/doc-validator.yml
vendored
@@ -1,13 +1,18 @@
|
||||
name: "doc-validator"
|
||||
on:
|
||||
pull_request:
|
||||
paths: ["docs/sources/**"]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
include:
|
||||
description: |
|
||||
Regular expression that matches paths to include in linting.
|
||||
|
||||
For example: docs/sources/(?:alerting|fundamentals)/.+\.md
|
||||
required: true
|
||||
jobs:
|
||||
doc-validator:
|
||||
runs-on: "ubuntu-latest"
|
||||
container:
|
||||
image: "grafana/doc-validator:v5.0.0"
|
||||
image: "grafana/doc-validator:v5.2.0"
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: "actions/checkout@v4"
|
||||
@@ -15,15 +20,7 @@ jobs:
|
||||
# Only run doc-validator on specific directories.
|
||||
run: >
|
||||
doc-validator
|
||||
'--include=^docs/sources/(?:alerting|fundamentals|getting-started|introduction|setup-grafana|upgrade-guide|whatsnew/whats-new-in-v(?:9|10))/.+\.md$'
|
||||
'--include=${{ inputs.include }}'
|
||||
'--skip-checks=^(?:image.+|canonical-does-not-match-pretty-URL)$'
|
||||
./docs/sources
|
||||
/docs/grafana/latest
|
||||
| reviewdog
|
||||
-f=rdjsonl
|
||||
--fail-on-error
|
||||
--filter-mode=nofilter
|
||||
--name=doc-validator
|
||||
--reporter=github-pr-review
|
||||
env:
|
||||
REVIEWDOG_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
49
.github/workflows/pr-dependabot-update-go-workspace.yml
vendored
Normal file
49
.github/workflows/pr-dependabot-update-go-workspace.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: "Update Go Workspace for Dependabot PRs"
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- .github/workflows/pr-dependabot-update-go-workspace.yml
|
||||
- go.mod
|
||||
- go.sum
|
||||
- go.work
|
||||
- go.work.sum
|
||||
- '**/go.mod'
|
||||
- '**/go.sum'
|
||||
- '**.go'
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
update:
|
||||
runs-on: "ubuntu-latest"
|
||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
|
||||
- name: Set go version
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Update workspace
|
||||
run: make update-workspace
|
||||
|
||||
- name: Commit and push workspace changes
|
||||
env:
|
||||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
||||
run: |
|
||||
if ! git diff --exit-code --quiet; then
|
||||
git config --local user.name "Grot"
|
||||
git config --local user.email "grot@grafana.com"
|
||||
git config --local --add --bool push.autoSetupRemote true
|
||||
echo "Committing and pushing workspace changes"
|
||||
git remote
|
||||
git branch -l
|
||||
git commit -a -m "update workspace"
|
||||
git push origin $BRANCH_NAME
|
||||
fi
|
||||
9
.github/workflows/pr-go-workspace-check.yml
vendored
9
.github/workflows/pr-go-workspace-check.yml
vendored
@@ -4,6 +4,15 @@ on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
paths:
|
||||
- .github/workflows/pr-go-workspace-check.yml
|
||||
- go.mod
|
||||
- go.sum
|
||||
- go.work
|
||||
- go.work.sum
|
||||
- '**/go.mod'
|
||||
- '**/go.sum'
|
||||
- '**.go'
|
||||
|
||||
jobs:
|
||||
check:
|
||||
|
||||
9
.github/workflows/scripts/pr-get-job-link.js
vendored
9
.github/workflows/scripts/pr-get-job-link.js
vendored
@@ -1,9 +0,0 @@
|
||||
|
||||
module.exports = async ({ name, github, context, core }) => {
|
||||
const { owner, repo } = context.repo;
|
||||
const url = `https://api.github.com/repos/${owner}/${repo}/actions/runs/${context.runId}/jobs`
|
||||
const result = await github.request(url);
|
||||
const job = result.data.jobs.find(j => j.name === name);
|
||||
|
||||
core.setOutput('link', `${job.html_url}?check_suite_focus=true`);
|
||||
}
|
||||
69
.github/workflows/trivy-scan.yml
vendored
69
.github/workflows/trivy-scan.yml
vendored
@@ -4,48 +4,59 @@ on:
|
||||
# only run on PRs where go.mod/go.sum/etc have been updated
|
||||
paths:
|
||||
- go.*
|
||||
- .github/workflows/trivy-scan.yml
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- go.*
|
||||
- .github/workflows/trivy-scan.yml
|
||||
|
||||
jobs:
|
||||
trivy-scan:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Trivy
|
||||
uses: aquasecurity/setup-trivy@v0.2.2
|
||||
with:
|
||||
version: v0.56.2
|
||||
cache: true
|
||||
- name: Download Trivy DB
|
||||
run: |
|
||||
trivy fs --no-progress --download-db-only --db-repository public.ecr.aws/aquasecurity/trivy-db
|
||||
- name: Run Trivy vulnerability scanner (table output)
|
||||
uses: aquasecurity/trivy-action@0.24.0
|
||||
with:
|
||||
# scan the filesystem, rather than building a Docker image prior - the
|
||||
# downside is we won't catch dependencies that are only installed in the
|
||||
# image, but the upside is we'll only catch vulnerabilities that are
|
||||
# explicitly in the our dependencies
|
||||
scan-type: 'fs'
|
||||
scanners: 'vuln'
|
||||
format: 'table'
|
||||
exit-code: 1
|
||||
ignore-unfixed: true
|
||||
vuln-type: 'os,library'
|
||||
severity: 'CRITICAL,HIGH'
|
||||
trivyignores: .trivyignore
|
||||
# for the PR check, ignore JS-related issues
|
||||
skip-files: 'yarn.lock,package.json'
|
||||
# Use the trivy binary rather than the aquasecurity/trivy-action action
|
||||
# to avoid a few bugs
|
||||
# scan the filesystem, rather than building a Docker image prior - the
|
||||
# downside is we won't catch dependencies that are only installed in the
|
||||
# image, but the upside is we'll only catch vulnerabilities that are
|
||||
# explicitly in the our dependencies
|
||||
run: |
|
||||
trivy fs \
|
||||
--scanners vuln \
|
||||
--format table \
|
||||
--exit-code 1 \
|
||||
--ignore-unfixed \
|
||||
--pkg-types os,library \
|
||||
--severity CRITICAL,HIGH \
|
||||
--ignorefile .trivyignore \
|
||||
--skip-files yarn.lock,package.json \
|
||||
--skip-db-update \
|
||||
.
|
||||
- name: Run Trivy vulnerability scanner (SARIF)
|
||||
uses: aquasecurity/trivy-action@0.24.0
|
||||
with:
|
||||
scan-type: 'fs'
|
||||
scanners: 'vuln'
|
||||
# Note: The SARIF format ignores severity and uploads all vulns for
|
||||
# later triage. The table-format step above is used to fail the build
|
||||
# if there are any critical or high vulnerabilities.
|
||||
# See https://github.com/aquasecurity/trivy-action/issues/95
|
||||
format: 'sarif'
|
||||
output: 'trivy-results.sarif'
|
||||
ignore-unfixed: true
|
||||
vuln-type: 'os,library'
|
||||
trivyignores: .trivyignore
|
||||
# Use the trivy binary rather than the aquasecurity/trivy-action action
|
||||
# to avoid a few bugs
|
||||
run: |
|
||||
trivy fs \
|
||||
--scanners vuln \
|
||||
--format sarif \
|
||||
--output trivy-results.sarif \
|
||||
--ignore-unfixed \
|
||||
--pkg-types os,library \
|
||||
--ignorefile .trivyignore \
|
||||
--skip-db-update \
|
||||
.
|
||||
if: always() && github.repository == 'grafana/grafana'
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -107,6 +107,7 @@ profile.cov
|
||||
/pkg/extensions/*
|
||||
/pkg/build/cmd/artifactspage.go
|
||||
/pkg/build/cmd/artifactspage.tmpl.html
|
||||
/pkg/build/cmd/exportversion.go
|
||||
/pkg/server/wireexts_enterprise.go
|
||||
/pkg/cmd/grafana-cli/runner/wireexts_enterprise.go
|
||||
!/pkg/extensions/main.go
|
||||
@@ -223,3 +224,5 @@ public/app/plugins/**/dist/
|
||||
|
||||
# Mock service worker used for fake API responses in frontend development
|
||||
public/mockServiceWorker.js
|
||||
|
||||
/e2e/test-plugins/*/dist
|
||||
16
.vscode/launch.json
vendored
16
.vscode/launch.json
vendored
@@ -9,7 +9,21 @@
|
||||
"program": "${workspaceFolder}/pkg/cmd/grafana/",
|
||||
"env": {},
|
||||
"cwd": "${workspaceFolder}",
|
||||
"args": ["server", "--homepath", "${workspaceFolder}", "--packaging", "dev", "cfg:app_mode=development"]
|
||||
"args": [
|
||||
"server",
|
||||
"--homepath", "${workspaceFolder}",
|
||||
"--packaging", "dev",
|
||||
"cfg:app_mode=development",
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Attach to Test Process",
|
||||
"type": "go",
|
||||
"request": "attach",
|
||||
"mode": "remote",
|
||||
"host": "127.0.0.1",
|
||||
"port": 50480,
|
||||
"apiVersion": 2,
|
||||
},
|
||||
{
|
||||
"name": "Run API Server (testdata)",
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
diff --git a/cjs/history.js b/cjs/history.js
|
||||
index fcd8ebab613c6d87b9ac824feb30ab1080cf0ef2..4df20d5cb2f9ba5fc8777899aada53f49399560b 100644
|
||||
--- a/cjs/history.js
|
||||
+++ b/cjs/history.js
|
||||
@@ -103,16 +103,6 @@ function createLocation(path, state, key, currentLocation) {
|
||||
if (state !== undefined && location.state === undefined) location.state = state;
|
||||
}
|
||||
|
||||
- try {
|
||||
- location.pathname = decodeURI(location.pathname);
|
||||
- } catch (e) {
|
||||
- if (e instanceof URIError) {
|
||||
- throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
||||
- } else {
|
||||
- throw e;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
if (key) location.key = key;
|
||||
|
||||
if (currentLocation) {
|
||||
diff --git a/esm/history.js b/esm/history.js
|
||||
index df67820fe3eed558c44fca07a82b0cd409d46720..e0e0d4f69a407e8de782b3fdf8297d42708e110a 100644
|
||||
--- a/esm/history.js
|
||||
+++ b/esm/history.js
|
||||
@@ -80,16 +80,6 @@ function createLocation(path, state, key, currentLocation) {
|
||||
if (state !== undefined && location.state === undefined) location.state = state;
|
||||
}
|
||||
|
||||
- try {
|
||||
- location.pathname = decodeURI(location.pathname);
|
||||
- } catch (e) {
|
||||
- if (e instanceof URIError) {
|
||||
- throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
||||
- } else {
|
||||
- throw e;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
if (key) location.key = key;
|
||||
|
||||
if (currentLocation) {
|
||||
diff --git a/umd/history.js b/umd/history.js
|
||||
index 80e4ff66c44a2a71d4f842cc05a252e48dd18e9a..f8f4901be95e48c66f5626fbf051747a2ffbe41d 100644
|
||||
--- a/umd/history.js
|
||||
+++ b/umd/history.js
|
||||
@@ -207,16 +207,6 @@
|
||||
if (state !== undefined && location.state === undefined) location.state = state;
|
||||
}
|
||||
|
||||
- try {
|
||||
- location.pathname = decodeURI(location.pathname);
|
||||
- } catch (e) {
|
||||
- if (e instanceof URIError) {
|
||||
- throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
|
||||
- } else {
|
||||
- throw e;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
if (key) location.key = key;
|
||||
|
||||
if (currentLocation) {
|
||||
File diff suppressed because one or more lines are too long
@@ -26,7 +26,7 @@ plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
|
||||
spec: 'https://mskelton.dev/yarn-outdated/v2'
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.5.0.cjs
|
||||
yarnPath: .yarn/releases/yarn-4.5.1.cjs
|
||||
# Uncomment the following lines if you want to use Verdaccio local npm registry. Read more at packages/README.md
|
||||
#npmScopes:
|
||||
# grafana:
|
||||
|
||||
181
CHANGELOG.md
181
CHANGELOG.md
@@ -1,3 +1,150 @@
|
||||
<!-- 11.3.0+security-01 START -->
|
||||
|
||||
# 11.3.0+security-01 (2024-11-12)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **MigrationAssistant:** Fix Migration Assistant issue [CVE-2024-9476]
|
||||
|
||||
<!-- 11.3.0+security-01 END -->
|
||||
<!-- 11.2.3+security-01 START -->
|
||||
|
||||
# 11.2.3+security-01 (2024-11-12)
|
||||
|
||||
- **MigrationAssistant:** Fix Migration Assistant issue [CVE-2024-9476]
|
||||
|
||||
<!-- 11.2.3+security-01 END -->
|
||||
<!-- 10.4.12 START -->
|
||||
|
||||
# 10.4.12 (2024-11-08)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting:** Make context deadline on AlertNG service startup configurable [#96058](https://github.com/grafana/grafana/pull/96058), [@fayzal-g](https://github.com/fayzal-g)
|
||||
|
||||
<!-- 10.4.12 END -->
|
||||
<!-- 11.3.0 START -->
|
||||
|
||||
# 11.3.0 (2024-10-22)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Alerting:** Add manage permissions UI logic for Contact Points [#92885](https://github.com/grafana/grafana/pull/92885), [@tomratcliffe](https://github.com/tomratcliffe)
|
||||
- **Alerting:** Allow linking to silence form with `__alert_rule_uid__` value preset [#93526](https://github.com/grafana/grafana/pull/93526), [@tomratcliffe](https://github.com/tomratcliffe)
|
||||
- **Alerting:** Hide query name when using simplified mode in the alert rule [#93779](https://github.com/grafana/grafana/pull/93779), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
|
||||
- **Alerting:** Limit and clean up old alert rules versions [#89754](https://github.com/grafana/grafana/pull/89754), [@igloo12](https://github.com/igloo12)
|
||||
- **Alerting:** Style nits for the simple query mode [#93930](https://github.com/grafana/grafana/pull/93930), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
|
||||
- **Alerting:** Update texts in annotations step [#93977](https://github.com/grafana/grafana/pull/93977), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
|
||||
- **Alerting:** Use useProduceNewAlertmanagerConfiguration for contact points [#88456](https://github.com/grafana/grafana/pull/88456), [@gillesdemey](https://github.com/gillesdemey)
|
||||
- **Auth:** Attach external session info to Grafana session [#93849](https://github.com/grafana/grafana/pull/93849), [@mgyongyosi](https://github.com/mgyongyosi)
|
||||
- **Auth:** Replace jmespath/go-jmespath with jmespath-community/go-jmespath [#94203](https://github.com/grafana/grafana/pull/94203), [@mgyongyosi](https://github.com/mgyongyosi)
|
||||
- **CloudMigrations:** Add support for migration of Library Elements (Panels) resources [#93898](https://github.com/grafana/grafana/pull/93898), [@macabu](https://github.com/macabu)
|
||||
- **Cloudwatch:** Update grafana-aws-sdk [#94155](https://github.com/grafana/grafana/pull/94155), [@iwysiu](https://github.com/iwysiu)
|
||||
- **Explore Logs:** Preinstall for onprem Grafana instances [#94221](https://github.com/grafana/grafana/pull/94221), [@svennergr](https://github.com/svennergr)
|
||||
- **ExploreMetrics:** Ensure compatibility with Incremental Querying [#94355](https://github.com/grafana/grafana/pull/94355), [@NWRichmond](https://github.com/NWRichmond)
|
||||
- **FieldConfig:** Add support for Actions [#92874](https://github.com/grafana/grafana/pull/92874), [@adela-almasan](https://github.com/adela-almasan)
|
||||
- **Plugin Extensions:** Require meta-data to be defined in `plugin.json` during development mode [#93429](https://github.com/grafana/grafana/pull/93429), [@leventebalogh](https://github.com/leventebalogh)
|
||||
- **Reporting:** Display template variables in the PDF (Enterprise)
|
||||
- **Tempo:** Add deprecation notice for Aggregate By [#94050](https://github.com/grafana/grafana/pull/94050), [@joey-grafana](https://github.com/joey-grafana)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting/Chore:** Fix TimeRangeInput not working across multiple months [#93622](https://github.com/grafana/grafana/pull/93622), [@tomratcliffe](https://github.com/tomratcliffe)
|
||||
- **Alerting:** Fix default value for input in simple condition [#94248](https://github.com/grafana/grafana/pull/94248), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
|
||||
- **Alerting:** Fix eval interval not being saved when creating a new group [#93821](https://github.com/grafana/grafana/pull/93821), [@tomratcliffe](https://github.com/tomratcliffe)
|
||||
- **Alerting:** Fix incorrect permission on POST external rule groups endpoint [CVE-2024-8118] [#93940](https://github.com/grafana/grafana/pull/93940), [@alexweav](https://github.com/alexweav)
|
||||
- **Alerting:** Fix panics when attempting to create an Alertmanager after failing [#94023](https://github.com/grafana/grafana/pull/94023), [@santihernandezc](https://github.com/santihernandezc)
|
||||
- **DashboardScene:** Fixes url issue with subpath when exiting edit mode [#93962](https://github.com/grafana/grafana/pull/93962), [@torkelo](https://github.com/torkelo)
|
||||
- **Dashboards:** Enable scenes by default [#93818](https://github.com/grafana/grafana/pull/93818), [@ivanortegaalba](https://github.com/ivanortegaalba)
|
||||
- **Dashboards:** Fixes view & edit keyboard shortcuts when grafana is behind a subpath [#93955](https://github.com/grafana/grafana/pull/93955), [@torkelo](https://github.com/torkelo)
|
||||
- **ElasticSearch:** Fix errorsource in newInstanceSettings [#93859](https://github.com/grafana/grafana/pull/93859), [@iwysiu](https://github.com/iwysiu)
|
||||
- **Reporting:** Fix reports on multi-org instance (Enterprise)
|
||||
- **SubMenu:** Fix expanding sub menu items on touch devices [#93208](https://github.com/grafana/grafana/pull/93208), [@yincongcyincong](https://github.com/yincongcyincong)
|
||||
|
||||
<!-- 11.3.0 END -->
|
||||
<!-- 11.2.3 START -->
|
||||
|
||||
# 11.2.3 (2024-10-22)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting:** Fix incorrect permission on POST external rule groups endpoint [CVE-2024-8118] [#93947](https://github.com/grafana/grafana/pull/93947), [@alexweav](https://github.com/alexweav)
|
||||
- **AzureMonitor:** Fix App Insights portal URL for multi-resource trace queries [#94475](https://github.com/grafana/grafana/pull/94475), [@aangelisc](https://github.com/aangelisc)
|
||||
- **Canvas:** Allow API calls to grafana origin [#94129](https://github.com/grafana/grafana/pull/94129), [@adela-almasan](https://github.com/adela-almasan)
|
||||
- **Folders:** Correctly show new folder button under root folder [#94712](https://github.com/grafana/grafana/pull/94712), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
|
||||
- **OrgSync:** Do not set default Organization for a user to a non-existent Organization [#94549](https://github.com/grafana/grafana/pull/94549), [@mgyongyosi](https://github.com/mgyongyosi)
|
||||
- **Plugins:** Skip install errors if dependency plugin already exists [#94717](https://github.com/grafana/grafana/pull/94717), [@wbrowne](https://github.com/wbrowne)
|
||||
- **ServerSideExpressions:** Disable SQL Expressions to prevent RCE and LFI vulnerability [#94959](https://github.com/grafana/grafana/pull/94959), [@samjewell](https://github.com/samjewell)
|
||||
|
||||
<!-- 11.2.3 END -->
|
||||
<!-- 11.2.2+security-01 START -->
|
||||
|
||||
# 11.2.2+security-01 (2024-10-17)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **SQL Expressions**: Fixes CVE-2024-9264
|
||||
|
||||
<!-- 11.2.2+security-01 END -->
|
||||
<!-- 11.2.1+security-01 START -->
|
||||
|
||||
# 11.2.1+security-01 (2024-10-17)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **SQL Expressions**: Fixes CVE-2024-9264
|
||||
|
||||
<!-- 11.2.1+security-01 END -->
|
||||
<!-- 11.1.8 START -->
|
||||
|
||||
# 11.1.8 (2024-10-22)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting:** Fix incorrect permission on POST external rule groups endpoint [CVE-2024-8118] [#93948](https://github.com/grafana/grafana/pull/93948), [@alexweav](https://github.com/alexweav)
|
||||
- **AzureMonitor:** Fix App Insights portal URL for multi-resource trace queries [#94474](https://github.com/grafana/grafana/pull/94474), [@aangelisc](https://github.com/aangelisc)
|
||||
- **OrgSync:** Do not set default Organization for a user to a non-existent Organization [#94551](https://github.com/grafana/grafana/pull/94551), [@mgyongyosi](https://github.com/mgyongyosi)
|
||||
- **ServerSideExpressions:** Disable SQL Expressions to prevent RCE and LFI vulnerability [#94969](https://github.com/grafana/grafana/pull/94969), [@scottlepp](https://github.com/scottlepp)
|
||||
|
||||
<!-- 11.1.8 END -->
|
||||
<!-- 11.1.7+security-01 START -->
|
||||
|
||||
# 11.1.7+security-01 (2024-10-17)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **SQL Expressions**: Fixes CVE-2024-9264
|
||||
|
||||
<!-- 11.1.7+security-01 END -->
|
||||
<!-- 11.1.6+security-01 START -->
|
||||
|
||||
# 11.1.6+security-01 (2024-10-17)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **SQL Expressions**: Fixes CVE-2024-9264
|
||||
|
||||
<!-- 11.1.6+security-01 END -->
|
||||
<!-- 11.0.6+security-01 START -->
|
||||
|
||||
# 11.0.6+security-01 (2024-10-17)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **SQL Expressions**: Fixes CVE-2024-9264
|
||||
|
||||
<!-- 11.0.6+security-01 END -->
|
||||
<!-- 11.0.5+security-01 START -->
|
||||
|
||||
# 11.0.5+security-01 (2024-10-17)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **SQL Expressions**: Fixes CVE-2024-9264
|
||||
|
||||
<!-- 11.0.5+security-01 END -->
|
||||
<!-- 11.2.2 START -->
|
||||
|
||||
# 11.2.2 (2024-10-01)
|
||||
@@ -41,6 +188,19 @@
|
||||
- **Plugins:** Avoid returning 404 for `AutoEnabled` apps [#93487](https://github.com/grafana/grafana/pull/93487), [@wbrowne](https://github.com/wbrowne)
|
||||
|
||||
<!-- 11.1.7 END -->
|
||||
<!-- 11.0.7 START -->
|
||||
|
||||
# 11.0.7 (2024-10-22)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting:** Fix incorrect permission on POST external rule groups endpoint [CVE-2024-8118] [#93949](https://github.com/grafana/grafana/pull/93949), [@alexweav](https://github.com/alexweav)
|
||||
- **AzureMonitor:** Fix App Insights portal URL for multi-resource trace queries [#94489](https://github.com/grafana/grafana/pull/94489), [@aangelisc](https://github.com/aangelisc)
|
||||
- **Dashboard:** Make dashboard search faster [#94702](https://github.com/grafana/grafana/pull/94702), [@knuzhdin](https://github.com/knuzhdin)
|
||||
- **OrgSync:** Do not set default Organization for a user to a non-existent Organization [#94552](https://github.com/grafana/grafana/pull/94552), [@mgyongyosi](https://github.com/mgyongyosi)
|
||||
- **ServerSideExpressions:** Disable SQL Expressions to prevent RCE and LFI vulnerability [#94971](https://github.com/grafana/grafana/pull/94971), [@samjewell](https://github.com/samjewell)
|
||||
|
||||
<!-- 11.0.7 END -->
|
||||
<!-- 11.0.6 START -->
|
||||
|
||||
# 11.0.6 (2024-10-01)
|
||||
@@ -58,6 +218,17 @@
|
||||
- **Plugins:** Avoid returning 404 for `AutoEnabled` apps [#93486](https://github.com/grafana/grafana/pull/93486), [@wbrowne](https://github.com/wbrowne)
|
||||
|
||||
<!-- 11.0.6 END -->
|
||||
<!-- 10.4.11 START -->
|
||||
|
||||
# 10.4.11 (2024-10-22)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting:** Fix broken panelId links [#94686](https://github.com/grafana/grafana/pull/94686), [@gillesdemey](https://github.com/gillesdemey)
|
||||
- **Alerting:** Fix incorrect permission on POST external rule groups endpoint [CVE-2024-8118] [#93946](https://github.com/grafana/grafana/pull/93946), [@alexweav](https://github.com/alexweav)
|
||||
- **Dashboard:** Make dashboard search faster [#94703](https://github.com/grafana/grafana/pull/94703), [@knuzhdin](https://github.com/knuzhdin)
|
||||
|
||||
<!-- 10.4.11 END -->
|
||||
<!-- 10.4.10 START -->
|
||||
|
||||
# 10.4.10 (2024-10-01)
|
||||
@@ -73,6 +244,16 @@
|
||||
- **Correlations:** Limit access to correlations page to users who can access Explore [#93673](https://github.com/grafana/grafana/pull/93673), [@ifrost](https://github.com/ifrost)
|
||||
|
||||
<!-- 10.4.10 END -->
|
||||
<!-- 10.3.12 START -->
|
||||
|
||||
# 10.3.12 (2024-10-22)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting:** Fix incorrect permission on POST external rule groups endpoint [CVE-2024-8118] [#93945](https://github.com/grafana/grafana/pull/93945), [@alexweav](https://github.com/alexweav)
|
||||
- **Dashboard:** Make dashboard search faster [#94704](https://github.com/grafana/grafana/pull/94704), [@knuzhdin](https://github.com/knuzhdin)
|
||||
|
||||
<!-- 10.3.12 END -->
|
||||
<!-- 10.3.11 START -->
|
||||
|
||||
# 10.3.11 (2024-10-01)
|
||||
|
||||
@@ -3,3 +3,4 @@
|
||||
List of previous team members that have had a big impact on the company or the product and contributed during a long period of time.
|
||||
|
||||
- Hugo Häggmark ([Björn Lundén](https://www.bjornlunden.se/))
|
||||
- Marcus Efraimsson
|
||||
|
||||
10
Makefile
10
Makefile
@@ -17,6 +17,7 @@ GO_RACE_FLAG := $(if $(GO_RACE),-race)
|
||||
GO_BUILD_FLAGS += $(if $(GO_BUILD_DEV),-dev)
|
||||
GO_BUILD_FLAGS += $(if $(GO_BUILD_TAGS),-build-tags=$(GO_BUILD_TAGS))
|
||||
GO_BUILD_FLAGS += $(GO_RACE_FLAG)
|
||||
GIT_BASE = remotes/origin/main
|
||||
|
||||
# GNU xargs has flag -r, and BSD xargs (e.g. MacOS) has that behaviour by default
|
||||
XARGSR = $(shell xargs --version 2>&1 | grep -q GNU && echo xargs -r || echo xargs)
|
||||
@@ -173,12 +174,16 @@ gen-jsonnet:
|
||||
go generate ./devenv/jsonnet
|
||||
|
||||
.PHONY: update-workspace
|
||||
update-workspace:
|
||||
update-workspace: gen-go
|
||||
@echo "updating workspace"
|
||||
bash scripts/go-workspace/update-workspace.sh
|
||||
|
||||
.PHONY: build-go
|
||||
build-go: gen-go update-workspace ## Build all Go binaries.
|
||||
@echo "build go files with updated workspace"
|
||||
$(GO) run build.go $(GO_BUILD_FLAGS) build
|
||||
|
||||
build-go-fast: gen-go ## Build all Go binaries.
|
||||
@echo "build go files"
|
||||
$(GO) run build.go $(GO_BUILD_FLAGS) build
|
||||
|
||||
@@ -308,7 +313,7 @@ lint-go: golangci-lint ## Run all code checks for backend. You can use GO_LINT_F
|
||||
|
||||
.PHONY: lint-go-diff
|
||||
lint-go-diff: $(GOLANGCI_LINT)
|
||||
git diff --name-only remotes/origin/main | \
|
||||
git diff --name-only $(GIT_BASE) | \
|
||||
grep '\.go$$' | \
|
||||
$(XARGSR) dirname | \
|
||||
sort -u | \
|
||||
@@ -411,6 +416,7 @@ protobuf: ## Compile protobuf definitions
|
||||
buf generate pkg/plugins/backendplugin/pluginextensionv2 --template pkg/plugins/backendplugin/pluginextensionv2/buf.gen.yaml
|
||||
buf generate pkg/plugins/backendplugin/secretsmanagerplugin --template pkg/plugins/backendplugin/secretsmanagerplugin/buf.gen.yaml
|
||||
buf generate pkg/storage/unified/resource --template pkg/storage/unified/resource/buf.gen.yaml
|
||||
buf generate pkg/services/authz/proto/v1 --template pkg/services/authz/proto/v1/buf.gen.yaml
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## Clean up intermediate build artifacts.
|
||||
|
||||
@@ -38,7 +38,7 @@ If you're interested in contributing to the Grafana project:
|
||||
|
||||
## Get involved
|
||||
|
||||
- Follow [@grafana on Twitter](https://twitter.com/grafana/).
|
||||
- Follow [@grafana on X (formerly Twitter)](https://x.com/grafana/).
|
||||
- Read and subscribe to the [Grafana blog](https://grafana.com/blog/).
|
||||
- If you have a specific question, check out our [discussion forums](https://community.grafana.com/).
|
||||
- For general discussions, join us on the [official Slack](https://slack.grafana.com) team.
|
||||
|
||||
4
apps/alerting/notifications/Makefile
Normal file
4
apps/alerting/notifications/Makefile
Normal file
@@ -0,0 +1,4 @@
|
||||
.PHONY: generate
|
||||
generate:
|
||||
## --crdencoding none is needed to avoid infinite loop while generating recursive models'
|
||||
grafana-app-sdk generate -c . -g ./apis --crdencoding none
|
||||
49
apps/alerting/notifications/routingtree.cue
Normal file
49
apps/alerting/notifications/routingtree.cue
Normal file
@@ -0,0 +1,49 @@
|
||||
package core
|
||||
|
||||
route: {
|
||||
kind: "RoutingTree"
|
||||
group: "notifications"
|
||||
apiResource: {
|
||||
groupOverride: "notifications.alerting.grafana.app"
|
||||
}
|
||||
codegen: {
|
||||
frontend: false
|
||||
backend: true
|
||||
}
|
||||
pluralName: "RoutingTrees"
|
||||
current: "v0alpha1"
|
||||
versions: {
|
||||
"v0alpha1": {
|
||||
schema: {
|
||||
#RouteDefaults: {
|
||||
receiver: string
|
||||
group_by?: [...string]
|
||||
group_wait?: string
|
||||
group_interval?: string
|
||||
repeat_interval?: string
|
||||
}
|
||||
#Matcher: {
|
||||
type: "=" |"!="|"=~"|"!~" @cuetsy(kind="enum")
|
||||
label: string
|
||||
value: string
|
||||
}
|
||||
#Route: {
|
||||
receiver?: string
|
||||
matchers?: [...#Matcher]
|
||||
continue: bool
|
||||
|
||||
group_by?: [...string]
|
||||
mute_time_intervals?: [...string]
|
||||
routes?: [...#Route]
|
||||
group_wait?: string
|
||||
group_interval?: string
|
||||
repeat_interval?: string
|
||||
}
|
||||
spec: {
|
||||
defaults: #RouteDefaults
|
||||
routes: [...#Route]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
.PHONY: generate
|
||||
generate:
|
||||
@grafana-app-sdk generate -g ./apis --kindgrouping=group --postprocess
|
||||
@grafana-app-sdk generate -g ./pkg/apis --kindgrouping=group --postprocess --crdencoding none
|
||||
@@ -3,36 +3,81 @@ module github.com/grafana/grafana/apps/playlist
|
||||
go 1.23.1
|
||||
|
||||
require (
|
||||
github.com/grafana/grafana-app-sdk v0.19.0
|
||||
github.com/grafana/grafana-app-sdk v0.23.1
|
||||
k8s.io/apimachinery v0.31.1
|
||||
k8s.io/klog/v2 v2.130.1
|
||||
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
|
||||
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
|
||||
github.com/getkin/kin-openapi v0.128.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
github.com/go-openapi/jsonpointer v0.21.0 // indirect
|
||||
github.com/go-openapi/jsonreference v0.21.0 // indirect
|
||||
github.com/go-openapi/swag v0.23.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang/protobuf v1.5.4 // indirect
|
||||
github.com/google/gnostic-models v0.6.8 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
github.com/google/gofuzz v1.2.0 // indirect
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/imdario/mergo v0.3.16 // indirect
|
||||
github.com/invopop/yaml v0.3.1 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/compress v1.17.9 // indirect
|
||||
github.com/mailru/easyjson v0.7.7 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
|
||||
github.com/perimeterx/marshmallow v1.1.5 // indirect
|
||||
github.com/prometheus/client_golang v1.20.5 // indirect
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/common v0.60.0 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
github.com/puzpuzpuz/xsync/v2 v2.5.1 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/x448/float16 v0.8.4 // indirect
|
||||
golang.org/x/net v0.29.0 // indirect
|
||||
golang.org/x/text v0.18.0 // indirect
|
||||
google.golang.org/protobuf v1.34.2 // indirect
|
||||
go.opentelemetry.io/otel v1.31.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.31.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.31.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.31.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
|
||||
golang.org/x/net v0.30.0 // indirect
|
||||
golang.org/x/oauth2 v0.23.0 // indirect
|
||||
golang.org/x/sys v0.26.0 // indirect
|
||||
golang.org/x/term v0.25.0 // indirect
|
||||
golang.org/x/text v0.19.0 // indirect
|
||||
golang.org/x/time v0.6.0 // indirect
|
||||
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 // indirect
|
||||
google.golang.org/grpc v1.67.1 // indirect
|
||||
google.golang.org/protobuf v1.35.1 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
k8s.io/klog/v2 v2.130.1 // indirect
|
||||
k8s.io/api v0.31.1 // indirect
|
||||
k8s.io/apiextensions-apiserver v0.31.1 // indirect
|
||||
k8s.io/client-go v0.31.1 // indirect
|
||||
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
|
||||
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||
)
|
||||
|
||||
@@ -1,19 +1,36 @@
|
||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874 h1:N7oVaKyGp8bttX0bfZGmcGkjz7DLQXhAn3DNd3T0ous=
|
||||
github.com/bradfitz/gomemcache v0.0.0-20230905024940-24af94b03874/go.mod h1:r5xuitiExdLAJ09PR7vBVENGvp4ZuTBeWTGtxuX3K+c=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
|
||||
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
|
||||
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
|
||||
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
|
||||
github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
|
||||
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
|
||||
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
|
||||
github.com/getkin/kin-openapi v0.128.0 h1:jqq3D9vC9pPq1dGcOCv7yOp1DaEe7c/T1vzcLbITSp4=
|
||||
github.com/getkin/kin-openapi v0.128.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM=
|
||||
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
|
||||
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
|
||||
github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ=
|
||||
github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4=
|
||||
github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE=
|
||||
github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ=
|
||||
github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
|
||||
github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
|
||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
@@ -26,18 +43,35 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/grafana/grafana-app-sdk v0.19.0 h1:RY9HvCFR+4WUy81n53wejZnof9qE6++pd6r24d6+JYs=
|
||||
github.com/grafana/grafana-app-sdk v0.19.0/go.mod h1:y0BgzYxc+a7CwOqkwUhN9zXd5cgZJjd2zAbgHEd/xzo=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/grafana/grafana-app-sdk v0.23.1 h1:BRpUG0bA0oVxjthkmO2thuJBo3nbjaRSSmZJHw+mA8I=
|
||||
github.com/grafana/grafana-app-sdk v0.23.1/go.mod h1:KzgPnTJfMeckGmMctv6CJb8Jr/o/5rwARDyjXoeR0Fc=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys=
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4=
|
||||
github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY=
|
||||
github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso=
|
||||
github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA=
|
||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
|
||||
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
|
||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
||||
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
|
||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
@@ -45,21 +79,59 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
|
||||
github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s=
|
||||
github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
||||
github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y=
|
||||
github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
|
||||
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
|
||||
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
|
||||
github.com/prometheus/common v0.60.0 h1:+V9PAREWNvJMAuJ1x1BaWl9dewMW4YrHZQbx0sJNllA=
|
||||
github.com/prometheus/common v0.60.0/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw=
|
||||
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
||||
github.com/puzpuzpuz/xsync/v2 v2.5.1 h1:mVGYAvzDSu52+zaGyNjC+24Xw2bQi3kTr4QJ6N9pIIU=
|
||||
github.com/puzpuzpuz/xsync/v2 v2.5.1/go.mod h1:gD2H2krq/w52MfPLE+Uy64TzJDVY7lP2znR9qmR35kU=
|
||||
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
|
||||
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
|
||||
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
||||
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
|
||||
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY=
|
||||
go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0 h1:K0XaT3DwHAcV4nKLzcQvwAgSyisUghWoY20I7huthMk=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.31.0/go.mod h1:B5Ki776z/MBnVha1Nzwp5arlzBbE3+1jk+pGmaP5HME=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0 h1:FFeLy03iVTXP6ffeN2iXrxfGsZGCjVx0/4KlizjyBwU=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.31.0/go.mod h1:TMu73/k1CP8nBUpDLc71Wj/Kf7ZS9FK5b53VapRsP9o=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0 h1:lUsI2TYsQw2r1IASwoROaCnjdj2cvC2+Jbxvk6nHnWU=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.31.0/go.mod h1:2HpZxxQurfGxJlJDblybejHB6RX6pmExPNe517hREw4=
|
||||
go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE=
|
||||
go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY=
|
||||
go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk=
|
||||
go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0=
|
||||
go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys=
|
||||
go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A=
|
||||
go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=
|
||||
go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
@@ -69,18 +141,26 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
|
||||
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
|
||||
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
|
||||
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
|
||||
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
|
||||
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
|
||||
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
|
||||
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
|
||||
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
|
||||
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
@@ -89,8 +169,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
||||
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
||||
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
|
||||
gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 h1:T6rh4haD3GVYsgEfWExoCZA2o2FmbNyKpTuAxbEFPTg=
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:wp2WsuBYj6j8wUdo3ToZsdxxixbvQNAHqVJrTgi5E5M=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9 h1:QCqS/PdaHTSWGvupk2F/ehwHtGc0/GYkT+3GAcR1CCc=
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20241007155032-5fefd90f89a9/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI=
|
||||
google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E=
|
||||
google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
|
||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
@@ -101,8 +189,14 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU=
|
||||
k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI=
|
||||
k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40=
|
||||
k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ=
|
||||
k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U=
|
||||
k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo=
|
||||
k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0=
|
||||
k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
|
||||
|
||||
@@ -5,6 +5,8 @@ externalName: {
|
||||
group: "playlist"
|
||||
apiResource: {
|
||||
groupOverride: "playlist.grafana.app"
|
||||
mutation: operations: ["create","update"]
|
||||
validation: operations: ["create","update"]
|
||||
}
|
||||
codegen: {
|
||||
frontend: false
|
||||
|
||||
64
apps/playlist/pkg/apis/manifest.go
Normal file
64
apps/playlist/pkg/apis/manifest.go
Normal file
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// This file is generated by grafana-app-sdk
|
||||
// DO NOT EDIT
|
||||
//
|
||||
|
||||
package apis
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/app"
|
||||
)
|
||||
|
||||
var (
|
||||
rawSchemaPlaylistv0alpha1 = []byte(`{"spec":{"properties":{"interval":{"type":"string"},"items":{"items":{"properties":{"type":{"description":"type of the item.","enum":["dashboard_by_tag","dashboard_by_uid","dashboard_by_id"],"type":"string"},"value":{"description":"Value depends on type and describes the playlist item.\n - dashboard_by_id: The value is an internal numerical identifier set by Grafana. This\n is not portable as the numerical identifier is non-deterministic between different instances.\n Will be replaced by dashboard_by_uid in the future. (deprecated)\n - dashboard_by_tag: The value is a tag which is set on any number of dashboards. All\n dashboards behind the tag will be added to the playlist.\n - dashboard_by_uid: The value is the dashboard UID","type":"string"}},"required":["type","value"],"type":"object"},"type":"array"},"title":{"type":"string"}},"required":["title","interval","items"],"type":"object"},"status":{"properties":{"additionalFields":{"description":"additionalFields is reserved for future use","type":"object","x-kubernetes-preserve-unknown-fields":true},"operatorStates":{"additionalProperties":{"properties":{"descriptiveState":{"description":"descriptiveState is an optional more descriptive state field which has no requirements on format","type":"string"},"details":{"description":"details contains any extra information that is operator-specific","type":"object","x-kubernetes-preserve-unknown-fields":true},"lastEvaluation":{"description":"lastEvaluation is the ResourceVersion last evaluated","type":"string"},"state":{"description":"state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.","enum":["success","in_progress","failed"],"type":"string"}},"required":["lastEvaluation","state"],"type":"object"},"description":"operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.","type":"object"}},"type":"object","x-kubernetes-preserve-unknown-fields":true}}`)
|
||||
versionSchemaPlaylistv0alpha1 app.VersionSchema
|
||||
_ = json.Unmarshal(rawSchemaPlaylistv0alpha1, &versionSchemaPlaylistv0alpha1)
|
||||
)
|
||||
|
||||
var appManifestData = app.ManifestData{
|
||||
AppName: "playlist",
|
||||
Group: "playlist.grafana.app",
|
||||
Kinds: []app.ManifestKind{
|
||||
{
|
||||
Kind: "Playlist",
|
||||
Scope: "Namespaced",
|
||||
Conversion: false,
|
||||
Versions: []app.ManifestKindVersion{
|
||||
{
|
||||
Name: "v0alpha1",
|
||||
Admission: &app.AdmissionCapabilities{
|
||||
Validation: &app.ValidationCapability{
|
||||
Operations: []app.AdmissionOperation{
|
||||
app.AdmissionOperationCreate,
|
||||
app.AdmissionOperationUpdate,
|
||||
},
|
||||
},
|
||||
Mutation: &app.MutationCapability{
|
||||
Operations: []app.AdmissionOperation{
|
||||
app.AdmissionOperationCreate,
|
||||
app.AdmissionOperationUpdate,
|
||||
},
|
||||
},
|
||||
},
|
||||
Schema: &versionSchemaPlaylistv0alpha1,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func jsonToMap(j string) map[string]any {
|
||||
m := make(map[string]any)
|
||||
json.Unmarshal([]byte(j), &j)
|
||||
return m
|
||||
}
|
||||
|
||||
func LocalManifest() app.Manifest {
|
||||
return app.NewEmbeddedManifest(appManifestData)
|
||||
}
|
||||
|
||||
func RemoteManifest() app.Manifest {
|
||||
return app.NewAPIServerManifest("playlist")
|
||||
}
|
||||
@@ -65,12 +65,13 @@ func (o *Playlist) SetSubresource(name string, value any) error {
|
||||
}
|
||||
|
||||
func (o *Playlist) GetStaticMetadata() resource.StaticMetadata {
|
||||
gvk := o.GroupVersionKind()
|
||||
return resource.StaticMetadata{
|
||||
Name: o.ObjectMeta.Name,
|
||||
Namespace: o.ObjectMeta.Namespace,
|
||||
Group: o.GroupVersionKind().Group,
|
||||
Version: o.GroupVersionKind().Version,
|
||||
Kind: o.GroupVersionKind().Kind,
|
||||
Group: gvk.Group,
|
||||
Version: gvk.Version,
|
||||
Kind: gvk.Kind,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,17 +12,17 @@ import (
|
||||
|
||||
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
|
||||
return map[string]common.OpenAPIDefinition{
|
||||
"github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.Playlist": schema_playlist_apis_playlist_v0alpha1_Playlist(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlaylistItem": schema_playlist_apis_playlist_v0alpha1_PlaylistItem(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlaylistList": schema_playlist_apis_playlist_v0alpha1_PlaylistList(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlaylistOperatorState": schema_playlist_apis_playlist_v0alpha1_PlaylistOperatorState(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlaylistSpec": schema_playlist_apis_playlist_v0alpha1_PlaylistSpec(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlaylistStatus": schema_playlist_apis_playlist_v0alpha1_PlaylistStatus(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlayliststatusOperatorState": schema_playlist_apis_playlist_v0alpha1_PlayliststatusOperatorState(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.Playlist": schema_pkg_apis_playlist_v0alpha1_Playlist(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlaylistItem": schema_pkg_apis_playlist_v0alpha1_PlaylistItem(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlaylistList": schema_pkg_apis_playlist_v0alpha1_PlaylistList(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlaylistOperatorState": schema_pkg_apis_playlist_v0alpha1_PlaylistOperatorState(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlaylistSpec": schema_pkg_apis_playlist_v0alpha1_PlaylistSpec(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlaylistStatus": schema_pkg_apis_playlist_v0alpha1_PlaylistStatus(ref),
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlayliststatusOperatorState": schema_pkg_apis_playlist_v0alpha1_PlayliststatusOperatorState(ref),
|
||||
}
|
||||
}
|
||||
|
||||
func schema_playlist_apis_playlist_v0alpha1_Playlist(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
func schema_pkg_apis_playlist_v0alpha1_Playlist(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
@@ -51,13 +51,13 @@ func schema_playlist_apis_playlist_v0alpha1_Playlist(ref common.ReferenceCallbac
|
||||
"spec": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlaylistSpec"),
|
||||
Ref: ref("github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlaylistSpec"),
|
||||
},
|
||||
},
|
||||
"status": {
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlaylistStatus"),
|
||||
Ref: ref("github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlaylistStatus"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -65,11 +65,11 @@ func schema_playlist_apis_playlist_v0alpha1_Playlist(ref common.ReferenceCallbac
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlaylistSpec", "github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlaylistStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlaylistSpec", "github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlaylistStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_playlist_apis_playlist_v0alpha1_PlaylistItem(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
func schema_pkg_apis_playlist_v0alpha1_PlaylistItem(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
@@ -99,7 +99,7 @@ func schema_playlist_apis_playlist_v0alpha1_PlaylistItem(ref common.ReferenceCal
|
||||
}
|
||||
}
|
||||
|
||||
func schema_playlist_apis_playlist_v0alpha1_PlaylistList(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
func schema_pkg_apis_playlist_v0alpha1_PlaylistList(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
@@ -132,7 +132,7 @@ func schema_playlist_apis_playlist_v0alpha1_PlaylistList(ref common.ReferenceCal
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.Playlist"),
|
||||
Ref: ref("github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.Playlist"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -143,11 +143,11 @@ func schema_playlist_apis_playlist_v0alpha1_PlaylistList(ref common.ReferenceCal
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.Playlist", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.Playlist", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_playlist_apis_playlist_v0alpha1_PlaylistOperatorState(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
func schema_pkg_apis_playlist_v0alpha1_PlaylistOperatorState(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
@@ -199,7 +199,7 @@ func schema_playlist_apis_playlist_v0alpha1_PlaylistOperatorState(ref common.Ref
|
||||
}
|
||||
}
|
||||
|
||||
func schema_playlist_apis_playlist_v0alpha1_PlaylistSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
func schema_pkg_apis_playlist_v0alpha1_PlaylistSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
@@ -220,7 +220,7 @@ func schema_playlist_apis_playlist_v0alpha1_PlaylistSpec(ref common.ReferenceCal
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlaylistItem"),
|
||||
Ref: ref("github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlaylistItem"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -238,11 +238,11 @@ func schema_playlist_apis_playlist_v0alpha1_PlaylistSpec(ref common.ReferenceCal
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlaylistItem"},
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlaylistItem"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_playlist_apis_playlist_v0alpha1_PlaylistStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
func schema_pkg_apis_playlist_v0alpha1_PlaylistStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
@@ -273,7 +273,7 @@ func schema_playlist_apis_playlist_v0alpha1_PlaylistStatus(ref common.ReferenceC
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlayliststatusOperatorState"),
|
||||
Ref: ref("github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlayliststatusOperatorState"),
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -283,11 +283,11 @@ func schema_playlist_apis_playlist_v0alpha1_PlaylistStatus(ref common.ReferenceC
|
||||
},
|
||||
},
|
||||
Dependencies: []string{
|
||||
"github.com/grafana/grafana/apps/playlist/apis/playlist/v0alpha1.PlayliststatusOperatorState"},
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1.PlayliststatusOperatorState"},
|
||||
}
|
||||
}
|
||||
|
||||
func schema_playlist_apis_playlist_v0alpha1_PlayliststatusOperatorState(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
func schema_pkg_apis_playlist_v0alpha1_PlayliststatusOperatorState(ref common.ReferenceCallback) common.OpenAPIDefinition {
|
||||
return common.OpenAPIDefinition{
|
||||
Schema: spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
87
apps/playlist/pkg/app/app.go
Normal file
87
apps/playlist/pkg/app/app.go
Normal file
@@ -0,0 +1,87 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/app"
|
||||
"github.com/grafana/grafana-app-sdk/operator"
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
"github.com/grafana/grafana-app-sdk/simple"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
playlistv0alpha1 "github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1"
|
||||
"github.com/grafana/grafana/apps/playlist/pkg/watchers"
|
||||
)
|
||||
|
||||
type PlaylistConfig struct {
|
||||
EnableWatchers bool
|
||||
}
|
||||
|
||||
func New(cfg app.Config) (app.App, error) {
|
||||
var (
|
||||
playlistWatcher operator.ResourceWatcher
|
||||
err error
|
||||
)
|
||||
|
||||
playlistConfig, ok := cfg.SpecificConfig.(*PlaylistConfig)
|
||||
if ok && playlistConfig.EnableWatchers {
|
||||
playlistWatcher, err = watchers.NewPlaylistWatcher()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to create PlaylistWatcher: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
simpleConfig := simple.AppConfig{
|
||||
Name: "playlist",
|
||||
KubeConfig: cfg.KubeConfig,
|
||||
InformerConfig: simple.AppInformerConfig{
|
||||
ErrorHandler: func(ctx context.Context, err error) {
|
||||
klog.ErrorS(err, "Informer processing error")
|
||||
},
|
||||
},
|
||||
ManagedKinds: []simple.AppManagedKind{
|
||||
{
|
||||
Kind: playlistv0alpha1.PlaylistKind(),
|
||||
Watcher: playlistWatcher,
|
||||
Mutator: &simple.Mutator{
|
||||
MutateFunc: func(ctx context.Context, req *app.AdmissionRequest) (*app.MutatingResponse, error) {
|
||||
// modify req.Object if needed
|
||||
return &app.MutatingResponse{
|
||||
UpdatedObject: req.Object,
|
||||
}, nil
|
||||
},
|
||||
},
|
||||
Validator: &simple.Validator{
|
||||
ValidateFunc: func(ctx context.Context, req *app.AdmissionRequest) error {
|
||||
// do something here if needed
|
||||
return nil
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
a, err := simple.NewApp(simpleConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = a.ValidateManifest(cfg.ManifestData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return a, nil
|
||||
}
|
||||
|
||||
func GetKinds() map[schema.GroupVersion]resource.Kind {
|
||||
gv := schema.GroupVersion{
|
||||
Group: playlistv0alpha1.PlaylistKind().Group(),
|
||||
Version: playlistv0alpha1.PlaylistKind().Version(),
|
||||
}
|
||||
return map[schema.GroupVersion]resource.Kind{
|
||||
gv: playlistv0alpha1.PlaylistKind(),
|
||||
}
|
||||
}
|
||||
75
apps/playlist/pkg/watchers/watcher_playlist.go
Normal file
75
apps/playlist/pkg/watchers/watcher_playlist.go
Normal file
@@ -0,0 +1,75 @@
|
||||
package watchers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/grafana/grafana-app-sdk/operator"
|
||||
"github.com/grafana/grafana-app-sdk/resource"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
playlist "github.com/grafana/grafana/apps/playlist/pkg/apis/playlist/v0alpha1"
|
||||
)
|
||||
|
||||
var _ operator.ResourceWatcher = &PlaylistWatcher{}
|
||||
|
||||
type PlaylistWatcher struct{}
|
||||
|
||||
func NewPlaylistWatcher() (*PlaylistWatcher, error) {
|
||||
return &PlaylistWatcher{}, nil
|
||||
}
|
||||
|
||||
// Add handles add events for playlist.Playlist resources.
|
||||
func (s *PlaylistWatcher) Add(ctx context.Context, rObj resource.Object) error {
|
||||
object, ok := rObj.(*playlist.Playlist)
|
||||
if !ok {
|
||||
return fmt.Errorf("provided object is not of type *playlist.Playlist (name=%s, namespace=%s, kind=%s)",
|
||||
rObj.GetStaticMetadata().Name, rObj.GetStaticMetadata().Namespace, rObj.GetStaticMetadata().Kind)
|
||||
}
|
||||
|
||||
klog.InfoS("Added resource", "name", object.GetStaticMetadata().Identifier().Name)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Update handles update events for playlist.Playlist resources.
|
||||
func (s *PlaylistWatcher) Update(ctx context.Context, rOld resource.Object, rNew resource.Object) error {
|
||||
oldObject, ok := rOld.(*playlist.Playlist)
|
||||
if !ok {
|
||||
return fmt.Errorf("provided object is not of type *playlist.Playlist (name=%s, namespace=%s, kind=%s)",
|
||||
rOld.GetStaticMetadata().Name, rOld.GetStaticMetadata().Namespace, rOld.GetStaticMetadata().Kind)
|
||||
}
|
||||
|
||||
_, ok = rNew.(*playlist.Playlist)
|
||||
if !ok {
|
||||
return fmt.Errorf("provided object is not of type *playlist.Playlist (name=%s, namespace=%s, kind=%s)",
|
||||
rNew.GetStaticMetadata().Name, rNew.GetStaticMetadata().Namespace, rNew.GetStaticMetadata().Kind)
|
||||
}
|
||||
|
||||
klog.InfoS("Updated resource", "name", oldObject.GetStaticMetadata().Identifier().Name)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Delete handles delete events for playlist.Playlist resources.
|
||||
func (s *PlaylistWatcher) Delete(ctx context.Context, rObj resource.Object) error {
|
||||
object, ok := rObj.(*playlist.Playlist)
|
||||
if !ok {
|
||||
return fmt.Errorf("provided object is not of type *playlist.Playlist (name=%s, namespace=%s, kind=%s)",
|
||||
rObj.GetStaticMetadata().Name, rObj.GetStaticMetadata().Namespace, rObj.GetStaticMetadata().Kind)
|
||||
}
|
||||
|
||||
klog.InfoS("Deleted resource", "name", object.GetStaticMetadata().Identifier().Name)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Sync is not a standard resource.Watcher function, but is used when wrapping this watcher in an operator.OpinionatedWatcher.
|
||||
// It handles resources which MAY have been updated during an outage period where the watcher was not able to consume events.
|
||||
func (s *PlaylistWatcher) Sync(ctx context.Context, rObj resource.Object) error {
|
||||
object, ok := rObj.(*playlist.Playlist)
|
||||
if !ok {
|
||||
return fmt.Errorf("provided object is not of type *playlist.Playlist (name=%s, namespace=%s, kind=%s)",
|
||||
rObj.GetStaticMetadata().Name, rObj.GetStaticMetadata().Namespace, rObj.GetStaticMetadata().Kind)
|
||||
}
|
||||
|
||||
klog.InfoS("Possible resource update", "name", object.GetStaticMetadata().Identifier().Name)
|
||||
return nil
|
||||
}
|
||||
@@ -316,6 +316,9 @@ feedback_links_enabled = true
|
||||
# Static context that is being added to analytics events
|
||||
reporting_static_context =
|
||||
|
||||
# Logs interaction events to the browser javascript console, intended for development only
|
||||
browser_console_reporter = false
|
||||
|
||||
#################################### Security ############################
|
||||
[security]
|
||||
# disable creation of admin user on first start of grafana
|
||||
@@ -403,8 +406,9 @@ angular_support_enabled = false
|
||||
# The CSRF check will be executed even if the request has no login cookie.
|
||||
csrf_always_check = false
|
||||
|
||||
# Comma-separated list of plugins ids that won't be loaded inside the frontend sandbox
|
||||
disable_frontend_sandbox_for_plugins = grafana-incident-app
|
||||
# Comma-separated list of plugins ids that will be loaded inside the frontend sandbox
|
||||
# Currently behind the feature flag pluginsFrontendSandbox
|
||||
enable_frontend_sandbox_for_plugins =
|
||||
|
||||
# Comma-separated list of paths for POST/PUT URL in actions. Empty will allow anything that is not on the same origin
|
||||
actions_allow_post_url =
|
||||
@@ -553,7 +557,7 @@ token_expiration_day_limit =
|
||||
# Login cookie name
|
||||
login_cookie_name = grafana_session
|
||||
|
||||
# Disable usage of Grafana build-in login solution.
|
||||
# Disable usage of Grafana's built-in login solution.
|
||||
disable_login = false
|
||||
|
||||
# The maximum lifetime (duration) an authenticated user can be inactive before being required to login at next visit. Default is 7 days (7d). This setting should be expressed as a duration, e.g. 5m (minutes), 6h (hours), 10d (days), 2w (weeks), 1M (month). The lifetime resets at each successful token rotation (token_rotation_interval_minutes).
|
||||
@@ -622,6 +626,11 @@ id_response_header_namespaces = user api-key service-account
|
||||
# This feature currently **only supports single-organization deployments**
|
||||
managed_service_accounts_enabled = false
|
||||
|
||||
#################################### Passwordless Auth ###########################
|
||||
[auth.passwordless]
|
||||
enabled = false
|
||||
code_expiration = 20m
|
||||
|
||||
#################################### SSO Settings ###########################
|
||||
[sso_settings]
|
||||
# interval for reloading the SSO Settings from the database
|
||||
@@ -1125,6 +1134,9 @@ log_endpoint_requests_per_second_limit = 3
|
||||
# Max requests accepted per short interval of time for Grafana backend log ingestion endpoint (/log)
|
||||
log_endpoint_burst_limit = 15
|
||||
|
||||
# Enables all Faro default instrumentation by using `getWebInstrumentations`. Overrides other instrumentation flags.
|
||||
instrumentations_all_enabled = false
|
||||
|
||||
# Should error instrumentation be enabled, only affects Grafana Javascript Agent
|
||||
instrumentations_errors_enabled = true
|
||||
|
||||
@@ -1209,6 +1221,9 @@ enabled =
|
||||
# Comma-separated list of organization IDs for which to disable unified alerting. Only supported if unified alerting is enabled.
|
||||
disabled_orgs =
|
||||
|
||||
# Specify how long to wait for the alerting service to initialize
|
||||
initialization_timeout = 30s
|
||||
|
||||
# Specify the frequency of polling for admin config changes.
|
||||
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
|
||||
admin_config_poll_interval = 60s
|
||||
@@ -1559,7 +1574,8 @@ enabled = true
|
||||
|
||||
#################################### Short Links #############################
|
||||
[short_links]
|
||||
# Short links which are never accessed will be deleted as cleanup. Time is in days. Default is 7 days. Max is 365. 0 means they will be deleted approximately every 10 minutes.
|
||||
# Short links that are never accessed will be deleted as cleanup. Time is set up in days. The default is 7 days. Maximum value is 365.
|
||||
# 0 means they will be deleted approximately every 10 minutes. A negative value (such as -1) will disable expiration.
|
||||
expire_time = 7
|
||||
|
||||
#################################### Internal Grafana Metrics ############
|
||||
@@ -1745,7 +1761,8 @@ hide_angular_deprecation =
|
||||
# Comma separated list of plugin ids for which environment variables should be forwarded. Used only when feature flag pluginsSkipHostEnvVars is enabled.
|
||||
forward_host_env_vars =
|
||||
# Comma separated list of plugin ids to install as part of the startup process.
|
||||
preinstall = grafana-lokiexplore-app
|
||||
# By default, the following plugins will be preinstalled: "grafana-lokiexplore-app"
|
||||
preinstall =
|
||||
# Controls whether preinstall plugins asynchronously (in the background) or synchronously (blocking). Useful when preinstalled plugins are used with provisioning.
|
||||
preinstall_async = true
|
||||
# Disables preinstall feature. It has the same effect as setting preinstall to an empty list.
|
||||
|
||||
@@ -315,6 +315,9 @@
|
||||
# Static context that is being added to analytics events
|
||||
;reporting_static_context = grafanaInstance=12, os=linux
|
||||
|
||||
# Logs interaction events to the browser javascript console, intended for development only
|
||||
;browser_console_reporter = false
|
||||
|
||||
#################################### Security ####################################
|
||||
[security]
|
||||
# disable creation of admin user on first start of grafana
|
||||
@@ -408,8 +411,9 @@
|
||||
# The CSRF check will be executed even if the request has no login cookie.
|
||||
;csrf_always_check = false
|
||||
|
||||
# Comma-separated list of plugins ids that won't be loaded inside the frontend sandbox
|
||||
;disable_frontend_sandbox_for_plugins =
|
||||
# Comma-separated list of plugins ids that will be loaded inside the frontend sandbox
|
||||
# Currently behind the feature flag pluginsFrontendSandbox
|
||||
;enable_frontend_sandbox_for_plugins =
|
||||
|
||||
# Comma-separated list of paths for POST/PUT URL in actions. Empty will allow anything that is not on the same origin
|
||||
;actions_allow_post_url =
|
||||
@@ -1118,6 +1122,9 @@
|
||||
# Max requests accepted per short interval of time for Grafana backend log ingestion endpoint (/log).
|
||||
;log_endpoint_burst_limit = 15
|
||||
|
||||
# Enables all Faro default instrumentation by using `getWebInstrumentations`. Overrides other instrumentation flags.
|
||||
;instrumentations_all_enabled = false
|
||||
|
||||
# Should error instrumentation be enabled, only affects Grafana Javascript Agent
|
||||
;instrumentations_errors_enabled = true
|
||||
|
||||
@@ -1197,6 +1204,9 @@
|
||||
# Comma-separated list of organization IDs for which to disable unified alerting. Only supported if unified alerting is enabled.
|
||||
;disabled_orgs =
|
||||
|
||||
# Specify how long to wait for the alerting service to initialize
|
||||
;initialization_timeout = 30s
|
||||
|
||||
# Specify the frequency of polling for admin config changes.
|
||||
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
|
||||
;admin_config_poll_interval = 60s
|
||||
|
||||
@@ -81,7 +81,7 @@ host = "localhost:1025"
|
||||
You can access the web UI at http://localhost:12080/#/
|
||||
|
||||
## Debugging setup in VS Code
|
||||
An example of launch.json is provided in `devenv/vscode/launch.json`. It basically does what Makefile and .bra.toml do. The 'program' field is set to the folder name so VS Code loads all *.go files in it instead of just main.go.
|
||||
An example of launch.json is provided in `.vscode/launch.json`. It basically does what Makefile and .bra.toml do. The 'program' field is set to the folder name so VS Code loads all *.go files in it instead of just main.go.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
echo "Deleting previous bulk folders"
|
||||
find ./bulk-folders -type d -name "Bulk Folder*" -exec rm -rf "{}" \;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
blocks_dir=docker/blocks
|
||||
docker_dir=docker
|
||||
|
||||
@@ -321,3 +321,11 @@ datasources:
|
||||
access: proxy
|
||||
url: http://localhost:4040
|
||||
editable: false
|
||||
|
||||
|
||||
- name: gdev-e2etestdatasource
|
||||
type: grafana-e2etest-datasource
|
||||
uid: gdev-e2etest-datasource
|
||||
access: proxy
|
||||
url: http://localhost:4040
|
||||
editable: false
|
||||
|
||||
33
devenv/docker/blocks/caddy_tls/README.md
Normal file
33
devenv/docker/blocks/caddy_tls/README.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# TLS Caddy Server
|
||||
|
||||
Starts a [Caddy server](https://caddyserver.com/) with TLS configured.
|
||||
|
||||
## Setup
|
||||
|
||||
- Caddy is setup to run on port 2081, so when configuring the webhook receiver in Grafana Alerting you should use the
|
||||
following the following URL: `https://localhost:2081`
|
||||
- Also, Caddy is configured to use a self-signed certificate and to check the client certificate (`require_and_verify` mode)
|
||||
- Caddy is setup to log requests and has debug mode enabled to make it easier to investigate possible issues
|
||||
|
||||
## TLS Certificates
|
||||
|
||||
If you want to configure a webhook contact point in Grafana Alerting with TLS, you need to provide a certificate and key.
|
||||
|
||||
You can find them in `/etc/caddy` directory in the container:
|
||||
|
||||
``` shell
|
||||
docker exec devenv-caddy_tls-1 ls /etc/caddy/
|
||||
```
|
||||
|
||||
### CA Certificate
|
||||
|
||||
``` shell
|
||||
docker exec devenv-caddy_tls-1 cat /etc/caddy/ca.pem
|
||||
```
|
||||
|
||||
### Client certificates
|
||||
|
||||
``` shell
|
||||
docker exec devenv-caddy_tls-1 cat /etc/caddy/client.pem
|
||||
docker exec devenv-caddy_tls-1 cat /etc/caddy/client.key
|
||||
```
|
||||
14
devenv/docker/blocks/caddy_tls/build/Caddyfile
Normal file
14
devenv/docker/blocks/caddy_tls/build/Caddyfile
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
debug
|
||||
}
|
||||
|
||||
localhost:2081 {
|
||||
log
|
||||
tls /etc/caddy/server.pem /etc/caddy/server.key {
|
||||
ca_root /etc/caddy/ca.pem
|
||||
client_auth {
|
||||
mode require_and_verify
|
||||
trust_pool file /etc/caddy/client.pem /etc/caddy/ca.pem
|
||||
}
|
||||
}
|
||||
}
|
||||
12
devenv/docker/blocks/caddy_tls/build/Dockerfile
Normal file
12
devenv/docker/blocks/caddy_tls/build/Dockerfile
Normal file
@@ -0,0 +1,12 @@
|
||||
FROM caddy:2.8.4-alpine
|
||||
|
||||
WORKDIR /etc/caddy
|
||||
EXPOSE 2081
|
||||
|
||||
COPY Caddyfile ./Caddyfile
|
||||
COPY san.cnf ./san.cnf
|
||||
COPY gen_certs.sh ./gen_certs.sh
|
||||
|
||||
RUN apk update && apk upgrade --no-cache && apk add openssl
|
||||
|
||||
RUN ./gen_certs.sh
|
||||
17
devenv/docker/blocks/caddy_tls/build/gen_certs.sh
Executable file
17
devenv/docker/blocks/caddy_tls/build/gen_certs.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAYS_VALID=3650
|
||||
|
||||
# Create CA certificate
|
||||
openssl genpkey -algorithm RSA -out ca.key
|
||||
openssl req -new -x509 -days $DAYS_VALID -key ca.key -out ca.pem -subj "/CN=My CA"
|
||||
|
||||
# Create server certificate
|
||||
openssl genpkey -algorithm RSA -out server.key
|
||||
openssl req -new -key server.key -out server.csr -subj "/CN=localhost"
|
||||
openssl x509 -req -days $DAYS_VALID -in server.csr -CA ca.pem -CAkey ca.key -CAcreateserial -out server.pem -extfile san.cnf -extensions v3_req
|
||||
|
||||
# Create client key and certificate
|
||||
openssl genpkey -algorithm RSA -out client.key
|
||||
openssl req -new -key client.key -out client.csr -subj "/CN=Client"
|
||||
openssl x509 -req -days $DAYS_VALID -in client.csr -CA ca.pem -CAkey ca.key -CAcreateserial -out client.pem -extfile san.cnf -extensions v3_req
|
||||
7
devenv/docker/blocks/caddy_tls/build/san.cnf
Normal file
7
devenv/docker/blocks/caddy_tls/build/san.cnf
Normal file
@@ -0,0 +1,7 @@
|
||||
[ v3_req ]
|
||||
subjectAltName = @alt_names
|
||||
|
||||
[ alt_names ]
|
||||
DNS.1 = localhost
|
||||
IP.1 = 127.0.0.1
|
||||
IP.2 = ::1
|
||||
5
devenv/docker/blocks/caddy_tls/docker-compose.yaml
Normal file
5
devenv/docker/blocks/caddy_tls/docker-compose.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
caddy_tls:
|
||||
build:
|
||||
context: docker/blocks/caddy_tls/build
|
||||
ports:
|
||||
- "2081:2081"
|
||||
@@ -150,7 +150,8 @@ function getRandomLogItem(counter, timestamp) {
|
||||
value: counter,
|
||||
metric: chooseRandomElement(['cpu', 'memory', 'latency']),
|
||||
description: "this is description",
|
||||
slash: "Access to the path '\\\\tkasnpo\\KASNPO\\Files\\contacts.xml' is denied."
|
||||
slash: "Access to the path '\\\\tkasnpo\\KASNPO\\Files\\contacts.xml' is denied.",
|
||||
url: "/foo/blah"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
mimir_backend:
|
||||
image: grafana/mimir-alpine:r304-3872ccb
|
||||
image: grafana/mimir-alpine:r316-55f47f8
|
||||
container_name: mimir_backend
|
||||
command:
|
||||
- -target=backend
|
||||
- -alertmanager.grafana-alertmanager-compatibility-enabled
|
||||
- -alertmanager.utf8-strict-mode-enabled
|
||||
nginx:
|
||||
environment:
|
||||
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
|
||||
|
||||
24
devenv/local_cdn/default.conf
Normal file
24
devenv/local_cdn/default.conf
Normal file
@@ -0,0 +1,24 @@
|
||||
server {
|
||||
root /data;
|
||||
autoindex on;
|
||||
|
||||
location / {
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
add_header 'Access-Control-Allow-Headers' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' '*';
|
||||
# add_header 'Access-Control-Max-Age' 1728000;
|
||||
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||
add_header 'Content-Length' 0;
|
||||
return 204;
|
||||
}
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
|
||||
add_header 'Access-Control-Allow-Methods' '*' always;
|
||||
add_header 'Access-Control-Allow-Headers' '*' always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
|
||||
rewrite ^/grafana-oss/11.4.0-pre/public(.*)$ $1 last;
|
||||
}
|
||||
}
|
||||
11
devenv/local_cdn/docker-compose.yaml
Normal file
11
devenv/local_cdn/docker-compose.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
grafana_local_cdn:
|
||||
image: nginx:alpine
|
||||
container_name: grafana_local_cdn
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ../../public:/data
|
||||
- ./default.conf:/etc/nginx/conf.d/default.conf
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
bulkDashboard() {
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "grafana-server",
|
||||
"type": "go",
|
||||
"request": "launch",
|
||||
"mode": "auto",
|
||||
"program": "${workspaceFolder}/pkg/cmd/grafana-server",
|
||||
"env": {},
|
||||
"args": [
|
||||
"--homepath=${workspaceFolder}",
|
||||
"--packaging=dev",
|
||||
"cfg:app_mode=development",
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -234,7 +234,7 @@ To determine the number of active users:
|
||||
|
||||
A tiered license defines dashboard viewers, and dashboard editors and administrators, as two distinct user types that each have their own user limit.
|
||||
|
||||
As of Grafana Enterprise version 9.0, Grafana only counts and enforces the _total_ number of active users in your Grafana instance. For example, if you purchase 150 active users, you can have 20 admins, 70 editors, and 60 viewers, or you can have 150 admins. Grafana will enforce the total number of active users even if you use a license that grants a specific number of admins or editors and a certain number of viewers. This is a more permissive policy than before, which gives you the flexibility to change users' roles.
|
||||
Grafana only counts and enforces the _total_ number of active users in your Grafana instance. For example, if you purchase 150 active users, you can have 20 admins, 70 editors, and 60 viewers, or you can have 150 admins. Grafana will enforce the total number of active users even if you use a license that grants a specific number of admins or editors and a certain number of viewers. This is a more permissive policy than before, which gives you the flexibility to change users' roles.
|
||||
|
||||
If you are running a pre-9.0 version of Grafana Enterprise, please refer to the documentation for that version to learn more about license enforcement in your current version.
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ To activate your license, complete the following tasks.
|
||||
|
||||
For more information about deploying an application on Amazon ECS, refer to [Creating an Amazon ECS service](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-service.html).
|
||||
|
||||
1. As you create the Amazon ECS service, use the Grafana Enterprise version 8.3.0 or later container image.
|
||||
1. As you create the Amazon ECS service, use the intended Grafana Enterprise container image version.
|
||||
|
||||
For example, enter `grafana/grafana-enterprise:8.3.3`.
|
||||
For example, enter `grafana/grafana-enterprise:11.3.0`.
|
||||
|
||||
> Only Grafana Enterprise versions 8.3.0 and later support licenses granted through AWS Marketplace.
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ weight: 200
|
||||
|
||||
# Activate a Grafana Enterprise license from AWS Marketplace on EKS
|
||||
|
||||
If you have purchased a Grafana Enterprise subscription through AWS Marketplace, you must activate it in order to use Grafana Enterprise data source plugins and features in Grafana.
|
||||
If you have purchased a Grafana Enterprise subscription through AWS Marketplace, you must activate it to use Grafana Enterprise data source plugins and features in Grafana.
|
||||
|
||||
## Before you begin:
|
||||
|
||||
@@ -37,9 +37,9 @@ To activate your license, complete the following tasks:
|
||||
|
||||
For more information about installing Grafana on Kubernetes using the Helm Chart, refer to the [Grafana Helm Chart](https://github.com/grafana/helm-charts/tree/main/charts/grafana#readme).
|
||||
|
||||
1. Use `kubectl set image deployment/my-release grafana=grafana/grafana-enterprise:<version>` to update the container image to Grafana Enterprise version 8.3.0 or later.
|
||||
1. Use `kubectl set image deployment/my-release grafana=grafana/grafana-enterprise:<version>` to update the container image.
|
||||
|
||||
For example, enter `grafana/grafana-enterprise:8.3.3`.
|
||||
For example, enter `grafana/grafana-enterprise:11.3.0`.
|
||||
|
||||
> Only Grafana Enterprise versions 8.3.0 and later support licenses granted through AWS Marketplace.
|
||||
|
||||
|
||||
@@ -228,6 +228,58 @@ WARN[06-01|16:45:59] Running an unsigned plugin pluginID=<plugin id>
|
||||
If you're developing a plugin, then you can enable development mode to allow all unsigned plugins.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Plugin Frontend Sandbox
|
||||
|
||||
{{% admonition type="caution" %}}
|
||||
Plugin Frontend Sandbox is currently in [public preview](/docs/release-life-cycle/). Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.
|
||||
{{% /admonition %}}
|
||||
|
||||
The Plugin Frontend Sandbox is a security feature that isolates plugin frontend code from the main Grafana application.
|
||||
When enabled, plugins run in a separate JavaScript context, which provides several security benefits:
|
||||
|
||||
- Prevents plugins from modifying parts of the Grafana interface outside their designated areas
|
||||
- Stops plugins from interfering with other plugins functionality
|
||||
- Protects core Grafana features from being altered by plugins
|
||||
- Prevents plugins from modifying global browser objects and behaviors
|
||||
|
||||
Plugins running inside the Frontend Sandbox should continue to work normally without any noticeable changes in their intended functionality.
|
||||
|
||||
### Enable Frontend Sandbox
|
||||
|
||||
The Frontend Sandbox feature is currently behind the `pluginsFrontendSandbox` feature flag. To enable it, you'll need to:
|
||||
|
||||
1. Enable the feature flag in your Grafana configuration. For more information about enabling feature flags, refer to [Configure feature toggles](/setup-grafana/configure-grafana/feature-toggles/).
|
||||
|
||||
2. For self-hosted Grafana installations, add the plugin IDs you want to sandbox in the `security` section using the `enable_frontend_sandbox_for_plugins` configuration option.
|
||||
|
||||
For Grafana Cloud users, you can simply use the toggle switch in the plugin catalog page to enable or disable the sandbox for each plugin. By default, the sandbox is disabled for all plugins.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Enabling the Frontend Sandbox might impact the performance of certain plugins. Only disable the sandbox if you fully trust the plugin and understand the security implications.
|
||||
{{% /admonition %}}
|
||||
|
||||
### Compatibility
|
||||
|
||||
The Frontend Sandbox is available in public preview in Grafana >=11.4. It is compatible with all types of plugins including app plugins, panel plugins, and data source plugins. Angular-based plugins are not supported. Plugins developed and signed by Grafana Labs are excluded and cannot be sandboxed.
|
||||
|
||||
### When to Use Frontend Sandbox
|
||||
|
||||
We strongly recommend enabling the Frontend Sandbox for plugins that allow users to write custom JavaScript code for data visualization or manipulation. These plugins, while powerful, can potentially execute arbitrary JavaScript code in your Grafana instance. The sandbox provides an additional layer of security by restricting what this code can access and modify.
|
||||
|
||||
Examples of plugins where the sandbox is particularly important include:
|
||||
|
||||
- Panel plugins that allow users to write custom JavaScript code
|
||||
- Plugins from untrusted sources
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
If a plugin isn't functioning correctly with the Frontend Sandbox enabled:
|
||||
|
||||
1. Temporarily disable the sandbox for that specific plugin
|
||||
1. Test if the plugin works correctly without the sandbox
|
||||
1. If the plugin only works with the sandbox disabled, ensure you trust the plugin source before continuing to use it without sandbox protection
|
||||
1. Report any sandbox-related issues to the plugin developer
|
||||
|
||||
## Learn more
|
||||
|
||||
- [Browse plugins](/grafana/plugins)
|
||||
|
||||
@@ -73,7 +73,7 @@ Therefore, we heavily rely on the expertise of the community.
|
||||
|
||||
## Data sources
|
||||
|
||||
You can manage data sources in Grafana by adding YAML configuration files in the [`provisioning/data sources`]({{< relref "../../setup-grafana/configure-grafana#provisioning" >}}) directory.
|
||||
You can manage data sources in Grafana by adding YAML configuration files in the [`provisioning/datasources`]({{< relref "../../setup-grafana/configure-grafana#provisioning" >}}) directory.
|
||||
Each configuration file can contain a list of `datasources` to add or update during startup.
|
||||
If the data source already exists, Grafana reconfigures it to match the provisioned configuration file.
|
||||
|
||||
@@ -81,13 +81,9 @@ The configuration file can also list data sources to automatically delete, calle
|
||||
Grafana deletes the data sources listed in `deleteDatasources` _before_ adding or updating those in the `datasources` list.
|
||||
|
||||
You can configure Grafana to automatically delete provisioned data sources when they're removed from the provisioning file.
|
||||
To do so, add `prune: true` to the root of your provisioning file.
|
||||
To do so, add `prune: true` to the root of your data source provisioning file.
|
||||
With this configuration, Grafana also removes the provisioned data sources if you remove the provisioning file entirely.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
The `prune` parameter is available in Grafana v11.1 and higher.
|
||||
{{< /admonition >}}
|
||||
|
||||
### Running multiple Grafana instances
|
||||
|
||||
If you run multiple instances of Grafana, add a version number to each data source in the configuration and increase it when you update the configuration.
|
||||
@@ -231,9 +227,9 @@ Data sources tagged with _HTTP\*_ communicate using the HTTP protocol, which inc
|
||||
| encrypt | string | MSSQL | Determines SSL encryption handling. Options include: `disable` - data sent between client and server is not encrypted; `false` - data sent between client and server is not encrypted beyond the login packet; `true` - data sent between client and server is encrypted. Default is `false`. |
|
||||
| postgresVersion | number | PostgreSQL | Postgres version as a number (903/904/905/906/1000) meaning v9.3, v9.4, ..., v10 |
|
||||
| timescaledb | boolean | PostgreSQL | Enable usage of TimescaleDB extension |
|
||||
| maxOpenConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of open connections to the database (Grafana v5.4+) |
|
||||
| maxIdleConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of connections in the idle connection pool (Grafana v5.4+) |
|
||||
| connMaxLifetime | number | MySQL, PostgreSQL and MSSQL | Maximum amount of time in seconds a connection may be reused (Grafana v5.4+) |
|
||||
| maxOpenConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of open connections to the database |
|
||||
| maxIdleConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of connections in the idle connection pool |
|
||||
| connMaxLifetime | number | MySQL, PostgreSQL and MSSQL | Maximum amount of time in seconds a connection may be reused |
|
||||
| keepCookies | array | _HTTP\*_ | Cookies that needs to be passed along while communicating with data sources |
|
||||
| prometheusVersion | string | Prometheus | The version of the Prometheus data source, such as `2.37.0`, `2.24.0` |
|
||||
| prometheusType | string | Prometheus | Prometheus database type. Options are `Prometheus`, `Cortex`, `Mimir` or`Thanos`. |
|
||||
@@ -257,17 +253,17 @@ All of these settings are optional.
|
||||
The _HTTP\*_ tag denotes data sources that communicate using the HTTP protocol, including all core data source plugins except MySQL, PostgreSQL, and MS SQL.
|
||||
{{< /admonition >}}
|
||||
|
||||
| Name | Type | Data source | Description |
|
||||
| ----------------- | ------ | ---------------------------------- | -------------------------------------------------------- |
|
||||
| tlsCACert | string | _HTTP\*_, MySQL, PostgreSQL | CA cert for out going requests |
|
||||
| tlsClientCert | string | _HTTP\*_, MySQL, PostgreSQL | TLS Client cert for outgoing requests |
|
||||
| tlsClientKey | string | _HTTP\*_, MySQL, PostgreSQL | TLS Client key for outgoing requests |
|
||||
| password | string | _HTTP\*_, MySQL, PostgreSQL, MSSQL | password |
|
||||
| basicAuthPassword | string | _HTTP\*_ | password for basic authentication |
|
||||
| accessKey | string | Cloudwatch | Access key for connecting to Cloudwatch |
|
||||
| secretKey | string | Cloudwatch | Secret key for connecting to Cloudwatch |
|
||||
| sigV4AccessKey | string | Elasticsearch and Prometheus | SigV4 access key. Required when using keys auth provider |
|
||||
| sigV4SecretKey | string | Elasticsearch and Prometheus | SigV4 secret key. Required when using keys auth provider |
|
||||
| Name | Type | Data source | Description |
|
||||
| ----------------- | ------ | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| tlsCACert | string | _HTTP\*_, MySQL, PostgreSQL | CA cert for out going requests. You can point directly to your stored cert by using an environment variable following the `$__file{path/to/ca}` format. |
|
||||
| tlsClientCert | string | _HTTP\*_, MySQL, PostgreSQL | TLS Client cert for outgoing requests. You can point directly to your stored cert by using an environment variable following the `$__file{path/to/cert}` format. |
|
||||
| tlsClientKey | string | _HTTP\*_, MySQL, PostgreSQL | TLS Client key for outgoing requests. You can point directly to your stored key by using an environment variable following the `$__file{path/to/key}` format. |
|
||||
| password | string | _HTTP\*_, MySQL, PostgreSQL, MSSQL | password |
|
||||
| basicAuthPassword | string | _HTTP\*_ | password for basic authentication |
|
||||
| accessKey | string | Cloudwatch | Access key for connecting to Cloudwatch |
|
||||
| secretKey | string | Cloudwatch | Secret key for connecting to Cloudwatch |
|
||||
| sigV4AccessKey | string | Elasticsearch and Prometheus | SigV4 access key. Required when using keys auth provider |
|
||||
| sigV4SecretKey | string | Elasticsearch and Prometheus | SigV4 secret key. Required when using keys auth provider |
|
||||
|
||||
#### Custom HTTP headers for data sources
|
||||
|
||||
@@ -618,12 +614,22 @@ The following sections detail the supported settings and secure settings for eac
|
||||
|
||||
#### Alert notification `webhook`
|
||||
|
||||
| Name | Secure setting |
|
||||
| ---------- | -------------- |
|
||||
| url | |
|
||||
| httpMethod | |
|
||||
| username | |
|
||||
| password | yes |
|
||||
| Name | Secure setting |
|
||||
| ----------- | -------------- |
|
||||
| url | |
|
||||
| http_method | |
|
||||
| username | |
|
||||
| password | yes |
|
||||
| tls_config | |
|
||||
|
||||
##### TLS config
|
||||
|
||||
| Name | Secure setting |
|
||||
| ------------------ | -------------- |
|
||||
| insecureSkipVerify | |
|
||||
| clientCertificate | yes |
|
||||
| clientKey | yes |
|
||||
| caCertificate | yes |
|
||||
|
||||
#### Alert notification `googlechat`
|
||||
|
||||
|
||||
@@ -100,6 +100,8 @@ The following list contains role-based access control actions.
|
||||
| `folders:delete` | <ul><li>`folders:*`</li><li>`folders:uid:*`</li></ul> | Delete one or more folders and their subfolders. |
|
||||
| `folders:read` | <ul><li>`folders:*`</li><li>`folders:uid:*`</li></ul> | Read one or more folders and their subfolders. |
|
||||
| `folders:write` | <ul><li>`folders:*`</li><li>`folders:uid:*`</li></ul> | Update one or more folders and their subfolders. |
|
||||
| `groupsync.mappings:read` | None | List group attribute sync mappings. To use this permission, enable the `groupAttributeSync` feature toggle. |
|
||||
| `groupsync.mappings:write` | None | List, create, update, and delete group attribute sync mappings. To use this permission, enable the `groupAttributeSync` feature toggle. |
|
||||
| `ldap.config:reload` | None | Reload the LDAP configuration. |
|
||||
| `ldap.status:read` | None | Verify the availability of the LDAP server or servers. |
|
||||
| `ldap.user:read` | None | Read users via LDAP. |
|
||||
@@ -188,16 +190,38 @@ The following list contains role-based access control actions used by Grafana Ad
|
||||
|
||||
| Action | Applicable scopes | Description |
|
||||
| ---------------------------------------------------- | ----------------- | ----------------------------------------------------- |
|
||||
| `grafana‑adaptive‑metrics‑app.plugin:access` | None | Access the Adaptive Metrics plugin in Grafana Cloud. |
|
||||
| `grafana‑adaptive‑metrics‑app.config:read` | None | Read the Adaptive Metrics app configuration. |
|
||||
| `grafana‑adaptive‑metrics‑app.config:write` | None | Update the Adaptive Metrics app configuration. |
|
||||
| `grafana‑adaptive‑metrics‑app.recommendations:read` | None | Read aggregation recommendations. |
|
||||
| `grafana‑adaptive‑metrics‑app.recommendations:apply` | None | Apply aggregation recommendations. |
|
||||
| `grafana‑adaptive‑metrics‑app.rules:read` | None | Read aggregation rules. |
|
||||
| `grafana‑adaptive‑metrics‑app.rules:write` | None | Create aggregation rules. |
|
||||
| `grafana‑adaptive‑metrics‑app.rules:delete` | None | Delete aggregation rules. |
|
||||
| `grafana‑adaptive‑metrics‑app.exemptions:read` | None | Read recommendation exemptions. |
|
||||
| `grafana‑adaptive‑metrics‑app.exemptions:write` | None | Create, update, and delete recommendation exemptions. |
|
||||
| `grafana-adaptive-metrics-app.plugin:access` | None | Access the Adaptive Metrics plugin in Grafana Cloud. |
|
||||
| `grafana-adaptive-metrics-app.config:read` | None | Read the Adaptive Metrics app configuration. |
|
||||
| `grafana-adaptive-metrics-app.config:write` | None | Update the Adaptive Metrics app configuration. |
|
||||
| `grafana-adaptive-metrics-app.recommendations:read` | None | Read aggregation recommendations. |
|
||||
| `grafana-adaptive-metrics-app.recommendations:apply` | None | Apply aggregation recommendations. |
|
||||
| `grafana-adaptive-metrics-app.rules:read` | None | Read aggregation rules. |
|
||||
| `grafana-adaptive-metrics-app.rules:write` | None | Create aggregation rules. |
|
||||
| `grafana-adaptive-metrics-app.rules:delete` | None | Delete aggregation rules. |
|
||||
| `grafana-adaptive-metrics-app.exemptions:read` | None | Read recommendation exemptions. |
|
||||
| `grafana-adaptive-metrics-app.exemptions:write` | None | Create, update, and delete recommendation exemptions. |
|
||||
|
||||
### Grafana Alerting Notification action definitions
|
||||
|
||||
To use these permissions, enable the `alertingApiServer` feature toggle.
|
||||
|
||||
| Action | Applicable scopes | Description |
|
||||
| -------------------------------------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
||||
| `alert.notifications.receivers:read` | `receivers:*`<br>`receivers:uid:*` | Read contact points. |
|
||||
| `alert.notifications.receivers.secrets:read` | `receivers:*`<br>`receivers:uid:*` | Export contact points with decrypted secrets. |
|
||||
| `alert.notifications.receivers:create` | None | Create a new contact points. The creator is automatically granted full access to the created contact point. |
|
||||
| `alert.notifications.receivers:write` | `receivers:*`<br>`receivers:uid:*` | Update existing contact points. |
|
||||
| `alert.notifications.receivers:delete` | `receivers:*`<br>`receivers:uid:*` | Update and delete existing contact points. |
|
||||
| `receivers.permissions:read` | `receivers:*`<br>`receivers:uid:*` | Read permissions for contact points. |
|
||||
| `receivers.permissions:write` | `receivers:*`<br>`receivers:uid:*` | Manage permissions for contact points. |
|
||||
| `alert.notifications.time-intervals:read` | None | Read mute time intervals. |
|
||||
| `alert.notifications.time-intervals:write` | None | Create new or update existing mute time intervals. |
|
||||
| `alert.notifications.time-intervals:delete` | None | Delete existing time intervals. |
|
||||
| `alert.notifications.templates:read` | None | Read templates. |
|
||||
| `alert.notifications.templates:write` | None | Create new or update existing templates. |
|
||||
| `alert.notifications.templates:delete` | None | Delete existing templates. |
|
||||
| `alert.notifications.routes:read` | None | Read notification policies. |
|
||||
| `alert.notifications.routes:write` | None | Create new, update or delete notification policies |
|
||||
|
||||
## Scope definitions
|
||||
|
||||
|
||||
@@ -54,13 +54,13 @@ The following tables list permissions associated with basic and fixed roles.
|
||||
|
||||
## Basic role assignments
|
||||
|
||||
| Basic role | UID | Associated fixed roles | Description |
|
||||
| ------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Grafana Admin | `basic_grafana_admin` | `fixed:roles:reader`<br>`fixed:roles:writer`<br>`fixed:users:reader`<br>`fixed:users:writer`<br>`fixed:org.users:reader`<br>`fixed:org.users:writer`<br>`fixed:ldap:reader`<br>`fixed:ldap:writer`<br>`fixed:stats:reader`<br>`fixed:settings:reader`<br>`fixed:settings:writer`<br>`fixed:provisioning:writer`<br>`fixed:organization:reader`<br>`fixed:organization:maintainer`<br>`fixed:licensing:reader`<br>`fixed:licensing:writer`<br>`fixed:datasources.caching:reader`<br>`fixed:datasources.caching:writer`<br>`fixed:dashboards.insights:reader`<br>`fixed:datasources.insights:reader`<br>`fixed:plugins:maintainer`<br>`fixed:authentication.config:writer`<br>`fixed:library.panels:creator`<br>`fixed:library.panels:reader`<br>`fixed:library.panels:general.reader`<br>`fixed:library.panels:writer`<br>`fixed:library.panels:general.writer` | Default [Grafana server administrator](/docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/#grafana-server-administrators) assignments. |
|
||||
| Admin | `basic_admin` | `fixed:reports:reader`<br>`fixed:reports:writer`<br>`fixed:datasources:reader`<br>`fixed:datasources:writer`<br>`fixed:organization:writer`<br>`fixed:datasources.permissions:reader`<br>`fixed:datasources.permissions:writer`<br>`fixed:teams:writer`<br>`fixed:dashboards:reader`<br>`fixed:dashboards:writer`<br>`fixed:dashboards.permissions:reader`<br>`fixed:dashboards.permissions:writer`<br>`fixed:dashboards.public:writer`<br>`fixed:folders:reader`<br>`fixed:folders:writer`<br>`fixed:folders.permissions:reader`<br>`fixed:folders.permissions:writer`<br>`fixed:alerting:writer`<br>`fixed:apikeys:reader`<br>`fixed:apikeys:writer`<br>`fixed:alerting.provisioning.secrets:reader`<br>`fixed:alerting.provisioning:writer`<br>`fixed:datasources.caching:reader`<br>`fixed:datasources.caching:writer`<br>`fixed:dashboards.insights:reader`<br>`fixed:datasources.insights:reader`<br>`fixed:plugins:writer`<br>`fixed:library.panels:creator`<br>`fixed:library.panels:reader`<br>`fixed:library.panels:general.reader`<br>`fixed:library.panels:writer`<br>`fixed:library.panels:general.writer`<br>`fixed:alerting.provisioning.status:writer` | Default [Grafana organization administrator](ref:rbac-basic-roles) assignments. |
|
||||
| Editor | `basic_editor` | `fixed:datasources:explorer`<br>`fixed:dashboards:creator`<br>`fixed:folders:creator`<br>`fixed:annotations:writer`<br>`fixed:teams:creator` if the `editors_can_admin` configuration flag is enabled<br>`fixed:alerting:writer`<br>`fixed:dashboards.insights:reader`<br>`fixed:datasources.insights:reader`<br>`fixed:library.panels:creator`<br>`fixed:library.panels:general.reader`<br>`fixed:library.panels:general.writer`<br>`fixed:alerting.provisioning.status:writer` | Default [Editor](ref:rbac-basic-roles) assignments. |
|
||||
| Viewer | `basic_viewer` | `fixed:datasources.id:reader`<br>`fixed:organization:reader`<br>`fixed:annotations:reader`<br>`fixed:annotations.dashboard:writer`<br>`fixed:alerting:reader`<br>`fixed:plugins.app:reader`<br>`fixed:dashboards.insights:reader`<br>`fixed:datasources.insights:reader`<br>`fixed:library.panels:general.reader`<br>`fixed:datasources:explorer` if the `viewers_can_edit` configuration flag is enabled | Default [Viewer](ref:rbac-basic-roles) assignments. |
|
||||
| No Basic Role | n/a | | Default [No Basic Role](ref:rbac-basic-roles) |
|
||||
| Basic role | UID | Associated fixed roles | Description |
|
||||
| ------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Grafana Admin | `basic_grafana_admin` | `fixed:roles:reader`<br>`fixed:roles:writer`<br>`fixed:users:reader`<br>`fixed:users:writer`<br>`fixed:org.users:reader`<br>`fixed:org.users:writer`<br>`fixed:ldap:reader`<br>`fixed:ldap:writer`<br>`fixed:stats:reader`<br>`fixed:settings:reader`<br>`fixed:settings:writer`<br>`fixed:provisioning:writer`<br>`fixed:organization:reader`<br>`fixed:organization:maintainer`<br>`fixed:licensing:reader`<br>`fixed:licensing:writer`<br>`fixed:datasources.caching:reader`<br>`fixed:datasources.caching:writer`<br>`fixed:dashboards.insights:reader`<br>`fixed:datasources.insights:reader`<br>`fixed:plugins:maintainer`<br>`fixed:authentication.config:writer`<br>`fixed:library.panels:creator`<br>`fixed:library.panels:reader`<br>`fixed:library.panels:general.reader`<br>`fixed:library.panels:writer`<br>`fixed:library.panels:general.writer`<br>`fixed:groupsync:writer` | Default [Grafana server administrator](/docs/grafana/<GRAFANA_VERSION>/administration/roles-and-permissions/#grafana-server-administrators) assignments. |
|
||||
| Admin | `basic_admin` | `fixed:reports:reader`<br>`fixed:reports:writer`<br>`fixed:datasources:reader`<br>`fixed:datasources:writer`<br>`fixed:organization:writer`<br>`fixed:datasources.permissions:reader`<br>`fixed:datasources.permissions:writer`<br>`fixed:teams:writer`<br>`fixed:dashboards:reader`<br>`fixed:dashboards:writer`<br>`fixed:dashboards.permissions:reader`<br>`fixed:dashboards.permissions:writer`<br>`fixed:dashboards.public:writer`<br>`fixed:folders:reader`<br>`fixed:folders:writer`<br>`fixed:folders.permissions:reader`<br>`fixed:folders.permissions:writer`<br>`fixed:alerting:writer`<br>`fixed:apikeys:reader`<br>`fixed:apikeys:writer`<br>`fixed:alerting.provisioning.secrets:reader`<br>`fixed:alerting.provisioning:writer`<br>`fixed:datasources.caching:reader`<br>`fixed:datasources.caching:writer`<br>`fixed:dashboards.insights:reader`<br>`fixed:datasources.insights:reader`<br>`fixed:plugins:writer`<br>`fixed:library.panels:creator`<br>`fixed:library.panels:reader`<br>`fixed:library.panels:general.reader`<br>`fixed:library.panels:writer`<br>`fixed:library.panels:general.writer`<br>`fixed:alerting.provisioning.status:writer`<br>`fixed:groupsync:writer` | Default [Grafana organization administrator](ref:rbac-basic-roles) assignments. |
|
||||
| Editor | `basic_editor` | `fixed:datasources:explorer`<br>`fixed:dashboards:creator`<br>`fixed:folders:creator`<br>`fixed:annotations:writer`<br>`fixed:teams:creator` if the `editors_can_admin` configuration flag is enabled<br>`fixed:alerting:writer`<br>`fixed:dashboards.insights:reader`<br>`fixed:datasources.insights:reader`<br>`fixed:library.panels:creator`<br>`fixed:library.panels:general.reader`<br>`fixed:library.panels:general.writer`<br>`fixed:alerting.provisioning.status:writer` | Default [Editor](ref:rbac-basic-roles) assignments. |
|
||||
| Viewer | `basic_viewer` | `fixed:datasources.id:reader`<br>`fixed:organization:reader`<br>`fixed:annotations:reader`<br>`fixed:annotations.dashboard:writer`<br>`fixed:alerting:reader`<br>`fixed:plugins.app:reader`<br>`fixed:dashboards.insights:reader`<br>`fixed:datasources.insights:reader`<br>`fixed:library.panels:general.reader`<br>`fixed:datasources:explorer` if the `viewers_can_edit` configuration flag is enabled | Default [Viewer](ref:rbac-basic-roles) assignments. |
|
||||
| No Basic Role | n/a | | Default [No Basic Role](ref:rbac-basic-roles) |
|
||||
|
||||
## Fixed role definitions
|
||||
|
||||
@@ -115,6 +115,8 @@ To learn how to use the roles API to determine the role UUIDs, refer to [Manage
|
||||
| `fixed:folders.permissions:reader` | `fixed_E06l4cx0JFm47EeLBE4nmv3pnSo` | `folders.permissions:read` | Read all folder permissions. |
|
||||
| `fixed:folders.permissions:writer` | `fixed_3GAgpQ_hWG8o7-lwNb86_VB37eI` | All permissions from `fixed:folders.permissions:reader` and <br>`folders.permissions:write` | Read and update all folder permissions. |
|
||||
| `fixed:ldap:reader` | `fixed_lMcOPwSkxKY-qCK8NMJc5k6izLE` | `ldap.user:read`<br>`ldap.status:read` | Read the LDAP configuration and LDAP status information. |
|
||||
| `fixed:groupsync:reader` | `fixed_tLIbDrE6kw93sKqooF8GVS9BF4E` | `groupsync.mappings:read` | List all group attribute sync mappings. To use this role, enable the `groupAttributeSync` feature toggle. |
|
||||
| `fixed:groupsync:writer` | `fixed_q7XUYx_efzxxsVmWhQgpiYClwBs` | `groupsync.mappings:read`<br>`groupsync.mappings:write` | Create, read, update, and delete all group attribute sync mappings. To use this role, enable the `groupAttributeSync` feature toggle. |
|
||||
| `fixed:ldap:writer` | `fixed_p6AvnU4GCQyIh7-hbwI-bk3GYnU` | All permissions from `fixed:ldap:reader` and <br>`ldap.user:sync`<br>`ldap.config:reload` | Read and update the LDAP configuration, and read LDAP status information. |
|
||||
| `fixed:library.panels:creator` | `fixed_6eX6ItfegCIY5zLmPqTDW8ZV7KY` | `library.panels:create`<br>`folders:read` | Create library panel at the root level. |
|
||||
| `fixed:library.panels:general.reader` | `fixed_ct0DghiBWR_2BiQm3EvNPDVmpio` | `library.panels:read` | Read all library panels at the root level. |
|
||||
|
||||
@@ -27,7 +27,7 @@ filters = accesscontrol:debug accesscontrol.evaluator:debug dashboard.permission
|
||||
## Enable audit logging
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise](/docs/grafana/<GRAFANA_VERSION>/introduction/grafana-enterprise/) version 7.3 and later, and [Grafana Cloud](/docs/grafana-cloud).
|
||||
Available in [Grafana Enterprise](/docs/grafana/<GRAFANA_VERSION>/introduction/grafana-enterprise/) and [Grafana Cloud](/docs/grafana-cloud).
|
||||
{{% /admonition %}}
|
||||
|
||||
You can enable auditing in the Grafana configuration file.
|
||||
|
||||
@@ -27,10 +27,6 @@ cards:
|
||||
href: ./fundamentals/
|
||||
description: Learn more about the fundamentals and available features that help you create, manage, and respond to alerts; and improve your team’s ability to resolve issues quickly.
|
||||
height: 24
|
||||
- title: Set up
|
||||
href: ./set-up/
|
||||
description: Set up your implementation of Grafana Alerting.
|
||||
height: 24
|
||||
- title: Configure alert rules
|
||||
href: ./alerting-rules/
|
||||
description: Create, manage, view, and adjust alert rules to alert on your metrics data or log entries from multiple data sources — no matter where your data is stored.
|
||||
@@ -39,13 +35,13 @@ cards:
|
||||
href: ./configure-notifications/
|
||||
description: Choose how, when, and where to send your alert notifications.
|
||||
height: 24
|
||||
- title: Detect and respond
|
||||
- title: Monitor status
|
||||
href: ./manage-notifications/
|
||||
description: Monitor, respond to, and triage issues within your services.
|
||||
height: 24
|
||||
- title: Monitor
|
||||
href: ./monitor/
|
||||
description: Monitor your alerting metrics to ensure you identify potential issues before they become critical.
|
||||
- title: Additional configuration
|
||||
href: ./set-up/
|
||||
description: Use advanced configuration options to further tailor your alerting setup. These options can enhance security, scalability, and automation in complex environments.
|
||||
height: 24
|
||||
---
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
---
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-alerts-panels/
|
||||
description: Create alert rules from panels. Reuse the queries in the panel and create alert rules based on them.
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- panels
|
||||
- create
|
||||
- grafana-managed
|
||||
- data source-managed
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Create alert rules from panels
|
||||
weight: 400
|
||||
---
|
||||
|
||||
## Create alert rules from panels
|
||||
|
||||
Create alert rules from time series panels. By doing so, you can reuse the queries in the panel and create alert rules based on them.
|
||||
|
||||
1. Navigate to a dashboard in the **Dashboards** section.
|
||||
2. Hover over the top-right corner of a time series panel and click the panel menu icon.
|
||||
3. From the dropdown menu, select **More...** > **New alert rule**.
|
||||
|
||||
The New alert rule form opens where you can configure and create your alert rule based on the query used in the panel.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Changes to the panel aren't reflected on the linked alert rules. If you change a query, you have to update it in both the panel and the alert rule.
|
||||
|
||||
Alert rules are only supported in [time series](ref:time-series) visualizations.
|
||||
{{% /admonition %}}
|
||||
|
||||
{{< docs/play title="visualizations with linked alerts in Grafana" url="https://play.grafana.org/d/000000074/" >}}
|
||||
|
||||
## View alert rules from panels
|
||||
|
||||
To view alert rules associated with a time series panel, complete the following steps.
|
||||
|
||||
1. Open the panel editor by hovering over the top-right corner of any panel
|
||||
1. Click the panel menu icon that appears.
|
||||
1. Click **Edit**.
|
||||
1. Click the **Alert** tab to view existing alert rules or create a new one.
|
||||
@@ -64,16 +64,17 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/
|
||||
alert-list:
|
||||
link-alert-rules-to-panels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/alert-list/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/alert-list/
|
||||
time-series:
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
data-sources:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/time-series/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/time-series/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/
|
||||
compatible-data-sources:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/GRAFANA_VERSION>/alerting/fundamentals/alert-rules/#supported-data-sources
|
||||
---
|
||||
|
||||
# Configure Grafana-managed alert rules
|
||||
@@ -84,6 +85,9 @@ Multiple alert instances can be created as a result of one alert rule (also know
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
For Grafana Cloud Free Forever, you can create up to 100 free Grafana-managed alert rules with each alert rule having a maximum of 1000 alert instances.
|
||||
|
||||
For all paid tiers (Cloud Pro and Advanced), there is a soft limit of 2000 alert rules and unlimited alert instances. To increase the limit, open a support ticket from the [Cloud portal](https://grafana.com/docs/grafana-cloud/account-management/support/).
|
||||
|
||||
{{% /admonition %}}
|
||||
|
||||
Grafana-managed alert rules can only be edited or deleted by users with Edit permissions for the folder storing the rules.
|
||||
@@ -93,6 +97,13 @@ To make a backup of your configuration and to be able to restore deleted alertin
|
||||
|
||||
## Before you begin
|
||||
|
||||
If you are using Grafana OSS:
|
||||
|
||||
1. Configure your [data sources](ref:data-sources).
|
||||
1. Check which [data sources](ref:compatible-data-sources) are compatible with and supported by Grafana Alerting.
|
||||
|
||||
If you are using Grafana OSS, Enterprise, or Cloud:
|
||||
|
||||
You can use default or advanced options for Grafana-managed alert rule creation. The default options streamline rule creation with a cleaner header and a single query and condition. For more complex rules, use advanced options to add multiple queries and expressions.
|
||||
|
||||
Default and advanced options are enabled by default for Grafana Cloud users and this feature is being rolled out progressively.
|
||||
@@ -257,13 +268,9 @@ Annotations add metadata to provide more information on the alert in your alert
|
||||
Webpage where you keep your runbook for the alert
|
||||
|
||||
1. Optional: Add a custom annotation
|
||||
1. Optional: Add a **dashboard and panel link**.
|
||||
1. Optional: **Link dashboard and panel**.
|
||||
|
||||
Links alert rules to panels in a dashboard.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
At the moment, alert rules are only supported in [time series](ref:time-series) and [alert list](ref:alert-list) visualizations.
|
||||
{{% /admonition %}}
|
||||
[Link the alert rule to a panel](ref:link-alert-rules-to-panels) to facilitate alert investigation.
|
||||
|
||||
1. Click **Save rule**.
|
||||
|
||||
|
||||
@@ -1,184 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- ../unified-alerting/alerting-rules/create-cortex-loki-managed-recording-rule/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/create-cortex-loki-managed-recording-rule/
|
||||
- ../unified-alerting/alerting-rules/create-mimir-loki-managed-recording-rule/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/create-mimir-loki-managed-recording-rule/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-mimir-loki-managed-recording-rule/
|
||||
description: Create recording rules for an external Grafana Mimir or Loki instance
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- guide
|
||||
- rules
|
||||
- recording rules
|
||||
- configure
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Configure recording rules
|
||||
weight: 300
|
||||
refs:
|
||||
configure-grafana:
|
||||
- pattern: /docs/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/
|
||||
annotation-label:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/
|
||||
---
|
||||
|
||||
# Configure recording rules
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
In Grafana Cloud, you can only create data source-managed recording rules.
|
||||
|
||||
In Grafana OSS and Enterprise, you can create both Grafana-managed and data source-managed recording rules if you enable the `grafanaManagedRecordingRules` feature flag.
|
||||
|
||||
For more information on enabling feature toggles, refer to [Configure feature toggles](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/feature-toggles).
|
||||
{{< /admonition >}}
|
||||
|
||||
Recording rules calculate frequently needed expressions or computationally expensive expressions in advance and save the result as a new set of time series. Querying this new time series is faster, especially for dashboards since they query the same expression every time the dashboards refresh.
|
||||
|
||||
For more information on recording rules in Prometheus, refer to [Defining recording rules in Prometheus](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/).
|
||||
|
||||
Recording rules are run as instant rules, which means that they run every 10s. To overwrite this configuration, update the min_interval in your custom configuration file.
|
||||
|
||||
[min_interval](ref:configure-grafana) sets the minimum interval to enforce between rule evaluations. The default value is 10s which equals the scheduler interval. Rules will be adjusted if they are less than this value or if they are not multiple of the scheduler interval (10s). Higher values can help with resource management as fewer evaluations are scheduled over time.
|
||||
|
||||
This setting has precedence over each individual rule frequency. If a rule frequency is lower than this value, then this value is enforced.
|
||||
|
||||
## Configure data source-managed recording rules
|
||||
|
||||
Configure data source-managed recording rules.
|
||||
|
||||
### Before you begin
|
||||
|
||||
- Verify that you have write permission to the Prometheus or Loki data source. Otherwise, you will not be able to create or update Grafana Mimir managed alerting rules.
|
||||
|
||||
- For Grafana Mimir and Loki data sources, enable the ruler API by configuring their respective services.
|
||||
|
||||
- **Loki** - The `local` rule storage type, default for the Loki data source, supports only viewing of rules. To edit rules, configure one of the other rule storage types.
|
||||
|
||||
- **Grafana Mimir** - use the `/prometheus` prefix. The Prometheus data source supports both Grafana Mimir and Prometheus, and Grafana expects that both the [Query API](/docs/mimir/latest/operators-guide/reference-http-api/#querier--query-frontend) and [Ruler API](/docs/mimir/latest/operators-guide/reference-http-api/#ruler) are under the same URL. You cannot provide a separate URL for the Ruler API.
|
||||
|
||||
To configure data-source managed recording rules, complete the following steps.
|
||||
|
||||
1. Click **Alerts & IRM** -> **Alerting** ->
|
||||
**Alert rules**.
|
||||
1. Scroll to the **Data source-managed section** and click **+New recording rule**.
|
||||
|
||||
#### Enter recording rule name
|
||||
|
||||
The recording rule name must be a Prometheus metric name and contain no whitespace.
|
||||
|
||||
#### Define recording rule
|
||||
|
||||
Select your data source and enter a query.
|
||||
|
||||
#### Add namespace and group
|
||||
|
||||
1. From the **Namespace** dropdown, select an existing rule namespace or add a new one.
|
||||
|
||||
Namespaces can contain one or more rule groups and only have an organizational purpose.
|
||||
|
||||
1. From the **Group** dropdown, select an existing group within the selected namespace or add a new one.
|
||||
|
||||
Newly created rules are appended to the end of the group. Rules within a group are run sequentially at a regular interval, with the same evaluation time.
|
||||
|
||||
#### Add labels
|
||||
|
||||
1. Add custom labels selecting existing key-value pairs from the drop down, or add new labels by entering the new key or value.
|
||||
|
||||
1. Click **Save rule** to save the rule or **Save rule and exit** to save the rule and go back to the Alerting page.
|
||||
|
||||
## Configure Grafana-managed recording rules
|
||||
|
||||
Configure Grafana-managed recording rules.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
This feature is only available for Grafana OSS and Enterprise users. It is not available in Grafana Cloud.
|
||||
{{< /admonition >}}
|
||||
|
||||
### Before you begin
|
||||
|
||||
- Enable the `grafanaManagedRecordingRules` [feature flag](https://grafana.com/docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/feature-toggles/).
|
||||
|
||||
To configure Grafana-managed recording rules, complete the following steps.
|
||||
|
||||
1. Click **Alerts & IRM** -> **Alerting** ->
|
||||
**Alert rules**.
|
||||
1. Scroll to the **Grafana-managed section** and click **+New recording rule**.
|
||||
|
||||
#### Enter a recording rule and metric name
|
||||
|
||||
Enter a names to identify your recording rule and metric. The metric name must be a Prometheus metric name and contain no whitespace.
|
||||
|
||||
For more information, refer to [Metrics and labels](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
|
||||
|
||||
#### Define recording rule
|
||||
|
||||
Define a query to get the data you want to measure and a condition that needs to be met before an alert rule fires.
|
||||
|
||||
1. Select a data source.
|
||||
1. From the **Options** dropdown, specify a time range.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Grafana Alerting only supports fixed relative time ranges, for example, `now-24hr: now`.
|
||||
|
||||
It does not support absolute time ranges: `2021-12-02 00:00:00 to 2021-12-05 23:59:592` or semi-relative time ranges: `now/d to: now`.
|
||||
{{< /admonition >}}
|
||||
|
||||
1. Add a query.
|
||||
|
||||
To add multiple queries, click **Add query**.
|
||||
|
||||
All alert rules are managed by Grafana by default. If you want to switch to a data source-managed alert rule, click **Switch to data source-managed alert rule**.
|
||||
|
||||
2. Add one or more [expressions].
|
||||
|
||||
a. For each expression, select either **Classic condition** to create a single alert rule, or choose from the **Math**, **Reduce**, and **Resample** options to generate separate alert for each series.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
When using Prometheus, you can use an instant vector and built-in functions, so you don't need to add additional expressions.
|
||||
{{% /admonition %}}
|
||||
|
||||
b. Click **Preview** to verify that the expression is successful.
|
||||
|
||||
3. To add a recovery threshold, turn the **Custom recovery threshold** toggle on and fill in a value for when your alert rule should stop firing.
|
||||
|
||||
You can only add one recovery threshold in a query and it must be the alert condition.
|
||||
|
||||
4. Click **Set as alert condition** on the query or expression you want to set as your alert condition.
|
||||
|
||||
#### Set evaluation behavior
|
||||
|
||||
Use alert rule evaluation to determine how frequently an alert rule should be evaluated and how quickly it should change its state.
|
||||
|
||||
To do this, you need to make sure that your alert rule is in the right evaluation group and set a pending period time that works best for your use case.
|
||||
|
||||
1. Select a folder or click **+ New folder**.
|
||||
1. Select an evaluation group or click **+ New evaluation group**.
|
||||
|
||||
If you are creating a new evaluation group, specify the interval for the group.
|
||||
|
||||
All rules within the same group are evaluated concurrently over the same time interval.
|
||||
|
||||
1. Enter a pending period.
|
||||
|
||||
The pending period is the period in which an alert rule can be in breach of the condition until it fires.
|
||||
|
||||
Once a condition is met, the alert goes into the **Pending** state. If the condition remains active for the duration specified, the alert transitions to the **Firing** state, else it reverts to the **Normal** state.
|
||||
|
||||
1. Turn on pause alert notifications, if required.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
You can pause alert rule evaluation to prevent noisy alerting while tuning your alerts.
|
||||
Pausing stops alert rule evaluation and doesn't create any alert instances.
|
||||
This is different to mute timings, which stop notifications from being delivered, but still allows for alert rule evaluation and the creation of alert instances.
|
||||
{{< /admonition >}}
|
||||
|
||||
#### Add labels
|
||||
|
||||
Add labels to your rule for searching, silencing, or routing to a notification policy.
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
aliases:
|
||||
- ../unified-alerting/alerting-rules/create-cortex-loki-managed-recording-rule/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/create-cortex-loki-managed-recording-rule/
|
||||
- ../unified-alerting/alerting-rules/create-mimir-loki-managed-recording-rule/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/create-mimir-loki-managed-recording-rule/
|
||||
- ../unified-alerting/alerting-rules/create-mimir-loki-managed-rule/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/create-mimir-loki-managed-rule/
|
||||
- ../unified-alerting/alerting-rules/edit-cortex-loki-namespace-group/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/edit-cortex-loki-namespace-group/
|
||||
- ../unified-alerting/alerting-rules/edit-mimir-loki-namespace-group/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/edit-mimir-loki-namespace-group/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-mimir-loki-managed-rule/
|
||||
description: Configure data source-managed alert rules alert for an external Grafana Mimir or Loki instance
|
||||
keywords:
|
||||
@@ -29,16 +29,11 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/
|
||||
alert-list:
|
||||
link-alert-rules-to-panels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/alert-list/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/alert-list/
|
||||
time-series:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/time-series/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/time-series/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
---
|
||||
|
||||
# Configure data source-managed alert rules
|
||||
@@ -142,12 +137,8 @@ Annotations add metadata to provide more information on the alert in your alert
|
||||
Webpage where you keep your runbook for the alert
|
||||
|
||||
1. Optional: Add a custom annotation
|
||||
1. Optional: Add a **dashboard and panel link**.
|
||||
1. Optional: **Link dashboard and panel**.
|
||||
|
||||
Links alerts to panels in a dashboard.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
At the moment, alert rules are only supported in [time series](ref:time-series) and [alert list](ref:alert-list) visualizations.
|
||||
{{% /admonition %}}
|
||||
[Link the alert rule to a panel](ref:link-alert-rules-to-panels) to facilitate alert investigation.
|
||||
|
||||
1. Click **Save rule**.
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
aliases:
|
||||
- ../fundamentals/alert-rules/recording-rules/ # /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/recording-rules/
|
||||
- ../unified-alerting/alerting-rules/create-cortex-loki-managed-recording-rule/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/create-cortex-loki-managed-recording-rule/
|
||||
- ../unified-alerting/alerting-rules/create-mimir-loki-managed-recording-rule/ # /docs/grafana/<GRAFANA_VERSION>/alerting/unified-alerting/alerting-rules/create-mimir-loki-managed-recording-rule/
|
||||
- ../alerting-rules/create-mimir-loki-managed-recording-rule/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-mimir-loki-managed-recording-rule/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-recording-rules/
|
||||
description: Recording rules allow you to pre-compute frequently needed or computationally expensive expressions and save the results as a new set of time series. Querying precomputed results is faster and can reduce system load.
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- guide
|
||||
- rules
|
||||
- recording rules
|
||||
- configure
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Create recording rules
|
||||
weight: 400
|
||||
refs:
|
||||
grafana-managed-recording-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-recording-rules/create-grafana-managed-recording-rules/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/create-recording-rules/create-grafana-managed-recording-rules/
|
||||
data-source-managed-recording-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-recording-rules/create-data-source-managed-recording-rules/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/create-recording-rules/create-data-source-managed-recording-rules/
|
||||
---
|
||||
|
||||
# Configure recording rules
|
||||
|
||||
Recording rules allows you to periodically pre-compute frequently used or computationally expensive queries, saving the results as a new time series metric.
|
||||
|
||||
For instance, you can create a recording rule generating a new metric, `error_9001_count`, which counts occurrences of a specific log error within one minute. Then, query the `error_9001_count` metric in dashboards and alert rules.
|
||||
|
||||
Recording rules can be helpful in various scenarios, such as:
|
||||
|
||||
- **Faster queries** are needed: Performing heavy aggregations or querying large data sets is quicker with precomputed results than real-time queries.
|
||||
- **Reducing system load:** Precomputing specific queries in advance can reduce system overload caused by multiple simultaneous queries.
|
||||
- **Simplifying complex aggregations:** Create a new metric from complex aggregations to facilitate alert and dashboard setup.
|
||||
- **Reusing queries across alerts:** Improve efficiency by reusing the same query across similar alert rules and dashboards.
|
||||
|
||||
The evaluation group of the recording rule determines how often the metric is pre-computed.
|
||||
|
||||
Similar to alert rules, Grafana supports two types of recording rules:
|
||||
|
||||
1. [Grafana-managed recording rules](ref:grafana-managed-recording-rules), which can query any Grafana data source supported by alerting.
|
||||
2. [Data source-managed recording rules](ref:data-source-managed-recording-rules), which can query Prometheus-based data sources like Mimir or Loki.
|
||||
@@ -0,0 +1,79 @@
|
||||
---
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-recording-rules/create-data-source-managed-recording-rules/
|
||||
description: Recording rules allow you to pre-compute expensive queries in advance and save the results as a new set of time series. Data source-managed recording rules can create a recording rule for Prometheus-based data sources like Mimir or Loki.
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- guide
|
||||
- rules
|
||||
- recording rules
|
||||
- configure
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Create data source-managed recording rules
|
||||
weight: 402
|
||||
refs:
|
||||
create-recording-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-recording-rules/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/create-recording-rules/
|
||||
---
|
||||
|
||||
# Create data source-managed recording rules
|
||||
|
||||
[Recording rules](ref:create-recording-rules) allow you to periodically pre-compute frequently used or computationally expensive queries, saving the results as a new time series metric.
|
||||
|
||||
Alert rules and dashboards can then query the new metric resulting from the recording rule. This is faster than querying real-time data and can help to reduce system load.
|
||||
|
||||
Data source-managed recording rules can query Prometheus-based data sources like Mimir or Loki. For more information on recording rules in Prometheus, refer to [Defining recording rules in Prometheus](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/).
|
||||
|
||||
Note that in data source-managed groups, the alert rules and recording rules within the same evaluation group are evaluated sequentially. This is useful to ensure that a recording rule is evaluated before any other alert rule queries the pre-computed metric.
|
||||
|
||||
## Before you begin
|
||||
|
||||
- Verify that you have write permission to the Prometheus or Loki data source. Otherwise, you will not be able to create or update Grafana Mimir managed alerting rules.
|
||||
|
||||
- For Grafana Mimir and Loki data sources, enable the ruler API by configuring their respective services.
|
||||
|
||||
- **Loki** - The `local` rule storage type, default for the Loki data source, supports only viewing of rules. To edit rules, configure one of the other rule storage types.
|
||||
|
||||
- **Grafana Mimir** - use the `/prometheus` prefix. The Prometheus data source supports both Grafana Mimir and Prometheus, and Grafana expects that both the [Query API](/docs/mimir/latest/operators-guide/reference-http-api/#querier--query-frontend) and [Ruler API](/docs/mimir/latest/operators-guide/reference-http-api/#ruler) are under the same URL. You cannot provide a separate URL for the Ruler API.
|
||||
|
||||
## Add new recording rule
|
||||
|
||||
To create a new data source-managed recording rule:
|
||||
|
||||
1. Click **Alerts & IRM** -> **Alerting** -> **Alert rules**.
|
||||
1. Scroll to the **Data source-managed section** and click **+New recording rule**.
|
||||
|
||||
## Enter recording rule name
|
||||
|
||||
The recording rule name must be a Prometheus metric name and contain no whitespace.
|
||||
|
||||
## Define recording rule
|
||||
|
||||
Select your data source and enter a query. The queries used in data source-managed recording rules always run as instant queries.
|
||||
|
||||
## Add namespace and group
|
||||
|
||||
1. From the **Namespace** dropdown, select an existing rule namespace or add a new one.
|
||||
|
||||
Namespaces can contain one or more rule groups and only have an organizational purpose.
|
||||
|
||||
1. From the **Group** dropdown, select an existing group within the selected namespace or add a new one.
|
||||
|
||||
Newly created rules are appended to the end of the group. Rules within a group are run sequentially at a regular interval, with the same evaluation time.
|
||||
|
||||
## Add labels
|
||||
|
||||
Optionally, you can add custom labels to the resulting metric by selecting existing key-value pairs from the drop down or entering the new key or value.
|
||||
|
||||
## Query the new metric in dashboards or alert rules
|
||||
|
||||
Click **Save rule** or **Save rule and exit** to save the rule.
|
||||
|
||||
Once saved, the new recording metric is available for use in dashboards and alert rules.
|
||||
@@ -0,0 +1,151 @@
|
||||
---
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-recording-rules/create-grafana-managed-recording-rules/
|
||||
description: Recording rules allow you to pre-compute expensive queries in advance and save the results as a new set of time series. Grafana-managed recording rules can create a recording rule for any data source supported by alerting.
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- guide
|
||||
- rules
|
||||
- recording rules
|
||||
- configure
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Create Grafana-managed recording rules
|
||||
weight: 401
|
||||
refs:
|
||||
expressions:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/queries-conditions/#expression-queries
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/queries-conditions/#expression-queries
|
||||
create-recording-rules:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-recording-rules/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/create-recording-rules/
|
||||
alerting-data-sources:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/#supported-data-sources
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/#supported-data-sources
|
||||
configure-grafana-min-interval:
|
||||
- pattern: /docs/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/#min_interval
|
||||
configure-feature-toggles:
|
||||
- pattern: /docs/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/setup-grafana/configure-grafana/feature-toggles/
|
||||
---
|
||||
|
||||
# Create Grafana-managed recording rules
|
||||
|
||||
[Recording rules](ref:create-recording-rules) allow you to periodically pre-compute frequently used or computationally expensive queries, saving the results as a new time series metric.
|
||||
|
||||
Alert rules and dashboards can then query the new metric resulting from the recording rule. This is faster than querying real-time data and can help to reduce system load.
|
||||
|
||||
Grafana does not contain an embedded time-series database to store recording rule results. You must bring your own Prometheus-compatible database to store the series generated by recording rules.
|
||||
|
||||
Grafana-managed recording rules offer the same Prometheus-like semantics but allow you to query [data sources supported by alerting](ref:alerting-data-sources). Additionally, you can use recording rules to import and map data from other data sources into Prometheus.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
|
||||
Grafana-managed recording rules are enabled by default in Grafana Cloud.
|
||||
|
||||
In Grafana OSS and Enterprise, you must enable them by following the [Before you begin](#before-you-begin) instructions.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
To configure Grafana-managed recording rules, complete the following steps.
|
||||
|
||||
## Before you begin
|
||||
|
||||
This section only applies to Grafana OSS and Grafana Enterprise.
|
||||
|
||||
First, enable the `grafanaManagedRecordingRules` [feature flag](ref:configure-feature-toggles).
|
||||
|
||||
Then, enable the feature by setting `enabled = true` in the `[recording_rules]` section of the Grafana config .ini. Provide the URL of your Prometheus-compatible remote-write endpoint in the `url` field, along with optional credentials or headers.
|
||||
|
||||
```
|
||||
[recording_rules]
|
||||
enabled = true
|
||||
url = http://my-example-prometheus.local:9090/api/prom/push
|
||||
basic_auth_username = my-user
|
||||
basic_auth_password = my-pass
|
||||
|
||||
[recording_rules.custom_headers]
|
||||
X-My-Header = MyValue
|
||||
```
|
||||
|
||||
## Add new recording rule
|
||||
|
||||
To create a new Grafana-managed recording rule:
|
||||
|
||||
1. Click **Alerts & IRM** -> **Alerting** ->
|
||||
**Alert rules**.
|
||||
1. Scroll to the **Grafana-managed section** and click **+New recording rule**.
|
||||
|
||||
1. Enter the names to identify your recording rule and metric.
|
||||
|
||||
The metric name must be a Prometheus metric name and contain no whitespace. For details, refer to [Prometheus metric names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
|
||||
|
||||
## Define recording rule
|
||||
|
||||
Define a query to get the data you want to measure and set the recording rule output.
|
||||
|
||||
1. Select a data source.
|
||||
1. From the **Options** dropdown, specify a time range.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Grafana Alerting only supports fixed relative time ranges, for example, `now-24hr: now`.
|
||||
|
||||
It does not support absolute time ranges: `2021-12-02 00:00:00 to 2021-12-05 23:59:592` or semi-relative time ranges: `now/d to: now`.
|
||||
{{< /admonition >}}
|
||||
|
||||
1. Add a query.
|
||||
|
||||
To add multiple queries, click **Add query**.
|
||||
|
||||
1. Add one or more [expressions](ref:expressions).
|
||||
|
||||
a. For each expression, select either **Classic condition** to create a single recording rule, or choose from the **Math**, **Reduce**, and **Resample** options.
|
||||
|
||||
When using Prometheus, you can use an instant vector and built-in functions, so you don't need to add additional expressions.
|
||||
|
||||
b. Click **Preview** to verify that the expression is successful.
|
||||
|
||||
1. Click **Set as recording rule output** on the query or expression you want to set as your rule output.
|
||||
|
||||
## Set evaluation behavior
|
||||
|
||||
Use recording rule evaluation to determine how frequently a recording rule should be evaluated.
|
||||
|
||||
To do this, you need to make sure that your recording rule is in the right evaluation group with an interval that works best for your use case.
|
||||
|
||||
1. Select a folder or click **+ New folder**.
|
||||
1. Select an evaluation group or click **+ New evaluation group**.
|
||||
|
||||
If you are creating a new evaluation group, specify the interval for the group.
|
||||
|
||||
All rules within the same group are evaluated concurrently over the same time interval. Every recording rule in a group uses the same evaluation time, meaning that all queries from the same group are always aligned with each other.
|
||||
|
||||
1. Before or after creating a recording rule, you have the option to **Pause evaluation** if necessary.
|
||||
|
||||
### Advanced configuration
|
||||
|
||||
[min_interval](ref:configure-grafana-min-interval) sets the minimum interval to enforce between rule evaluations. The default value is 10s which equals the scheduler interval. Rules are adjusted if they are less than this value or if they are not multiple of the scheduler interval (10s). Higher values can help with resource management as fewer evaluations are scheduled over time.
|
||||
|
||||
This setting has precedence over each individual rule frequency. If a rule frequency is lower than this value, then this value is enforced.
|
||||
|
||||
This setting applies to both Grafana-managed alert and recording rules.
|
||||
|
||||
## Add labels
|
||||
|
||||
Optionally, you can add custom labels to the resulting metric by selecting existing key-value pairs from the drop down or entering the new key or value.
|
||||
|
||||
## Query the new metric in dashboards or alert rules
|
||||
|
||||
Click **Save rule** or **Save rule and exit** to save the rule.
|
||||
|
||||
Once saved, the new recording metric is available for use in dashboards and alert rules.
|
||||
@@ -0,0 +1,84 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../alerting/alerting-rules/create-alerts-panels/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-alerts-panels/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/link-alert-rules-to-panels/
|
||||
description: Grafana allows you to link alert rules with panels and dashboards. This helps connect alerts with an existing dashboard and informs alert responders on where to investigate.
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- panels
|
||||
- create
|
||||
- grafana-managed
|
||||
- data source-managed
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Create and link alert rules to panels
|
||||
weight: 300
|
||||
refs:
|
||||
time-series-visualizations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/panels-visualizations/visualizations/time-series/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/time-series/
|
||||
annotations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#annotations
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#annotations
|
||||
view-alert-state-on-panels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/view-alert-state-on-panels/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/manage-notifications/view-alert-state-on-panels/
|
||||
---
|
||||
|
||||
# Create and link alert rules to panels
|
||||
|
||||
Grafana allows you to link an alert rule to a dashboard panel. This can help you:
|
||||
|
||||
- Inform alert responders about where to investigate and which data to examine.
|
||||
- Visualize the alert state directly from dashboards.
|
||||
|
||||
An alert rule is linked to a panel by setting the [`dashboardUId` and `panelId` annotations](ref:annotations). Both annotations must be set together.
|
||||
|
||||
## Link alert rules to panels
|
||||
|
||||
When configuring the alert rule, you can set the dashboard and panel annotations as shown in this [video](https://youtu.be/ClLp-iSoaSY?si=qKWnvSVaQuvYcuw9&t=170).
|
||||
|
||||
1. Configure the alert rule.
|
||||
1. In the **Configure notification message** section, click **Link dashboard and panel**.
|
||||
1. Select an existing dashboard, then choose a panel from the selected dashboard.
|
||||
1. Complete the alert rule configuration and click **Save rule** to initiate the alert rule.
|
||||
|
||||
You can then [view the alert state on the panel](ref:view-alert-state-on-panels).
|
||||
|
||||
{{< figure src="/media/docs/alerting/panel-displays-alert-state.png" max-width="1200px" caption="A panel displaying the alert status and state changes." >}}
|
||||
|
||||
## Create alert rules from panels
|
||||
|
||||
To streamline alert creation, you can create an alert rule directly from a panel.
|
||||
|
||||
1. Navigate to a dashboard in the **Dashboards** section.
|
||||
1. Hover over the top-right corner of a panel and click the panel menu icon.
|
||||
1. From the dropdown menu, select **More...** > **New alert rule**.
|
||||
1. This opens the **Edit rule** form and pre-fills some values:
|
||||
- Sets the `dashboardUId` and `panelId` annotations to the corresponding dashboard and panel.
|
||||
- Sets the alert rule query using the panel query.
|
||||
1. Complete the alert rule configuration and click **Save rule** to initiate the alert rule.
|
||||
|
||||
You can then [view the alert state on the panel](ref:view-alert-state-on-panels).
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Changes to panel and alert rule queries aren't synchronized. If you change a query, you have to update it in both the panel and the alert rule.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Access linked alert rules from panels
|
||||
|
||||
This option is available only in [time series panels](ref:time-series-visualizations). To access alert rules associated to a time series panel, complete the following steps.
|
||||
|
||||
1. Hover over the top-right corner of the panel and click the panel menu icon.
|
||||
1. Click **Edit**.
|
||||
1. Click the **Alert** tab to view existing alert rules or create a new one.
|
||||
215
docs/sources/alerting/alerting-rules/templates/_index.md
Normal file
215
docs/sources/alerting/alerting-rules/templates/_index.md
Normal file
@@ -0,0 +1,215 @@
|
||||
---
|
||||
aliases:
|
||||
- ../fundamentals/annotation-label/variables-label-annotation/ # /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/annotation-label/variables-label-annotation/
|
||||
- ../alerting-rules/templating-labels-annotations/ # /docs/grafana/<GRAFANA_VERSION>/alerting-rules/templating-labels-annotations/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/templates/
|
||||
description: Learn how to template annotations and labels to include data from queries and expressions in alert messages
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- templating
|
||||
- labels
|
||||
- annotations
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Template annotations and labels
|
||||
weight: 500
|
||||
refs:
|
||||
labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#labels
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#labels
|
||||
values:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#values
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#values
|
||||
annotations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#annotations
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#annotations
|
||||
explore:
|
||||
- pattern: /docs/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/explore/
|
||||
intro-to-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/templates/
|
||||
alert-rule-template-reference:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/reference/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/reference/
|
||||
alert-rule-template-examples:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/examples/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/examples/
|
||||
notification-template-reference:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/reference/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/
|
||||
notification-data-reference:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/reference/#notification-data
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/#notification-data
|
||||
view-alert-state:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/view-state-health/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/manage-notifications/view-state-health/
|
||||
preview-notifications:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/manage-notification-templates/#preview-notification-templates
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/manage-notification-templates/#preview-notification-templates
|
||||
---
|
||||
|
||||
# Template annotations and labels
|
||||
|
||||
You can use templates to customize alert and notification messages, including dynamic data from alert rule queries.
|
||||
|
||||
In Grafana Alerting, you can template alert messages in two ways.
|
||||
|
||||
1. **Template annotations and labels**: In the alert rule definition, you can template annotations and labels to include extra information from query data to the alert, adding meaningful details based on the query results.
|
||||
1. **Template notifications**: You can template notifications to control the content and appearance of your notifications.
|
||||
|
||||
## How templating works
|
||||
|
||||
In this diagram, you can see the differences between both types of templates.
|
||||
|
||||
{{< figure src="/media/docs/alerting/how-notification-templates-works.png" max-width="1200px" alt="How templating works" >}}
|
||||
|
||||
Refer to [Templates Introduction](ref:intro-to-templates) for a more detailed explanation of this diagram.
|
||||
|
||||
Both types of templates are written in the Go templating system. However, it's important to understand that variables and functions used in notification templates are different from those used in annotation and label templates.
|
||||
|
||||
1. **Template annotations and labels**: These templates add extra information to individual alert instances. Template variables like [`$labels`](ref:labels) and [`$values`](ref:values) represent alert query data of the individual alert instance.
|
||||
1. **Template notifications**: Notification templates format the notification content for a group of alerts. Variables like [`.Alerts`](ref:notification-data-reference) include all firing and resolved alerts in the notification.
|
||||
|
||||
## Template annotations
|
||||
|
||||
[Annotations](ref:annotations) add additional information to alert instances and are often used to help identify the alert and guide responders on how to address the issue.
|
||||
|
||||
Annotations are key-value pairs defined in the alert rule. They can contain plain text or template code that is evaluated when the alert fires.
|
||||
|
||||
Grafana includes several optional annotations, such as `description`, `summary`, `runbook_url`, `dashboardUId` and `panelId`, which can be edited in the alert rule. You can also create your custom annotations. For example, you might create a new annotation named `location` to report the location of the system that triggered the alert.
|
||||
|
||||
Here’s an example of a `summary` annotation explaining why the alert was triggered, using plain text.
|
||||
|
||||
```
|
||||
CPU usage has exceeded 80% for the last 5 minutes.
|
||||
```
|
||||
|
||||
However, if you want to display dynamic query values in annotations, you need to use template code. Common use cases include:
|
||||
|
||||
- Displaying the query value or threshold that triggered the alert.
|
||||
- Highlighting label information that identifies the alert, such as environment, region, or priority.
|
||||
- Providing specific instructions based on query values.
|
||||
- Customizing runbook links depending on query or label values.
|
||||
- Including contact information based on alert labels.
|
||||
|
||||
For instance, you can template the previous example to display the specific instance and CPU value that triggered the alert.
|
||||
|
||||
```
|
||||
CPU usage for {{ $labels.instance }} has exceeded 80% ({{ $values.A.Value }}) for the last 5 minutes.
|
||||
```
|
||||
|
||||
Alternatively, you can use the `index` function to print query values.
|
||||
|
||||
```
|
||||
CPU usage for {{ index $labels "instance" }} has exceeded 80% ({{ index $values "A" }}) for the last 5 minutes.
|
||||
```
|
||||
|
||||
The result of the annotation would be as follows.
|
||||
|
||||
```
|
||||
CPU usage for Instance 1 has exceeded 80% (81.2345) for the last 5 minutes.
|
||||
```
|
||||
|
||||
### How to template an annotation
|
||||
|
||||
Complete the following steps to template an annotation.
|
||||
|
||||
1. Navigate to **Alerts & IRM** -> **Alert rules** -> create or edit an alert rule.
|
||||
1. Scroll down to the **Configure notification message** section.
|
||||
1. Copy in your template in the corresponding annotation field (`summary`, `description`, `runbook_url`, `custom`).
|
||||
|
||||
### Preview annotation templates
|
||||
|
||||
You can template annotations when creating or editing an alert rule.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alert-rule-using-annotation-template.png" max-width="1200px" alt="An alert rule templating the annotation summary" >}}
|
||||
|
||||
Two common methods are used to test and preview annotation templates:
|
||||
|
||||
1. Trigger the alert and [view the alert instance state in the Grafana UI](ref:view-alert-state), where all annotations of the alert instance are displayed.
|
||||
1. Use a notification template that displays all annotations, then [preview the notification template](ref:preview-notifications) using the alert instance.
|
||||
|
||||
## Template labels
|
||||
|
||||
The set of [labels](ref:labels) for an alert instance is used to uniquely identify that alert among all other alert instances.
|
||||
|
||||
Labels determine how alerts are routed and managed for notifications, making their design key to the effectiveness of your alerting system.
|
||||
|
||||
Labels can be returned from an alert rule query, such as the `pod` label in a Kubernetes Prometheus query. You can also define additional labels in the alert rule to provide extra information for processing alerts.
|
||||
|
||||
Like annotations, labels are key-value pairs that can contain plain text or template code evaluated when the alert fires.
|
||||
|
||||
Template labels when the labels returned by your queries are insufficient. For instance:
|
||||
|
||||
- A new label based on a query value can group a subset of alerts differently, changing how notifications are sent.
|
||||
- A new label based on a query value can be used in a notification policy to alter the notification contact point.
|
||||
|
||||
Here’s an example of templating a `severity` label based on the query value.
|
||||
|
||||
```
|
||||
{{ if (gt $values.A.Value 90.0) -}}
|
||||
critical
|
||||
{{ else if (gt $values.A.Value 80.0) -}}
|
||||
high
|
||||
{{ else if (gt $values.A.Value 60.0) -}}
|
||||
medium
|
||||
{{ else -}}
|
||||
low
|
||||
{{- end }}
|
||||
```
|
||||
|
||||
In this example, the value of the `severity` label is determined by the query value, and the possible options are `critical`, `high`, `medium`, or `low`. You can then use the `severity` label to change their notifications—for instance, sending `critical` alerts immediately or routing `low` alerts to a specific team for further review.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
You should avoid displaying query values in labels, as this may create numerous unique alert instances—one for each distinct label value. Instead, use annotations for query values.
|
||||
{{% /admonition %}}
|
||||
|
||||
### How to template a label
|
||||
|
||||
Complete the following steps to template a label.
|
||||
|
||||
1. Navigate to **Alerts & IRM** -> **Alert rules** -> create or edit an alert rule.
|
||||
1. Scroll down to the **Configure labels and notifications** section.
|
||||
1. Click **+ Add labels**.
|
||||
1. Enter a **key** that identifies the label.
|
||||
1. Copy in your template in the **value** field.
|
||||
|
||||
### Preview label templates
|
||||
|
||||
You can template label values when creating or editing an alert rule.
|
||||
|
||||
To preview label values, select `Use notification policy`, and then click on `Preview routing`.
|
||||
|
||||
{{< figure src="/media/docs/alerting/alert-instance-routing-preview.png" max-width="1200px" alt="Routing preview displays label values" >}}
|
||||
|
||||
## More information
|
||||
|
||||
For further details on how to template alert rules, refer to:
|
||||
|
||||
- [Annotation and label template reference](ref:alert-rule-template-reference)
|
||||
- [Annotation and label examples](ref:alert-rule-template-examples)
|
||||
308
docs/sources/alerting/alerting-rules/templates/examples.md
Normal file
308
docs/sources/alerting/alerting-rules/templates/examples.md
Normal file
@@ -0,0 +1,308 @@
|
||||
---
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/templates/examples/
|
||||
description: Examples of templating labels and annotations in Grafana alert rules
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- templating
|
||||
- labels
|
||||
- annotations
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Labels and annotations template examples
|
||||
menuTitle: Examples
|
||||
weight: 102
|
||||
refs:
|
||||
labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#labels
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#labels
|
||||
annotations:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#annotations
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#annotations
|
||||
alert-rule-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/
|
||||
- pattern: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/
|
||||
reference:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/reference/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/reference/
|
||||
reference-labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/reference/#labels
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/reference/#labels
|
||||
reference-values:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/reference/#values
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/reference/#values
|
||||
reference-humanize:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/reference/#humanize
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/reference/#humanize
|
||||
reference-humanizepercentage:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/reference/#humanizepercentage
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/reference/#humanizepercentage
|
||||
reference-match:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/reference/#match
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/reference/#match
|
||||
reference-functions:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/reference/#functions
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/reference/#functions
|
||||
language-functions:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/language/#functions
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/language/#functions
|
||||
language-index:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/language/#functions
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/language/#functions
|
||||
language:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/language
|
||||
- pattern: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/language
|
||||
---
|
||||
|
||||
# Labels and annotations template examples
|
||||
|
||||
Templating allows you to add dynamic data from queries to alert labels and annotations. Dynamic data enhances alert context, making it easier for responders to quickly assess and address the issue.
|
||||
|
||||
This page provides common examples for templating labels and annotations. For more information on templating, refer to:
|
||||
|
||||
- [Template annotations and labels](ref:alert-rule-templates)
|
||||
- [Annotation and label template reference](ref:reference)
|
||||
- [Alerting template language](ref:language)
|
||||
|
||||
## Annotation example
|
||||
|
||||
[Annotations](ref:annotations) add extra details to alert instances and are often used to provide helpful information for identifying the issue and guiding the response.
|
||||
|
||||
A common use case for annotations is to display the specific query value or threshold that triggered the alert.
|
||||
|
||||
For example, you can display the query value from the [`$values`](ref:reference-values) variable to inform about the CPU value that triggered the alert.
|
||||
|
||||
```
|
||||
CPU usage has exceeded 80% ({{ $values.A.value }}) for the last 5 minutes.
|
||||
```
|
||||
|
||||
Alternatively, you can use the [`index()`](ref:language-index) function to retrieve the query value as follows.
|
||||
|
||||
```
|
||||
CPU usage has exceeded 80% ({{ index $values "A" }}) for the last 5 minutes.
|
||||
```
|
||||
|
||||
```template_output
|
||||
CPU usage has exceeded 80% (81.2345) for the last 5 minutes.
|
||||
```
|
||||
|
||||
### Include labels for extra details
|
||||
|
||||
To provide additional context, you can include labels from the query. For instance, access the [`$labels`](ref:reference-labels) variable to display a label that informs about the affected instance:
|
||||
|
||||
```
|
||||
CPU usage for {{ $labels.instance }} has exceeded 80% ({{ $values.A.Value }}) for the last 5 minutes.
|
||||
```
|
||||
|
||||
```template_output
|
||||
CPU usage for Instance 1 has exceeded 80% (81.2345) for the last 5 minutes.
|
||||
```
|
||||
|
||||
Annotations can also be used to provide a summary of key alert labels, such as the environment and alert severity. For instance, you can display a summary of the alert with important labels like:
|
||||
|
||||
```
|
||||
Alert triggered in {{ $labels.environment }} with severity {{ $labels.severity }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
Alert triggered in production with severity critical.
|
||||
```
|
||||
|
||||
### Print a range query
|
||||
|
||||
To print the value of an instant query you can print its Ref ID using the `index` function or the `$values` variable:
|
||||
|
||||
```
|
||||
{{ $values.A.Value }}
|
||||
```
|
||||
|
||||
For range queries, reduce them from a time series to an instant vector using a reduce expression. You can then print the result by referencing its Ref ID. For example, if the reduce expression averages `A` with the Ref ID `B`, you would then print `$values.B`:
|
||||
|
||||
```
|
||||
{{ $values.B.Value }}
|
||||
```
|
||||
|
||||
### Humanize the value of a query
|
||||
|
||||
To print the humanized value of an instant query, use the [`humanize`](ref:reference-humanize) function:
|
||||
|
||||
```
|
||||
{{ humanize $values.A.Value }}
|
||||
```
|
||||
|
||||
Alternatively:
|
||||
|
||||
```
|
||||
{{ humanize (index $values "A").Value }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
554.9
|
||||
```
|
||||
|
||||
To print the value of an instant query as a percentage, use the [`humanizePercentage`](ref:reference-humanizepercentage) function:
|
||||
|
||||
```
|
||||
{{ humanizePercentage $values.A.Value }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
10%
|
||||
```
|
||||
|
||||
For additional functions to display or format data, refer to:
|
||||
|
||||
- [Annotation and label template functions](ref:reference-functions)
|
||||
- [Template language functions](ref:language-functions)
|
||||
|
||||
## Label example
|
||||
|
||||
[Labels](ref:labels) determine how alerts are routed and managed, ensuring that notifications reach the right teams at the right time. If the labels returned by your queries don’t fully capture the necessary context, you can create a new label and sets its value based on query data.
|
||||
|
||||
### Based on query value
|
||||
|
||||
Here’s an example of creating a `severity` label based on a query value:
|
||||
|
||||
```go
|
||||
{{ if (gt $values.A.Value 90.0) -}}
|
||||
critical
|
||||
{{ else if (gt $values.A.Value 80.0) -}}
|
||||
high
|
||||
{{ else if (gt $values.A.Value 60.0) -}}
|
||||
medium
|
||||
{{ else -}}
|
||||
low
|
||||
{{- end }}
|
||||
```
|
||||
|
||||
In this example, the `severity` label is determined by the query value:
|
||||
|
||||
- `critical` for values above 90,
|
||||
- `high` for values above 80,
|
||||
- `medium` for values above 60,
|
||||
- and `low` for anything below.
|
||||
|
||||
You can then use the `severity` label to control how alerts are handled. For instance, you could send `critical` alerts immediately, while routing `low` severity alerts to a team for further investigation.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
You should avoid displaying query values in labels, as this may create many alert instances—one for each distinct label value. Instead, use annotations to convey query values.
|
||||
{{% /admonition %}}
|
||||
|
||||
### Based on query label
|
||||
|
||||
You can use labels to differentiate alerts coming from various environments (e.g., production, staging, dev). For example, you may want to add a label that sets the environment based on the instance’s label. Here’s how you can template it:
|
||||
|
||||
```go
|
||||
{{ if eq $labels.instance "prod-server-1" }}production
|
||||
{{ else if eq $labels.instance "staging-server-1" }}staging
|
||||
{{ else }}development
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
This would print:
|
||||
|
||||
- For instance `prod-server-1`, the label would be `production`.
|
||||
- For `staging-server-1`, the label would be `staging`.
|
||||
- All other instances would be labeled `development`.
|
||||
|
||||
To make this template more flexible, you can use a regular expression that matches the instance name with the instance name prefix using the [`match()`](ref:reference-match) function:
|
||||
|
||||
```go
|
||||
{{ if match "^prod-server-.*" $labels.instance }}production
|
||||
{{ else if match "^staging-server-.*" $labels.instance}}staging
|
||||
{{ else }}development
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
{{< collapse title="Legacy Alerting templates" >}}
|
||||
|
||||
## Legacy Alerting templates
|
||||
|
||||
For users working with Grafana's legacy alerting system, templates can still be utilized to extract useful information from alert conditions. However, it's important to note that you cannot use `$labels` to print labels from the query if you are using classic conditions, and must use `$values` instead. The reason for this is classic conditions discard these labels to enforce uni-dimensional behavior (at most one alert per alert rule). If classic conditions didn't discard these labels, then queries that returned many time series would cause alerts to flap between firing and resolved constantly as the labels would change every time the alert rule was evaluated.
|
||||
|
||||
Instead, the `$values` variable contains the reduced values of all time series for all conditions that are firing. For example, if you have an alert rule with a query A that returns two time series, and a classic condition B with two conditions, then `$values` would contain `B0`, `B1`, `B2` and `B3`. If the classic condition B had just one condition, then `$values` would contain just `B0` and `B1`.
|
||||
|
||||
#### Print all labels from a classic condition
|
||||
|
||||
To print all labels of all firing time series use the following template (make sure to replace `B` in the regular expression with the Ref ID of the classic condition if it's different):
|
||||
|
||||
```go
|
||||
{{ range $k, $v := $values -}}
|
||||
{{ if (match "B[0-9]+" $k) -}}
|
||||
{{ $k }}: {{ $v.Labels }}{{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
For example, a classic condition for two time series exceeding a single condition would print:
|
||||
|
||||
```
|
||||
B0: instance=server1
|
||||
B1: instance=server2
|
||||
```
|
||||
|
||||
If the classic condition has two or more conditions, and a time series exceeds multiple conditions at the same time, then its labels will be duplicated for each condition that is exceeded:
|
||||
|
||||
```
|
||||
B0: instance=server1
|
||||
B1: instance=server2
|
||||
B2: instance=server1
|
||||
B3: instance=server2
|
||||
```
|
||||
|
||||
If you need to print unique labels you should consider changing your alert rules from uni-dimensional to multi-dimensional instead. You can do this by replacing your classic condition with reduce and math expressions.
|
||||
|
||||
#### Print all values from a classic condition
|
||||
|
||||
To print all values from a classic condition take the previous example and replace `$v.Labels` with `$v.Value`:
|
||||
|
||||
```go
|
||||
{{ range $k, $v := $values -}}
|
||||
{{ if (match "B[0-9]+" $k) -}}
|
||||
{{ $k }}: {{ $v.Value }}{{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
For example, a classic condition for two time series exceeding a single condition would print:
|
||||
|
||||
```
|
||||
B0: 81.2345
|
||||
B1: 84.5678
|
||||
```
|
||||
|
||||
If the classic condition has two or more conditions, and a time series exceeds multiple conditions at the same time, then `$values` will contain the values of all conditions:
|
||||
|
||||
```
|
||||
B0: 81.2345
|
||||
B1: 92.3456
|
||||
B2: 84.5678
|
||||
B3: 95.6789
|
||||
```
|
||||
|
||||
{{< /collapse >}}
|
||||
81
docs/sources/alerting/alerting-rules/templates/language.md
Normal file
81
docs/sources/alerting/alerting-rules/templates/language.md
Normal file
@@ -0,0 +1,81 @@
|
||||
---
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/configure-notifications/template-notifications/language/
|
||||
description: Use Go template language to create your notification and alert rule templates
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- templates
|
||||
- write templates
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Alerting template language
|
||||
menuTitle: Template language
|
||||
refs:
|
||||
alert-rule-template-reference:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/reference/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/reference/
|
||||
alert-rule-template-reference-variables:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/reference/#variables
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/reference/#variables
|
||||
notification-template-reference:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/reference/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/
|
||||
reference-notificationdata:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/reference/#notification-data
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/#notification-data
|
||||
---
|
||||
|
||||
# Alerting template language
|
||||
|
||||
Notification templates and alert rule templates, such as annotations and labels, both use the Go template language, [text/template](https://pkg.go.dev/text/template).
|
||||
|
||||
Both types of templates can use the same keywords, functions, and comparison operators of the Go template language, such as `range`, `if`, `and`, `index`, `eq`, and more.
|
||||
|
||||
However, it's important to note that because notifications and alert rules operate in distinct contexts, some additional variables and functions are only available for either notification or alert rule templates. Refer to:
|
||||
|
||||
- [Annotation and label template reference](ref:alert-rule-template-reference)
|
||||
- [Notification template reference](ref:notification-template-reference)
|
||||
|
||||
This documentation provides an overview of the functions and operators of the Go template language that are available for both notification and alert rule templates.
|
||||
|
||||
## Print
|
||||
|
||||
To print the value of something, use `{{` and `}}`. You can print the value of a [variable](#variables), a field of a variable, the result of a function, or the value of dot.
|
||||
|
||||
```go
|
||||
{{ $values }}
|
||||
{{ $values.A.Value }}
|
||||
{{ humanize 1000.0 }}
|
||||
{{ .Alerts }}
|
||||
```
|
||||
|
||||
## Dot
|
||||
|
||||
In `text/template`, there is a special cursor called dot, written as `.`. You can think of this cursor as a variable whose value changes depending on where in the template it is used.
|
||||
|
||||
At the start of notification templates, dot (`.`) refers to [Notification Data](ref:reference-notificationdata).
|
||||
|
||||
```go
|
||||
{{ .Alerts }}
|
||||
```
|
||||
|
||||
In annotation and label templates, dot (`.`) is initialized with all alert data. It’s recommended to use the [`$labels` and `$values` variables](ref:alert-rule-template-reference-variables) instead to directly access the alert labels and query values.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Dot (`.`) might refer to something else when used in a [range](#range), a [with](#with), or when writing [templates](#templates) used in other templates.
|
||||
{{% /admonition %}}
|
||||
|
||||
[//]: <> (The above section is not included in the shared file because `refs` links are not supported in shared files.)
|
||||
|
||||
{{< docs/shared lookup="alerts/template-language.md" source="grafana" version="<GRAFANA_VERSION>" >}}
|
||||
445
docs/sources/alerting/alerting-rules/templates/reference.md
Normal file
445
docs/sources/alerting/alerting-rules/templates/reference.md
Normal file
@@ -0,0 +1,445 @@
|
||||
---
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/templates/reference/
|
||||
description: Reference for variables and functions in Grafana alert rule templating.
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- templating
|
||||
- labels
|
||||
- annotations
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Annotation and label template reference
|
||||
menuTitle: Template reference
|
||||
weight: 101
|
||||
refs:
|
||||
notification-template-reference:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/reference/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/
|
||||
language:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/language/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/language/
|
||||
language-functions:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/language/#functions
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/language/#functions
|
||||
language-index:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/language/#functions
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/language/#functions
|
||||
print-all-labels-from-a-classic-condition:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/examples/#print-all-labels-from-a-classic-condition
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/examples/#print-all-labels-from-a-classic-condition
|
||||
template-annotations-and-labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/
|
||||
---
|
||||
|
||||
# Annotation and label template reference
|
||||
|
||||
Annotations and labels in alert rules can be defined using plain text. However, you can also define templates to customize their values with dynamic data from alert rule queries.
|
||||
|
||||
For example, you can template the `summary` annotation to include information from query values, providing relevant alert context for responders. Refer to [Template annotations and labels](ref:template-annotations-and-labels) for various use cases.
|
||||
|
||||
In templates, variables represent dynamic values from queries, while functions perform actions to transform or format this data.
|
||||
|
||||
## Variables
|
||||
|
||||
Variables represent dynamic values from alert rule queries that can be displayed or accessed in your templates.
|
||||
|
||||
The `$` and `.` symbols are used to reference variables and their properties. You can reference variables directly in your alert rule definitions using the `$` symbol followed by the variable name. Similarly, you can access properties of variables using the dot (`.`) notation in alert rule templates.
|
||||
|
||||
```
|
||||
{{ $values.A.Value }}
|
||||
```
|
||||
|
||||
Templates are based on the **Go templating system**. Refer to [Template language](ref:language) for additional information.
|
||||
|
||||
The following variables are available when templating annotations and labels:
|
||||
|
||||
| Variables | Description |
|
||||
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [$labels](#labels) | Contains all labels from the query. |
|
||||
| [$values](#values) | Contains the labels and floating point values of all instant queries and expressions, indexed by their Ref IDs. |
|
||||
| [$value](#value) | A string containing the labels and values of all instant queries; threshold, reduce and math expressions, and classic conditions in the alert rule. |
|
||||
|
||||
### $labels
|
||||
|
||||
The `$labels` variable contains all labels from the query.
|
||||
|
||||
{{< figure src="/media/docs/alerting/query-labels-and_value.png" max-width="1200px" caption="An alert rule displaying labels and value from a query" >}}
|
||||
|
||||
For example, suppose you have a query that returns CPU usage for all of your servers, and you have an alert rule that fires when any of your servers have exceeded 80% CPU usage for the last 5 minutes. You want to add a summary annotation to the alert that tells you which server is experiencing high CPU usage. With the `$labels` variable you can write a template that prints a human-readable sentence such as:
|
||||
|
||||
```
|
||||
CPU usage for {{ $labels.instance }} has exceeded 80% for the last 5 minutes
|
||||
```
|
||||
|
||||
The outcome of this template would be:
|
||||
|
||||
```
|
||||
CPU usage for server1 has exceeded 80% for the last 5 minutes
|
||||
```
|
||||
|
||||
> If you are using a classic condition then `$labels` will not contain any labels from the query. Classic conditions discard these labels in order to enforce uni-dimensional behavior (at most one alert per alert rule). If you want to use labels from the query in your template then use the example [here](ref:print-all-labels-from-a-classic-condition).
|
||||
|
||||
### $values
|
||||
|
||||
The `$values` variable is a table containing the labels and floating point values of all instant queries and expressions, indexed by their Ref IDs (e.g, `A`, `B`, `C`, etc.). It does not contain the results of range queries, as they can return hundreds or thousands of rows.
|
||||
|
||||
Each Ref IDs, such as `$values.A`, has the following properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| -------- | --------------- | ------------------------------------------------------------ |
|
||||
| `Value` | Float | The value returned by the instant query or expression. |
|
||||
| `Labels` | Key/value pairs | The labels associated with the instance query or expression. |
|
||||
|
||||
Here's the previous example printing now the value of the instant query with Ref ID `A`:
|
||||
|
||||
```
|
||||
{{ $values.A.Value }} CPU usage for {{ $labels.instance }} over the last 5 minutes.
|
||||
```
|
||||
|
||||
If the alert has the label `instance=server1` and the query returns `81.2345`, the template would print:
|
||||
|
||||
```
|
||||
81.2345 CPU usage for instance1 over the last 5 minutes.
|
||||
```
|
||||
|
||||
If the query in Ref ID `A` is a range query rather than an instant query then add a reduce expression with Ref ID `B` and replace `$values.A.Value` with `$values.B.Value`:
|
||||
|
||||
```
|
||||
{{ $values.B.Value }} CPU usage for {{ $labels.instance }} over the last 5 minutes.
|
||||
```
|
||||
|
||||
Alternatively, you can use the `index()` function to retrieve the query value:
|
||||
|
||||
```
|
||||
{{ index $values "B" }} CPU usage for {{ index $labels "instance" }} over the last 5 minutes.
|
||||
```
|
||||
|
||||
#### $value
|
||||
|
||||
The `$value` variable is a string containing the labels and values of all instant queries; threshold, reduce and math expressions, and classic conditions in the alert rule.
|
||||
|
||||
This example prints the `$value` variable:
|
||||
|
||||
```
|
||||
{{ $value }}: CPU usage has exceeded 80% for the last 5 minutes.
|
||||
```
|
||||
|
||||
It would display something like this:
|
||||
|
||||
```
|
||||
[ var='A' labels={instance=instance1} value=81.234 ]: CPU usage has exceeded 80% for the last 5 minutes.
|
||||
```
|
||||
|
||||
Instead, we recommend using [$values](#values), which contains the same information as `$value` but is structured in an easier-to-use table format.
|
||||
|
||||
## Functions
|
||||
|
||||
Functions can perform actions in templates such as transforming or formatting data.
|
||||
|
||||
Note that the [functions provided by Go's template language](ref:language-functions), such as `index`, `and`, `printf`, and `len`, are available, along with many others.
|
||||
|
||||
In addition, the following functions are also available for templating annotations and labels:
|
||||
|
||||
**Numbers**
|
||||
|
||||
| Name | Arguments | Returns | Description |
|
||||
| ----------------------------------------- | ---------------- | ------- | ---------------------------------------------------------------- |
|
||||
| [humanize](#humanize) | number or string | string | Humanizes decimal numbers. |
|
||||
| [humanize1024](#humanize1024) | number or string | string | Like `humanize`, but but uses 1024 as the base rather than 1000. |
|
||||
| [humanizeDuration](#humanizeduration) | number or string | string | Humanizes a duration in seconds. |
|
||||
| [humanizePercentage](#humanizepercentage) | number or string | string | Humanizes a ratio value to a percentage. |
|
||||
| [humanizeTimestamp](#humanizetimestamp) | number or string | string | Humanizes a Unix timestamp. |
|
||||
| [toTime](#totime) | number or string | time | Converts a Unix timestamp in seconds to time. |
|
||||
|
||||
**Strings**
|
||||
|
||||
| Name | Arguments | Returns | Description |
|
||||
| ------------------------------- | -------------------------- | ------- | --------------------------------------------------------------------------------------------- |
|
||||
| [title](#title) | string | string | Capitalizes the first character of each word. |
|
||||
| [toUpper](#toupper) | string | string | Returns all text in uppercase. |
|
||||
| [toLower](#tolower) | string | string | Returns all text in lowercase. |
|
||||
| [stripPort](#stripport) | string | string | Returns only host. |
|
||||
| [match](#match) | pattern, text | boolean | Matches the text against a regular expression pattern. |
|
||||
| [reReplaceAll](#rereplaceall) | pattern, replacement, text | string | Replaces text matching the regular expression. |
|
||||
| [graphLink](#graphlink) | expr | string | Returns the path to the graphical view in `Explore` for the given expression and data source. |
|
||||
| [tableLink](#tablelink) | expr | string | Returns the path to the tabular view in `Explore` for the given expression and data source. |
|
||||
| [parseDuration](#parseduration) | string | float | Parses a duration string such as "1h" into the number of seconds it represents. |
|
||||
| [stripDomain](#stripdomain) | string | string | Returns the result of removing the domain part of a FQDN. |
|
||||
|
||||
**Others**
|
||||
|
||||
| Name | Arguments | Returns | Description |
|
||||
| --------------------------- | ------------- | ---------------------- | -------------------------------------------------------------------------------- |
|
||||
| [args](#args) | []interface{} | map[string]interface{} | Translates a list of objects to a map with keys arg0, arg1 etc. |
|
||||
| [safeHtml](#safehtml) | string | string | Marks string as HTML not requiring auto-escaping. |
|
||||
| [externalURL](#externalurl) | none | string | Returns the external URL of the Grafana server as configured in the ini file(s). |
|
||||
| [pathPrefix](#pathprefix) | none | string | Returns the path of the Grafana server as configured in the ini file(s). |
|
||||
|
||||
For further context on these functions, note that templating in Grafana is based on the [Prometheus template implementation](https://prometheus.io/docs/prometheus/latest/configuration/template_reference/), enabling the use of these functions and Prometheus-like templates for formatting alert messages within Grafana.
|
||||
|
||||
#### humanize
|
||||
|
||||
The `humanize` function humanizes decimal numbers:
|
||||
|
||||
```
|
||||
{{ humanize 1000.0 }}
|
||||
```
|
||||
|
||||
```
|
||||
1k
|
||||
```
|
||||
|
||||
#### humanize1024
|
||||
|
||||
The `humanize1024` works similar to `humanize` but but uses 1024 as the base rather than 1000:
|
||||
|
||||
```
|
||||
{{ humanize1024 1024.0 }}
|
||||
```
|
||||
|
||||
```
|
||||
1ki
|
||||
```
|
||||
|
||||
#### humanizeDuration
|
||||
|
||||
The `humanizeDuration` function humanizes a duration in seconds:
|
||||
|
||||
```
|
||||
{{ humanizeDuration 60.0 }}
|
||||
```
|
||||
|
||||
```
|
||||
1m 0s
|
||||
```
|
||||
|
||||
#### humanizePercentage
|
||||
|
||||
The `humanizePercentage` function humanizes a ratio value between 0 and 1 to a percentage:
|
||||
|
||||
```
|
||||
{{ humanizePercentage 0.2 }}
|
||||
```
|
||||
|
||||
```
|
||||
20%
|
||||
```
|
||||
|
||||
#### humanizeTimestamp
|
||||
|
||||
The `humanizeTimestamp` function humanizes a Unix timestamp:
|
||||
|
||||
```
|
||||
{{ humanizeTimestamp 1577836800.0 }}
|
||||
```
|
||||
|
||||
```
|
||||
2020-01-01 00:00:00 +0000 UTC
|
||||
```
|
||||
|
||||
#### toTime
|
||||
|
||||
The `toTime` function converts a Unix timestamp in seconds to time.:
|
||||
|
||||
```
|
||||
{{ toTime 1727802106 }}
|
||||
```
|
||||
|
||||
```
|
||||
2024-10-01 17:01:46 +0000 UTC
|
||||
```
|
||||
|
||||
#### title
|
||||
|
||||
The `title` function capitalizes the first character of each word:
|
||||
|
||||
```
|
||||
{{ title "hello, world!" }}
|
||||
```
|
||||
|
||||
```
|
||||
Hello, World!
|
||||
```
|
||||
|
||||
#### toUpper
|
||||
|
||||
The `toUpper` function returns all text in uppercase:
|
||||
|
||||
```
|
||||
{{ toUpper "Hello, world!" }}
|
||||
```
|
||||
|
||||
```
|
||||
HELLO, WORLD!
|
||||
```
|
||||
|
||||
#### toLower
|
||||
|
||||
The `toLower` function returns all text in lowercase:
|
||||
|
||||
```
|
||||
{{ toLower "Hello, world!" }}
|
||||
```
|
||||
|
||||
```
|
||||
hello, world!
|
||||
```
|
||||
|
||||
#### stripPort
|
||||
|
||||
The `stripPort` splits string into host and port, then returns only host:
|
||||
|
||||
```
|
||||
{{ stripPort "example.com:8080" }}
|
||||
```
|
||||
|
||||
```
|
||||
example.com
|
||||
```
|
||||
|
||||
#### match
|
||||
|
||||
The `match` function matches the text against a regular expression pattern:
|
||||
|
||||
```
|
||||
{{ match "a.*" "abc" }}
|
||||
```
|
||||
|
||||
```
|
||||
true
|
||||
```
|
||||
|
||||
#### reReplaceAll
|
||||
|
||||
The `reReplaceAll` function replaces text matching the regular expression:
|
||||
|
||||
```
|
||||
{{ reReplaceAll "localhost:(.*)" "example.com:$1" "localhost:8080" }}
|
||||
```
|
||||
|
||||
```
|
||||
example.com:8080
|
||||
```
|
||||
|
||||
#### graphLink
|
||||
|
||||
The `graphLink` function returns the path to the graphical view in [Explore](ref:explore) for the given expression and data source:
|
||||
|
||||
```
|
||||
{{ graphLink "{\"expr\": \"up\", \"datasource\": \"gdev-prometheus\"}" }}
|
||||
```
|
||||
|
||||
```
|
||||
/explore?left=["now-1h","now","gdev-prometheus",{"datasource":"gdev-prometheus","expr":"up","instant":false,"range":true}]
|
||||
```
|
||||
|
||||
#### parseDuration
|
||||
|
||||
The `parseDuration` function parses a duration string such as "1h" into the number of seconds it represents.
|
||||
|
||||
```
|
||||
{{ parseDuration "1h" }}
|
||||
```
|
||||
|
||||
```
|
||||
3600
|
||||
```
|
||||
|
||||
#### stripDomain
|
||||
|
||||
The `stripDomain` removes the domain part of a FQDN, leaving port untouched:
|
||||
|
||||
```
|
||||
{{ stripDomain "example.com:8080" }}
|
||||
```
|
||||
|
||||
```
|
||||
example:8080
|
||||
```
|
||||
|
||||
#### tableLink
|
||||
|
||||
The `tableLink` function returns the path to the tabular view in [Explore](ref:explore) for the given expression and data source:
|
||||
|
||||
```
|
||||
{{ tableLink "{\"expr\": \"up\", \"datasource\": \"gdev-prometheus\"}" }}
|
||||
```
|
||||
|
||||
```
|
||||
/explore?left=["now-1h","now","gdev-prometheus",{"datasource":"gdev-prometheus","expr":"up","instant":true,"range":false}]
|
||||
```
|
||||
|
||||
#### args
|
||||
|
||||
The `args` function translates a list of objects to a map with keys arg0, arg1 etc. This is intended to allow multiple arguments to be passed to templates:
|
||||
|
||||
```
|
||||
{{define "x"}}{{.arg0}} {{.arg1}}{{end}}{{template "x" (args 1 "2")}}
|
||||
```
|
||||
|
||||
```
|
||||
1 2
|
||||
```
|
||||
|
||||
#### safeHtml
|
||||
|
||||
The `safeHtml` function marks string as HTML not requiring auto-escaping:
|
||||
|
||||
```
|
||||
{{ safeHtml "<b>Text</b>"}}
|
||||
```
|
||||
|
||||
```
|
||||
<b>Text</b>
|
||||
```
|
||||
|
||||
#### externalURL
|
||||
|
||||
The `externalURL` function returns the external URL of the Grafana server as configured in the ini file(s):
|
||||
|
||||
```
|
||||
{{ externalURL }}
|
||||
```
|
||||
|
||||
```
|
||||
https://example.com/grafana
|
||||
```
|
||||
|
||||
#### pathPrefix
|
||||
|
||||
The `pathPrefix` function returns the path of the Grafana server as configured in the ini file(s):
|
||||
|
||||
```
|
||||
{{ pathPrefix }}
|
||||
```
|
||||
|
||||
```
|
||||
/grafana
|
||||
```
|
||||
|
||||
## Differences with notification templates
|
||||
|
||||
Both notification templates and alert rule templates use the Go templating system. However, the [functions and variables available in notification templates](ref:notification-template-reference) differ from those used in annotations and labels templates, which are described in this documentation.
|
||||
|
||||
Annotation and label templates operate in the context of an individual alert instance, while notification templates apply to a notification that includes a group of alert(s).
|
||||
|
||||
For example, notification templates provide the `.Alerts` variable, which includes the list of all firing and resolved alerts in the notification. This variable is not available in alert rule templates, which operate within the context of a single alert instance.
|
||||
|
||||
Additionally, you cannot reuse templates for labels and annotations as you can with notification templates. Instead, you need to write each template inline within the label or annotation fields and manually copy them wherever you want to reuse the templates.
|
||||
@@ -1,459 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- ../fundamentals/annotation-label/variables-label-annotation/ # /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/annotation-label/variables-label-annotation/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/templating-labels-annotations/
|
||||
description: Learn about how to template labels and annotations
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- templating
|
||||
- labels
|
||||
- annotations
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Template labels and annotations
|
||||
weight: 500
|
||||
refs:
|
||||
explore:
|
||||
- pattern: /docs/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/explore/
|
||||
---
|
||||
|
||||
# Template labels and annotations
|
||||
|
||||
You can use templates to include data from queries and expressions in labels and annotations. For example, you might want to set the severity label for an alert based on the value of the query, or use the instance label from the query in a summary annotation so you know which server is experiencing high CPU usage.
|
||||
|
||||
When using custom labels with templates it is important to make sure that the label value does not change between consecutive evaluations of the alert rule as this will end up creating large numbers of distinct alerts. However, it is OK for the template to produce different label values for different alerts. For example, do not put the value of the query in a custom label as this will end up creating a new set of alerts each time the value changes. Instead use annotations.
|
||||
|
||||
All templates should be written in [text/template](https://pkg.go.dev/text/template). Regardless of whether you are templating a label or an annotation, you should write each template inline inside the label or annotation that you are templating. This means you cannot share templates between labels and annotations, and instead you will need to copy templates wherever you want to use them.
|
||||
|
||||
Each template is evaluated whenever the alert rule is evaluated, and is evaluated for every alert separately. For example, if your alert rule has a templated summary annotation, and the alert rule has 10 firing alerts, then the template will be executed 10 times, once for each alert. You should try to avoid doing expensive computations in your templates as much as possible.
|
||||
|
||||
{{% admonition type="caution" %}}
|
||||
Extra whitespace in label templates can break matches with notification policies.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Variables
|
||||
|
||||
In Grafana templating, the `$` and `.` symbols are used to reference variables and their properties. You can reference variables directly in your alert rule definitions using the `$` symbol followed by the variable name. Similarly, you can access properties of variables using the dot (`.`) notation within alert rule definitions.
|
||||
|
||||
The following variables are available to you when templating labels and annotations:
|
||||
|
||||
### The labels variable
|
||||
|
||||
The `$labels` variable contains all labels from the query. For example, suppose you have a query that returns CPU usage for all of your servers, and you have an alert rule that fires when any of your servers have exceeded 80% CPU usage for the last 5 minutes. You want to add a summary annotation to the alert that tells you which server is experiencing high CPU usage. With the `$labels` variable you can write a template that prints a human-readable sentence such as:
|
||||
|
||||
```
|
||||
CPU usage for {{ index $labels "instance" }} has exceeded 80% for the last 5 minutes
|
||||
```
|
||||
|
||||
> If you are using a classic condition then `$labels` will not contain any labels from the query. Classic conditions discard these labels in order to enforce uni-dimensional behavior (at most one alert per alert rule). If you want to use labels from the query in your template then use the example [here](#print-all-labels-from-a-classic-condition).
|
||||
|
||||
### The value variable
|
||||
|
||||
The `$value` variable is a string containing the labels and values of all instant queries; threshold, reduce and math expressions, and classic conditions in the alert rule. It does not contain the results of range queries, as these can return anywhere from 10s to 10,000s of rows or metrics. If it did, for especially large queries a single alert could use 10s of MBs of memory and Grafana would run out of memory very quickly.
|
||||
|
||||
To print the `$value` variable in the summary you would write something like this:
|
||||
|
||||
```
|
||||
CPU usage for {{ index $labels "instance" }} has exceeded 80% for the last 5 minutes: {{ $value }}
|
||||
```
|
||||
|
||||
And would look something like this:
|
||||
|
||||
```
|
||||
CPU usage for instance1 has exceeded 80% for the last 5 minutes: [ var='A' labels={instance=instance1} value=81.234 ]
|
||||
```
|
||||
|
||||
Here `var='A'` refers to the instant query with Ref ID A, `labels={instance=instance1}` refers to the labels, and `value=81.234` refers to the average CPU usage over the last 5 minutes.
|
||||
|
||||
If you want to print just some of the string instead of the full string then use the `$values` variable. It contains the same information as `$value`, but in a structured table, and is much easier to use then writing a regular expression to match just the text you want.
|
||||
|
||||
### The values variable
|
||||
|
||||
The `$values` variable is a table containing the labels and floating point values of all instant queries and expressions, indexed by their Ref IDs.
|
||||
|
||||
To print the value of the instant query with Ref ID A:
|
||||
|
||||
```
|
||||
CPU usage for {{ index $labels "instance" }} has exceeded 80% for the last 5 minutes: {{ index $values "A" }}
|
||||
```
|
||||
|
||||
For example, given an alert with the labels `instance=server1` and an instant query with the value `81.2345`, this would print:
|
||||
|
||||
```
|
||||
CPU usage for instance1 has exceeded 80% for the last 5 minutes: 81.2345
|
||||
```
|
||||
|
||||
If the query in Ref ID A is a range query rather than an instant query then add a reduce expression with Ref ID B and replace `(index $values "A")` with `(index $values "B")`:
|
||||
|
||||
```
|
||||
CPU usage for {{ index $labels "instance" }} has exceeded 80% for the last 5 minutes: {{ index $values "B" }}
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
The following examples attempt to show the most common use-cases we have seen for templates. You can use these examples verbatim, or adapt them as necessary for your use case. For more information on how to write text/template refer see [the beginner's guide to alert notification templates in Grafana](https://grafana.com/blog/2023/04/05/grafana-alerting-a-beginners-guide-to-templating-alert-notifications/).
|
||||
|
||||
### Print all labels, comma separated
|
||||
|
||||
To print all labels, comma separated, print the `$labels` variable:
|
||||
|
||||
```
|
||||
{{ $labels }}
|
||||
```
|
||||
|
||||
For example, given an alert with the labels `alertname=High CPU usage`, `grafana_folder=CPU alerts` and `instance=server1`, this would print:
|
||||
|
||||
```
|
||||
alertname=High CPU usage, grafana_folder=CPU alerts, instance=server1
|
||||
```
|
||||
|
||||
> If you are using classic conditions then `$labels` will not contain any labels from the query. Refer to [the $labels variable](#the-labels-variable) for more information.
|
||||
|
||||
### Print all labels, one per line
|
||||
|
||||
To print all labels, one per line, use a `range` to iterate over each key/value pair and print them individually. Here `$k` refers to the name and `$v` refers to the value of the current label:
|
||||
|
||||
```
|
||||
{{ range $k, $v := $labels -}}
|
||||
{{ $k }}={{ $v }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
For example, given an alert with the labels `alertname=High CPU usage`, `grafana_folder=CPU alerts` and `instance=server1`, this would print:
|
||||
|
||||
```
|
||||
alertname=High CPU usage
|
||||
grafana_folder=CPU alerts
|
||||
instance=server1
|
||||
```
|
||||
|
||||
> If you are using classic conditions then `$labels` will not contain any labels from the query. Refer to [the $labels variable](#the-labels-variable) for more information.
|
||||
|
||||
### Print an individual label
|
||||
|
||||
To print an individual label use the `index` function with the `$labels` variable:
|
||||
|
||||
```
|
||||
The host {{ index $labels "instance" }} has exceeded 80% CPU usage for the last 5 minutes
|
||||
```
|
||||
|
||||
For example, given an alert with the labels `instance=server1`, this would print:
|
||||
|
||||
```
|
||||
The host server1 has exceeded 80% CPU usage for the last 5 minutes
|
||||
```
|
||||
|
||||
> If you are using classic conditions then `$labels` will not contain any labels from the query. Refer to [the $labels variable](#the-labels-variable) for more information.
|
||||
|
||||
### Print the value of a query
|
||||
|
||||
To print the value of an instant query you can print its Ref ID using the `index` function and the `$values` variable:
|
||||
|
||||
```
|
||||
{{ index $values "A" }}
|
||||
```
|
||||
|
||||
For example, given an instant query that returns the value 81.2345, this will print:
|
||||
|
||||
```
|
||||
81.2345
|
||||
```
|
||||
|
||||
To print the value of a range query you must first reduce it from a time series to an instant vector with a reduce expression. You can then print the result of the reduce expression by using its Ref ID instead. For example, if the reduce expression takes the average of A and has the Ref ID B you would write:
|
||||
|
||||
```
|
||||
{{ index $values "B" }}
|
||||
```
|
||||
|
||||
### Print the humanized value of a query
|
||||
|
||||
To print the humanized value of an instant query use the `humanize` function:
|
||||
|
||||
```
|
||||
{{ humanize (index $values "A").Value }}
|
||||
```
|
||||
|
||||
For example, given an instant query that returns the value 81.2345, this will print:
|
||||
|
||||
```
|
||||
81.234
|
||||
```
|
||||
|
||||
To print the humanized value of a range query you must first reduce it from a time series to an instant vector with a reduce expression. You can then print the result of the reduce expression by using its Ref ID instead. For example, if the reduce expression takes the average of A and has the Ref ID B you would write:
|
||||
|
||||
```
|
||||
{{ humanize (index $values "B").Value }}
|
||||
```
|
||||
|
||||
### Print the value of a query as a percentage
|
||||
|
||||
To print the value of an instant query as a percentage use the `humanizePercentage` function:
|
||||
|
||||
```
|
||||
{{ humanizePercentage (index $values "A").Value }}
|
||||
```
|
||||
|
||||
This function expects the value to be a decimal number between 0 and 1. If the value is instead a decimal number between 0 and 100 you can either divide it by 100 in your query or using a math expression. If the query is a range query you must first reduce it from a time series to an instant vector with a reduce expression.
|
||||
|
||||
### Set a severity from the value of a query
|
||||
|
||||
To set a severity label from the value of a query use an if statement and the greater than comparison function. Make sure to use decimals (`80.0`, `50.0`, `0.0`, etc) when doing comparisons against `$values` as text/template does not support type coercion. You can find a list of all the supported comparison functions [here](https://pkg.go.dev/text/template#hdr-Functions).
|
||||
|
||||
```
|
||||
{{ if (gt $values.A.Value 80.0) -}}
|
||||
high
|
||||
{{ else if (gt $values.A.Value 50.0) -}}
|
||||
medium
|
||||
{{ else -}}
|
||||
low
|
||||
{{- end }}
|
||||
```
|
||||
|
||||
### Print all labels from a classic condition
|
||||
|
||||
You cannot use `$labels` to print labels from the query if you are using classic conditions, and must use `$values` instead. The reason for this is classic conditions discard these labels to enforce uni-dimensional behavior (at most one alert per alert rule). If classic conditions didn't discard these labels, then queries that returned many time series would cause alerts to flap between firing and resolved constantly as the labels would change every time the alert rule was evaluated.
|
||||
|
||||
Instead, the `$values` variable contains the reduced values of all time series for all conditions that are firing. For example, if you have an alert rule with a query A that returns two time series, and a classic condition B with two conditions, then `$values` would contain `B0`, `B1`, `B2` and `B3`. If the classic condition B had just one condition, then `$values` would contain just `B0` and `B1`.
|
||||
|
||||
To print all labels of all firing time series use the following template (make sure to replace `B` in the regular expression with the Ref ID of the classic condition if it's different):
|
||||
|
||||
```
|
||||
{{ range $k, $v := $values -}}
|
||||
{{ if (match "B[0-9]+" $k) -}}
|
||||
{{ $k }}: {{ $v.Labels }}{{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
For example, a classic condition for two time series exceeding a single condition would print:
|
||||
|
||||
```
|
||||
B0: instance=server1
|
||||
B1: instance=server2
|
||||
```
|
||||
|
||||
If the classic condition has two or more conditions, and a time series exceeds multiple conditions at the same time, then its labels will be duplicated for each condition that is exceeded:
|
||||
|
||||
```
|
||||
B0: instance=server1
|
||||
B1: instance=server2
|
||||
B2: instance=server1
|
||||
B3: instance=server2
|
||||
```
|
||||
|
||||
If you need to print unique labels you should consider changing your alert rules from uni-dimensional to multi-dimensional instead. You can do this by replacing your classic condition with reduce and math expressions.
|
||||
|
||||
### Print all values from a classic condition
|
||||
|
||||
To print all values from a classic condition take the previous example and replace `$v.Labels` with `$v.Value`:
|
||||
|
||||
```
|
||||
{{ range $k, $v := $values -}}
|
||||
{{ if (match "B[0-9]+" $k) -}}
|
||||
{{ $k }}: {{ $v.Value }}{{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
For example, a classic condition for two time series exceeding a single condition would print:
|
||||
|
||||
```
|
||||
B0: 81.2345
|
||||
B1: 84.5678
|
||||
```
|
||||
|
||||
If the classic condition has two or more conditions, and a time series exceeds multiple conditions at the same time, then `$values` will contain the values of all conditions:
|
||||
|
||||
```
|
||||
B0: 81.2345
|
||||
B1: 92.3456
|
||||
B2: 84.5678
|
||||
B3: 95.6789
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
The following functions are available to you when templating labels and annotations:
|
||||
|
||||
### args
|
||||
|
||||
The `args` function translates a list of objects to a map with keys arg0, arg1 etc. This is intended to allow multiple arguments to be passed to templates:
|
||||
|
||||
```
|
||||
{{define "x"}}{{.arg0}} {{.arg1}}{{end}}{{template "x" (args 1 "2")}}
|
||||
```
|
||||
|
||||
```
|
||||
1 2
|
||||
```
|
||||
|
||||
### externalURL
|
||||
|
||||
The `externalURL` function returns the external URL of the Grafana server as configured in the ini file(s):
|
||||
|
||||
```
|
||||
{{ externalURL }}
|
||||
```
|
||||
|
||||
```
|
||||
https://example.com/grafana
|
||||
```
|
||||
|
||||
### graphLink
|
||||
|
||||
The `graphLink` function returns the path to the graphical view in [Explore](ref:explore) for the given expression and data source:
|
||||
|
||||
```
|
||||
{{ graphLink "{\"expr\": \"up\", \"datasource\": \"gdev-prometheus\"}" }}
|
||||
```
|
||||
|
||||
```
|
||||
/explore?left=["now-1h","now","gdev-prometheus",{"datasource":"gdev-prometheus","expr":"up","instant":false,"range":true}]
|
||||
```
|
||||
|
||||
### humanize
|
||||
|
||||
The `humanize` function humanizes decimal numbers:
|
||||
|
||||
```
|
||||
{{ humanize 1000.0 }}
|
||||
```
|
||||
|
||||
```
|
||||
1k
|
||||
```
|
||||
|
||||
### humanize1024
|
||||
|
||||
The `humanize1024` works similar to `humanize` but but uses 1024 as the base rather than 1000:
|
||||
|
||||
```
|
||||
{{ humanize1024 1024.0 }}
|
||||
```
|
||||
|
||||
```
|
||||
1ki
|
||||
```
|
||||
|
||||
### humanizeDuration
|
||||
|
||||
The `humanizeDuration` function humanizes a duration in seconds:
|
||||
|
||||
```
|
||||
{{ humanizeDuration 60.0 }}
|
||||
```
|
||||
|
||||
```
|
||||
1m 0s
|
||||
```
|
||||
|
||||
### humanizePercentage
|
||||
|
||||
The `humanizePercentage` function humanizes a ratio value to a percentage:
|
||||
|
||||
```
|
||||
{{ humanizePercentage 0.2 }}
|
||||
```
|
||||
|
||||
```
|
||||
20%
|
||||
```
|
||||
|
||||
### humanizeTimestamp
|
||||
|
||||
The `humanizeTimestamp` function humanizes a Unix timestamp:
|
||||
|
||||
```
|
||||
{{ humanizeTimestamp 1577836800.0 }}
|
||||
```
|
||||
|
||||
```
|
||||
2020-01-01 00:00:00 +0000 UTC
|
||||
```
|
||||
|
||||
### match
|
||||
|
||||
The `match` function matches the text against a regular expression pattern:
|
||||
|
||||
```
|
||||
{{ match "a.*" "abc" }}
|
||||
```
|
||||
|
||||
```
|
||||
true
|
||||
```
|
||||
|
||||
### pathPrefix
|
||||
|
||||
The `pathPrefix` function returns the path of the Grafana server as configured in the ini file(s):
|
||||
|
||||
```
|
||||
{{ pathPrefix }}
|
||||
```
|
||||
|
||||
```
|
||||
/grafana
|
||||
```
|
||||
|
||||
### tableLink
|
||||
|
||||
The `tableLink` function returns the path to the tabular view in [Explore](ref:explore) for the given expression and data source:
|
||||
|
||||
```
|
||||
{{ tableLink "{\"expr\": \"up\", \"datasource\": \"gdev-prometheus\"}" }}
|
||||
```
|
||||
|
||||
```
|
||||
/explore?left=["now-1h","now","gdev-prometheus",{"datasource":"gdev-prometheus","expr":"up","instant":true,"range":false}]
|
||||
```
|
||||
|
||||
### title
|
||||
|
||||
The `title` function capitalizes the first character of each word:
|
||||
|
||||
```
|
||||
{{ title "hello, world!" }}
|
||||
```
|
||||
|
||||
```
|
||||
Hello, World!
|
||||
```
|
||||
|
||||
### toLower
|
||||
|
||||
The `toLower` function returns all text in lowercase:
|
||||
|
||||
```
|
||||
{{ toLower "Hello, world!" }}
|
||||
```
|
||||
|
||||
```
|
||||
hello, world!
|
||||
```
|
||||
|
||||
### toUpper
|
||||
|
||||
The `toUpper` function returns all text in uppercase:
|
||||
|
||||
```
|
||||
{{ toUpper "Hello, world!" }}
|
||||
```
|
||||
|
||||
```
|
||||
HELLO, WORLD!
|
||||
```
|
||||
|
||||
### reReplaceAll
|
||||
|
||||
The `reReplaceAll` function replaces text matching the regular expression:
|
||||
|
||||
```
|
||||
{{ reReplaceAll "localhost:(.*)" "example.com:$1" "localhost:8080" }}
|
||||
```
|
||||
|
||||
```
|
||||
example.com:8080
|
||||
```
|
||||
@@ -26,9 +26,9 @@ refs:
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/notification-policies/
|
||||
templates-page:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/templates/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/templates/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/templates/
|
||||
---
|
||||
|
||||
# Configure notifications
|
||||
|
||||
@@ -26,6 +26,16 @@ labels:
|
||||
title: Configure contact points
|
||||
weight: 410
|
||||
refs:
|
||||
sns:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/manage-contact-points/integrations/configure-amazon-sns/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/manage-contact-points/integrations/configure-amazon-sns/
|
||||
gchat:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/manage-contact-points/integrations/configure-google-chat/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/manage-contact-points/integrations/configure-google-chat/
|
||||
email:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/manage-contact-points/integrations/configure-email/
|
||||
@@ -81,27 +91,28 @@ refs:
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/manage-contact-points/integrations/configure-mqtt/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/manage-contact-points/integrations/configure-mqtt/
|
||||
manage-notification-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/manage-notification-templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/manage-notification-templates/
|
||||
---
|
||||
|
||||
# Configure contact points
|
||||
|
||||
Use contact points to select your preferred communication channel for receiving notifications when your alert rules are firing. You can add, edit, delete, export, and test a contact point.
|
||||
Use contact points to specify where to receive alert notifications. Contact points contain the configuration for sending alert notifications, including destinations like email, Slack, OnCall, webhooks, and their notification messages.
|
||||
|
||||
Testing a contact point is only available for Grafana Alertmanager.
|
||||
A contact point can have one or multiple destinations, known as [contact point integrations](#list-of-supported-integrations). Alert notifications are sent to each integration within the chosen contact point.
|
||||
|
||||
On the **Contact Points** tab, you can:
|
||||
|
||||
- Add, edit, and view contact points and integrations.
|
||||
- Search for name and type of contact points and integrations.
|
||||
- View all existing contact points and integrations.
|
||||
- View how many notification policies each contact point is being used for and navigate directly to the linked notification policies.
|
||||
- View the status of notification deliveries.
|
||||
- Export individual contact points or all contact points in JSON, YAML, or Terraform format.
|
||||
- Delete contact points. Note that you cannot delete contact points that are in use by a notification policy. To proceed, either delete the notification policy or update it to use another contact point.
|
||||
|
||||
On the **Notification templates** tab, you can:
|
||||
|
||||
- View, edit, copy or delete existing notification templates.
|
||||
|
||||
## Add a contact point
|
||||
|
||||
Complete the following steps to add a contact point.
|
||||
@@ -114,41 +125,23 @@ Complete the following steps to add a contact point.
|
||||
1. From **Integration**, select a type and fill out mandatory fields. For example, if you choose email, enter the email addresses. Or if you choose Slack, enter the Slack channel and users who should be contacted.
|
||||
1. Some contact point integrations, like email or Webhook, have optional settings. In **Optional settings**, specify additional settings for the selected contact point integration.
|
||||
1. In Notification settings, optionally select **Disable resolved message** if you do not want to be notified when an alert resolves.
|
||||
1. To add another contact point integration, click **Add contact point integration** and repeat steps 6 through 8.
|
||||
1. Save your changes.
|
||||
|
||||
## Use notification templates
|
||||
## Add another contact point integration
|
||||
|
||||
Use templates in contact points to customize your notifications.
|
||||
A contact point can have multiple integrations, or destinations for sending notifications.
|
||||
|
||||
Complete the following steps to add templates to your contact point.
|
||||
To add another integration to a contact point, complete the following steps.
|
||||
|
||||
1. Click an existing contact point or create a new one
|
||||
1. In **Optional settings**, click any field that contains templates.
|
||||
|
||||
For example, if you are creating an email contact point integration, click **Message** or **Subject**.
|
||||
|
||||
1. Click **Edit**.
|
||||
A dialog box opens where you can select templates.
|
||||
1. [Optional] Click **Select existing template** to select a template and preview it using the default payload.
|
||||
|
||||
Click **Save** to use just a single template in the field.
|
||||
|
||||
You can also copy the selected template and use it in the custom tab.
|
||||
|
||||
1. [Optional] Click **Enter custom message** to customize and edit the field directly. Note that the title changes depending on the field you are editing.
|
||||
|
||||
Click **Save** to use just a single template in the field.
|
||||
|
||||
1. You can switch between the two tabs to access the list of available templates and copy them across to the customized version.
|
||||
|
||||
1. Click **Save contact point**.
|
||||
1. Add or edit an existing contact point.
|
||||
1. Click **Add contact point integration** and repeat the same steps as [Add a contact point](#add-a-contact-point).
|
||||
- From **Integration**, select a type and fill out mandatory fields.
|
||||
- In **Optional settings**, specify additional settings for the selected contact point integration.
|
||||
1. Save your changes.
|
||||
|
||||
## Test a contact point
|
||||
|
||||
** For Grafana Alertmanager only.**
|
||||
|
||||
Complete the following steps to test a contact point.
|
||||
Testing a contact point is only available for Grafana Alertmanager. Complete the following steps to test a contact point.
|
||||
|
||||
1. In the left-side menu, click **Alerts & IRM** and then **Alerting**.
|
||||
1. Click **Contact points** to view a list of existing contact points.
|
||||
@@ -166,17 +159,17 @@ The following table lists the contact point integrations supported by Grafana.
|
||||
| Name | Type |
|
||||
| ---------------------------- | ------------------------- |
|
||||
| Alertmanager | `prometheus-alertmanager` |
|
||||
| Amazon SNS | `sns` |
|
||||
| [Amazon SNS](ref:sns) | `sns` |
|
||||
| Cisco Webex Teams | `webex` |
|
||||
| DingDing | `dingding` |
|
||||
| [Discord](ref:discord) | `discord` |
|
||||
| [Email](ref:email) | `email` |
|
||||
| Google Chat | `googlechat` |
|
||||
| [Google Chat](ref:gchat) | `googlechat` |
|
||||
| [Grafana Oncall](ref:oncall) | `oncall` |
|
||||
| Kafka REST Proxy | `kafka` |
|
||||
| [MQTT](ref:mqtt) | `mqtt` |
|
||||
| Line | `line` |
|
||||
| [Microsoft Teams](ref:teams) | `teams` |
|
||||
| [MQTT](ref:mqtt) | `mqtt` |
|
||||
| [Opsgenie](ref:opsgenie) | `opsgenie` |
|
||||
| [Pagerduty](ref:pagerduty) | `pagerduty` |
|
||||
| Pushover | `pushover` |
|
||||
@@ -185,7 +178,17 @@ The following table lists the contact point integrations supported by Grafana.
|
||||
| [Telegram](ref:telegram) | `telegram` |
|
||||
| Threema Gateway | `threema` |
|
||||
| VictorOps | `victorops` |
|
||||
| WeCom | `wecom` |
|
||||
| [Webhook](ref:webhook) | `webhook` |
|
||||
| WeCom | `wecom` |
|
||||
|
||||
Some of these integrations are not compatible with [external Alertmanagers](ref:external-alertmanager). For the list of Prometheus Alertmanager integrations, refer to the [Prometheus Alertmanager receiver settings](https://prometheus.io/docs/alerting/latest/configuration/#receiver-integration-settings).
|
||||
|
||||
## Customize notification messages
|
||||
|
||||
In contact points, you can also customize notification messages. For example, when setting up an email contact point integration, click **Message** or **Subject** to modify it.
|
||||
|
||||
By default, notification messages include common alert details, which are usually sufficient for most cases.
|
||||
|
||||
If necessary, you can customize the content and format of notification messages. You can create a custom notification template, which can then be applied to one or more contact points.
|
||||
|
||||
On the **Notification templates** tab, you can view, edit, copy or delete notification templates. Refer to [manage notification templates](ref:manage-notification-templates) for instructions on selecting or creating a template for a contact point.
|
||||
|
||||
@@ -13,7 +13,7 @@ labels:
|
||||
- oss
|
||||
menuTitle: Amazon SNS
|
||||
title: Configure Amazon SNS for Alerting
|
||||
weight: 0
|
||||
weight: 100
|
||||
---
|
||||
|
||||
# Configure Amazon SNS for Alerting
|
||||
|
||||
@@ -13,7 +13,7 @@ labels:
|
||||
- oss
|
||||
menuTitle: Discord
|
||||
title: Configure Discord for Alerting
|
||||
weight: 0
|
||||
weight: 105
|
||||
---
|
||||
|
||||
# Configure Discord for Alerting
|
||||
|
||||
@@ -13,13 +13,21 @@ labels:
|
||||
- oss
|
||||
menuTitle: Email
|
||||
title: Configure email for Alerting
|
||||
weight: 0
|
||||
weight: 110
|
||||
refs:
|
||||
notification-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/
|
||||
---
|
||||
|
||||
# Configure email for Alerting
|
||||
|
||||
Use the Grafana Alerting - email integration to send email notifications when your alerts are firing. An email is sent when an alert fires and when an alert gets resolved.
|
||||
|
||||
Note that you can customize the `subject` and `message` of the email using [notification templates](ref:notification-templates). However, you cannot add HTML and CSS to email notifications for visual changes.
|
||||
|
||||
## Before you begin
|
||||
|
||||
{{<admonition type="note">}}
|
||||
|
||||
@@ -13,7 +13,7 @@ labels:
|
||||
- oss
|
||||
menuTitle: Google Chat
|
||||
title: Configure Google Chat for Alerting
|
||||
weight: 0
|
||||
weight: 115
|
||||
---
|
||||
|
||||
# Configure Google Chat for Alerting
|
||||
|
||||
@@ -12,9 +12,9 @@ labels:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
menuTitle: MQTT notifier
|
||||
menuTitle: MQTT
|
||||
title: Configure the MQTT notifier for Alerting
|
||||
weight: 0
|
||||
weight: 140
|
||||
---
|
||||
|
||||
# Configure the MQTT notifier for Alerting
|
||||
@@ -149,8 +149,8 @@ Each alert instance in the `alerts` array has the following fields.
|
||||
| generatorURL | string | URL of the alert rule in the Grafana UI |
|
||||
| fingerprint | string | The labels fingerprint, alarms with the same labels will have the same fingerprint |
|
||||
| silenceURL | string | URL to silence the alert rule in the Grafana UI |
|
||||
| dashboardURL | string | **Deprecated. It will be removed in a future release.** |
|
||||
| panelURL | string | **Deprecated. It will be removed in a future release.** |
|
||||
| dashboardURL | string | A link to the Grafana Dashboard if the alert has a Dashboard UID annotation |
|
||||
| panelURL | string | A link to the panel if the alert has a Panel ID annotation |
|
||||
| imageURL | string | URL of a screenshot of a panel assigned to the rule that created this notification |
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
aliases:
|
||||
- ../../../alerting-rules/manage-contact-points/configure-oncall/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/manage-contact-points/configure-oncall/
|
||||
- ../../../alerting-rules/manage-contact-points/integrations/configure-oncall/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/manage-contact-points/integrations/configure-oncall/
|
||||
- ../configure-oncall/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/manage-contact-points/configure-oncall/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/configure-notifications/manage-contact-points/integrations/configure-oncall/
|
||||
description: Configure the Alerting - Grafana OnCall integration to connect alerts generated by Grafana Alerting with Grafana OnCall
|
||||
keywords:
|
||||
@@ -9,8 +10,6 @@ keywords:
|
||||
- alerting
|
||||
- oncall
|
||||
- integration
|
||||
aliases:
|
||||
- ../configure-oncall/ # /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/manage-contact-points/configure-oncall/
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
@@ -18,7 +17,7 @@ labels:
|
||||
- oss
|
||||
menuTitle: Grafana OnCall
|
||||
title: Configure Grafana OnCall for Alerting
|
||||
weight: 0
|
||||
weight: 120
|
||||
---
|
||||
|
||||
# Configure Grafana OnCall for Alerting
|
||||
@@ -26,7 +25,7 @@ weight: 0
|
||||
Use the Grafana Alerting - Grafana OnCall integration to effortlessly connect alerts generated by Grafana Alerting with Grafana OnCall, where you can then route them according to defined escalation chains and schedules.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
You can also configure the integration from Grafana OnCall. For more information, refer to [Grafana OnCall documentation](http://grafana.com/docs/oncall/latest/integrations/grafana-alerting/).
|
||||
You can also configure the integration from Grafana OnCall. For more information, refer to [Grafana OnCall documentation](http://grafana.com/docs/oncall/latest/configure/integrations/references/grafana-alerting/).
|
||||
{{< /admonition >}}
|
||||
|
||||
## Before you begin
|
||||
|
||||
@@ -13,7 +13,7 @@ labels:
|
||||
- oss
|
||||
menuTitle: Opsgenie
|
||||
title: Configure Opsgenie for Alerting
|
||||
weight: 0
|
||||
weight: 145
|
||||
---
|
||||
|
||||
# Configure Opsgenie for Alerting
|
||||
|
||||
@@ -13,8 +13,13 @@ labels:
|
||||
- oss
|
||||
menuTitle: Slack
|
||||
title: Configure Slack for Alerting
|
||||
weight: 0
|
||||
weight: 155
|
||||
refs:
|
||||
notification-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/
|
||||
nested-policy:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/create-notification-policy/#add-new-nested-policy
|
||||
@@ -36,9 +41,9 @@ There are two ways of integrating Slack into Grafana Alerting.
|
||||
|
||||
Webhooks is the simpler way to post messages into Slack. Slack automatically creates a bot user with all the necessary permissions to post messages to one particular channel of your choice.
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Grafana Alerting only allows one Slack channel per contact point.
|
||||
{{< /admonition >}}
|
||||
Note that you can only setup one Slack channel per contact point.
|
||||
|
||||
You can customize the `title` and `body` of the Slack message using [notification templates](ref:notification-templates); however, you cannot modify its visual appearance with custom blocks.
|
||||
|
||||
## Before you begin
|
||||
|
||||
@@ -53,17 +58,12 @@ If you are using a Slack API Token, complete the following steps.
|
||||
1. Right click the channel you want to receive notifications in.
|
||||
1. Click View channel details.
|
||||
1. Scroll down and copy the Channel ID.
|
||||
{{< admonition type="note" >}}
|
||||
While going through these steps, Slack may prompt you to Reinstall your app in order for the changes to take effect.
|
||||
{{< /admonition >}}
|
||||
|
||||
Note that while going through these steps, Slack may prompt you to Reinstall your app in order for the changes to take effect.
|
||||
|
||||
### Webhook URL
|
||||
|
||||
If you are using a Webhook URL, follow steps 1 and 5 in the [Slack API Quickstart](https://api.slack.com/start/quickstart).
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Make sure you copy the Slack app Webhook URL. You need this when setting up your contact point integration in Grafana Alerting.
|
||||
{{< /admonition >}}
|
||||
If you are using a Webhook URL, follow steps 1 and 5 in the [Slack API Quickstart](https://api.slack.com/start/quickstart), and copy the Slack app Webhook URL. You need this when setting up your contact point integration in Grafana Alerting.
|
||||
|
||||
## Procedure
|
||||
|
||||
|
||||
@@ -13,13 +13,21 @@ labels:
|
||||
- oss
|
||||
menuTitle: Microsoft Teams
|
||||
title: Configure Microsoft Teams for Alerting
|
||||
weight: 0
|
||||
weight: 135
|
||||
refs:
|
||||
notification-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/
|
||||
---
|
||||
|
||||
# Configure Microsoft Teams for Alerting
|
||||
|
||||
Use the Grafana Alerting - Microsoft Teams integration to receive notifications in your team’s channel when your alerts are firing.
|
||||
|
||||
Note that you can customize the `title` and `message` of the notification using [notification templates](ref:notification-templates); however, you cannot modify its visual appearance with adaptive cards.
|
||||
|
||||
## Before you begin
|
||||
|
||||
To set up Microsoft Teams for integration with Grafana Alerting, create a new workflow that accepts Webhook requests. This allows Grafana to send alert notifications to Microsoft Teams channels.
|
||||
|
||||
@@ -13,7 +13,7 @@ labels:
|
||||
- oss
|
||||
menuTitle: Telegram
|
||||
title: Configure Telegram for Alerting
|
||||
weight: 0
|
||||
weight: 160
|
||||
---
|
||||
|
||||
# Configure Telegram for Alerting
|
||||
|
||||
@@ -14,7 +14,7 @@ labels:
|
||||
- oss
|
||||
menuTitle: PagerDuty
|
||||
title: Configure PagerDuty for Alerting
|
||||
weight: 0
|
||||
weight: 150
|
||||
---
|
||||
|
||||
# Configure PagerDuty for Alerting
|
||||
|
||||
@@ -19,9 +19,15 @@ labels:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
menuTitle: Webhook notifier
|
||||
menuTitle: Webhook
|
||||
title: Configure the webhook notifier for Alerting
|
||||
weight: 0
|
||||
weight: 165
|
||||
refs:
|
||||
notification-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/
|
||||
---
|
||||
|
||||
# Configure the webhook notifier for Alerting
|
||||
@@ -134,12 +140,16 @@ The webhook notification is a simple way to send information about a state chang
|
||||
| generatorURL | string | URL of the alert rule in the Grafana UI |
|
||||
| fingerprint | string | The labels fingerprint, alarms with the same labels will have the same fingerprint |
|
||||
| silenceURL | string | URL to silence the alert rule in the Grafana UI |
|
||||
| dashboardURL | string | **Will be deprecated soon** |
|
||||
| panelURL | string | **Will be deprecated soon** |
|
||||
| dashboardURL | string | A link to the Grafana Dashboard if the alert has a Dashboard UID annotation |
|
||||
| panelURL | string | A link to the panel if the alert has a Panel ID annotation |
|
||||
| imageURL | string | URL of a screenshot of a panel assigned to the rule that created this notification |
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Alert rules are not coupled to dashboards anymore therefore the fields related to dashboards `dashboardId` and `panelId` have been removed.
|
||||
|
||||
You can customize the `title` and `message` fields using [notification templates](ref:notification-templates).
|
||||
|
||||
However, you cannot customize webhook data structure or format, including JSON fields or sending data in XML, nor can you change the webhook HTTP headers.
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
## Procedure
|
||||
|
||||
@@ -13,55 +13,98 @@ labels:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Configure notification messages
|
||||
title: Template notifications
|
||||
weight: 430
|
||||
refs:
|
||||
use-notification-templates:
|
||||
template-annotations-and-labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/use-notification-templates/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/use-notification-templates/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/
|
||||
manage-notification-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/manage-notification-templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/manage-notification-templates/
|
||||
reference:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/reference/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/
|
||||
using-go-templating-language:
|
||||
examples:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/using-go-templating-language/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/examples/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/using-go-templating-language/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/examples/
|
||||
---
|
||||
|
||||
# Configure notification messages
|
||||
# Template notifications
|
||||
|
||||
Customize the content of your notifications with notifications templates.
|
||||
You can use notification templates to change the title, message, and format of notifications.
|
||||
|
||||
You can use notification templates to change the title, message, and format of the message in your notifications.
|
||||
Grafana provides a **default template** for notification titles (`default.title`) and one default template for notification messages (`default.message`). Both templates display common alert details.
|
||||
|
||||
Notification templates are not tied to specific contact point integrations, such as email or Slack. However, you can choose to create separate notification templates for different contact point integrations.
|
||||
You can also create a notification template to customize the content and format of your notification messages. For example:
|
||||
|
||||
You can use notification templates to:
|
||||
|
||||
- Customize content: Personalize the subject of an email or the title of a message. Modify text within notifications, like selecting or omitting certain labels, annotations, and links. Format text with bold and italic styles, and add or remove line breaks.
|
||||
- Personalize the subject of an email or the title of a message.
|
||||
- Modify text within notifications, like selecting or omitting certain labels, annotations, and links.
|
||||
- Format text with bold and italic styles, and add or remove line breaks.
|
||||
|
||||
However, there are limitations. You cannot:
|
||||
|
||||
- Modify Visual Appearance: Add HTML and CSS to email notifications for visual changes. Alter the design of notifications in messaging services like Slack and Microsoft Teams, such as adding custom blocks or adaptive cards.
|
||||
- Manage Media and Data: Adjust the number and size of images or their placement in notifications. Customize webhook data structure or format, including JSON fields or sending data in XML. Modify HTTP headers in webhooks beyond those in the contact point configuration.
|
||||
- Modify Visual Appearance: Add HTML or CSS to email notifications for visual changes. Alter the design of notifications in messaging services like Slack or Microsoft Teams, such as adding custom blocks or adaptive cards.
|
||||
- Manage Media and Data: Customize the data structure or format passed to the templates, like adding new JSON fields or sending XML data for webhooks. Modify HTTP headers in webhooks beyond those defined in the configuration, or adjust the number, size, or placement of images.
|
||||
|
||||
## Learn more
|
||||
Here's an [example](ref:examples) that displays the summary and description annotations for each alert in the notification:
|
||||
|
||||
[Using Go's templating language](ref:using-go-templating-language)
|
||||
```go
|
||||
{{ define "custom.alerts" -}}
|
||||
{{ len .Alerts }} alert(s)
|
||||
{{ range .Alerts -}}
|
||||
{{ template "alert.summary_and_description" . -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ define "alert.summary_and_description" }}
|
||||
Summary: {{.Annotations.summary}}
|
||||
Status: {{ .Status }}
|
||||
Description: {{.Annotations.description}}
|
||||
{{ end -}}
|
||||
```
|
||||
|
||||
Learn how to write the content of your notification templates in Go’s templating language.
|
||||
The notification message would look like this:
|
||||
|
||||
Create reusable notification templates for your contact points.
|
||||
```
|
||||
2 alert(s)
|
||||
|
||||
[Use notification templates](ref:use-notification-templates)
|
||||
Summary: The database server db1 has exceeded 75% of available disk space.
|
||||
Status: firing
|
||||
Description: This alert fires when a database server is at risk of running out of disk space. You should take measures to increase the maximum available disk space as soon as possible to avoid possible corruption.
|
||||
|
||||
Use notification templates to send notifications to your contact points.
|
||||
Summary: The web server web1 has been responding to 5% of HTTP requests with 5xx errors for the last 5 minutes.
|
||||
Status: resolved
|
||||
Description: This alert fires when a web server responds with more 5xx errors than is expected. This could be an issue with the web server or a backend service.
|
||||
```
|
||||
|
||||
[Reference](ref:reference)
|
||||
{{% admonition type="note" %}}
|
||||
Avoid adding extra information about alert instances in notification templates, as this information will only be visible in the notification message.
|
||||
|
||||
Data that is available when writing templates.
|
||||
Instead, you should [use annotations or labels](ref:template-annotations-and-labels) to add information directly to the alert, ensuring it's also visible in the alert state and alert history within Grafana. You can then print the new alert annotation or label in notification templates.
|
||||
{{% /admonition %}}
|
||||
|
||||
#### Select a notification template for a contact point
|
||||
|
||||
Notification templates are not tied to specific contact point integrations, such as email or Slack, and the same template can be shared across multiple contact points.
|
||||
|
||||
The notification template is assigned to the contact point to determine the notification message sent to contact point integrations.
|
||||
|
||||
{{< figure src="/media/docs/alerting/how-notification-templates-works.png" max-width="1200px" caption="A flow of the alert notification process, from querying the alert rule to sending the alert notification message." >}}
|
||||
|
||||
By default, Grafana provides default templates, such as `default.title` and `default.message`, to format notification messages.
|
||||
|
||||
## More information
|
||||
|
||||
For further details on how to write notification templates, refer to:
|
||||
|
||||
- [Select, create, and preview a notification template](ref:manage-notification-templates)
|
||||
- [Notification template reference](ref:reference)
|
||||
- [Notification template examples](ref:examples)
|
||||
|
||||
@@ -1,376 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../manage-notifications/template-notifications/create-notification-templates/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/template-notifications/create-notification-templates/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/configure-notifications/template-notifications/create-notification-templates/
|
||||
description: Create notification templates to sent to your contact points
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- notifications
|
||||
- templates
|
||||
- create templates
|
||||
- edit templates
|
||||
- delete templates
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Create notification templates
|
||||
weight: 200
|
||||
---
|
||||
|
||||
# Create notification templates
|
||||
|
||||
Create reusable notification templates to send to your contact points.
|
||||
|
||||
You can add one or more templates to your notification template.
|
||||
|
||||
Your notification template name must be unique. You cannot have two templates with the same name in the same notification template or in different notification templates. Avoid defining templates with the same name as default templates, such as: `__subject`, `__text_values_list`, `__text_alert_list`, `default.title` and `default.message`.
|
||||
|
||||
To create a notification template, complete the following steps.
|
||||
|
||||
1. Click **Alerts & IRM** -> **Contact points**.
|
||||
1. Click the **Notification Templates** tab and then **+ Add notification template**.
|
||||
|
||||
1. Enter a name for the notification template.
|
||||
|
||||
1. Write the content of the template in the content field.
|
||||
|
||||
1. Save your changes.
|
||||
|
||||
`{{ define "email.subject" }}` and `{{ end }}` is automatically added to the start and end of the content:
|
||||
|
||||
To create a notification template that contains more than one template:
|
||||
|
||||
1. Click **+ Add notification template**.
|
||||
|
||||
2. Enter a name for the notification template.
|
||||
|
||||
3. Write each template in the Content field, including `{{ define "name-of-template" }}` and `{{ end }}` at the start and end of each template.
|
||||
|
||||
4. Save your changes.
|
||||
|
||||
## Preview notification templates
|
||||
|
||||
Preview how your notification templates should look before using them in your contact points, helping you understand the result of the template you are creating as well as enabling you to fix any errors before saving it.
|
||||
|
||||
**Note:** This feature is only for Grafana Alertmanager.
|
||||
|
||||
To preview your notification templates:
|
||||
|
||||
1. Navigate to **Alerts&IRM** -> **Alerting** -> **Contact points** -> **Notification Templates**.
|
||||
1. Click **+ Add notification template** or edit an existing template.
|
||||
1. Add or update your template content.
|
||||
|
||||
Default data is provided and you can add or edit alert data to it as well as alert instances. You can add alert data directly in the Payload data window itself or click **Select alert instances** or **Add custom alerts**.
|
||||
|
||||
1. Optional: To add alert data from existing alert instances:
|
||||
|
||||
a. Click **Select alert instances**.
|
||||
|
||||
b. Hover over the alert instances to view more information on each alert instance.
|
||||
|
||||
c. Click **Confirm** to add the alert instance(s) to the payload.
|
||||
|
||||
1. Optional: To add alert data using the Alert data editor, click **Add custom data:**
|
||||
|
||||
a. Add annotations, custom labels and/or set a dashboard or a panel.
|
||||
|
||||
b. Toggle Firing/resolved depending on whether you want to add firing or resolved alerts to your notification.
|
||||
|
||||
c. Click **Add alert data**.
|
||||
|
||||
d. Click **Refresh preview** to see what your template content should look like and the corresponding payload data.
|
||||
|
||||
If there are any errors in your template, they are displayed in the Preview and you can correct them before saving.
|
||||
|
||||
1. Save your changes.
|
||||
|
||||
## Template the subject of an email
|
||||
|
||||
Template the subject of an email to contain the number of firing and resolved alerts:
|
||||
|
||||
```
|
||||
1 firing alert(s), 0 resolved alerts(s)
|
||||
```
|
||||
|
||||
1. Create a template called `email.subject` with the following content:
|
||||
|
||||
```
|
||||
{{ define "email.subject" }}
|
||||
{{ len .Alerts.Firing }} firing alert(s), {{ len .Alerts.Resolved }} resolved alert(s)
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
2. Execute the template from the subject field in your contact point integration:
|
||||
|
||||
```
|
||||
{{ template "email.subject" . }}
|
||||
```
|
||||
|
||||
## Template the message of an email
|
||||
|
||||
Template the message of an email to contain a summary of all firing and resolved alerts:
|
||||
|
||||
```
|
||||
There are 2 firing alert(s), and 1 resolved alert(s)
|
||||
|
||||
Firing alerts:
|
||||
|
||||
- alertname=Test 1 grafana_folder=GrafanaCloud has value(s) B=1
|
||||
- alertname=Test 2 grafana_folder=GrafanaCloud has value(s) B=2
|
||||
|
||||
Resolved alerts:
|
||||
|
||||
- alertname=Test 3 grafana_folder=GrafanaCloud has value(s) B=0
|
||||
```
|
||||
|
||||
1. Create a notification template called `email` with two templates in the content: `email.message_alert` and `email.message`.
|
||||
|
||||
The `email.message_alert` template is used to print the labels and values for each firing and resolved alert while the `email.message` template contains the structure of the email.
|
||||
|
||||
```
|
||||
{{- define "email.message_alert" -}}
|
||||
{{- range .Labels.SortedPairs }}{{ .Name }}={{ .Value }} {{ end }} has value(s)
|
||||
{{- range $k, $v := .Values }} {{ $k }}={{ $v }}{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "email.message" }}
|
||||
There are {{ len .Alerts.Firing }} firing alert(s), and {{ len .Alerts.Resolved }} resolved alert(s)
|
||||
|
||||
{{ if .Alerts.Firing -}}
|
||||
Firing alerts:
|
||||
{{- range .Alerts.Firing }}
|
||||
- {{ template "email.message_alert" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{ if .Alerts.Resolved -}}
|
||||
Resolved alerts:
|
||||
{{- range .Alerts.Resolved }}
|
||||
- {{ template "email.message_alert" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
2. Execute the template from the message field in your contact point integration:
|
||||
|
||||
```
|
||||
{{ template "email.message" . }}
|
||||
```
|
||||
|
||||
## Group multiple alert instances into one email notification
|
||||
|
||||
To make alerts more concise, you can group multiple instances of a firing alert into a single email notification in a table format. This way, you avoid long, repetitive emails and make alerts easier to digest.
|
||||
|
||||
Follow these steps to create a custom notification template that consolidates alert instances into a table.
|
||||
|
||||
1. Modify the alert rule to include an annotation that is referenced in the notification template later on.
|
||||
1. Enter a name for the **custom annotation**: In this example, _ServerInfo_.
|
||||
1. Enter the following code as the value for the annotation. It retrieves the server's instance name and a corresponding metric value, formatted as a table row:
|
||||
|
||||
```
|
||||
{{ index $labels "instance" }}{{- "\t" -}}{{ index $values "A"}}{{- "\n" -}}
|
||||
```
|
||||
|
||||
This line of code returns the labels and their values in the form of a table. Assuming $labels has `{"instance": "node1"}` and $values has `{"A": "123"}`, the output would be:
|
||||
|
||||
```
|
||||
node1 123
|
||||
```
|
||||
|
||||
1. Create a notification template that references the _ServerInfo_ annotation.
|
||||
|
||||
```go
|
||||
{{ define "Table" }}
|
||||
{{- "\nHost\t\tValue\n" -}}
|
||||
{{ range .Alerts -}}
|
||||
{{ range .Annotations.SortedPairs -}}
|
||||
{{ if (eq .Name "ServerInfo") -}}
|
||||
{{ .Value -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
The notification template outputs a list of server information from the "ServerInfo" annotation for each alert instance.
|
||||
|
||||
1. Navigate to your contact point in Grafana
|
||||
1. In the **Message** field, reference the template by name (see **Optional Email settings** section):
|
||||
|
||||
```
|
||||
{{ template "Table" . }}
|
||||
```
|
||||
|
||||
This generates a neatly formatted table in the email, grouping information for all affected servers into a single notification.
|
||||
|
||||
## Conditional notification template
|
||||
|
||||
Template alert notifications based on a label. In this example the label represents a namespace.
|
||||
|
||||
1. Use the following code in your notification template to display different messages based on the namespace:
|
||||
|
||||
```go
|
||||
{{ define "my_conditional_notification" }}
|
||||
{{ if eq .CommonLabels.namespace "namespace-a" }}
|
||||
Alert: CPU limits have reached 80% in namespace-a.
|
||||
{{ else if eq .CommonLabels.namespace "namespace-b" }}
|
||||
Alert: CPU limits have reached 80% in namespace-b.
|
||||
{{ else if eq .CommonLabels.namespace "namespace-c" }}
|
||||
Alert: CPU limits have reached 80% in namespace-c.
|
||||
{{ else }}
|
||||
Alert: CPU limits have reached 80% for {{ .CommonLabels.namespace }} namespace.
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
`.CommonLabels` is a map containing the labels that are common to all the alerts firing.
|
||||
|
||||
Make sure to replace the `.namespace` label with a label that exists in your alert rule.
|
||||
|
||||
1. Replace `namespace-a`, `namespace-b`, and `namespace-c` with your specific namespace values.
|
||||
1. Navigate to your contact point in Grafana
|
||||
1. In the **Message** field, reference the template by name (see **Optional settings** section):
|
||||
|
||||
```
|
||||
{{ template "my_conditional_notification" . }}
|
||||
```
|
||||
|
||||
This template alters the content of alert notifications depending on the namespace value.
|
||||
|
||||
## Template the title of a Slack message
|
||||
|
||||
Template the title of a Slack message to contain the number of firing and resolved alerts:
|
||||
|
||||
```
|
||||
1 firing alert(s), 0 resolved alerts(s)
|
||||
```
|
||||
|
||||
1. Create a template called `slack.title` with the following content:
|
||||
|
||||
```
|
||||
{{ define "slack.title" }}
|
||||
{{ len .Alerts.Firing }} firing alert(s), {{ len .Alerts.Resolved }} resolved alert(s)
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
2. Execute the template from the title field in your contact point integration:
|
||||
|
||||
```
|
||||
{{ template "slack.title" . }}
|
||||
```
|
||||
|
||||
## Template the content of a Slack message
|
||||
|
||||
Template the content of a Slack message to contain a description of all firing and resolved alerts, including their labels, annotations, Silence URL and Dashboard URL.
|
||||
|
||||
**Note:**
|
||||
|
||||
This template is for Grafana-managed alerts only.
|
||||
To use the template for Grafana Mimir/Loki-managed alerts, delete the references to DashboardURL and SilenceURL.
|
||||
For more information, see the [Prometheus documentation on notifications](https://prometheus.io/docs/alerting/latest/notifications/).
|
||||
|
||||
```
|
||||
1 firing alert(s):
|
||||
|
||||
[firing] Test1
|
||||
Labels:
|
||||
- alertname: Test1
|
||||
- grafana_folder: GrafanaCloud
|
||||
Annotations:
|
||||
- description: This is a test alert
|
||||
Silence: https://example.com/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DTest1&matcher=grafana_folder%3DGrafanaCloud
|
||||
Go to dashboard: https://example.com/d/dlhdLqF4z?orgId=1
|
||||
|
||||
1 resolved alert(s):
|
||||
|
||||
[firing] Test2
|
||||
Labels:
|
||||
- alertname: Test2
|
||||
- grafana_folder: GrafanaCloud
|
||||
Annotations:
|
||||
- description: This is another test alert
|
||||
Silence: https://example.com/alerting/silence/new?alertmanager=grafana&matcher=alertname%3DTest2&matcher=grafana_folder%3DGrafanaCloud
|
||||
Go to dashboard: https://example.com/d/dlhdLqF4z?orgId=1
|
||||
```
|
||||
|
||||
1. Create a template called `slack` with two templates in the content: `slack.print_alert` and `slack.message`.
|
||||
|
||||
The `slack.print_alert` template is used to print the labels, annotations, SilenceURL and DashboardURL while the `slack.message` template contains the structure of the notification.
|
||||
|
||||
```
|
||||
{{ define "slack.print_alert" -}}
|
||||
[{{.Status}}] {{ .Labels.alertname }}
|
||||
Labels:
|
||||
{{ range .Labels.SortedPairs -}}
|
||||
- {{ .Name }}: {{ .Value }}
|
||||
{{ end -}}
|
||||
{{ if .Annotations -}}
|
||||
Annotations:
|
||||
{{ range .Annotations.SortedPairs -}}
|
||||
- {{ .Name }}: {{ .Value }}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ if .SilenceURL -}}
|
||||
Silence: {{ .SilenceURL }}
|
||||
{{ end -}}
|
||||
{{ if .DashboardURL -}}
|
||||
Go to dashboard: {{ .DashboardURL }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{ define "slack.message" -}}
|
||||
{{ if .Alerts.Firing -}}
|
||||
{{ len .Alerts.Firing }} firing alert(s):
|
||||
{{ range .Alerts.Firing }}
|
||||
{{ template "slack.print_alert" . }}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
{{ if .Alerts.Resolved -}}
|
||||
{{ len .Alerts.Resolved }} resolved alert(s):
|
||||
{{ range .Alerts.Resolved }}
|
||||
{{ template "slack.print_alert" .}}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
```
|
||||
|
||||
2. Execute the template from the text body field in your contact point integration:
|
||||
|
||||
```
|
||||
{{ template "slack.message" . }}
|
||||
```
|
||||
|
||||
## Template both email and Slack with shared templates
|
||||
|
||||
Instead of creating separate notification templates for email and Slack, you can share the same template.
|
||||
|
||||
For example, if you want to send an email with this subject and Slack message with this title:
|
||||
|
||||
```
|
||||
1 firing alert(s), 0 resolved alerts(s)
|
||||
```
|
||||
|
||||
1. Create a template called `common.subject_title` with the following content:
|
||||
|
||||
```
|
||||
{{ define "common.subject_title" }}
|
||||
{{ len .Alerts.Firing }} firing alert(s), {{ len .Alerts.Resolved }} resolved alert(s)
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
2. For email, execute the template from the subject field in your email contact point integration:
|
||||
|
||||
```
|
||||
{{ template "common.subject_title" . }}
|
||||
```
|
||||
|
||||
3. For Slack, execute the template from the title field in your Slack contact point integration:
|
||||
|
||||
```
|
||||
{{ template "common.subject_title" . }}
|
||||
```
|
||||
@@ -0,0 +1,362 @@
|
||||
---
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/alerting-rules/templates/examples/
|
||||
description: Examples of notification templates
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- templating
|
||||
- notification templates
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Notification template examples
|
||||
menuTitle: Examples
|
||||
weight: 103
|
||||
refs:
|
||||
template-annotations-and-labels:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/alerting-rules/templates/
|
||||
template-notifications:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/
|
||||
manage-notification-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/manage-notification-templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/manage-notification-templates/
|
||||
reference:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/reference/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/
|
||||
reference-notification-data:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/reference/#notification-data
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/#notification-data
|
||||
reference-alert:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/reference/#alert
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/reference/#alert
|
||||
language:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/language/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/language/
|
||||
group-alert-notifications:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/notifications/group-alert-notifications/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/notifications/group-alert-notifications/
|
||||
---
|
||||
|
||||
# Notification template examples
|
||||
|
||||
Notification templates allows you to change the default notification messages.
|
||||
|
||||
You can modify the content and format of notification messages. For example, you can customize the content to show only specific information or adjust the format to suit a particular contact point, such as Slack or Email.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Avoid adding extra information about alert instances in notification templates, as this information is only be visible in the notification message.
|
||||
|
||||
Instead, you should [use annotations or labels](ref:template-annotations-and-labels) to add information directly to the alert, ensuring it's also visible in the alert state and alert history within Grafana. You can then print the new alert annotation or label in notification templates.
|
||||
{{% /admonition %}}
|
||||
|
||||
This page provides various examples illustrating how to template common notification messages. For more details about notification templates, refer to:
|
||||
|
||||
- [Template notifications](ref:template-notifications)
|
||||
- [Select, create, and preview a notification template](ref:manage-notification-templates)
|
||||
- [Notification template reference](ref:reference)
|
||||
|
||||
## Basic examples
|
||||
|
||||
Notification templates can access the [notification data](ref:reference-notification-data) using the dot (`.`). The following examples demonstrate some basic uses of the [template language](ref:language).
|
||||
|
||||
For instance, to check if there are common labels (`.CommonLabels`) for all alerts in the notification, use `if`:
|
||||
|
||||
```go
|
||||
{{ define "custom_message" -}}
|
||||
{{ if .CommonLabels }}
|
||||
Alerts have common labels
|
||||
{{ else }}
|
||||
There are no common labels
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
To iterate on the alerts in the notification and print a specific label, use `range` and `index`:
|
||||
|
||||
```go
|
||||
{{ define "custom_message" -}}
|
||||
{{ range .Alerts }}
|
||||
The name of the alert is {{ index .Labels "alertname" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
Alternatively, you can use the `.` notation to print the value of the key.
|
||||
|
||||
```go
|
||||
{{ define "custom_message" -}}
|
||||
{{ range .Alerts }}
|
||||
The name of the alert is {{ .Labels.alertname }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
```template_output
|
||||
The name of the alert is InstanceDown
|
||||
|
||||
The name of the alert is CpuOverload
|
||||
```
|
||||
|
||||
## Print alerts with summary and description
|
||||
|
||||
Here's an example that displays the summary and description annotations for each alert in the notification.
|
||||
|
||||
```go
|
||||
{{ define "custom.alerts" -}}
|
||||
{{ len .Alerts }} alert(s)
|
||||
{{ range .Alerts -}}
|
||||
{{ template "alert.summary_and_description" . -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ define "alert.summary_and_description" }}
|
||||
Summary: {{.Annotations.summary}}
|
||||
Status: {{ .Status }}
|
||||
Description: {{.Annotations.description}}
|
||||
{{ end -}}
|
||||
```
|
||||
|
||||
In this example:
|
||||
|
||||
- A template (`alert.summary_and_description`) is defined to print the `summary`, `status`, and `description` of one [alert](ref:reference-alert).
|
||||
- The main template `custom.alerts` iterates the list of alerts (`.Alerts`) in [notification data](ref:reference-notification-data), executing the `alert.summary_and_description` template to print the details of each alert.
|
||||
|
||||
The notification message would look like this:
|
||||
|
||||
```template_output
|
||||
2 alert(s)
|
||||
|
||||
Summary: The database server db1 has exceeded 75% of available disk space.
|
||||
Status: firing
|
||||
Description: This alert fires when a database server is at risk of running out of disk space. You should take measures to increase the maximum available disk space as soon as possible to avoid possible corruption.
|
||||
|
||||
Summary: The web server web1 has been responding to 5% of HTTP requests with 5xx errors for the last 5 minutes.
|
||||
Status: resolved
|
||||
Description: This alert fires when a web server responds with more 5xx errors than is expected. This could be an issue with the web server or a backend service.
|
||||
```
|
||||
|
||||
## Print firing and resolved alerts
|
||||
|
||||
The following example is similar to the previous one, but it separates firing and resolved alerts.
|
||||
|
||||
```go
|
||||
{{ define "custom.firing_and_resolved_alerts" -}}
|
||||
{{ len .Alerts.Resolved }} resolved alert(s)
|
||||
{{ range .Alerts.Resolved -}}
|
||||
{{ template "alert.summary_and_description" . -}}
|
||||
{{ end }}
|
||||
{{ len .Alerts.Firing }} firing alert(s)
|
||||
{{ range .Alerts.Firing -}}
|
||||
{{ template "alert.summary_and_description" . -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ define "alert.summary_and_description" }}
|
||||
Summary: {{.Annotations.summary}}
|
||||
Status: {{ .Status }}
|
||||
Description: {{.Annotations.description}}
|
||||
{{ end -}}
|
||||
```
|
||||
|
||||
Instead of `.Alerts`, the template accesses `.Alerts.Firing` and `.Alerts.Resolved` separately to print details for each alert.
|
||||
|
||||
The output might now look like this:
|
||||
|
||||
```template_output
|
||||
1 resolved alert(s)
|
||||
|
||||
Summary: The database server db1 has exceeded 75% of available disk space.
|
||||
Status: resolved
|
||||
Description: This alert fires when a database server is at risk of running out of disk space. You should take measures to increase the maximum available disk space as soon as possible to avoid possible corruption.
|
||||
|
||||
1 firing alert(s)
|
||||
|
||||
Summary: The web server web1 has been responding to 5% of HTTP requests with 5xx errors for the last 5 minutes.
|
||||
Status: firing
|
||||
Description: This alert fires when a web server responds with more 5xx errors than is expected. This could be an issue with the web server or a backend service.
|
||||
```
|
||||
|
||||
## Print common labels and annotations
|
||||
|
||||
This example displays only the labels and annotations that are common to all alerts in the notification.
|
||||
|
||||
```go
|
||||
{{ define "custom.common_labels_and_annotations" -}}
|
||||
{{ len .Alerts.Resolved }} resolved alert(s)
|
||||
{{ len .Alerts.Firing }} firing alert(s)
|
||||
Common labels: {{ len .CommonLabels.SortedPairs }}
|
||||
{{ range .CommonLabels.SortedPairs -}}
|
||||
- {{ .Name }} = {{ .Value }}
|
||||
{{ end }}
|
||||
Common annotations: {{ len .CommonAnnotations.SortedPairs }}
|
||||
{{ range .CommonAnnotations.SortedPairs }}
|
||||
- {{ .Name }} = {{ .Value }}
|
||||
{{ end }}
|
||||
{{ end -}}
|
||||
```
|
||||
|
||||
Note that `.CommonAnnotations` and `.CommonLabels` are part of [notification data](ref:reference-notification-data).
|
||||
|
||||
```template_output
|
||||
1 resolved alert(s)
|
||||
1 firing alert(s)
|
||||
Common labels: 2
|
||||
- grafana_folder = server_alerts
|
||||
- team = server_admin
|
||||
|
||||
Common annotations: 0
|
||||
```
|
||||
|
||||
## Print individual labels and annotations
|
||||
|
||||
This example displays all labels and annotations for each [alert](ref:reference-alert) in the notification.
|
||||
|
||||
```go
|
||||
{{ define "custom.alert_labels_and_annotations" -}}
|
||||
{{ len .Alerts.Resolved }} resolved alert(s)
|
||||
{{ range .Alerts.Resolved -}}
|
||||
{{ template "alert.labels_and_annotations" . -}}
|
||||
{{ end }}
|
||||
{{ len .Alerts.Firing }} firing alert(s)
|
||||
{{ range .Alerts.Firing -}}
|
||||
{{ template "alert.labels_and_annotations" . -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ define "alert.labels_and_annotations" }}
|
||||
Alert labels: {{ len .Labels.SortedPairs }}
|
||||
{{ range .Labels.SortedPairs -}}
|
||||
- {{ .Name }} = {{ .Value }}
|
||||
{{ end -}}
|
||||
Alert annotations: {{ len .Annotations.SortedPairs }}
|
||||
{{ range .Annotations.SortedPairs -}}
|
||||
- {{ .Name }} = {{ .Value }}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
```
|
||||
|
||||
In this example:
|
||||
|
||||
- The `custom.alert_labels_and_annotations` template iterates over the list of resolved and firing alerts, similar to previous examples. It then executes `alert.labels_and_annotations` for each alert.
|
||||
- The `alert.labels_and_annotations` template prints all the alert labels and annotations by accessing `.Labels.SortedPairs` and `.Annotations.SortedPairs`.
|
||||
|
||||
```template_output
|
||||
1 resolved alert(s)
|
||||
|
||||
Alert labels: 4
|
||||
- alertname = db_server_disk_space
|
||||
- grafana_folder = server_alerts
|
||||
- server = db1
|
||||
- team = server_admin
|
||||
|
||||
Alert annotations: 2
|
||||
- summary = The database server db1 has exceeded 75% of available disk space.
|
||||
- description = This alert fires when a database server is at risk of running out of disk space. You should take measures to increase the maximum available disk space as soon as possible to avoid possible corruption.
|
||||
|
||||
1 firing alert(s)
|
||||
|
||||
Alert labels: 4
|
||||
- alertname = web_server_http_errors
|
||||
- grafana_folder = server_alerts
|
||||
- server = web1
|
||||
- team = server_admin
|
||||
|
||||
Alert annotations: 2
|
||||
- summary = The web server web1 has been responding to 5% of HTTP requests with 5xx errors for the last 5 minutes.
|
||||
- description = This alert fires when a web server responds with more 5xx errors than is expected. This could be an issue with the web server or a backend service.
|
||||
```
|
||||
|
||||
## Print URLs for runbook and alert data in Grafana
|
||||
|
||||
Note that the following example works only for Grafana-managed alerts. It displays some [alert data](ref:reference-alert) such as `DashboardURL`, `PanelURL`, and `SilenceURL`, which are exclusive to Grafana-managed alerts.
|
||||
|
||||
```go
|
||||
{{ define "custom.alert_additional_details" -}}
|
||||
{{ len .Alerts.Resolved }} resolved alert(s)
|
||||
{{ range .Alerts.Resolved -}}
|
||||
{{ template "alert.additional_details" . -}}
|
||||
{{ end }}
|
||||
{{ len .Alerts.Firing }} firing alert(s)
|
||||
{{ range .Alerts.Firing -}}
|
||||
{{ template "alert.additional_details" . -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ define "alert.additional_details" }}
|
||||
- Dashboard: {{ .DashboardURL }}
|
||||
- Panel: {{ .PanelURL }}
|
||||
- AlertGenerator: {{ .GeneratorURL }}
|
||||
- Silence: {{ .SilenceURL }}
|
||||
- RunbookURL: {{ .Annotations.runbook_url}}
|
||||
{{ end -}}
|
||||
```
|
||||
|
||||
The output of this template looks like this:
|
||||
|
||||
```template_output
|
||||
1 resolved alert(s)
|
||||
|
||||
- Dashboard: https://example.com/d/
|
||||
- Panel: https://example.com/d/
|
||||
- AlertGenerator: ?orgId=1
|
||||
- Silence: https://example.com/alerting/silence/new
|
||||
- RunbookURL: https://example.com/on-call/db_server_disk_space
|
||||
|
||||
1 firing alert(s)
|
||||
|
||||
- Dashboard: https://example.com/d/
|
||||
- Panel: https://example.com/d/
|
||||
- AlertGenerator: ?orgId=1
|
||||
- Silence: https://example.com/alerting/silence/new
|
||||
- RunbookURL: https://example.com/on-call/web_server_http_errors
|
||||
```
|
||||
|
||||
## Print a notification title or subject
|
||||
|
||||
A title or subject provides a one-line summary of the notification content.
|
||||
|
||||
Here’s a basic example that displays the number of firing and resolved alerts in the notification.
|
||||
|
||||
```go
|
||||
{{ define "custom_title" -}}
|
||||
{{ if gt (.Alerts.Firing | len) 0 }}🚨 {{ .Alerts.Firing | len }} firing alerts. {{ end }}{{ if gt (.Alerts.Resolved | len) 0 }}✅ {{ .Alerts.Resolved | len }} resolved alerts.{{ end }}
|
||||
{{ end -}}
|
||||
```
|
||||
|
||||
```template_output
|
||||
🚨 1 firing alerts. ✅ 1 resolved alerts.
|
||||
```
|
||||
|
||||
The next example is a copy of the default title/subject template used in Grafana.
|
||||
|
||||
```go
|
||||
{{ define "copy_of_default_title" -}}
|
||||
[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ if gt (.Alerts.Resolved | len) 0 }}, RESOLVED:{{ .Alerts.Resolved | len }}{{ end }}{{ end }}] {{ .GroupLabels.SortedPairs.Values | join " " }} {{ if gt (len .CommonLabels) (len .GroupLabels) }}({{ with .CommonLabels.Remove .GroupLabels.Names }}{{ .Values | join " " }}{{ end }}){{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
This is a more advanced example:
|
||||
|
||||
- Prints the number of firing and resolved alerts in the notification.
|
||||
- Outputs `.GroupLabels`, the labels used to [group multiple alerts in one notification](ref:group-alert-notifications).
|
||||
- Prints `CommonLabels`, excluding labels in `.GroupLabels`.
|
||||
|
||||
```template_output
|
||||
[FIRING:1, RESOLVED:1] api warning (sql_db)
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user