mirror of
https://github.com/grafana/grafana.git
synced 2026-01-14 13:21:26 +00:00
Compare commits
268 Commits
sriram/SQL
...
v11.3.5+se
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a69005aae | ||
|
|
4a6865f806 | ||
|
|
a0db830156 | ||
|
|
f8d4c9fc43 | ||
|
|
1d6c12055f | ||
|
|
22d7a474b3 | ||
|
|
dadc898de4 | ||
|
|
d7e697d6a4 | ||
|
|
22604c198c | ||
|
|
43b69cd72d | ||
|
|
bb19e14a97 | ||
|
|
0e1acbaf3e | ||
|
|
57aa392680 | ||
|
|
9f1e8e66be | ||
|
|
534a96a72c | ||
|
|
4d5714a61f | ||
|
|
78c9437129 | ||
|
|
cb3f9baab7 | ||
|
|
9a2ab39cf0 | ||
|
|
8f47143c97 | ||
|
|
dd15c5dc95 | ||
|
|
739ac52c3e | ||
|
|
c05dcecd2c | ||
|
|
a635dd5240 | ||
|
|
22a6840011 | ||
|
|
f2a29f6695 | ||
|
|
9fac1a7b73 | ||
|
|
77e7e2eecd | ||
|
|
94271b1951 | ||
|
|
e0f120d757 | ||
|
|
ec913bf706 | ||
|
|
5d30a16617 | ||
|
|
93692e3cc2 | ||
|
|
5b1695f6ba | ||
|
|
ee2d0aac2a | ||
|
|
7476d99bc7 | ||
|
|
d73386f0fa | ||
|
|
c186acc49f | ||
|
|
83296fe765 | ||
|
|
fbc8a48410 | ||
|
|
c37b67c2e3 | ||
|
|
f99b152dc1 | ||
|
|
16d77128f2 | ||
|
|
120d198e42 | ||
|
|
507f80c593 | ||
|
|
2e87a7cc15 | ||
|
|
d441372f77 | ||
|
|
2b9acf6346 | ||
|
|
e042c90214 | ||
|
|
d796e44fee | ||
|
|
a7fc5daee1 | ||
|
|
d4a744c8d5 | ||
|
|
e5c3b8a937 | ||
|
|
4605a8e751 | ||
|
|
98b1f860c8 | ||
|
|
f522a54ae1 | ||
|
|
be599c43f9 | ||
|
|
578f49a7f6 | ||
|
|
2d8c7ea350 | ||
|
|
8c94782840 | ||
|
|
df60e9f905 | ||
|
|
27dfafe1c8 | ||
|
|
82e7325214 | ||
|
|
7f0a01fa98 | ||
|
|
6e824e5f5b | ||
|
|
1bdfc4c017 | ||
|
|
d6727bea41 | ||
|
|
f1995f23aa | ||
|
|
5fef0fe76a | ||
|
|
eda141bde1 | ||
|
|
ca070a1792 | ||
|
|
a8a86f35d3 | ||
|
|
cb4368cbb9 | ||
|
|
9cc0bfea57 | ||
|
|
6d9925ba21 | ||
|
|
7d003d7394 | ||
|
|
1b020db8b5 | ||
|
|
c5000228dc | ||
|
|
7710a1cd1e | ||
|
|
1f25f8af42 | ||
|
|
53f1f71aed | ||
|
|
706392e357 | ||
|
|
d0a31e48d9 | ||
|
|
90aad8cfe7 | ||
|
|
cc30b2fbb1 | ||
|
|
0e6bcba4a8 | ||
|
|
ed48cf0851 | ||
|
|
e7584b9339 | ||
|
|
bcfa03ba39 | ||
|
|
34da17fcb7 | ||
|
|
3d545a989f | ||
|
|
0709fad9e6 | ||
|
|
a01883f0d0 | ||
|
|
09793d8ce7 | ||
|
|
5b5b9269a4 | ||
|
|
61c930162f | ||
|
|
5db3aacd81 | ||
|
|
6a203fa621 | ||
|
|
ad7fd4ea2b | ||
|
|
4a8b4d2496 | ||
|
|
80691e4297 | ||
|
|
8bc94106e2 | ||
|
|
54ff80afb1 | ||
|
|
780e191177 | ||
|
|
e80e6e532c | ||
|
|
17d7ca7232 | ||
|
|
bc3fd9d808 | ||
|
|
1de9f9477f | ||
|
|
4428bf7025 | ||
|
|
b35522672b | ||
|
|
c8031ed338 | ||
|
|
9c606f2302 | ||
|
|
8395bda60f | ||
|
|
f8dfaebf4c | ||
|
|
1c201629d5 | ||
|
|
37858e7e24 | ||
|
|
60370b4ea6 | ||
|
|
70c37c9b03 | ||
|
|
55cb58b8be | ||
|
|
1695d2716f | ||
|
|
9ab6d23f77 | ||
|
|
13e8921d27 | ||
|
|
d0e5c87992 | ||
|
|
4cb555fa8b | ||
|
|
98be4ac047 | ||
|
|
9c7c333856 | ||
|
|
d15321179e | ||
|
|
f0e56bdf64 | ||
|
|
bc89fe04b9 | ||
|
|
e3367ccf9a | ||
|
|
dfb1f9a3c1 | ||
|
|
f5cf121eb5 | ||
|
|
64b556c137 | ||
|
|
8d6bbb7a4b | ||
|
|
08e10ff665 | ||
|
|
13d60c9bd4 | ||
|
|
96d1d5a07b | ||
|
|
c97b64e9ff | ||
|
|
54eca5c73f | ||
|
|
4b634e887d | ||
|
|
9225f4a1cb | ||
|
|
a09dcda92d | ||
|
|
a6bc76df32 | ||
|
|
d5cbf07090 | ||
|
|
d32c02ae14 | ||
|
|
d815e1107d | ||
|
|
700f59a0ea | ||
|
|
a6cdb48249 | ||
|
|
ecf127c0fa | ||
|
|
9241bc5f5c | ||
|
|
a2b1cda210 | ||
|
|
50762226a0 | ||
|
|
58333e0507 | ||
|
|
5cc78ea219 | ||
|
|
a8cb62f05a | ||
|
|
89ea2a15ce | ||
|
|
5e1479d887 | ||
|
|
f1c4e83865 | ||
|
|
cfa3ef73a1 | ||
|
|
c99c8c56e2 | ||
|
|
5b1a386dac | ||
|
|
8bc0014845 | ||
|
|
8f10dbe12d | ||
|
|
546e0e214b | ||
|
|
3704073e6f | ||
|
|
c9c1bbfa6e | ||
|
|
402b023b45 | ||
|
|
be895603c8 | ||
|
|
c2d85230b1 | ||
|
|
3824dc412d | ||
|
|
0e0a2c0371 | ||
|
|
8273628550 | ||
|
|
d489ecf794 | ||
|
|
16411b1b4a | ||
|
|
8567089ed2 | ||
|
|
1100a0409f | ||
|
|
a7c1f37435 | ||
|
|
cbf9e323b6 | ||
|
|
0826aa0078 | ||
|
|
9bb7d77cdb | ||
|
|
e31c4fc59b | ||
|
|
28f9eb3221 | ||
|
|
693ed6dddd | ||
|
|
8f030aa210 | ||
|
|
ef12cfe67d | ||
|
|
4f80c4c55c | ||
|
|
66518db34c | ||
|
|
855dcd7b7b | ||
|
|
ab85eacea6 | ||
|
|
11aedea347 | ||
|
|
fdc1859d0d | ||
|
|
1540c767cc | ||
|
|
7f36355451 | ||
|
|
397c96c1cc | ||
|
|
13336dd198 | ||
|
|
cb5df488a8 | ||
|
|
5af40ed44f | ||
|
|
c081bb53d0 | ||
|
|
8ea5af7335 | ||
|
|
d763aae5f2 | ||
|
|
4a30c85b77 | ||
|
|
a78607432e | ||
|
|
12a54c2414 | ||
|
|
bb4e253c76 | ||
|
|
90a562257c | ||
|
|
5889d680e9 | ||
|
|
86deb2b4c4 | ||
|
|
c5d7a954ef | ||
|
|
54e5e6c1b5 | ||
|
|
c99956285b | ||
|
|
9d867a4441 | ||
|
|
a9088a7bbb | ||
|
|
7cf08ebaf9 | ||
|
|
c76d97bb13 | ||
|
|
f8cb0ccb71 | ||
|
|
f702577e83 | ||
|
|
b8c43bcf3d | ||
|
|
d865fa64ce | ||
|
|
a292f838fe | ||
|
|
50c5d806c1 | ||
|
|
6d5fa7b7a0 | ||
|
|
035f6dde73 | ||
|
|
494ddad79d | ||
|
|
2e81653b68 | ||
|
|
6924b9641a | ||
|
|
f68938c842 | ||
|
|
c426f12df7 | ||
|
|
bbc76071b5 | ||
|
|
ca7156d411 | ||
|
|
8e7ba6f123 | ||
|
|
6e0e8d0370 | ||
|
|
073436f2f8 | ||
|
|
367c82bd51 | ||
|
|
a2db7105a9 | ||
|
|
bdf41feda9 | ||
|
|
aa8c58abd0 | ||
|
|
48d083d495 | ||
|
|
e0da40ea8c | ||
|
|
aba5388a42 | ||
|
|
48ce1636bd | ||
|
|
71e980ee9a | ||
|
|
060846d056 | ||
|
|
df57ba1b70 | ||
|
|
4a800ace30 | ||
|
|
a577031ba9 | ||
|
|
efeb05386b | ||
|
|
1ac972f086 | ||
|
|
4590698e10 | ||
|
|
ab368bfb06 | ||
|
|
489c9db173 | ||
|
|
8bbf0a1869 | ||
|
|
8b8a67fad6 | ||
|
|
2e956696a4 | ||
|
|
d58468b60b | ||
|
|
d784d370d3 | ||
|
|
d4beddfb0e | ||
|
|
ae3419cd79 | ||
|
|
65c759c76a | ||
|
|
e6475b80c2 | ||
|
|
749714fe50 | ||
|
|
e1a4fcda48 | ||
|
|
9af2af8b9f | ||
|
|
50de92f873 | ||
|
|
2a7d8279a2 | ||
|
|
f5d29152c9 | ||
|
|
c938b751cf | ||
|
|
f24f59225d | ||
|
|
5f7e46f886 |
@@ -1697,9 +1697,6 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "10"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "11"]
|
||||
],
|
||||
"public/app/features/alerting/unified/components/expressions/ExpressionStatusIndicator.tsx:5381": [
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"]
|
||||
],
|
||||
"public/app/features/alerting/unified/components/extensions/AlertInstanceExtensionPointMenu.tsx:5381": [
|
||||
[0, 0, 0, "Do not re-export imported variable (\`app/features/explore/extensions/ToolbarExtensionPointMenu\`)", "0"]
|
||||
],
|
||||
@@ -1935,8 +1932,7 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "10"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "11"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "12"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "13"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "14"]
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "13"]
|
||||
],
|
||||
"public/app/features/alerting/unified/components/rule-editor/NeedHelpInfo.tsx:5381": [
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"]
|
||||
@@ -2035,16 +2031,13 @@ exports[`better eslint`] = {
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "2"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "3"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "4"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "5"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "6"]
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "4"]
|
||||
],
|
||||
"public/app/features/alerting/unified/components/rule-editor/labels/LabelsFieldInForm.tsx:5381": [
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "2"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "3"],
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "4"]
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "3"]
|
||||
],
|
||||
"public/app/features/alerting/unified/components/rule-editor/notificaton-preview/NotificationPolicyMatchers.tsx:5381": [
|
||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"],
|
||||
|
||||
@@ -35,11 +35,11 @@ $(DRONE): $(BINGO_DIR)/drone.mod
|
||||
@echo "(re)installing $(GOBIN)/drone-v1.5.0"
|
||||
@cd $(BINGO_DIR) && GOWORK=off CGO_ENABLED=0 $(GO) build -mod=mod -modfile=drone.mod -o=$(GOBIN)/drone-v1.5.0 "github.com/drone/drone-cli/drone"
|
||||
|
||||
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.60.1
|
||||
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.62.0
|
||||
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
|
||||
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
|
||||
@echo "(re)installing $(GOBIN)/golangci-lint-v1.60.1"
|
||||
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.60.1 "github.com/golangci/golangci-lint/cmd/golangci-lint"
|
||||
@echo "(re)installing $(GOBIN)/golangci-lint-v1.62.0"
|
||||
@cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.62.0 "github.com/golangci/golangci-lint/cmd/golangci-lint"
|
||||
|
||||
JB := $(GOBIN)/jb-v0.5.1
|
||||
$(JB): $(BINGO_DIR)/jb.mod
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
|
||||
|
||||
go 1.22.1
|
||||
go 1.23
|
||||
|
||||
toolchain go1.23.0
|
||||
|
||||
require github.com/golangci/golangci-lint v1.60.1 // cmd/golangci-lint
|
||||
require github.com/golangci/golangci-lint v1.62.0 // cmd/golangci-lint
|
||||
|
||||
@@ -41,14 +41,22 @@ github.com/4meepo/tagalign v1.3.4 h1:P51VcvBnf04YkHzjfclN6BbsopfJR5rxs1n+5zHt+w8
|
||||
github.com/4meepo/tagalign v1.3.4/go.mod h1:M+pnkHH2vG8+qhE5bVc/zeP7HS/j910Fwa9TUSyZVI0=
|
||||
github.com/Abirdcfly/dupword v0.0.14 h1:3U4ulkc8EUo+CaT105/GJ1BQwtgyj6+VaBVbAX11Ba8=
|
||||
github.com/Abirdcfly/dupword v0.0.14/go.mod h1:VKDAbxdY8YbKUByLGg8EETzYSuC4crm9WwI6Y3S0cLI=
|
||||
github.com/Abirdcfly/dupword v0.1.1 h1:Bsxe0fIw6OwBtXMIncaTxCLHYO5BB+3mcsR5E8VXloY=
|
||||
github.com/Abirdcfly/dupword v0.1.1/go.mod h1:B49AcJdTYYkpd4HjgAcutNGG9HZ2JWwKunH9Y2BA6sM=
|
||||
github.com/Abirdcfly/dupword v0.1.3 h1:9Pa1NuAsZvpFPi9Pqkd93I7LIYRURj+A//dFd5tgBeE=
|
||||
github.com/Abirdcfly/dupword v0.1.3/go.mod h1:8VbB2t7e10KRNdwTVoxdBaxla6avbhGzb8sCTygUMhw=
|
||||
github.com/Antonboom/errname v0.1.12 h1:oh9ak2zUtsLp5oaEd/erjB4GPu9w19NyoIskZClDcQY=
|
||||
github.com/Antonboom/errname v0.1.12/go.mod h1:bK7todrzvlaZoQagP1orKzWXv59X/x0W0Io2XT1Ssro=
|
||||
github.com/Antonboom/errname v0.1.13 h1:JHICqsewj/fNckzrfVSe+T33svwQxmjC+1ntDsHOVvM=
|
||||
github.com/Antonboom/errname v0.1.13/go.mod h1:uWyefRYRN54lBg6HseYCFhs6Qjcy41Y3Jl/dVhA87Ns=
|
||||
github.com/Antonboom/errname v1.0.0 h1:oJOOWR07vS1kRusl6YRSlat7HFnb3mSfMl6sDMRoTBA=
|
||||
github.com/Antonboom/errname v1.0.0/go.mod h1:gMOBFzK/vrTiXN9Oh+HFs+e6Ndl0eTFbtsRTSRdXyGI=
|
||||
github.com/Antonboom/nilnil v0.1.7 h1:ofgL+BA7vlA1K2wNQOsHzLJ2Pw5B5DpWRLdDAVvvTow=
|
||||
github.com/Antonboom/nilnil v0.1.7/go.mod h1:TP+ScQWVEq0eSIxqU8CbdT5DFWoHp0MbP+KMUO1BKYQ=
|
||||
github.com/Antonboom/nilnil v0.1.9 h1:eKFMejSxPSA9eLSensFmjW2XTgTwJMjZ8hUHtV4s/SQ=
|
||||
github.com/Antonboom/nilnil v0.1.9/go.mod h1:iGe2rYwCq5/Me1khrysB4nwI7swQvjclR8/YRPl5ihQ=
|
||||
github.com/Antonboom/nilnil v1.0.0 h1:n+v+B12dsE5tbAqRODXmEKfZv9j2KcTBrp+LkoM4HZk=
|
||||
github.com/Antonboom/nilnil v1.0.0/go.mod h1:fDJ1FSFoLN6yoG65ANb1WihItf6qt9PJVTn/s2IrcII=
|
||||
github.com/Antonboom/testifylint v1.2.0 h1:015bxD8zc5iY8QwTp4+RG9I4kIbqwvGX9TrBbb7jGdM=
|
||||
github.com/Antonboom/testifylint v1.2.0/go.mod h1:rkmEqjqVnHDRNsinyN6fPSLnoajzFwsCcguJgwADBkw=
|
||||
github.com/Antonboom/testifylint v1.3.0 h1:UiqrddKs1W3YK8R0TUuWwrVKlVAnS07DTUVWWs9c+y4=
|
||||
@@ -57,6 +65,8 @@ github.com/Antonboom/testifylint v1.3.1 h1:Uam4q1Q+2b6H7gvk9RQFw6jyVDdpzIirFOOrb
|
||||
github.com/Antonboom/testifylint v1.3.1/go.mod h1:NV0hTlteCkViPW9mSR4wEMfwp+Hs1T3dY60bkvSfhpM=
|
||||
github.com/Antonboom/testifylint v1.4.3 h1:ohMt6AHuHgttaQ1xb6SSnxCeK4/rnK7KKzbvs7DmEck=
|
||||
github.com/Antonboom/testifylint v1.4.3/go.mod h1:+8Q9+AOLsz5ZiQiiYujJKs9mNz398+M6UgslP4qgJLA=
|
||||
github.com/Antonboom/testifylint v1.5.0 h1:dlUIsDMtCrZWUnvkaCz3quJCoIjaGi41GzjPBGkkJ8A=
|
||||
github.com/Antonboom/testifylint v1.5.0/go.mod h1:wqaJbu0Blb5Wag2wv7Z5xt+CIV+eVLxtGZrlK13z3AE=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
|
||||
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
@@ -69,6 +79,8 @@ github.com/Crocmagnon/fatcontext v0.2.2 h1:OrFlsDdOj9hW/oBEJBNSuH7QWf+E9WPVHw+x5
|
||||
github.com/Crocmagnon/fatcontext v0.2.2/go.mod h1:WSn/c/+MMNiD8Pri0ahRj0o9jVpeowzavOQplBJw6u0=
|
||||
github.com/Crocmagnon/fatcontext v0.4.0 h1:4ykozu23YHA0JB6+thiuEv7iT6xq995qS1vcuWZq0tg=
|
||||
github.com/Crocmagnon/fatcontext v0.4.0/go.mod h1:ZtWrXkgyfsYPzS6K3O88va6t2GEglG93vnII/F94WC0=
|
||||
github.com/Crocmagnon/fatcontext v0.5.2 h1:vhSEg8Gqng8awhPju2w7MKHqMlg4/NI+gSDHtR3xgwA=
|
||||
github.com/Crocmagnon/fatcontext v0.5.2/go.mod h1:87XhRMaInHP44Q7Tlc7jkgKKB7kZAOPiDkFMdKCC+74=
|
||||
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM=
|
||||
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs=
|
||||
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 h1:sATXp1x6/axKxz2Gjxv8MALP0bXaNRfQinEwyfMcx8c=
|
||||
@@ -79,10 +91,14 @@ github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3Q
|
||||
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
|
||||
github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
|
||||
github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
|
||||
github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0=
|
||||
github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
|
||||
github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA=
|
||||
github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ=
|
||||
github.com/alecthomas/go-check-sumtype v0.1.4 h1:WCvlB3l5Vq5dZQTFmodqL2g68uHiSwwlWcT5a2FGK0c=
|
||||
github.com/alecthomas/go-check-sumtype v0.1.4/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ=
|
||||
github.com/alecthomas/go-check-sumtype v0.2.0 h1:Bo+e4DFf3rs7ME9w/0SU/g6nmzJaphduP8Cjiz0gbwY=
|
||||
github.com/alecthomas/go-check-sumtype v0.2.0/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
@@ -90,6 +106,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/alexkohler/nakedret/v2 v2.0.4 h1:yZuKmjqGi0pSmjGpOC016LtPJysIL0WEUiaXW5SUnNg=
|
||||
github.com/alexkohler/nakedret/v2 v2.0.4/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU=
|
||||
github.com/alexkohler/nakedret/v2 v2.0.5 h1:fP5qLgtwbx9EJE8dGEERT02YwS8En4r9nnZ71RK+EVU=
|
||||
github.com/alexkohler/nakedret/v2 v2.0.5/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU=
|
||||
github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw=
|
||||
github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE=
|
||||
github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw=
|
||||
@@ -104,6 +122,8 @@ 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/bkielbasa/cyclop v1.2.1 h1:AeF71HZDob1P2/pRm1so9cd1alZnrpyc4q2uP2l0gJY=
|
||||
github.com/bkielbasa/cyclop v1.2.1/go.mod h1:K/dT/M0FPAiYjBgQGau7tz+3TMh4FWAEqlMhzFWCrgM=
|
||||
github.com/bkielbasa/cyclop v1.2.3 h1:faIVMIGDIANuGPWH031CZJTi2ymOQBULs9H21HSMa5w=
|
||||
github.com/bkielbasa/cyclop v1.2.3/go.mod h1:kHTwA9Q0uZqOADdupvcFJQtp/ksSnytRMe8ztxG8Fuo=
|
||||
github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M=
|
||||
github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k=
|
||||
github.com/bombsimon/wsl/v4 v4.2.1 h1:Cxg6u+XDWff75SIFFmNsqnIOgob+Q9hG6y/ioKbRFiM=
|
||||
@@ -112,8 +132,12 @@ github.com/bombsimon/wsl/v4 v4.4.1 h1:jfUaCkN+aUpobrMO24zwyAMwMAV5eSziCkOKEauOLd
|
||||
github.com/bombsimon/wsl/v4 v4.4.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo=
|
||||
github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY=
|
||||
github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ=
|
||||
github.com/breml/bidichk v0.3.2 h1:xV4flJ9V5xWTqxL+/PMFF6dtJPvZLPsyixAoPe8BGJs=
|
||||
github.com/breml/bidichk v0.3.2/go.mod h1:VzFLBxuYtT23z5+iVkamXO386OB+/sVwZOpIj6zXGos=
|
||||
github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA=
|
||||
github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U=
|
||||
github.com/breml/errchkjson v0.4.0 h1:gftf6uWZMtIa/Is3XJgibewBm2ksAQSY/kABDNFTAdk=
|
||||
github.com/breml/errchkjson v0.4.0/go.mod h1:AuBOSTHyLSaaAFlWsRSuRBIroCh3eh7ZHh5YeelDIk8=
|
||||
github.com/butuzov/ireturn v0.3.0 h1:hTjMqWw3y5JC3kpnC5vXmFJAWI/m31jaCYQqzkS6PL0=
|
||||
github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD6edP5ZA=
|
||||
github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI=
|
||||
@@ -139,6 +163,10 @@ github.com/ckaznocha/intrange v0.1.0 h1:ZiGBhvrdsKpoEfzh9CjBfDSZof6QB0ORY5tXasUt
|
||||
github.com/ckaznocha/intrange v0.1.0/go.mod h1:Vwa9Ekex2BrEQMg6zlrWwbs/FtYw7eS5838Q7UjK7TQ=
|
||||
github.com/ckaznocha/intrange v0.1.2 h1:3Y4JAxcMntgb/wABQ6e8Q8leMd26JbX2790lIss9MTI=
|
||||
github.com/ckaznocha/intrange v0.1.2/go.mod h1:RWffCw/vKBwHeOEwWdCikAtY0q4gGt8VhJZEEA5n+RE=
|
||||
github.com/ckaznocha/intrange v0.2.0 h1:FykcZuJ8BD7oX93YbO1UY9oZtkRbp+1/kJcDjkefYLs=
|
||||
github.com/ckaznocha/intrange v0.2.0/go.mod h1:r5I7nUlAAG56xmkOpw4XVr16BXhwYTUdcuRFeevn1oE=
|
||||
github.com/ckaznocha/intrange v0.2.1 h1:M07spnNEQoALOJhwrImSrJLaxwuiQK+hA2DeajBlwYk=
|
||||
github.com/ckaznocha/intrange v0.2.1/go.mod h1:7NEhVyf8fzZO5Ds7CRaqPEm52Ut83hsTiL5zbER/HYk=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
@@ -149,6 +177,8 @@ github.com/daixiang0/gci v0.12.3 h1:yOZI7VAxAGPQmkb1eqt5g/11SUlwoat1fSblGLmdiQc=
|
||||
github.com/daixiang0/gci v0.12.3/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI=
|
||||
github.com/daixiang0/gci v0.13.4 h1:61UGkmpoAcxHM2hhNkZEf5SzwQtWJXTSws7jaPyqwlw=
|
||||
github.com/daixiang0/gci v0.13.4/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk=
|
||||
github.com/daixiang0/gci v0.13.5 h1:kThgmH1yBmZSBCh1EJVxQ7JsHpm5Oms0AMed/0LaH4c=
|
||||
github.com/daixiang0/gci v0.13.5/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -164,6 +194,8 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
|
||||
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
|
||||
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
|
||||
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
|
||||
github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4=
|
||||
github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
|
||||
github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y=
|
||||
@@ -178,10 +210,14 @@ github.com/ghostiam/protogetter v0.3.5 h1:+f7UiF8XNd4w3a//4DnusQ2SZjPkUjxkMEfjbx
|
||||
github.com/ghostiam/protogetter v0.3.5/go.mod h1:7lpeDnEJ1ZjL/YtyoN99ljO4z0pd3H0d18/t2dPBxHw=
|
||||
github.com/ghostiam/protogetter v0.3.6 h1:R7qEWaSgFCsy20yYHNIJsU9ZOb8TziSRRxuAOTVKeOk=
|
||||
github.com/ghostiam/protogetter v0.3.6/go.mod h1:7lpeDnEJ1ZjL/YtyoN99ljO4z0pd3H0d18/t2dPBxHw=
|
||||
github.com/ghostiam/protogetter v0.3.8 h1:LYcXbYvybUyTIxN2Mj9h6rHrDZBDwZloPoKctWrFyJY=
|
||||
github.com/ghostiam/protogetter v0.3.8/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA=
|
||||
github.com/go-critic/go-critic v0.11.2 h1:81xH/2muBphEgPtcwH1p6QD+KzXl2tMSi3hXjBSxDnM=
|
||||
github.com/go-critic/go-critic v0.11.2/go.mod h1:OePaicfjsf+KPy33yq4gzv6CO7TEQ9Rom6ns1KsJnl8=
|
||||
github.com/go-critic/go-critic v0.11.4 h1:O7kGOCx0NDIni4czrkRIXTnit0mkyKOCePh3My6OyEU=
|
||||
github.com/go-critic/go-critic v0.11.4/go.mod h1:2QAdo4iuLik5S9YG0rT4wcZ8QxwHYkrr6/2MWAiv/vc=
|
||||
github.com/go-critic/go-critic v0.11.5 h1:TkDTOn5v7EEngMxu8KbuFqFR43USaaH8XRJLz1jhVYA=
|
||||
github.com/go-critic/go-critic v0.11.5/go.mod h1:wu6U7ny9PiaHaZHcvMDmdysMqvDem162Rh3zWTrqk8M=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
@@ -213,6 +249,10 @@ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsM
|
||||
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||
github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc=
|
||||
github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||
github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w=
|
||||
github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
|
||||
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||
github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U=
|
||||
github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM=
|
||||
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
|
||||
@@ -253,8 +293,12 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM=
|
||||
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk=
|
||||
github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUPPyAKJuzv8pEJU=
|
||||
github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s=
|
||||
github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g=
|
||||
github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM=
|
||||
github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 h1:/1322Qns6BtQxUZDTAT4SdcoxknUki7IAoK4SAXr8ME=
|
||||
github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9/go.mod h1:Oesb/0uFAyWoaw1U1qS5zyjCg5NP9C9iwjnI4tIsXEE=
|
||||
github.com/golangci/golangci-lint v1.57.1 h1:cqhpzkzjDwdN12rfMf1SUyyKyp88a1SltNqEYGS0nJw=
|
||||
github.com/golangci/golangci-lint v1.57.1/go.mod h1:zLcHhz3NHc88T5zV2j75lyc0zH3LdOPOybblYa4p0oI=
|
||||
github.com/golangci/golangci-lint v1.59.0 h1:st69YDnAH/v2QXDcgUaZ0seQajHScPALBVkyitYLXEk=
|
||||
@@ -263,6 +307,10 @@ github.com/golangci/golangci-lint v1.59.1 h1:CRRLu1JbhK5avLABFJ/OHVSQ0Ie5c4ulsOI
|
||||
github.com/golangci/golangci-lint v1.59.1/go.mod h1:jX5Oif4C7P0j9++YB2MMJmoNrb01NJ8ITqKWNLewThg=
|
||||
github.com/golangci/golangci-lint v1.60.1 h1:DRKNqNTQRLBJZ1il5u4fvgLQCjQc7QFs0DbhksJtVJE=
|
||||
github.com/golangci/golangci-lint v1.60.1/go.mod h1:jDIPN1rYaIA+ijp9OZcUmUCoQOtZ76pOlFbi15FlLJY=
|
||||
github.com/golangci/golangci-lint v1.61.0 h1:VvbOLaRVWmyxCnUIMTbf1kDsaJbTzH20FAMXTAlQGu8=
|
||||
github.com/golangci/golangci-lint v1.61.0/go.mod h1:e4lztIrJJgLPhWvFPDkhiMwEFRrWlmFbrZea3FsJyN8=
|
||||
github.com/golangci/golangci-lint v1.62.0 h1:/G0g+bi1BhmGJqLdNQkKBWjcim8HjOPc4tsKuHDOhcI=
|
||||
github.com/golangci/golangci-lint v1.62.0/go.mod h1:jtoOhQcKTz8B6dGNFyfQV3WZkQk+YvBDewDtNpiAJts=
|
||||
github.com/golangci/misspell v0.4.1 h1:+y73iSicVy2PqyX7kmUefHusENlrP9YwuHZHPLGQj/g=
|
||||
github.com/golangci/misspell v0.4.1/go.mod h1:9mAN1quEo3DlpbaIKKyEvRxK1pwqR9s/Sea1bJCtlNI=
|
||||
github.com/golangci/misspell v0.5.1 h1:/SjR1clj5uDjNLwYzCahHwIOPmQgoH04AyQIiWGbhCM=
|
||||
@@ -365,6 +413,8 @@ github.com/karamaru-alpha/copyloopvar v1.1.0 h1:x7gNyKcC2vRBO1H2Mks5u1VxQtYvFiym
|
||||
github.com/karamaru-alpha/copyloopvar v1.1.0/go.mod h1:u7CIfztblY0jZLOQZgH3oYsJzpC2A7S6u/lfgSXHy0k=
|
||||
github.com/kisielk/errcheck v1.7.0 h1:+SbscKmWJ5mOK/bO1zS60F5I9WwZDWOfRsC4RwfwRV0=
|
||||
github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ=
|
||||
github.com/kisielk/errcheck v1.8.0 h1:ZX/URYa7ilESY19ik/vBmCn6zdGQLxACwjAcWbHlYlg=
|
||||
github.com/kisielk/errcheck v1.8.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/kkHAIKE/contextcheck v1.1.4 h1:B6zAaLhOEEcjvUgIYEqystmnFk1Oemn8bvJhbt0GMb8=
|
||||
github.com/kkHAIKE/contextcheck v1.1.4/go.mod h1:1+i/gWqokIa+dm31mqGLZhZJ7Uh44DJGZVmr6QRBNJg=
|
||||
@@ -384,6 +434,8 @@ github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/
|
||||
github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA=
|
||||
github.com/lasiar/canonicalheader v1.1.1 h1:wC+dY9ZfiqiPwAexUApFush/csSPXeIi4QqyxXmng8I=
|
||||
github.com/lasiar/canonicalheader v1.1.1/go.mod h1:cXkb3Dlk6XXy+8MVQnF23CYKWlyA7kfQhSw2CcZtZb0=
|
||||
github.com/lasiar/canonicalheader v1.1.2 h1:vZ5uqwvDbyJCnMhmFYimgMZnJMjwljN5VGY0VKbMXb4=
|
||||
github.com/lasiar/canonicalheader v1.1.2/go.mod h1:qJCeLFS0G/QlLQ506T+Fk/fWMa2VmBUiEI2cuMK4djI=
|
||||
github.com/ldez/gomoddirectives v0.2.3 h1:y7MBaisZVDYmKvt9/l1mjNCiSA1BVn34U0ObUcJwlhA=
|
||||
github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0=
|
||||
github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJZ3alg=
|
||||
@@ -414,12 +466,16 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
|
||||
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/mgechev/revive v1.3.7 h1:502QY0vQGe9KtYJ9FpxMz9rL+Fc/P13CI5POL4uHCcE=
|
||||
github.com/mgechev/revive v1.3.7/go.mod h1:RJ16jUbF0OWC3co/+XTxmFNgEpUPwnnA0BRllX2aDNA=
|
||||
github.com/mgechev/revive v1.3.9 h1:18Y3R4a2USSBF+QZKFQwVkBROUda7uoBlkEuBD+YD1A=
|
||||
github.com/mgechev/revive v1.3.9/go.mod h1:+uxEIr5UH0TjXWHTno3xh4u7eg6jDpXKzQccA9UGhHU=
|
||||
github.com/mgechev/revive v1.5.0 h1:oaSmjA7rP8+HyoRuCgC531VHwnLH1AlJdjj+1AnQceQ=
|
||||
github.com/mgechev/revive v1.5.0/go.mod h1:L6T3H8EoerRO86c7WuGpvohIUmiploGiyoYbtIWFmV8=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
@@ -445,6 +501,8 @@ github.com/nunnatsa/ginkgolinter v0.16.1 h1:uDIPSxgVHZ7PgbJElRDGzymkXH+JaF7mjew+
|
||||
github.com/nunnatsa/ginkgolinter v0.16.1/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ=
|
||||
github.com/nunnatsa/ginkgolinter v0.16.2 h1:8iLqHIZvN4fTLDC0Ke9tbSZVcyVHoBs0HIbnVSxfHJk=
|
||||
github.com/nunnatsa/ginkgolinter v0.16.2/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ=
|
||||
github.com/nunnatsa/ginkgolinter v0.18.0 h1:ZXO1wKhPg3A6LpbN5dMuqwhfOjN5c3ous8YdKOuqk9k=
|
||||
github.com/nunnatsa/ginkgolinter v0.18.0/go.mod h1:vPrWafSULmjMGCMsfGA908if95VnHQNAahvSBOjTuWs=
|
||||
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
|
||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
||||
github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw=
|
||||
@@ -458,6 +516,8 @@ github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeB
|
||||
github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
|
||||
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
|
||||
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
|
||||
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
|
||||
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
@@ -495,6 +555,8 @@ github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0
|
||||
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||
github.com/quasilyte/go-ruleguard v0.4.2 h1:htXcXDK6/rO12kiTHKfHuqR4kr3Y4M0J0rOL6CH/BYs=
|
||||
github.com/quasilyte/go-ruleguard v0.4.2/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI=
|
||||
github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 h1:+Wl/0aFp0hpuHM3H//KMft64WQ1yX9LdJY64Qm/gFCo=
|
||||
github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI=
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE=
|
||||
github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU=
|
||||
github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo=
|
||||
@@ -503,7 +565,14 @@ github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl
|
||||
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0=
|
||||
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs=
|
||||
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ=
|
||||
github.com/raeperd/recvcheck v0.1.2 h1:SjdquRsRXJc26eSonWIo8b7IMtKD3OAT2Lb5G3ZX1+4=
|
||||
github.com/raeperd/recvcheck v0.1.2/go.mod h1:n04eYkwIR0JbgD73wT8wL4JjPC3wm0nFtzBnWNocnYU=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
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/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/ryancurrah/gomodguard v1.3.1 h1:fH+fUg+ngsQO0ruZXXHnA/2aNllWA1whly4a6UvyzGE=
|
||||
github.com/ryancurrah/gomodguard v1.3.1/go.mod h1:DGFHzEhi6iJ0oIDfMuo3TgrS+L9gZvrEfmjjuelnRU0=
|
||||
@@ -511,6 +580,8 @@ github.com/ryancurrah/gomodguard v1.3.2 h1:CuG27ulzEB1Gu5Dk5gP8PFxSOZ3ptSdP5iI/3
|
||||
github.com/ryancurrah/gomodguard v1.3.2/go.mod h1:LqdemiFomEjcxOqirbQCb3JFvSxH2JUYMerTFd3sF2o=
|
||||
github.com/ryancurrah/gomodguard v1.3.3 h1:eiSQdJVNr9KTNxY2Niij8UReSwR8Xrte3exBrAZfqpg=
|
||||
github.com/ryancurrah/gomodguard v1.3.3/go.mod h1:rsKQjj4l3LXe8N344Ow7agAy5p9yjsWOtRzUMYmA0QY=
|
||||
github.com/ryancurrah/gomodguard v1.3.5 h1:cShyguSwUEeC0jS7ylOiG/idnd1TpJ1LfHGpV3oJmPU=
|
||||
github.com/ryancurrah/gomodguard v1.3.5/go.mod h1:MXlEPQRxgfPQa62O8wzK3Ozbkv9Rkqr+wKjSxTdsNJE=
|
||||
github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU=
|
||||
github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ=
|
||||
github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc=
|
||||
@@ -529,6 +600,10 @@ github.com/securego/gosec/v2 v2.19.0 h1:gl5xMkOI0/E6Hxx0XCY2XujA3V7SNSefA8sC+3f1
|
||||
github.com/securego/gosec/v2 v2.19.0/go.mod h1:hOkDcHz9J/XIgIlPDXalxjeVYsHxoWUc5zJSHxcB8YM=
|
||||
github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9 h1:rnO6Zp1YMQwv8AyxzuwsVohljJgp4L0ZqiCgtACsPsc=
|
||||
github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9/go.mod h1:dg7lPlu/xK/Ut9SedURCoZbVCR4yC7fM65DtH9/CDHs=
|
||||
github.com/securego/gosec/v2 v2.21.2 h1:deZp5zmYf3TWwU7A7cR2+SolbTpZ3HQiwFqnzQyEl3M=
|
||||
github.com/securego/gosec/v2 v2.21.2/go.mod h1:au33kg78rNseF5PwPnTWhuYBFf534bvJRvOrgZ/bFzU=
|
||||
github.com/securego/gosec/v2 v2.21.4 h1:Le8MSj0PDmOnHJgUATjD96PaXRvCpKC+DGJvwyy0Mlk=
|
||||
github.com/securego/gosec/v2 v2.21.4/go.mod h1:Jtb/MwRQfRxCXyCm1rfM1BEiiiTfUOdyzzAhlr6lUTA=
|
||||
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU=
|
||||
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs=
|
||||
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
|
||||
@@ -544,8 +619,12 @@ github.com/sivchari/tenv v1.7.1 h1:PSpuD4bu6fSmtWMxSGWcvqUUgIn7k3yOJhOIzVWn8Ak=
|
||||
github.com/sivchari/tenv v1.7.1/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg=
|
||||
github.com/sivchari/tenv v1.10.0 h1:g/hzMA+dBCKqGXgW8AV/1xIWhAvDrx0zFKNR48NFMg0=
|
||||
github.com/sivchari/tenv v1.10.0/go.mod h1:tdY24masnVoZFxYrHv/nD6Tc8FbkEtAQEEziXpyMgqY=
|
||||
github.com/sivchari/tenv v1.12.1 h1:+E0QzjktdnExv/wwsnnyk4oqZBUfuh89YMQT1cyuvSY=
|
||||
github.com/sivchari/tenv v1.12.1/go.mod h1:1LjSOUCc25snIr5n3DtGGrENhX3LuWefcplwVGC24mw=
|
||||
github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00=
|
||||
github.com/sonatard/noctx v0.0.2/go.mod h1:kzFz+CzWSjQ2OzIm46uJZoXuBpa2+0y3T36U18dWqIo=
|
||||
github.com/sonatard/noctx v0.1.0 h1:JjqOc2WN16ISWAjAk8M5ej0RfExEXtkEyExl2hLW+OM=
|
||||
github.com/sonatard/noctx v0.1.0/go.mod h1:0RvBxqY8D4j9cTTTWE8ylt2vqj2EPI8fHmrxHdsaZ2c=
|
||||
github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0=
|
||||
github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs=
|
||||
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
|
||||
@@ -592,12 +671,20 @@ github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg
|
||||
github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY=
|
||||
github.com/tetafro/godot v1.4.16 h1:4ChfhveiNLk4NveAZ9Pu2AN8QZ2nkUGFuadM9lrr5D0=
|
||||
github.com/tetafro/godot v1.4.16/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio=
|
||||
github.com/tetafro/godot v1.4.17 h1:pGzu+Ye7ZUEFx7LHU0dAKmCOXWsPjl7qA6iMGndsjPs=
|
||||
github.com/tetafro/godot v1.4.17/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio=
|
||||
github.com/tetafro/godot v1.4.18 h1:ouX3XGiziKDypbpXqShBfnNLTSjR8r3/HVzrtJ+bHlI=
|
||||
github.com/tetafro/godot v1.4.18/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio=
|
||||
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M=
|
||||
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ=
|
||||
github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4=
|
||||
github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg=
|
||||
github.com/timonwong/loggercheck v0.10.1 h1:uVZYClxQFpw55eh+PIoqM7uAOHMrhVcDoWDery9R8Lg=
|
||||
github.com/timonwong/loggercheck v0.10.1/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8=
|
||||
github.com/tomarrell/wrapcheck/v2 v2.8.3 h1:5ov+Cbhlgi7s/a42BprYoxsr73CbdMUTzE3bRDFASUs=
|
||||
github.com/tomarrell/wrapcheck/v2 v2.8.3/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo=
|
||||
github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4=
|
||||
github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo=
|
||||
github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw=
|
||||
github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw=
|
||||
github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI=
|
||||
@@ -610,6 +697,8 @@ github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvni
|
||||
github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k=
|
||||
github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZyM=
|
||||
github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U=
|
||||
github.com/uudashr/iface v1.2.0 h1:ECJjh5q/1Zmnv/2yFpWV6H3oMg5+Mo+vL0aqw9Gjazo=
|
||||
github.com/uudashr/iface v1.2.0/go.mod h1:Ux/7d/rAF3owK4m53cTVXL4YoVHKNqnoOeQHn2xrlp0=
|
||||
github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU=
|
||||
github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg=
|
||||
github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM=
|
||||
@@ -635,6 +724,8 @@ go-simpler.org/musttag v0.9.0 h1:Dzt6/tyP9ONr5g9h9P3cnYWCxeBFRkd0uJL/w+1Mxos=
|
||||
go-simpler.org/musttag v0.9.0/go.mod h1:gA9nThnalvNSKpEoyp3Ko4/vCX2xTpqKoUtNqXOnVR4=
|
||||
go-simpler.org/musttag v0.12.2 h1:J7lRc2ysXOq7eM8rwaTYnNrHd5JwjppzB6mScysB2Cs=
|
||||
go-simpler.org/musttag v0.12.2/go.mod h1:uN1DVIasMTQKk6XSik7yrJoEysGtR2GRqvWnI9S7TYM=
|
||||
go-simpler.org/musttag v0.13.0 h1:Q/YAW0AHvaoaIbsPj3bvEI5/QFP7w696IMUpnKXQfCE=
|
||||
go-simpler.org/musttag v0.13.0/go.mod h1:FTzIGeK6OkKlUDVpj0iQUXZLUO1Js9+mvykDQy9C5yM=
|
||||
go-simpler.org/sloglint v0.5.0 h1:2YCcd+YMuYpuqthCgubcF5lBSjb6berc5VMOYUHKrpY=
|
||||
go-simpler.org/sloglint v0.5.0/go.mod h1:EUknX5s8iXqf18KQxKnaBHUPVriiPnOrPjjJcsaTcSQ=
|
||||
go-simpler.org/sloglint v0.7.0 h1:rMZRxD9MbaGoRFobIOicMxZzum7AXNFDlez6xxJs5V4=
|
||||
@@ -652,6 +743,8 @@ go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
|
||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8=
|
||||
go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
|
||||
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
|
||||
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
|
||||
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
|
||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||
go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60=
|
||||
@@ -676,10 +769,16 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH
|
||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM=
|
||||
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
|
||||
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk=
|
||||
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
|
||||
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk=
|
||||
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY=
|
||||
golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
|
||||
golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
|
||||
golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8=
|
||||
golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
|
||||
golang.org/x/exp/typeparams v0.0.0-20240909161429-701f63a606c0 h1:bVwtbF629Xlyxk6xLQq2TDYmqP0uiWaet5LwRebuY0k=
|
||||
golang.org/x/exp/typeparams v0.0.0-20240909161429-701f63a606c0/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
@@ -716,6 +815,10 @@ golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
|
||||
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
|
||||
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
|
||||
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
|
||||
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -779,6 +882,8 @@ golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
|
||||
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -841,6 +946,10 @@ golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
|
||||
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
|
||||
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
@@ -861,6 +970,8 @@ golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@@ -933,6 +1044,8 @@ golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
|
||||
golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c=
|
||||
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
|
||||
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
|
||||
golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o=
|
||||
golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
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=
|
||||
@@ -1014,6 +1127,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
||||
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
@@ -1042,8 +1157,12 @@ honnef.co/go/tools v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs=
|
||||
honnef.co/go/tools v0.4.7/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0=
|
||||
honnef.co/go/tools v0.5.0 h1:29uoiIormS3Z6R+t56STz/oI4v+mB51TSmEOdJPgRnE=
|
||||
honnef.co/go/tools v0.5.0/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs=
|
||||
honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=
|
||||
honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs=
|
||||
mvdan.cc/gofumpt v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo=
|
||||
mvdan.cc/gofumpt v0.6.0/go.mod h1:4L0wf+kgIPZtcCWXynNS2e6bhmj73umwnuXSZarixzA=
|
||||
mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU=
|
||||
mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo=
|
||||
mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14 h1:zCr3iRRgdk5eIikZNDphGcM6KGVTx3Yu+/Uu9Es254w=
|
||||
mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14/go.mod h1:ZzZjEpJDOmx8TdVU6umamY3Xy0UAQUI2DHbf05USVbI=
|
||||
mvdan.cc/unparam v0.0.0-20240427195214-063aff900ca1 h1:Nykk7fggxChwLK4rUPYESzeIwqsuxXXlFEAh5YhaMRo=
|
||||
|
||||
@@ -14,7 +14,7 @@ CUE="${GOBIN}/cue-v0.5.0"
|
||||
|
||||
DRONE="${GOBIN}/drone-v1.5.0"
|
||||
|
||||
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.60.1"
|
||||
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.62.0"
|
||||
|
||||
JB="${GOBIN}/jb-v0.5.1"
|
||||
|
||||
|
||||
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()
|
||||
)
|
||||
|
||||
1505
.drone.yml
1505
.drone.yml
File diff suppressed because it is too large
Load Diff
26
.github/CODEOWNERS
vendored
26
.github/CODEOWNERS
vendored
@@ -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
|
||||
|
||||
@@ -66,7 +60,7 @@
|
||||
/pkg/README.md @grafana/grafana-backend-group
|
||||
/pkg/ruleguard.rules.go @grafana/grafana-backend-group
|
||||
/.bra.toml @grafana/grafana-backend-group
|
||||
/.golangci.toml @grafana/grafana-backend-group
|
||||
/.golangci.yml @grafana/grafana-backend-group
|
||||
/build.go @grafana/grafana-backend-services-squad
|
||||
/scripts/modowners/ @grafana/grafana-backend-services-squad
|
||||
/scripts/go-workspace @grafana/grafana-app-platform-squad
|
||||
@@ -701,12 +695,14 @@ embed.go @grafana/grafana-as-code
|
||||
/.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/migrate-prs.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/create-next-release-branch.yml @grafana/grafana-developer-enablement-squad
|
||||
/.github/workflows/codeowners-validator.yml @tolzhabayev
|
||||
/.github/workflows/codeql-analysis.yml @DanCech
|
||||
/.github/workflows/commands.yml @torkelo
|
||||
@@ -747,7 +743,7 @@ embed.go @grafana/grafana-as-code
|
||||
/.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-k8s-codegen-check.yml @grafana/grafana-app-platform-squad
|
||||
/.github/workflows/go_lint.yml @grafana/grafana-backend-services-squad
|
||||
/.github/workflows/go-lint.yml @grafana/grafana-backend-services-squad
|
||||
/.github/workflows/trivy-scan.yml @grafana/grafana-backend-services-squad
|
||||
/.github/workflows/changelog.yml @zserge
|
||||
/.github/workflows/actions/changelog @zserge
|
||||
|
||||
16
.github/workflows/backport.yml
vendored
16
.github/workflows/backport.yml
vendored
@@ -10,24 +10,18 @@ jobs:
|
||||
if: github.repository == 'grafana/grafana'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: "grafana/grafana-github-actions"
|
||||
path: ./actions
|
||||
ref: main
|
||||
- name: Install Actions
|
||||
run: npm install --production --prefix ./actions
|
||||
- name: "Generate token"
|
||||
id: generate_token
|
||||
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
||||
with:
|
||||
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
- run: git config --global user.email '132647405+grafana-delivery-bot[bot]@users.noreply.github.com'
|
||||
- run: git config --global user.name 'grafana-delivery-bot[bot]'
|
||||
- run: git remote set-url origin "https://grafana-delivery-bot:${{ steps.generate_token.outputs.token }}@github.com/grafana/grafana.git"
|
||||
- name: Run backport
|
||||
uses: ./actions/backport
|
||||
uses: grafana/grafana-github-actions-go/backport@main
|
||||
with:
|
||||
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
labelsToAdd: "backport"
|
||||
title: "[{{base}}] {{originalTitle}}"
|
||||
|
||||
53
.github/workflows/create-next-release-branch.yml
vendored
Normal file
53
.github/workflows/create-next-release-branch.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: Create next release branch
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ownerRepo:
|
||||
type: string
|
||||
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
|
||||
required: true
|
||||
source:
|
||||
description: The release branch to increment (eg providing `release-11.2.3` will result in `release-11.2.4` being created)
|
||||
type: string
|
||||
required: true
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID:
|
||||
required: true
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM:
|
||||
required: true
|
||||
outputs:
|
||||
branch:
|
||||
description: The new branch that was created
|
||||
value: ${{ jobs.main.outputs.branch }}
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ownerRepo:
|
||||
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
|
||||
source:
|
||||
description: The release branch to increment (eg providing `release-11.2.3` will result in `release-11.2.4` being created)
|
||||
type: string
|
||||
required: true
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID:
|
||||
required: true
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM:
|
||||
required: true
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
branch: ${{ steps.branch.outputs.branch }}
|
||||
steps:
|
||||
- name: "Generate token"
|
||||
id: generate_token
|
||||
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
||||
with:
|
||||
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
- name: Create release branch
|
||||
id: branch
|
||||
uses: grafana/grafana-github-actions-go/bump-release@main
|
||||
with:
|
||||
ownerRepo: ${{ inputs.ownerRepo }}
|
||||
source: ${{ inputs.source }}
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
@@ -11,6 +11,7 @@ on:
|
||||
branches:
|
||||
- "main"
|
||||
- "v*.*.*"
|
||||
- "release-*.*.*"
|
||||
|
||||
# This is run before the pull request has been merged, so we'll run against the src branch
|
||||
jobs:
|
||||
|
||||
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 }}"
|
||||
|
||||
3
.github/workflows/github-release.yml
vendored
3
.github/workflows/github-release.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
type: string
|
||||
latest:
|
||||
required: false
|
||||
default: false
|
||||
default: "0"
|
||||
description: Mark this release as latest (`1`) or not (`0`, default)
|
||||
type: string
|
||||
dry_run:
|
||||
@@ -23,6 +23,7 @@ on:
|
||||
type: string
|
||||
latest:
|
||||
required: false
|
||||
default: "0"
|
||||
description: Mark this release as latest (`1`) or not (`0`, default)
|
||||
type: string
|
||||
dry_run:
|
||||
|
||||
@@ -3,7 +3,7 @@ on:
|
||||
push:
|
||||
paths:
|
||||
- pkg/**
|
||||
- .github/workflows/go_lint.yml
|
||||
- .github/workflows/go-lint.yml
|
||||
- go.*
|
||||
branches:
|
||||
- main
|
||||
@@ -20,13 +20,11 @@ jobs:
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: ./go.mod
|
||||
- run: CODEGEN_VERIFY=1 make gen-cue
|
||||
- run: make gen-go
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
version: v1.60.1
|
||||
version: v1.62.0
|
||||
args: |
|
||||
--config .golangci.toml --max-same-issues=0 --max-issues-per-linter=0 --verbose $(./scripts/go-workspace/golangci-lint-includes.sh)
|
||||
skip-cache: true
|
||||
--verbose $(go list -m -f '{{.Dir}}' | xargs -I{} sh -c 'test ! -f {}/.nolint && echo {}/...')
|
||||
install-mode: binary
|
||||
60
.github/workflows/migrate-prs.yml
vendored
Normal file
60
.github/workflows/migrate-prs.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Migrate open PRs
|
||||
# Migrate open PRs from a superseded release branch to the current release branch and notify authors
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
from:
|
||||
description: 'The base branch to check for open PRs'
|
||||
required: true
|
||||
type: string
|
||||
to:
|
||||
description: 'The base branch to migrate open PRs to'
|
||||
required: true
|
||||
type: string
|
||||
ownerRepo:
|
||||
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID:
|
||||
required: true
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM:
|
||||
required: true
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
from:
|
||||
description: 'The base branch to check for open PRs'
|
||||
required: true
|
||||
type: string
|
||||
to:
|
||||
description: 'The base branch to migrate open PRs to'
|
||||
required: true
|
||||
type: string
|
||||
ownerRepo:
|
||||
description: Owner/repo of the repository where the branch is created (e.g. 'grafana/grafana')
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID:
|
||||
required: true
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Generate token"
|
||||
id: generate_token
|
||||
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
|
||||
with:
|
||||
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
- name: Migrate PRs
|
||||
uses: grafana/grafana-github-actions-go/migrate-open-prs@main
|
||||
with:
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
ownerRepo: ${{ inputs.ownerRepo }}
|
||||
from: ${{ inputs.from }}
|
||||
to: ${{ inputs.to }}
|
||||
binary_release_tag: 'dev'
|
||||
@@ -3,7 +3,7 @@ name: publish-technical-documentation-release
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v[0-9]+.[0-9]+.x
|
||||
- release-[0-9]+.[0-9]+.[0-9]+
|
||||
tags:
|
||||
- v[0-9]+.[0-9]+.[0-9]+
|
||||
paths:
|
||||
@@ -20,10 +20,10 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: grafana/writers-toolkit/publish-technical-documentation-release@publish-technical-documentation-release/v1
|
||||
- uses: grafana/writers-toolkit/publish-technical-documentation-release@publish-technical-documentation-release/v2
|
||||
with:
|
||||
release_tag_regexp: "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
|
||||
release_branch_regexp: "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.x$"
|
||||
release_branch_with_patch_regexp: "^v(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"
|
||||
release_tag_regexp: "^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
|
||||
release_branch_regexp: "^release-(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
|
||||
release_branch_with_patch_regexp: "^release-(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
|
||||
website_directory: content/docs/grafana
|
||||
version_suffix: ""
|
||||
|
||||
56
.github/workflows/release-comms.yml
vendored
56
.github/workflows/release-comms.yml
vendored
@@ -8,17 +8,18 @@ on:
|
||||
dry_run:
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
version:
|
||||
required: true
|
||||
latest:
|
||||
type: bool
|
||||
type: boolean
|
||||
default: false
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
branches:
|
||||
- 'main'
|
||||
- 'v*.*.*'
|
||||
- 'release-*.*.*'
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
@@ -26,30 +27,77 @@ jobs:
|
||||
name: Setup and establish latest
|
||||
outputs:
|
||||
version: ${{ steps.output.outputs.version }}
|
||||
release_branch: ${{ steps.output.outputs.release_branch }}
|
||||
dry_run: ${{ steps.output.outputs.dry_run }}
|
||||
latest: ${{ steps.output.outputs.latest }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# The github-release action expects a `LATEST` value of a string of either '1' or '0'
|
||||
- if: ${{ github.event_name == 'workflow_dispatch' }}
|
||||
run: |
|
||||
echo setting up GITHUB_ENV for ${{ github.event_name }}
|
||||
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
|
||||
echo "DRY_RUN=${{ inputs.dry_run }}" >> $GITHUB_ENV
|
||||
echo "LATEST=${{ inputs.latest }}" >> $GITHUB_ENV
|
||||
echo "LATEST=${{ inputs.latest && '1' || '0' }}" >> $GITHUB_ENV
|
||||
- if: ${{ github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/') }}
|
||||
run: |
|
||||
echo "VERSION=$(echo ${{ github.head_ref }} | sed -e 's/release\/.*\///g')" >> $GITHUB_ENV
|
||||
echo "DRY_RUN=${{ contains(github.event.pull_request.labels.*.name, 'release/dry-run') }}" >> $GITHUB_ENV
|
||||
echo "LATEST=${{ contains(github.event.pull_request.labels.*.name, 'release/latest') }}" >> $GITHUB_ENV
|
||||
echo "LATEST=${{ contains(github.event.pull_request.labels.*.name, 'release/latest') && '1' || '0' }}" >> $GITHUB_ENV
|
||||
- id: output
|
||||
run: |
|
||||
echo "dry_run: $DRY_RUN"
|
||||
echo "latest: $LATEST"
|
||||
echo "version: $VERSION"
|
||||
|
||||
echo "release_branch=$(echo $VERSION | sed -s 's/^v/release-/g')" >> "$GITHUB_OUTPUT"
|
||||
echo "dry_run=$DRY_RUN" >> "$GITHUB_OUTPUT"
|
||||
echo "latest=$LATEST" >> "$GITHUB_OUTPUT"
|
||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
create_next_release_branch_grafana:
|
||||
name: Create next release branch (Grafana)
|
||||
needs: setup
|
||||
uses: ./.github/workflows/create-next-release-branch.yml
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
with:
|
||||
ownerRepo: 'grafana/grafana'
|
||||
source: ${{ needs.setup.outputs.release_branch }}
|
||||
create_next_release_branch_enterprise:
|
||||
name: Create next release branch (Grafana Enterprise)
|
||||
needs: setup
|
||||
uses: ./.github/workflows/create-next-release-branch.yml
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
with:
|
||||
ownerRepo: 'grafana/grafana-enterprise'
|
||||
source: ${{ needs.setup.outputs.release_branch }}
|
||||
migrate_prs_grafana:
|
||||
needs:
|
||||
- setup
|
||||
- create_next_release_branch_grafana
|
||||
uses: ./.github/workflows/migrate-prs.yml
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
with:
|
||||
ownerRepo: 'grafana/grafana'
|
||||
from: ${{ needs.setup.outputs.release_branch }}
|
||||
to: ${{ needs.create_next_release_branch_grafana.outputs.branch }}
|
||||
migrate_prs_enterprise:
|
||||
needs:
|
||||
- setup
|
||||
- create_next_release_branch_enterprise
|
||||
uses: ./.github/workflows/migrate-prs.yml
|
||||
secrets:
|
||||
GRAFANA_DELIVERY_BOT_APP_ID: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
GRAFANA_DELIVERY_BOT_APP_PEM: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
with:
|
||||
ownerRepo: 'grafana/grafana-enterprise'
|
||||
from: ${{ needs.setup.outputs.release_branch }}
|
||||
to: ${{ needs.create_next_release_branch_enterprise.outputs.branch }}
|
||||
post_changelog_on_forum:
|
||||
needs: setup
|
||||
uses: ./.github/workflows/community-release.yml
|
||||
|
||||
18
.github/workflows/release-pr.yml
vendored
18
.github/workflows/release-pr.yml
vendored
@@ -4,7 +4,7 @@
|
||||
# Please refrain from including any processes that do not result in code changes in this workflow. Instead, they should
|
||||
# either be triggered in the release promotion process or in the release comms process (that is triggered by merging
|
||||
# this PR).
|
||||
name: Complete a Grafana release
|
||||
name: Grafana Release PR
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
@@ -19,7 +19,7 @@ on:
|
||||
target:
|
||||
required: true
|
||||
type: string
|
||||
description: The base branch that these changes are being merged into
|
||||
description: The release branch pattern (eg v9.5.x) that these changes are being merged into
|
||||
backport:
|
||||
required: false
|
||||
type: string
|
||||
@@ -61,10 +61,17 @@ jobs:
|
||||
with:
|
||||
app_id: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
|
||||
private_key: ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
|
||||
- name: Get release branch
|
||||
id: branch
|
||||
uses: grafana/grafana-github-actions-go/latest-release-branch@main
|
||||
with:
|
||||
token: ${{ steps.generate_token.outputs.token }}
|
||||
ownerRepo: 'grafana/grafana'
|
||||
pattern: ${{ inputs.target }}
|
||||
- name: Checkout Grafana
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ inputs.target }}
|
||||
ref: ${{ steps.branch.outputs.branch }}
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Checkout Grafana (main)
|
||||
@@ -124,7 +131,6 @@ jobs:
|
||||
rm -f CHANGELOG.part changelog_items.md
|
||||
|
||||
git diff CHANGELOG.md
|
||||
|
||||
- name: "Prettify CHANGELOG.md"
|
||||
run: npx prettier --write CHANGELOG.md
|
||||
- name: Commit CHANGELOG.md changes
|
||||
@@ -151,7 +157,7 @@ jobs:
|
||||
$( [ "x${{ inputs.latest }}" == "xtrue" ] && printf %s '-l "release/latest"') \
|
||||
-l "no-changelog" \
|
||||
--dry-run=${{ inputs.dry_run }} \
|
||||
-B "${{ inputs.target }}" \
|
||||
-B "${{ steps.branch.outputs.branch }}" \
|
||||
--title "Release: ${{ inputs.version }}" \
|
||||
--body "These code changes must be merged after a release is complete"
|
||||
env:
|
||||
@@ -165,7 +171,7 @@ jobs:
|
||||
-l "product-approved" \
|
||||
-l "no-changelog" \
|
||||
--dry-run=${{ inputs.dry_run }} \
|
||||
-B "${{ inputs.target }}" \
|
||||
-B "${{ steps.branch.outputs.branch }}" \
|
||||
--title "Release: ${{ inputs.version }}" \
|
||||
--body "These code changes must be merged after a release is complete"
|
||||
env:
|
||||
|
||||
315
.golangci.toml
315
.golangci.toml
@@ -1,315 +0,0 @@
|
||||
[run]
|
||||
timeout = "20m"
|
||||
concurrency = 10
|
||||
allow-parallel-runners = true
|
||||
|
||||
[linters-settings.exhaustive]
|
||||
default-signifies-exhaustive = true
|
||||
|
||||
[linters-settings.revive]
|
||||
ignore-generated-header = false
|
||||
severity = "warning"
|
||||
confidence = 3
|
||||
|
||||
[linters-settings.depguard.rules.main]
|
||||
allow = [] # allow all
|
||||
deny = [
|
||||
{ pkg = "io/ioutil", desc = "Deprecated: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details." },
|
||||
{ pkg = "gopkg.in/yaml.v2", desc = "Grafana packages are not allowed to depend on gopkg.in/yaml.v2 as gopkg.in/yaml.v3 is now available" },
|
||||
{ pkg = "github.com/pkg/errors", desc = "Deprecated: Go 1.13 supports the functionality provided by pkg/errors in the standard library." },
|
||||
{ pkg = "github.com/xorcare/pointer", desc = "Use pkg/util.Pointer instead, which is a generic one-liner alternative" },
|
||||
{ pkg = "github.com/gofrs/uuid", desc = "Use github.com/google/uuid instead, which we already depend on." },
|
||||
{ pkg = "github.com/bmizerany/assert", desc = "Use github.com/stretchr/testify/assert instead, which we already depend on." },
|
||||
]
|
||||
|
||||
[linters-settings.depguard.rules.coreplugins]
|
||||
deny = [
|
||||
{ pkg = "github.com/grafana/grafana/pkg/api", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/cmd", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/cuectx", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/extensions", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/kinds", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/middleware", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/modules", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/registry", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/services", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/build", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/codegen", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/events", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/ifaces", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/kindsysreport", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/mocks", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/plugins", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/setting", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/util", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/bus", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/components", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/expr", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/infra", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/login", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/models", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/server", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/tests", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/web", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
{ pkg = "github.com/grafana/grafana/pkg/tsdb/intervalv2", desc = "Core plugins are not allowed to depend on Grafana core packages" },
|
||||
]
|
||||
files = [
|
||||
"**/pkg/tsdb/grafana-pyroscope-datasource/*",
|
||||
"**/pkg/tsdb/grafana-pyroscope-datasource/**/*",
|
||||
"**/pkg/tsdb/grafana-testdata-datasource/*",
|
||||
"**/pkg/tsdb/grafana-testdata-datasource/**/*",
|
||||
"**/pkg/tsdb/azuremonitor/*",
|
||||
"**/pkg/tsdb/azuremonitor/**/*",
|
||||
"**/pkg/tsdb/cloud-monitoring/*",
|
||||
"**/pkg/tsdb/cloud-monitoring/**/*",
|
||||
"**/pkg/tsdb/mysql/*",
|
||||
"**/pkg/tsdb/mysql/**/*",
|
||||
"**/pkg/tsdb/parca/*",
|
||||
"**/pkg/tsdb/parca/**/*",
|
||||
"**/pkg/tsdb/tempo/*",
|
||||
"**/pkg/tsdb/tempo/**/*",
|
||||
"**/pkg/tsdb/cloudwatch/*",
|
||||
"**/pkg/tsdb/cloudwatch/**/*",
|
||||
]
|
||||
|
||||
[linters-settings.depguard.rules.apiserver]
|
||||
list-mode = "lax"
|
||||
allow = [
|
||||
"github.com/grafana/grafana/pkg/apimachinery",
|
||||
"github.com/grafana/grafana/pkg/apiserver",
|
||||
]
|
||||
deny = [
|
||||
{ pkg = "github.com/grafana/grafana/pkg", desc = "apiserver is not allowed to import grafana core" }
|
||||
]
|
||||
files = [
|
||||
"**/pkg/apiserver/*",
|
||||
"**/pkg/apiserver/**/*"
|
||||
]
|
||||
|
||||
[linters-settings.depguard.rules.apimachinery]
|
||||
list-mode = "lax"
|
||||
allow = [
|
||||
"github.com/grafana/grafana/pkg/apimachinery",
|
||||
]
|
||||
deny = [
|
||||
{ pkg = "github.com/grafana/grafana/pkg", desc = "apimachinery is not allowed to import grafana core" }
|
||||
]
|
||||
files = [
|
||||
"**/pkg/apimachinery/*",
|
||||
"**/pkg/apimachinery/**/*"
|
||||
]
|
||||
|
||||
[linters-settings.depguard.rules.aggregator]
|
||||
list-mode = "lax"
|
||||
allow = [
|
||||
"github.com/grafana/grafana/pkg/aggregator",
|
||||
"github.com/grafana/grafana/pkg/semconv",
|
||||
"github.com/grafana/grafana/pkg/apimachinery",
|
||||
]
|
||||
deny = [
|
||||
{ pkg = "github.com/grafana/grafana/pkg", desc = "apimachinery is not allowed to import grafana core" }
|
||||
]
|
||||
files = [
|
||||
"./pkg/aggregator/*",
|
||||
"./pkg/aggregator/**/*"
|
||||
]
|
||||
|
||||
[linters-settings.depguard.rules.promlib]
|
||||
list-mode = "lax" # allow unless explicitely denied
|
||||
deny = [
|
||||
{ pkg = "github.com/grafana/grafana/pkg", desc = "promlib is not allowed to import grafana core" }
|
||||
]
|
||||
allow = [
|
||||
"github.com/grafana/grafana/pkg/promlib"
|
||||
]
|
||||
files = [
|
||||
"**/pkg/promlib/**/*"
|
||||
]
|
||||
|
||||
[linters-settings.depguard.rules.storage-unified-resource]
|
||||
list-mode = "lax"
|
||||
allow = [
|
||||
"github.com/grafana/grafana/pkg/apimachinery",
|
||||
]
|
||||
deny = [
|
||||
{ pkg = "github.com/grafana/grafana/pkg", desc = "pkg/storage/unified/resource is not allowed to import grafana core" }
|
||||
]
|
||||
files = [
|
||||
"./pkg/storage/unified/resource/*",
|
||||
"./pkg/storage/unified/resource/**/*"
|
||||
]
|
||||
|
||||
[linters-settings.depguard.rules.storage-unified-apistore]
|
||||
list-mode = "lax"
|
||||
allow = [
|
||||
"github.com/grafana/grafana/pkg/apimachinery",
|
||||
"github.com/grafana/grafana/pkg/apiserver",
|
||||
"github.com/grafana/grafana/pkg/unified/resource",
|
||||
]
|
||||
deny = [
|
||||
{ pkg = "github.com/grafana/grafana/pkg", desc = "pkg/storage/unified/apistore is not allowed to import grafana core" }
|
||||
]
|
||||
files = [
|
||||
"./pkg/storage/unified/apistore/*",
|
||||
"./pkg/storage/unified/apistore/**/*"
|
||||
]
|
||||
|
||||
[linters-settings.depguard.rules.apps-playlist]
|
||||
list-mode = "lax"
|
||||
allow = []
|
||||
deny = [
|
||||
{ pkg = "github.com/grafana/grafana/pkg", desc = "apps/playlist is not allowed to import grafana core" }
|
||||
]
|
||||
files = [
|
||||
"./apps/playlist/*",
|
||||
"./apps/playlist/**/*"
|
||||
]
|
||||
|
||||
[linters-settings.gocritic]
|
||||
enabled-checks = ["ruleguard"]
|
||||
[linters-settings.gocritic.settings.ruleguard]
|
||||
rules = "pkg/ruleguard.rules.go"
|
||||
|
||||
[linters-settings.misspell]
|
||||
ignore-words = ["Unknwon", "Creater"]
|
||||
|
||||
[linters-settings.nakedret]
|
||||
max-func-lines = 60
|
||||
|
||||
[linters]
|
||||
disable-all = true
|
||||
# try to keep this list sorted, please
|
||||
enable = [
|
||||
"asciicheck",
|
||||
"bodyclose",
|
||||
"depguard",
|
||||
"dogsled",
|
||||
"errcheck",
|
||||
"errorlint",
|
||||
"exhaustive",
|
||||
"exportloopref",
|
||||
# "gochecknoinits",
|
||||
# "goconst",
|
||||
# "gocritic", # Temporarily disabled on 2022-09-09, running into weird bug "ruleguard: execution error: used Run() with an empty rule set; forgot to call Load() first?"
|
||||
"gocyclo",
|
||||
"goimports",
|
||||
"goprintffuncname",
|
||||
"gosec",
|
||||
"gosimple",
|
||||
"govet",
|
||||
"ineffassign",
|
||||
"misspell",
|
||||
"nakedret",
|
||||
"prealloc",
|
||||
"revive",
|
||||
"staticcheck",
|
||||
"stylecheck",
|
||||
"unconvert",
|
||||
"unused",
|
||||
"whitespace",
|
||||
]
|
||||
|
||||
# Disabled linters (might want them later)
|
||||
# "unparam"
|
||||
# "rowserrcheck" # The linter doesn't detect that both Scan and Close also returns the error message returned by Err.
|
||||
|
||||
[issues]
|
||||
exclude-use-default = false
|
||||
max-same-issues = 0
|
||||
|
||||
# Enable when appropriate
|
||||
# Poorly chosen identifier
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["stylecheck"]
|
||||
text = "ST1003"
|
||||
|
||||
# Enable when appropriate
|
||||
# Dot imports that aren't in external test packages are discouraged.
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["stylecheck"]
|
||||
text = "ST1001"
|
||||
|
||||
# Enable when appropriate
|
||||
# http.CloseNotifier has been deprecated since Go 1.11 and an alternative has been available since Go 1.7: We currently need it in pkg/web/response_writer.go.
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["staticcheck"]
|
||||
text = "SA1019: http.CloseNotifier"
|
||||
|
||||
# strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly.
|
||||
# Use golang.org/x/text/cases instead.
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["staticcheck"]
|
||||
text = "SA1019: strings.Title"
|
||||
|
||||
# go.opentelemetry.io/otel/exporters/jaeger" is deprecated: This module is no longer supported. OpenTelemetry dropped support for Jaeger exporter in July 2023.
|
||||
# Jaeger officially accepts and recommends using OTLP.
|
||||
# Use [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp] or [go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc] instead.
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["staticcheck"]
|
||||
text = "SA1019: \"go.opentelemetry.io/otel/exporters/jaeger\""
|
||||
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["staticcheck"]
|
||||
text = "use fake service and real access control evaluator instead"
|
||||
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["gosec"]
|
||||
text = "G108"
|
||||
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["gosec"]
|
||||
text = "G110"
|
||||
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["gosec"]
|
||||
text = "G201"
|
||||
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["gosec"]
|
||||
text = "G202"
|
||||
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["gosec"]
|
||||
text = "G306"
|
||||
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["gosec"]
|
||||
text = "401"
|
||||
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["gosec"]
|
||||
text = "402"
|
||||
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["gosec"]
|
||||
text = "501"
|
||||
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["gosec"]
|
||||
text = "404"
|
||||
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["errorlint"]
|
||||
text = "non-wrapping format verb for fmt.Errorf"
|
||||
|
||||
# TODO: Enable
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["stylecheck"]
|
||||
text = "ST1000"
|
||||
|
||||
# TODO: Enable
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["stylecheck"]
|
||||
text = "ST1020"
|
||||
|
||||
# TODO: Enable
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["stylecheck"]
|
||||
text = "ST1021"
|
||||
|
||||
# Remove this when we have go v1.22 in place
|
||||
# https://stackoverflow.com/a/68247837/767660
|
||||
[[issues.exclude-rules]]
|
||||
linters = ["gosec"]
|
||||
path = '(.+)_test\.go'
|
||||
text = "G601"
|
||||
298
.golangci.yml
Normal file
298
.golangci.yml
Normal file
@@ -0,0 +1,298 @@
|
||||
run:
|
||||
timeout: 10m
|
||||
concurrency: 10
|
||||
allow-parallel-runners: true
|
||||
linters-settings:
|
||||
exhaustive:
|
||||
default-signifies-exhaustive: true
|
||||
revive:
|
||||
ignore-generated-header: false
|
||||
severity: warning
|
||||
confidence: 3
|
||||
depguard:
|
||||
rules:
|
||||
main:
|
||||
allow: []
|
||||
deny:
|
||||
- pkg: io/ioutil
|
||||
desc: >-
|
||||
Deprecated: As of Go 1.16, the same functionality is now provided
|
||||
by package io or package os, and those implementations should be
|
||||
preferred in new code. See the specific function documentation for
|
||||
details.
|
||||
- pkg: gopkg.in/yaml.v2
|
||||
desc: >-
|
||||
Grafana packages are not allowed to depend on gopkg.in/yaml.v2 as
|
||||
gopkg.in/yaml.v3 is now available
|
||||
- pkg: github.com/pkg/errors
|
||||
desc: >-
|
||||
Deprecated: Go 1.13 supports the functionality provided by
|
||||
pkg/errors in the standard library.
|
||||
- pkg: github.com/xorcare/pointer
|
||||
desc: >-
|
||||
Use pkg/util.Pointer instead, which is a generic one-liner
|
||||
alternative
|
||||
- pkg: github.com/gofrs/uuid
|
||||
desc: 'Use github.com/google/uuid instead, which we already depend on.'
|
||||
- pkg: github.com/bmizerany/assert
|
||||
desc: >-
|
||||
Use github.com/stretchr/testify/assert instead, which we already
|
||||
depend on.
|
||||
coreplugins:
|
||||
deny:
|
||||
- pkg: github.com/grafana/grafana/pkg/api
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/cmd
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/cuectx
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/extensions
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/kinds
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/middleware
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/modules
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/registry
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/services
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/build
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/codegen
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/events
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/ifaces
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/kindsysreport
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/mocks
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/plugins
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/setting
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/util
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/bus
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/components
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/expr
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/infra
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/login
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/models
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/server
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/tests
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/web
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
- pkg: github.com/grafana/grafana/pkg/tsdb/intervalv2
|
||||
desc: Core plugins are not allowed to depend on Grafana core packages
|
||||
files:
|
||||
- '**/pkg/tsdb/grafana-pyroscope-datasource/*'
|
||||
- '**/pkg/tsdb/grafana-pyroscope-datasource/**/*'
|
||||
- '**/pkg/tsdb/grafana-testdata-datasource/*'
|
||||
- '**/pkg/tsdb/grafana-testdata-datasource/**/*'
|
||||
- '**/pkg/tsdb/azuremonitor/*'
|
||||
- '**/pkg/tsdb/azuremonitor/**/*'
|
||||
- '**/pkg/tsdb/cloud-monitoring/*'
|
||||
- '**/pkg/tsdb/cloud-monitoring/**/*'
|
||||
- '**/pkg/tsdb/mysql/*'
|
||||
- '**/pkg/tsdb/mysql/**/*'
|
||||
- '**/pkg/tsdb/parca/*'
|
||||
- '**/pkg/tsdb/parca/**/*'
|
||||
- '**/pkg/tsdb/tempo/*'
|
||||
- '**/pkg/tsdb/tempo/**/*'
|
||||
- '**/pkg/tsdb/cloudwatch/*'
|
||||
- '**/pkg/tsdb/cloudwatch/**/*'
|
||||
apiserver:
|
||||
list-mode: lax
|
||||
allow:
|
||||
- github.com/grafana/grafana/pkg/apimachinery
|
||||
- github.com/grafana/grafana/pkg/apiserver
|
||||
deny:
|
||||
- pkg: github.com/grafana/grafana/pkg
|
||||
desc: apiserver is not allowed to import grafana core
|
||||
files:
|
||||
- '**/pkg/apiserver/*'
|
||||
- '**/pkg/apiserver/**/*'
|
||||
apimachinery:
|
||||
list-mode: lax
|
||||
allow:
|
||||
- github.com/grafana/grafana/pkg/apimachinery
|
||||
deny:
|
||||
- pkg: github.com/grafana/grafana/pkg
|
||||
desc: apimachinery is not allowed to import grafana core
|
||||
files:
|
||||
- '**/pkg/apimachinery/*'
|
||||
- '**/pkg/apimachinery/**/*'
|
||||
aggregator:
|
||||
list-mode: lax
|
||||
allow:
|
||||
- github.com/grafana/grafana/pkg/aggregator
|
||||
- github.com/grafana/grafana/pkg/semconv
|
||||
- github.com/grafana/grafana/pkg/apimachinery
|
||||
deny:
|
||||
- pkg: github.com/grafana/grafana/pkg
|
||||
desc: apimachinery is not allowed to import grafana core
|
||||
files:
|
||||
- ./pkg/aggregator/*
|
||||
- ./pkg/aggregator/**/*
|
||||
promlib:
|
||||
list-mode: lax
|
||||
deny:
|
||||
- pkg: github.com/grafana/grafana/pkg
|
||||
desc: promlib is not allowed to import grafana core
|
||||
allow:
|
||||
- github.com/grafana/grafana/pkg/promlib
|
||||
files:
|
||||
- '**/pkg/promlib/**/*'
|
||||
storage-unified-resource:
|
||||
list-mode: lax
|
||||
allow:
|
||||
- github.com/grafana/grafana/pkg/apimachinery
|
||||
deny:
|
||||
- pkg: github.com/grafana/grafana/pkg
|
||||
desc: pkg/storage/unified/resource is not allowed to import grafana core
|
||||
files:
|
||||
- ./pkg/storage/unified/resource/*
|
||||
- ./pkg/storage/unified/resource/**/*
|
||||
storage-unified-apistore:
|
||||
list-mode: lax
|
||||
allow:
|
||||
- github.com/grafana/grafana/pkg/apimachinery
|
||||
- github.com/grafana/grafana/pkg/apiserver
|
||||
- github.com/grafana/grafana/pkg/unified/resource
|
||||
deny:
|
||||
- pkg: github.com/grafana/grafana/pkg
|
||||
desc: pkg/storage/unified/apistore is not allowed to import grafana core
|
||||
files:
|
||||
- ./pkg/storage/unified/apistore/*
|
||||
- ./pkg/storage/unified/apistore/**/*
|
||||
apps-playlist:
|
||||
list-mode: lax
|
||||
allow: []
|
||||
deny:
|
||||
- pkg: github.com/grafana/grafana/pkg
|
||||
desc: apps/playlist is not allowed to import grafana core
|
||||
files:
|
||||
- ./apps/playlist/*
|
||||
- ./apps/playlist/**/*
|
||||
gocritic:
|
||||
enabled-checks:
|
||||
- ruleguard
|
||||
settings:
|
||||
ruleguard:
|
||||
rules: pkg/ruleguard.rules.go
|
||||
misspell:
|
||||
ignore-words:
|
||||
- Unknwon
|
||||
- Creater
|
||||
nakedret:
|
||||
max-func-lines: 60
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- asciicheck
|
||||
- bodyclose
|
||||
- depguard
|
||||
- dogsled
|
||||
- errcheck
|
||||
- errorlint
|
||||
- exhaustive
|
||||
- gocyclo
|
||||
- goimports
|
||||
- goprintffuncname
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
- nakedret
|
||||
- prealloc
|
||||
- revive
|
||||
- staticcheck
|
||||
- stylecheck
|
||||
- unconvert
|
||||
- unused
|
||||
- whitespace
|
||||
issues:
|
||||
exclude-use-default: false
|
||||
max-same-issues: 0
|
||||
exclude-dirs:
|
||||
- devenv
|
||||
- scripts
|
||||
exclude-rules:
|
||||
- linters:
|
||||
- stylecheck
|
||||
text: ST1003
|
||||
- linters:
|
||||
- stylecheck
|
||||
text: ST1001
|
||||
- linters:
|
||||
- staticcheck
|
||||
text: 'SA1019: http.CloseNotifier'
|
||||
- linters:
|
||||
- staticcheck
|
||||
text: 'SA1019: strings.Title'
|
||||
- linters:
|
||||
- staticcheck
|
||||
text: 'SA1019: "go.opentelemetry.io/otel/exporters/jaeger"'
|
||||
- linters:
|
||||
- staticcheck
|
||||
text: use fake service and real access control evaluator instead
|
||||
- linters:
|
||||
- gosec
|
||||
text: G108
|
||||
- linters:
|
||||
- gosec
|
||||
text: G110
|
||||
- linters:
|
||||
- gosec
|
||||
text: G115
|
||||
- linters:
|
||||
- gosec
|
||||
text: G201
|
||||
- linters:
|
||||
- gosec
|
||||
text: G202
|
||||
- linters:
|
||||
- gosec
|
||||
text: G306
|
||||
- linters:
|
||||
- gosec
|
||||
text: '401'
|
||||
- linters:
|
||||
- gosec
|
||||
text: '402'
|
||||
- linters:
|
||||
- gosec
|
||||
text: '501'
|
||||
- linters:
|
||||
- gosec
|
||||
text: '404'
|
||||
- linters:
|
||||
- errorlint
|
||||
text: non-wrapping format verb for fmt.Errorf
|
||||
- linters:
|
||||
- stylecheck
|
||||
text: ST1000
|
||||
- linters:
|
||||
- stylecheck
|
||||
text: ST1020
|
||||
- linters:
|
||||
- stylecheck
|
||||
text: ST1021
|
||||
- linters:
|
||||
- gosec
|
||||
path: (.+)_test\.go
|
||||
text: G601
|
||||
|
||||
141
CHANGELOG.md
141
CHANGELOG.md
@@ -1,3 +1,144 @@
|
||||
<!-- 11.3.4 START -->
|
||||
|
||||
# 11.3.4 (2025-02-18)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Docker:** Use our own glibc 2.40 binaries [#99923](https://github.com/grafana/grafana/pull/99923), [@DanCech](https://github.com/DanCech)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Auth:** Fix redirect with JWT auth URL login [#100495](https://github.com/grafana/grafana/pull/100495), [@mgyongyosi](https://github.com/mgyongyosi)
|
||||
- **Azure:** Correctly set application insights resource values [#99597](https://github.com/grafana/grafana/pull/99597), [@aangelisc](https://github.com/aangelisc)
|
||||
- **Dashboards:** Bring back scripted dashboards [#100627](https://github.com/grafana/grafana/pull/100627), [@dprokop](https://github.com/dprokop)
|
||||
- **Plugin Metrics:** Eliminate data race in plugin metrics middleware [#100076](https://github.com/grafana/grafana/pull/100076), [@clord](https://github.com/clord)
|
||||
|
||||
<!-- 11.3.4 END -->
|
||||
<!-- 11.3.3 START -->
|
||||
|
||||
# 11.3.3 (2025-01-28)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Azure Monitor:** Add a feature flag to toggle user auth for Azure Monitor only [#97576](https://github.com/grafana/grafana/pull/97576), [@adamyeats](https://github.com/adamyeats)
|
||||
- **Security:** Update to Go 1.23.5 - Backport to v11.3.x [#99124](https://github.com/grafana/grafana/pull/99124), [@Proximyst](https://github.com/Proximyst)
|
||||
- **Security:** Update to Go 1.23.5 - Backport to v11.3.x (Enterprise)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting:** AlertingQueryRunner should skip descendant nodes of invalid queries [#97829](https://github.com/grafana/grafana/pull/97829), [@gillesdemey](https://github.com/gillesdemey)
|
||||
- **Azure/GCM:** Improve error display [#97593](https://github.com/grafana/grafana/pull/97593), [@aangelisc](https://github.com/aangelisc)
|
||||
- **Dashboard:** Fixes issue with compatability of old DashboardModel.annotations [#97467](https://github.com/grafana/grafana/pull/97467), [@torkelo](https://github.com/torkelo)
|
||||
- **Dashboards:** Fix issue where filtered panels would not react to variable changes [#98733](https://github.com/grafana/grafana/pull/98733), [@oscarkilhed](https://github.com/oscarkilhed)
|
||||
- **Dashboards:** Fixes issue with panel header showing even when hide time override was enabled [#97389](https://github.com/grafana/grafana/pull/97389), [@torkelo](https://github.com/torkelo)
|
||||
- **Dashboards:** Fixes week relative time ranges when weekStart was changed [#98268](https://github.com/grafana/grafana/pull/98268), [@torkelo](https://github.com/torkelo)
|
||||
- **DateTimePicker:** Fixes issue with date picker showing invalid date [#97970](https://github.com/grafana/grafana/pull/97970), [@torkelo](https://github.com/torkelo)
|
||||
- **Fix:** Add support for datasource variable queries [#98118](https://github.com/grafana/grafana/pull/98118), [@sunker](https://github.com/sunker)
|
||||
- **InfluxDB:** Adhoc filters can use template vars as values [#98785](https://github.com/grafana/grafana/pull/98785), [@bossinc](https://github.com/bossinc)
|
||||
- **Unified Storage:** Use tls preferred when grafana db using ssl [#97379](https://github.com/grafana/grafana/pull/97379), [@owensmallwood](https://github.com/owensmallwood)
|
||||
|
||||
### Plugin development fixes & changes
|
||||
|
||||
- **Grafana UI:** Re-add react-router-dom as a dependency [#98421](https://github.com/grafana/grafana/pull/98421), [@leventebalogh](https://github.com/leventebalogh)
|
||||
|
||||
<!-- 11.3.3 END -->
|
||||
<!-- 11.3.2 START -->
|
||||
|
||||
# 11.3.2 (2024-12-04)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Backport:** Announcement Banners: Enable feature for all cloud tiers (Enterprise)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Fix:** Do not fetch Orgs if the user is authenticated by apikey/sa or render key [#97262](https://github.com/grafana/grafana/pull/97262), [@mgyongyosi](https://github.com/mgyongyosi)
|
||||
|
||||
<!-- 11.3.2 END -->
|
||||
<!-- 11.3.1 START -->
|
||||
|
||||
# 11.3.1 (2024-11-19)
|
||||
|
||||
### Features and enhancements
|
||||
|
||||
- **Alerting:** Make context deadline on AlertNG service startup configurable [#96135](https://github.com/grafana/grafana/pull/96135), [@fayzal-g](https://github.com/fayzal-g)
|
||||
- **MigrationAssistant:** Restrict dashboards, folders and datasources by the org id of the signed in user [#96345](https://github.com/grafana/grafana/pull/96345), [@leandro-deveikis](https://github.com/leandro-deveikis)
|
||||
- **User:** Check SignedInUser OrgID in RevokeInvite [#95490](https://github.com/grafana/grafana/pull/95490), [@mgyongyosi](https://github.com/mgyongyosi)
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- **Alerting:** Fix escaping of silence matchers in utf8 mode [#95347](https://github.com/grafana/grafana/pull/95347), [@tomratcliffe](https://github.com/tomratcliffe)
|
||||
- **Alerting:** Fix overflow for long receiver names [#95133](https://github.com/grafana/grafana/pull/95133), [@gillesdemey](https://github.com/gillesdemey)
|
||||
- **Alerting:** Fix saving advanced mode toggle state in the alert rule editor [#95981](https://github.com/grafana/grafana/pull/95981), [@alexander-akhmetov](https://github.com/alexander-akhmetov)
|
||||
- **Alerting:** Fix setting datasource uid, when datasource is string in old version [#96273](https://github.com/grafana/grafana/pull/96273), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
|
||||
- **Alerting:** Force refetch prom rules when refreshing panel [#96125](https://github.com/grafana/grafana/pull/96125), [@soniaAguilarPeiron](https://github.com/soniaAguilarPeiron)
|
||||
- **Anonymous User:** Adds validator service for anonymous users [#94994](https://github.com/grafana/grafana/pull/94994), [@leandro-deveikis](https://github.com/leandro-deveikis)
|
||||
- **Anonymous User:** Adds validator service for anonymous users (Enterprise)
|
||||
- **Azure Monitor:** Support metric namespaces fallback [#95155](https://github.com/grafana/grafana/pull/95155), [@aangelisc](https://github.com/aangelisc)
|
||||
- **Azure:** Fix duplicated traces in multi-resource trace query [#95247](https://github.com/grafana/grafana/pull/95247), [@aangelisc](https://github.com/aangelisc)
|
||||
- **Azure:** Handle namespace request rejection [#95909](https://github.com/grafana/grafana/pull/95909), [@aangelisc](https://github.com/aangelisc)
|
||||
- **CloudWatch:** Interpolate region in log context query [#94990](https://github.com/grafana/grafana/pull/94990), [@iwysiu](https://github.com/iwysiu)
|
||||
- **Dashboard datasource:** Return annotations as series when query topic is "annotations" [#95971](https://github.com/grafana/grafana/pull/95971), [@kaydelaney](https://github.com/kaydelaney)
|
||||
- **Dashboard:** Append orgId to URL [#95963](https://github.com/grafana/grafana/pull/95963), [@bfmatei](https://github.com/bfmatei)
|
||||
- **Dashboards:** Fixes performance issue expanding a row [#95321](https://github.com/grafana/grafana/pull/95321), [@torkelo](https://github.com/torkelo)
|
||||
- **Flame Graph:** Fix crash when it receives empty data [#96211](https://github.com/grafana/grafana/pull/96211), [@yincongcyincong](https://github.com/yincongcyincong)
|
||||
- **Folders:** Add admin permissions upon creation of a folder w. SA [#95365](https://github.com/grafana/grafana/pull/95365), [@eleijonmarck](https://github.com/eleijonmarck)
|
||||
- **Folders:** Don't show error pop-up if the user can't fetch the root folder [#95600](https://github.com/grafana/grafana/pull/95600), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
|
||||
- **Migration:** Remove table aliasing in delete statement to make it work for mariadb [#95232](https://github.com/grafana/grafana/pull/95232), [@kalleep](https://github.com/kalleep)
|
||||
- **ServerLock:** Fix pg concurrency/locking issue [#95935](https://github.com/grafana/grafana/pull/95935), [@mgyongyosi](https://github.com/mgyongyosi)
|
||||
- **Service Accounts:** Run service account creation in transaction [#94803](https://github.com/grafana/grafana/pull/94803), [@IevaVasiljeva](https://github.com/IevaVasiljeva)
|
||||
- **Table:** Fix text wrapping applying to wrong field [#95425](https://github.com/grafana/grafana/pull/95425), [@codeincarnate](https://github.com/codeincarnate)
|
||||
- **Unified Storage:** Use ssl_mode instead of sslmode [#95662](https://github.com/grafana/grafana/pull/95662), [@chaudyg](https://github.com/chaudyg)
|
||||
|
||||
<!-- 11.3.1 END -->
|
||||
<!-- 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.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.2 START -->
|
||||
|
||||
# 11.2.2 (2024-10-01)
|
||||
|
||||
46
Dockerfile
46
Dockerfile
@@ -1,14 +1,19 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG BASE_IMAGE=alpine:3.19.1
|
||||
# to maintain formatting of multiline commands in vscode, add the following to settings.json:
|
||||
# "docker.languageserver.formatter.ignoreMultilineInstructions": true
|
||||
|
||||
ARG BASE_IMAGE=alpine:3.21
|
||||
ARG JS_IMAGE=node:20-alpine
|
||||
ARG JS_PLATFORM=linux/amd64
|
||||
ARG GO_IMAGE=golang:1.23.1-alpine
|
||||
ARG GO_IMAGE=golang:1.23.7-alpine
|
||||
|
||||
# Default to building locally
|
||||
ARG GO_SRC=go-builder
|
||||
ARG JS_SRC=js-builder
|
||||
|
||||
FROM --platform=${JS_PLATFORM} ${JS_IMAGE} as js-builder
|
||||
# Javascript build stage
|
||||
FROM --platform=${JS_PLATFORM} ${JS_IMAGE} AS js-builder
|
||||
|
||||
ENV NODE_OPTIONS=--max_old_space_size=8000
|
||||
|
||||
@@ -33,7 +38,8 @@ COPY emails emails
|
||||
ENV NODE_ENV production
|
||||
RUN yarn build
|
||||
|
||||
FROM ${GO_IMAGE} as go-builder
|
||||
# Golang build stage
|
||||
FROM ${GO_IMAGE} AS go-builder
|
||||
|
||||
ARG COMMIT_SHA=""
|
||||
ARG BUILD_BRANCH=""
|
||||
@@ -91,7 +97,8 @@ ENV BUILD_BRANCH=${BUILD_BRANCH}
|
||||
|
||||
RUN make build-go GO_BUILD_TAGS=${GO_BUILD_TAGS} WIRE_TAGS=${WIRE_TAGS}
|
||||
|
||||
FROM ${BASE_IMAGE} as tgz-builder
|
||||
# From-tarball build stage
|
||||
FROM ${BASE_IMAGE} AS tgz-builder
|
||||
|
||||
WORKDIR /tmp/grafana
|
||||
|
||||
@@ -103,8 +110,8 @@ COPY ${GRAFANA_TGZ} /tmp/grafana.tar.gz
|
||||
RUN tar x -z -f /tmp/grafana.tar.gz --strip-components=1
|
||||
|
||||
# helpers for COPY --from
|
||||
FROM ${GO_SRC} as go-src
|
||||
FROM ${JS_SRC} as js-src
|
||||
FROM ${GO_SRC} AS go-src
|
||||
FROM ${JS_SRC} AS js-src
|
||||
|
||||
# Final stage
|
||||
FROM ${BASE_IMAGE}
|
||||
@@ -139,19 +146,20 @@ RUN if grep -i -q alpine /etc/issue; then \
|
||||
fi
|
||||
|
||||
# glibc support for alpine x86_64 only
|
||||
# docker run --rm --env STDOUT=1 sgerrand/glibc-builder 2.40 /usr/glibc-compat > glibc-bin-2.40.tar.gz
|
||||
ARG GLIBC_VERSION=2.40
|
||||
|
||||
RUN if grep -i -q alpine /etc/issue && [ `arch` = "x86_64" ]; then \
|
||||
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \
|
||||
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-2.35-r0.apk \
|
||||
-O /tmp/glibc-2.35-r0.apk && \
|
||||
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r0/glibc-bin-2.35-r0.apk \
|
||||
-O /tmp/glibc-bin-2.35-r0.apk && \
|
||||
apk add --force-overwrite --no-cache /tmp/glibc-2.35-r0.apk /tmp/glibc-bin-2.35-r0.apk && \
|
||||
rm -f /lib64/ld-linux-x86-64.so.2 && \
|
||||
ln -s /usr/glibc-compat/lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 && \
|
||||
rm -f /tmp/glibc-2.35-r0.apk && \
|
||||
rm -f /tmp/glibc-bin-2.35-r0.apk && \
|
||||
rm -f /lib/ld-linux-x86-64.so.2 && \
|
||||
rm -f /etc/ld.so.cache; \
|
||||
wget -qO- "https://dl.grafana.com/glibc/glibc-bin-$GLIBC_VERSION.tar.gz" | tar zxf - -C / \
|
||||
usr/glibc-compat/lib/ld-linux-x86-64.so.2 \
|
||||
usr/glibc-compat/lib/libc.so.6 \
|
||||
usr/glibc-compat/lib/libdl.so.2 \
|
||||
usr/glibc-compat/lib/libm.so.6 \
|
||||
usr/glibc-compat/lib/libpthread.so.0 \
|
||||
usr/glibc-compat/lib/librt.so.1 \
|
||||
usr/glibc-compat/lib/libresolv.so.2 && \
|
||||
mkdir /lib64 && \
|
||||
ln -s /usr/glibc-compat/lib/ld-linux-x86-64.so.2 /lib64; \
|
||||
fi
|
||||
|
||||
COPY --from=go-src /tmp/grafana/conf ./conf
|
||||
|
||||
4
Makefile
4
Makefile
@@ -8,7 +8,7 @@ WIRE_TAGS = "oss"
|
||||
include .bingo/Variables.mk
|
||||
|
||||
GO = go
|
||||
GO_VERSION = 1.23.1
|
||||
GO_VERSION = 1.23.7
|
||||
GO_LINT_FILES ?= $(shell ./scripts/go-workspace/golangci-lint-includes.sh)
|
||||
GO_TEST_FILES ?= $(shell ./scripts/go-workspace/test-includes.sh)
|
||||
SH_FILES ?= $(shell find ./scripts -name *.sh)
|
||||
@@ -300,7 +300,7 @@ test: test-go test-js ## Run all tests.
|
||||
golangci-lint: $(GOLANGCI_LINT)
|
||||
@echo "lint via golangci-lint"
|
||||
$(GOLANGCI_LINT) run \
|
||||
--config .golangci.toml \
|
||||
--config .golangci.yml \
|
||||
$(GO_LINT_FILES)
|
||||
|
||||
.PHONY: lint-go
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/grafana/grafana/apps/playlist
|
||||
|
||||
go 1.23.1
|
||||
go 1.23.7
|
||||
|
||||
require (
|
||||
github.com/grafana/grafana-app-sdk v0.19.0
|
||||
@@ -24,10 +24,13 @@ require (
|
||||
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/rogpeppe/go-internal v1.13.1 // indirect
|
||||
github.com/spf13/pflag v1.0.6 // indirect
|
||||
github.com/stretchr/testify v1.10.0 // 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
|
||||
golang.org/x/net v0.36.0 // indirect
|
||||
golang.org/x/text v0.22.0 // indirect
|
||||
google.golang.org/protobuf v1.36.4 // 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
|
||||
|
||||
@@ -48,14 +48,14 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
|
||||
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/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
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.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
|
||||
github.com/spf13/pflag v1.0.6/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/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
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=
|
||||
@@ -69,8 +69,8 @@ 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.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
|
||||
golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
|
||||
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=
|
||||
@@ -79,8 +79,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
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.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
||||
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 +89,8 @@ 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=
|
||||
google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM=
|
||||
google.golang.org/protobuf v1.36.4/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=
|
||||
|
||||
@@ -1209,6 +1209,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
|
||||
|
||||
@@ -1197,6 +1197,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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module high-card
|
||||
|
||||
go 1.22.4
|
||||
go 1.23.7
|
||||
|
||||
require (
|
||||
github.com/prometheus/client_golang v1.20.2
|
||||
@@ -15,6 +15,6 @@ require (
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/common v0.55.0 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
golang.org/x/sys v0.22.0 // indirect
|
||||
golang.org/x/sys v0.30.0 // indirect
|
||||
google.golang.org/protobuf v1.34.2 // indirect
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg
|
||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
||||
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 h1:kx6Ds3MlpiUHKj7syVnbp57++8WpuKPcR5yjLBjvLEA=
|
||||
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
|
||||
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
|
||||
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
||||
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
aks
|
||||
eror
|
||||
iam
|
||||
wan
|
||||
[Operato Windrose](https://grafana.com/grafana/plugins/operato-windrose-panel/)
|
||||
sergent
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
# shellcheck disable=SC2034
|
||||
#
|
||||
# The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs.
|
||||
# # `make-docs` procedure changelog
|
||||
#
|
||||
@@ -6,6 +8,26 @@
|
||||
# [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes.
|
||||
# Changes are relevant to this script and the support docs.mk GNU Make interface.
|
||||
#
|
||||
# ## 8.4.0 (2025-01-27)
|
||||
#
|
||||
# ### Fixed
|
||||
#
|
||||
# - Correct mount for the /docs/grafana-cloud/send-data/fleet-management/ project.
|
||||
#
|
||||
# ## 8.3.0 (2024-12-27)
|
||||
#
|
||||
# ### Added
|
||||
#
|
||||
# - Debug output of the final command when DEBUG=true.
|
||||
#
|
||||
# Useful to inspect if the script is correctly constructing the final command.
|
||||
#
|
||||
# ## 8.2.0 (2024-12-22)
|
||||
#
|
||||
# ### Removed
|
||||
#
|
||||
# - Special cases for Oracle and Datadog plugins now that they exist in the plugins monorepo.
|
||||
#
|
||||
# ## 8.1.0 (2024-08-22)
|
||||
#
|
||||
# ### Added
|
||||
@@ -13,7 +35,7 @@
|
||||
# - Additional website mounts for projects that use the website repository.
|
||||
#
|
||||
# Mounts are required for `make docs` to work in the website repository or with the website project.
|
||||
# The Makefile is also mounted for convenient development of the procedure that repository.
|
||||
# The Makefile is also mounted for convenient development of the procedure in that repository.
|
||||
#
|
||||
# ## 8.0.1 (2024-07-01)
|
||||
#
|
||||
@@ -290,6 +312,7 @@ PODMAN="$(if command -v podman >/dev/null 2>&1; then echo podman; else echo dock
|
||||
|
||||
if ! command -v curl >/dev/null 2>&1; then
|
||||
if ! command -v wget >/dev/null 2>&1; then
|
||||
# shellcheck disable=SC2016
|
||||
errr 'either `curl` or `wget` must be installed for this script to work.'
|
||||
|
||||
exit 1
|
||||
@@ -297,6 +320,7 @@ if ! command -v curl >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
if ! command -v "${PODMAN}" >/dev/null 2>&1; then
|
||||
# shellcheck disable=SC2016
|
||||
errr 'either `podman` or `docker` must be installed for this script to work.'
|
||||
|
||||
exit 1
|
||||
@@ -343,6 +367,10 @@ EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The following variables comprise a pseudo associative array of project names to source repositories.
|
||||
# You only need to set a SOURCES variable if the project name does not match the source repository name.
|
||||
# You can get a key identifier using the `identifier` function.
|
||||
# To look up the value of any pseudo associative array, use the `aget` function.
|
||||
SOURCES_as_code='as-code-docs'
|
||||
SOURCES_enterprise_metrics='backend-enterprise'
|
||||
SOURCES_enterprise_metrics_='backend-enterprise'
|
||||
@@ -352,13 +380,16 @@ SOURCES_grafana_cloud_alerting_and_irm_slo='slo'
|
||||
SOURCES_grafana_cloud_k6='k6-docs'
|
||||
SOURCES_grafana_cloud_data_configuration_integrations='cloud-onboarding'
|
||||
SOURCES_grafana_cloud_frontend_observability_faro_web_sdk='faro-web-sdk'
|
||||
SOURCES_grafana_cloud_send_data_fleet_management='fleet-management'
|
||||
SOURCES_helm_charts_mimir_distributed='mimir'
|
||||
SOURCES_helm_charts_tempo_distributed='tempo'
|
||||
SOURCES_opentelemetry='opentelemetry-docs'
|
||||
SOURCES_plugins_grafana_datadog_datasource='datadog-datasource'
|
||||
SOURCES_plugins_grafana_oracle_datasource='oracle-datasource'
|
||||
SOURCES_resources='website'
|
||||
|
||||
# The following variables comprise a pseudo associative array of project names to versions.
|
||||
# You only need to set a VERSIONS variable if it is not the default of 'latest'.
|
||||
# You can get a key identifier using the `identifier` function.
|
||||
# To look up the value of any pseudo associative array, use the `aget` function.
|
||||
VERSIONS_as_code='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud_alerting_and_irm_machine_learning='UNVERSIONED'
|
||||
@@ -366,20 +397,21 @@ VERSIONS_grafana_cloud_alerting_and_irm_slo='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud_k6='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud_data_configuration_integrations='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud_frontend_observability_faro_web_sdk='UNVERSIONED'
|
||||
VERSIONS_grafana_cloud_send_data_fleet_management='UNVERSIONED'
|
||||
VERSIONS_opentelemetry='UNVERSIONED'
|
||||
VERSIONS_plugins_grafana_datadog_datasource='latest'
|
||||
VERSIONS_plugins_grafana_oracle_datasource='latest'
|
||||
VERSIONS_resources='UNVERSIONED'
|
||||
VERSIONS_technical_documentation='UNVERSIONED'
|
||||
VERSIONS_website='UNVERSIONED'
|
||||
VERSIONS_writers_toolkit='UNVERSIONED'
|
||||
|
||||
# The following variables comprise a pseudo associative array of project names to source repository paths.
|
||||
# You only need to set a PATHS variable if it is not the default of 'docs/sources'.
|
||||
# You can get a key identifier using the `identifier` function.
|
||||
# To look up the value of any pseudo associative array, use the `aget` function.
|
||||
PATHS_grafana_cloud='content/docs/grafana-cloud'
|
||||
PATHS_helm_charts_mimir_distributed='docs/sources/helm-charts/mimir-distributed'
|
||||
PATHS_helm_charts_tempo_distributed='docs/sources/helm-charts/tempo-distributed'
|
||||
PATHS_mimir='docs/sources/mimir'
|
||||
PATHS_plugins_grafana_datadog_datasource='docs/sources'
|
||||
PATHS_plugins_grafana_oracle_datasource='docs/sources'
|
||||
PATHS_resources='content'
|
||||
PATHS_tempo='docs/sources/tempo'
|
||||
PATHS_website='content'
|
||||
@@ -631,7 +663,7 @@ POSIX_HERESTRING
|
||||
|
||||
case "${_project}" in
|
||||
# Workaround for arbitrary mounts where the version field is expected to be the local directory
|
||||
# and the repo field is expected to be the container directory.
|
||||
# and the repo field is expected to be the container directory.
|
||||
arbitrary)
|
||||
echo "${_project}^${_version}^${_repo}^" # TODO
|
||||
;;
|
||||
@@ -801,10 +833,16 @@ case "${image}" in
|
||||
| sed "s#$(proj_dst "${proj}")#sources#"
|
||||
EOF
|
||||
|
||||
if [ -n "${DEBUG}" ]; then
|
||||
debg "${cmd}"
|
||||
fi
|
||||
|
||||
case "${OUTPUT_FORMAT}" in
|
||||
human)
|
||||
if ! command -v jq >/dev/null 2>&1; then
|
||||
# shellcheck disable=SC2016
|
||||
errr '`jq` must be installed for the `doc-validator` target to work.'
|
||||
# shellcheck disable=SC2016
|
||||
note 'To install `jq`, refer to https://jqlang.github.io/jq/download/,'
|
||||
|
||||
exit 1
|
||||
@@ -837,6 +875,10 @@ EOF
|
||||
/hugo/content/docs
|
||||
EOF
|
||||
|
||||
if [ -n "${DEBUG}" ]; then
|
||||
debg "${cmd}"
|
||||
fi
|
||||
|
||||
case "${OUTPUT_FORMAT}" in
|
||||
human)
|
||||
${cmd} --output=line \
|
||||
|
||||
@@ -14,23 +14,23 @@ weight: 900
|
||||
|
||||
You can create interactive links for Explore visualizations by setting up Correlations. These links can either run queries or generate external URLs related to presented data.
|
||||
|
||||
A correlation defines how data in one [data source]({{< relref "../../datasources" >}}) is used to query data in another data source or to generate an external URL.
|
||||
A correlation defines how data in one [data source](../../datasources/) is used to query data in another data source or to generate an external URL.
|
||||
Some examples:
|
||||
|
||||
- an application name returned in a logs data source can be used to query metrics related to that application in a metrics data source, or
|
||||
- a user name returned by an SQL data source can be used to query logs related to that particular user in a logs data source
|
||||
- a customer ID in a logs data source can link to a different platform that has a profile on that customer.
|
||||
|
||||
[Explore]({{< relref "../../explore" >}}) takes user-defined correlations to display links inside the visualizations.
|
||||
If a correlation links to a query, you can click on that link to run the related query and see results in [Explore Split View]({{< relref "../../explore#split-and-compare" >}}).
|
||||
[Explore](../../explore/) takes user-defined correlations to display links inside the visualizations.
|
||||
If a correlation links to a query, you can click on that link to run the related query and see results in [Explore Split View](../../explore/#split-and-compare).
|
||||
If a correlation links to an external URL, you can click on the link to open the URL in a new tab in your browser.
|
||||
|
||||
Explore visualizations that currently support showing links based on correlations:
|
||||
|
||||
- [Logs Panel]({{< relref "./use-correlations-in-visualizations#correlations-in-logs-panel">}})
|
||||
- [Table]({{< relref "./use-correlations-in-visualizations#correlations-in-table">}})
|
||||
- [Logs Panel](use-correlations-in-visualizations/#correlations-in-logs-panel)
|
||||
- [Table](use-correlations-in-visualizations/#correlations-in-table)
|
||||
|
||||
You can configure correlations using [provisioning]({{< relref "../provisioning" >}}), the **Administration > Plugins and data > Correlations** page in Grafana or directly in [Explore]({{< relref "../../explore/correlations-editor-in-explore" >}}).
|
||||
You can configure correlations using [provisioning](../provisioning/), the **Administration > Plugins and data > Correlations** page in Grafana or directly in [Explore](../../explore/correlations-editor-in-explore/).
|
||||
|
||||
## Example of how links work in Explore once set up
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ weight: 30
|
||||
|
||||
## Before you begin
|
||||
|
||||
Adding access to create correlations for [Viewers and Editors]({{< relref "../../../administration/roles-and-permissions" >}}) is available with [Role-based access control]({{< relref "../../../administration/roles-and-permissions/access-control" >}}).
|
||||
Adding access to create correlations for [Viewers and Editors](../../roles-and-permissions/) is available with [Role-based access control](../../roles-and-permissions/access-control/).
|
||||
|
||||
## Add permissions to create correlations
|
||||
|
||||
|
||||
@@ -29,13 +29,13 @@ Each correlation is configured with the following options:
|
||||
**Transformations**
|
||||
: Optional manipulations to the source data included passed to the target query
|
||||
|
||||
Learn how to create correlations using the [Administration page]({{< relref "./create-a-new-correlation#create-a-correlation-in-administration-page" >}}) or with [provisioning]({{< relref "./create-a-new-correlation#create-a-correlation-with-provisioning" >}}).
|
||||
Learn how to create correlations using the [Administration page](../create-a-new-correlation/#create-a-correlation-in-administration-page) or with [provisioning](../create-a-new-correlation/#create-a-correlation-with-provisioning).
|
||||
|
||||
## Source data source and result field
|
||||
|
||||
Links are shown in Explore visualizations for the results from the correlation’s source data source.
|
||||
A link is assigned to one of the fields from the result provided in the correlation configuration (the results field).
|
||||
Each visualization displays fields with links in a different way ([Correlations in Logs Panel]({{< relref "./use-correlations-in-visualizations#correlations-in-logs-panel">}}) and see [Correlations in Table]({{< relref "./use-correlations-in-visualizations#correlations-in-table">}})).
|
||||
Each visualization displays fields with links in a different way ([Correlations in Logs Panel](../use-correlations-in-visualizations/#correlations-in-logs-panel) and see [Correlations in Table](../use-correlations-in-visualizations/#correlations-in-table)).
|
||||
|
||||
## Target query
|
||||
|
||||
@@ -44,10 +44,10 @@ The target query is run when a link is clicked in the visualization. You can use
|
||||
### Correlation Variables
|
||||
|
||||
You can use variables inside the target query to access the source data related to the query.
|
||||
Correlations use [Grafana variable syntax]({{< relref "../../../dashboards/variables/variable-syntax" >}}).
|
||||
Correlations use [Grafana variable syntax](../../../dashboards/variables/variable-syntax/).
|
||||
Variables are filled with values from the source results when the link is clicked. There are two types of variables you can use:
|
||||
|
||||
- [field variables]({{< relref "../../../panels-visualizations/configure-data-links#field-variables" >}}) (allows to access field values and labels)
|
||||
- [field variables](../../../panels-visualizations/configure-data-links/#field-variables) (allows to access field values and labels)
|
||||
- correlation variables (allows to access field values and transformations)
|
||||
|
||||
Example: If source results contain a field called “employee”, the value of the field can be accessed with:
|
||||
@@ -57,9 +57,9 @@ Example: If source results contain a field called “employee”, the value of t
|
||||
|
||||
In addition to mapping field values to shorter variable names, more correlation variables can be created by applying transformations to existing fields
|
||||
|
||||
For more details, please see the example in [Use variables and transformations in a correlation]({{< relref "./use-variables-and-transformations" >}}).
|
||||
For more details, please see the example in [Use variables and transformations in a correlation](../use-variables-and-transformations/).
|
||||
|
||||
Correlation creates a data link only if all variables have values in the selected data row. [Global variables]({{< relref "/docs/grafana/latest/dashboards/variables/add-template-variables#global-variables" >}}) are exception to this rule and are not required to be filled in from the returned data. These variables are interpolated automatically by data sources.
|
||||
Correlation creates a data link only if all variables have values in the selected data row. [Global variables](/docs/grafana/latest/dashboards/variables/add-template-variables/#global-variables) are exception to this rule and are not required to be filled in from the returned data. These variables are interpolated automatically by data sources.
|
||||
|
||||
### Correlation Transformations
|
||||
|
||||
@@ -69,7 +69,7 @@ There are two types of transformations: logfmt and regular expression.
|
||||
|
||||
Each transformation uses a selected field value as the input. The output of a transformation is a set of new variables based on the type and options of the transformation.
|
||||
|
||||
For more details, please see the example in [Use variables and transformations in a correlation]({{< relref "./use-variables-and-transformations" >}}) for more details.
|
||||
For more details, please see the example in [Use variables and transformations in a correlation](../use-variables-and-transformations/) for more details.
|
||||
|
||||
### Logfmt transformation
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ weight: 20
|
||||
|
||||
# Permissions
|
||||
|
||||
Users with [Viewer base role]({{< relref "../../../administration/roles-and-permissions" >}}) or with [datasources:query RBAC role]({{< relref "../../../administration/roles-and-permissions/access-control" >}}) can:
|
||||
Users with [Viewer base role](../../roles-and-permissions/) or with [datasources:query RBAC role](../../roles-and-permissions/access-control/) can:
|
||||
|
||||
- Use correlations in Explore’s visualizations.
|
||||
- List all available correlations in read-only mode.
|
||||
|
||||
Users with [Admin base role]({{< relref "../../../administration/roles-and-permissions" >}}) or with [datasources:write RBAC role]({{< relref "../../../administration/roles-and-permissions/access-control" >}}) can:
|
||||
Users with [Admin base role](../../roles-and-permissions/) or with [datasources:write RBAC role](../../roles-and-permissions/access-control/) can:
|
||||
|
||||
- Add, edit and delete correlations.
|
||||
|
||||
@@ -15,7 +15,7 @@ Make sure you have permission to add new correlations. Only users with write per
|
||||
|
||||
## Create a correlation in Explore's correlations editor
|
||||
|
||||
To learn more, refer to Explore's [documentation]({{< relref "../../../explore/correlations-editor-in-explore" >}}) about building correlations in Explore.
|
||||
To learn more, refer to Explore's [documentation](../../../explore/correlations-editor-in-explore/) about building correlations in Explore.
|
||||
|
||||
## Create a correlation in Administration page
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ weight: 70
|
||||
1. Open Explore.
|
||||
1. Select a data source that you chose as the source data source of the correlation.
|
||||
1. Run a query that results in data containing fields required to build variables in the target query.
|
||||
1. Links are added to cell rows in the column representing the field with the assigned link ([the results field]({{< relref "../correlation-configuration#source-data-source-and-result-field" >}}).
|
||||
1. Links are added to cell rows in the column representing the field with the assigned link ([the results field](../correlation-configuration/#source-data-source-and-result-field).
|
||||
1. Cells containing multiple links accessible with a context menu.
|
||||
|
||||
{{< figure src="/static/img/docs/correlations/correlations-in-table-10-0.png" max-width="600px" caption="Correlations links in table" >}}
|
||||
|
||||
@@ -73,7 +73,7 @@ Instructions below show how to set up a link that can run metrics query for the
|
||||
- Required correlation type (query)
|
||||
- Target query matching test data source model
|
||||
- “App metrics” correlation contains the following configuration:
|
||||
- Alias is set to ${application} variable (note that in provisioning files $ is used to access environment variables so it has to be [escaped]({{< relref "../../../administration/provisioning#using-environment-variables" >}})).
|
||||
- Alias is set to ${application} variable (note that in provisioning files $ is used to access environment variables so it has to be [escaped](../../provisioning/#using-environment-variables)).
|
||||
- Regular expression transformation is created to extract values from “msg” field
|
||||
- Regular expression transformation is used to capture the application name from the full name of the service stored in the log line.
|
||||
- The output of the transformation is mapped to a variable called “application”.
|
||||
|
||||
@@ -18,10 +18,10 @@ weight: 100
|
||||
# Data source management
|
||||
|
||||
Grafana supports many different storage backends for your time series data (data source).
|
||||
Refer to [data sources]({{< relref "../../datasources" >}}) for more information about using data sources in Grafana.
|
||||
Refer to [data sources](../../datasources/) for more information about using data sources in Grafana.
|
||||
Only users with the organization admin role can add data sources.
|
||||
|
||||
For links to data source-specific documentation, see [Data sources]({{< relref "../../datasources" >}}).
|
||||
For links to data source-specific documentation, see [Data sources](../../datasources/).
|
||||
|
||||
## Data source permissions
|
||||
|
||||
@@ -32,7 +32,7 @@ You can configure data source permissions to allow or deny certain users the abi
|
||||
- The `admin` permission allows users to query and edit the data source, change permissions on the data source and enable or disable query caching for the data source.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud](/docs/grafana-cloud).
|
||||
Available in [Grafana Enterprise](../../introduction/grafana-enterprise/) and [Grafana Cloud](/docs/grafana-cloud).
|
||||
{{% /admonition %}}
|
||||
|
||||
By default, data sources in an organization can be queried by any user in that organization. For example, a user with the `Viewer` role can issue any possible query to a data source, not just queries that exist on dashboards to which they have access. Additionally, by default, data sources can be edited by the user who created the data source, as well as users with the `Admin` role.
|
||||
@@ -80,10 +80,10 @@ When you enable query and resource caching, Grafana temporarily stores the resul
|
||||
|
||||
When using Grafana, a query pertains to a request for data frames to be modified or displayed. A resource relates to any HTTP requests made by a plugin, such as the Amazon Timestream plugin requesting a list of available databases from AWS. For more information on data source queries and resources, please see the developers page on [backend plugins](https://grafana.com/developers/plugin-tools/key-concepts/backend-plugins/).
|
||||
|
||||
The caching feature works for **all** backend data sources. You can enable the cache globally in Grafana's [configuration]({{< relref "../../setup-grafana/configure-grafana/enterprise-configuration/#caching" >}}), and configure a cache duration (also called Time to Live, or TTL) for each data source individually.
|
||||
The caching feature works for **all** backend data sources. You can enable the cache globally in Grafana's [configuration](../../setup-grafana/configure-grafana/enterprise-configuration/#caching), and configure a cache duration (also called Time to Live, or TTL) for each data source individually.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Available in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise/" >}}) and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
Available in [Grafana Enterprise](../../introduction/grafana-enterprise/) and [Grafana Cloud](/docs/grafana-cloud/).
|
||||
{{% /admonition %}}
|
||||
|
||||
The following cache backend options are available: in-memory, Redis, and Memcached.
|
||||
@@ -94,9 +94,9 @@ Storing cached queries in-memory can increase Grafana's memory footprint. In pro
|
||||
|
||||
When a panel queries a data source with cached data, it will either fetch fresh data or use cached data depending on the panel's **interval.** The interval is used to round the query time range to a nearby cached time range, increasing the likelihood of cache hits. Therefore, wider panels and dashboards with shorter time ranges fetch new data more often than narrower panels and dashboards with longer time ranges.
|
||||
|
||||
A panel's interval is visible in the [query options]({{< relref "../../panels-visualizations/query-transform-data/" >}}). It is calculated as follows: `time range / max data points`. Max data points are calculated based on the width of the panel. For example, a wide panel with `1000 data points` on a dashboard with a time range of `last 7 days` will retrieve fresh data every 10 minutes: `7d / 1000 = 10m`. In this example, cached data for this panel will be served for up to 10 minutes before Grafana needs to query the data source again for new data.
|
||||
A panel's interval is visible in the [query options](../../panels-visualizations/query-transform-data/). It is calculated as follows: `time range / max data points`. Max data points are calculated based on the width of the panel. For example, a wide panel with `1000 data points` on a dashboard with a time range of `last 7 days` will retrieve fresh data every 10 minutes: `7d / 1000 = 10m`. In this example, cached data for this panel will be served for up to 10 minutes before Grafana needs to query the data source again for new data.
|
||||
|
||||
You can configure a panel to retrieve data more often by increasing the **Max data points** setting in the panel's [query options]({{< relref "../../panels-visualizations/query-transform-data/" >}}).
|
||||
You can configure a panel to retrieve data more often by increasing the **Max data points** setting in the panel's [query options](../../panels-visualizations/query-transform-data/).
|
||||
|
||||
### Caching benefits
|
||||
|
||||
@@ -108,7 +108,7 @@ By reducing the number of queries and requests sent to data sources, caching can
|
||||
|
||||
### Data sources that work with query caching
|
||||
|
||||
Query caching works for Grafana's [built-in data sources]({{< relref "../../datasources/#built-in-core-data-sources" >}}), and [backend data source plugins](https://grafana.com/grafana/plugins/?type=datasource) that extend the `DataSourceWithBackend` class in the plugins SDK.
|
||||
Query caching works for Grafana's [built-in data sources](../../datasources/#built-in-core-data-sources), and [backend data source plugins](https://grafana.com/grafana/plugins/?type=datasource) that extend the `DataSourceWithBackend` class in the plugins SDK.
|
||||
|
||||
To verify that a data source works with query caching, follow the [instructions below](#enable-and-configure-query-caching) to **Enable and Configure query caching**. If caching is enabled in Grafana but the Caching tab is not visible for the given data source, then query caching is not available for that data source.
|
||||
|
||||
@@ -118,7 +118,7 @@ Some data sources, such as Elasticsearch, Prometheus, and Loki, cache queries th
|
||||
|
||||
### Enable and configure query caching
|
||||
|
||||
You must be an Org admin or Grafana admin to enable query caching for a data source. For more information on Grafana roles and permissions, refer to [About users and permissions]({{< relref "../roles-and-permissions/" >}}).
|
||||
You must be an Org admin or Grafana admin to enable query caching for a data source. For more information on Grafana roles and permissions, refer to [About users and permissions](../roles-and-permissions/).
|
||||
|
||||
By default, data source queries are not cached. To enable query caching for a single data source:
|
||||
|
||||
@@ -137,7 +137,7 @@ You can optionally override a data source's configured TTL for individual dashbo
|
||||
If query caching is enabled and the Cache tab is not visible in a data source's settings, then query caching is not available for that data source.
|
||||
{{% /admonition %}}
|
||||
|
||||
To configure global settings for query caching, refer to the `caching` section of [Configure Grafana Enterprise]({{< relref "../../setup-grafana/configure-grafana/enterprise-configuration/#caching" >}}).
|
||||
To configure global settings for query caching, refer to the `caching` section of [Configure Grafana Enterprise](../../setup-grafana/configure-grafana/enterprise-configuration/#caching).
|
||||
|
||||
### Disable query caching
|
||||
|
||||
@@ -148,7 +148,7 @@ To disable query caching for a single data source:
|
||||
1. In the data source list, click the data source that you want to turn off caching for.
|
||||
1. On the Cache tab, click **Disable**.
|
||||
|
||||
To disable query caching for an entire Grafana instance, set the `enabled` flag to `false` in the `caching` section of [Configure Grafana Enterprise]({{< relref "../../setup-grafana/configure-grafana/enterprise-configuration/#caching" >}}). You will no longer see the Cache tab on any data sources, and no data source queries will be cached.
|
||||
To disable query caching for an entire Grafana instance, set the `enabled` flag to `false` in the `caching` section of [Configure Grafana Enterprise](../../setup-grafana/configure-grafana/enterprise-configuration/#caching). You will no longer see the Cache tab on any data sources, and no data source queries will be cached.
|
||||
|
||||
### Clear cache
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ weight: 250
|
||||
|
||||
LBAC for data sources is available in private preview on Grafana Cloud for Loki created with basic authentication. Loki data sources for LBAC for data sources can only be created, provisioning is currently not available.
|
||||
|
||||
You cannot configure LBAC rules for Grafana-provisioned data sources from the UI. Alternatively, you can replicate the setting of the provisioned data source in a new data source as described in [LBAC Configuration for New Loki Data Source](https://grafana.com/docs/grafana/latest/administration/data-source-management/teamlbac/configure-teamlbac-for-loki/#task-1-lbac-configuration-for-new-loki-data-source) and then add the LBAC configuration to the new data source.
|
||||
|
||||
## Before you begin
|
||||
|
||||
To be able to use LBAC for data sources rules, you need to enable the feature toggle `teamHttpHeaders` on your Grafana instance. Contact support to enable the feature toggle for you.
|
||||
|
||||
@@ -23,11 +23,11 @@ weight: 500
|
||||
|
||||
# Grafana Enterprise license
|
||||
|
||||
When you become a Grafana Enterprise customer, you gain access to Grafana's premium observability features, including enterprise data source plugins, reporting, and role-based access control. In order to use these [enhanced features of Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise" >}}), you must purchase and activate a Grafana Enterprise license.
|
||||
When you become a Grafana Enterprise customer, you gain access to Grafana's premium observability features, including enterprise data source plugins, reporting, and role-based access control. In order to use these [enhanced features of Grafana Enterprise](../../introduction/grafana-enterprise/), you must purchase and activate a Grafana Enterprise license.
|
||||
|
||||
To purchase a license directly from Grafana Labs, [Contact a Grafana Labs representative](/contact?about=grafana-enterprise). To activate an Enterprise license purchased from Grafana Labs, refer to [Activate an Enterprise license]({{< relref "#activate-an-enterprise-license" >}}).
|
||||
To purchase a license directly from Grafana Labs, [Contact a Grafana Labs representative](/contact?about=grafana-enterprise). To activate an Enterprise license purchased from Grafana Labs, refer to [Activate an Enterprise license](#activate-an-enterprise-license).
|
||||
|
||||
You can also purchase a Grafana Enterprise license through the AWS Marketplace. To learn more about activating a license purchased through AWS, refer to [Activate a Grafana Enterprise license purchased through AWS Marketplace]({{< relref "./activate-aws-marketplace-license/" >}}).
|
||||
You can also purchase a Grafana Enterprise license through the AWS Marketplace. To learn more about activating a license purchased through AWS, refer to [Activate a Grafana Enterprise license purchased through AWS Marketplace](activate-aws-marketplace-license/).
|
||||
|
||||
{{< section >}}
|
||||
|
||||
@@ -94,9 +94,9 @@ environment variable.
|
||||
|
||||
### Step 3. Ensure that the license file's root URL matches the root_url configuration option
|
||||
|
||||
Update the [`root_url`]({{< relref "../../setup-grafana/configure-grafana/#root_url" >}}) in your configuration. It should be the URL that users type in their browsers to access the frontend, not the node hostname(s).
|
||||
Update the [`root_url`](../../setup-grafana/configure-grafana/#root_url) in your configuration. It should be the URL that users type in their browsers to access the frontend, not the node hostname(s).
|
||||
|
||||
This is important, because as part of the validation checks at startup, Grafana compares the license URL to the [`root_url`]({{< relref "../../setup-grafana/configure-grafana/#root_url" >}}) in your configuration.
|
||||
This is important, because as part of the validation checks at startup, Grafana compares the license URL to the [`root_url`](../../setup-grafana/configure-grafana/#root_url) in your configuration.
|
||||
|
||||
In your configuration file:
|
||||
|
||||
@@ -113,7 +113,7 @@ GF_SERVER_ROOT_URL=https://grafana.example.com/
|
||||
|
||||
### Step 4. Restart Grafana
|
||||
|
||||
To finalize the installation of Grafana Enterprise, restart Grafana to enable all Grafana Enterprise features. Refer to [restart Grafana]({{< relref "../../setup-grafana/start-restart-grafana/" >}}) for more information.
|
||||
To finalize the installation of Grafana Enterprise, restart Grafana to enable all Grafana Enterprise features. Refer to [restart Grafana](../../setup-grafana/start-restart-grafana/) for more information.
|
||||
|
||||
## License expiration
|
||||
|
||||
@@ -123,7 +123,7 @@ If your license has expired, most of Grafana keeps working as normal. Some enter
|
||||
|
||||
### Update your license
|
||||
|
||||
1. Locate your current `license.jwt` file. In a standard installation it is stored inside the Grafana data directory, which on a typical Linux installation is in `/var/lib/grafana/data`. This location might be overridden in the ini file [Configuration]({{< relref "../../setup-grafana/configure-grafana/" >}}).
|
||||
1. Locate your current `license.jwt` file. In a standard installation it is stored inside the Grafana data directory, which on a typical Linux installation is in `/var/lib/grafana/data`. This location might be overridden in the ini file [Configuration](../../setup-grafana/configure-grafana/).
|
||||
|
||||
```ini
|
||||
[enterprise]
|
||||
@@ -135,7 +135,7 @@ If your license has expired, most of Grafana keeps working as normal. Some enter
|
||||
2. Log in to your [Grafana Cloud Account](/login) and make sure you're in the correct organization in the dropdown at the top of the page.
|
||||
3. Under the **Grafana Enterprise** section in the menu bar to the left, choose licenses and download the currently valid license with which you want to run Grafana. If you cannot see a valid license on Grafana.com, please contact your account manager at Grafana Labs to renew your subscription.
|
||||
4. Replace the current `license.jwt`-file with the one you've just downloaded.
|
||||
5. [Restart Grafana]({{< relref "../../setup-grafana/start-restart-grafana/" >}}).
|
||||
5. [Restart Grafana](../../setup-grafana/start-restart-grafana/).
|
||||
|
||||
### If your license expires
|
||||
|
||||
@@ -244,11 +244,11 @@ Your license is controlled by the following rules:
|
||||
|
||||
**License expiration date:** The license includes an expiration date, which is the date when a license becomes inactive.
|
||||
|
||||
As the license expiration date approaches, you will see a banner in Grafana that encourages you to renew. To learn about how to renew your license and what happens in Grafana when a license expires, refer to [License expiration]({{< relref "#license-expiration" >}}).
|
||||
As the license expiration date approaches, you will see a banner in Grafana that encourages you to renew. To learn about how to renew your license and what happens in Grafana when a license expires, refer to [License expiration](#license-expiration).
|
||||
|
||||
**Grafana License URL:** Your license does not work with an instance of Grafana with a different root URL.
|
||||
|
||||
The License URL is the complete URL of your Grafana instance, for example `https://grafana.your-company.com/`. It is defined in the [root_url]({{< relref "../../setup-grafana/configure-grafana/#root_url" >}}) configuration setting.
|
||||
The License URL is the complete URL of your Grafana instance, for example `https://grafana.your-company.com/`. It is defined in the [root_url](../../setup-grafana/configure-grafana/#root_url) configuration setting.
|
||||
|
||||
**Concurrent sessions limit**: As of Grafana Enterprise 7.5, users can initiate up to three concurrent sessions of Grafana.
|
||||
|
||||
@@ -260,10 +260,10 @@ When a user reaches the session limit, the fourth connection succeeds and the lo
|
||||
|
||||
You can request Grafana Labs to activate usage billing which allows an unlimited number of active users. When usage billing is enabled, Grafana does not enforce active user limits or display warning banners. Instead, you are charged for active users that exceed the limit, according to your customer contract.
|
||||
|
||||
Usage billing involves a contractual agreement between you and Grafana Labs, and it is only available if Grafana Enterprise is configured to [automatically refresh its license token]({{< relref "../../setup-grafana/configure-grafana/enterprise-configuration/#auto_refresh_license" >}}).
|
||||
Usage billing involves a contractual agreement between you and Grafana Labs, and it is only available if Grafana Enterprise is configured to [automatically refresh its license token](../../setup-grafana/configure-grafana/enterprise-configuration/#auto_refresh_license).
|
||||
|
||||
### Request a change to your license
|
||||
|
||||
To increase the number of licensed users within Grafana, extend a license, or change your licensed URL, contact [Grafana support](/profile/org#support) or your Grafana Labs account team. They will update your license, which you can activate from within Grafana.
|
||||
|
||||
For instructions about how to activate your license after it is updated, refer to [Activate an Enterprise license]({{< relref "#activate-an-enterprise-license" >}}).
|
||||
For instructions about how to activate your license after it is updated, refer to [Activate an Enterprise license](#activate-an-enterprise-license).
|
||||
|
||||
@@ -30,7 +30,7 @@ You can deploy Grafana Enterprise in the following ways:
|
||||
- Using AWS services like ECS, EKS or EC2.
|
||||
- In an instance outside AWS.
|
||||
|
||||
In each case, you must activate the Grafana Enterprise license purchased in AWS Marketplace to take advantage of Grafana Enterprise observability features. Grafana Enterprise licenses purchased through AWS Marketplace are subject to the same [restrictions]({{< relref "../#license-restrictions" >}}) as Grafana Enterprise licensed purchased directly from Grafana Labs.
|
||||
In each case, you must activate the Grafana Enterprise license purchased in AWS Marketplace to take advantage of Grafana Enterprise observability features. Grafana Enterprise licenses purchased through AWS Marketplace are subject to the same [restrictions](../#license-restrictions) as Grafana Enterprise licensed purchased directly from Grafana Labs.
|
||||
|
||||
> To purchase a license directly from Grafana Labs or learn more about other Grafana offerings, [Contact a Grafana Labs representative](/contact?about=grafana-enterprise).
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -48,7 +48,7 @@ Grafana requires that you configure a database to hold dashboards, users, and ot
|
||||
### Before you begin
|
||||
|
||||
- Ensure that you have a supported Grafana database available.
|
||||
- For a list of supported databases, refer to [Supported databases]({{< relref "../../../../setup-grafana/installation/#supported-databases" >}}).
|
||||
- For a list of supported databases, refer to [Supported databases](../../../../setup-grafana/installation/#supported-databases).
|
||||
- For information about creating a database, refer to [Creating an Amazon RDS DB instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html).
|
||||
- Review the information required to connect to the RDS DB instance. For more information, refer to [Connecting to an Amazon RDS DB instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_CommonTasks.Connect.html).
|
||||
|
||||
@@ -56,7 +56,7 @@ To configure Grafana for high availability:
|
||||
|
||||
1. In AWS ECS, use environment variables to update the `database` parameters.
|
||||
|
||||
For a list of database parameters, refer to [Configuration]({{< relref "../../../../setup-grafana/configure-grafana/#database" >}}).
|
||||
For a list of database parameters, refer to [Configuration](../../../../setup-grafana/configure-grafana/#database).
|
||||
|
||||
1. Create a revision of the task definition for the ECS Task that runs Grafana Enterprise.
|
||||
|
||||
@@ -114,4 +114,4 @@ In this task you configure Grafana Enterprise to validate the license with AWS i
|
||||
1. To restart Grafana and activate your license, update the service running Grafana to use the latest revision of the task definition that you created.
|
||||
1. After you update the service, navigate to your Grafana instance, sign in with Grafana Admin credentials, and navigate to **Administration > General > Stats and license** to validate that your license is active.
|
||||
|
||||
For more information about validating that your license is active, refer to [Grafana Enterprise license restrictions]({{< relref "../../#grafana-enterprise-license-restrictions" >}}).
|
||||
For more information about validating that your license is active, refer to [Grafana Enterprise license restrictions](../../#grafana-enterprise-license-restrictions).
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -50,7 +50,7 @@ Grafana requires that you configure a database to hold dashboards, users, and ot
|
||||
### Before you begin
|
||||
|
||||
- Ensure that you have a supported Grafana database available.
|
||||
- For a list of supported databases, refer to [Supported databases]({{< relref "../../../../setup-grafana/installation/#supported-databases" >}}).
|
||||
- For a list of supported databases, refer to [Supported databases](../../../../setup-grafana/installation/#supported-databases).
|
||||
- For information about creating a database, refer to [Creating an Amazon RDS DB instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html).
|
||||
- Review the information required to connect to the RDS DB instance. For more information, refer to [Connecting to an Amazon RDS DB instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_CommonTasks.Connect.html).
|
||||
|
||||
@@ -82,7 +82,7 @@ To configure Grafana for high availability, choose **one** of the following opti
|
||||
value: [database password]
|
||||
```
|
||||
|
||||
For more information on Grafana High Availability setup, refer to [Set up Grafana for high availability]({{< relref "../../../../setup-grafana/set-up-for-high-availability/" >}}).
|
||||
For more information on Grafana High Availability setup, refer to [Set up Grafana for high availability](../../../../setup-grafana/set-up-for-high-availability/).
|
||||
|
||||
## Task 3: Configure Grafana Enterprise to validate its license with AWS
|
||||
|
||||
@@ -99,7 +99,7 @@ In this task, you configure Grafana Enterprise to validate the license with AWS
|
||||
|
||||
For more information about AWS license permissions, refer to [Actions, resources, and condition keys for AWS License Manager](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awslicensemanager.html).
|
||||
|
||||
1. Choose **one** of the following options to update the [license_validation_type]({{< relref "../../../../setup-grafana/configure-grafana/enterprise-configuration/#license_validation_type" >}}) configuration to `aws`:
|
||||
1. Choose **one** of the following options to update the [license_validation_type](../../../../setup-grafana/configure-grafana/enterprise-configuration/#license_validation_type) configuration to `aws`:
|
||||
|
||||
- **Option 1:** Use `kubectl edit configmap grafana` to edit `grafana.ini` add the following section to the configuration:
|
||||
|
||||
@@ -125,6 +125,6 @@ To restart Grafana on a Kubernetes cluster,
|
||||
|
||||
1. After you update the service, navigate to your Grafana instance, sign in with Grafana Admin credentials, and navigate to **Administration > General > Stats and license** to validate that your license is active.
|
||||
|
||||
For more information about restarting Grafana, refer to [Restart Grafana]({{< relref "../../../../setup-grafana/start-restart-grafana/" >}}).
|
||||
For more information about restarting Grafana, refer to [Restart Grafana](../../../../setup-grafana/start-restart-grafana/).
|
||||
|
||||
> If you experience issues when you update the EKS cluster, refer to [Amazon EKS troubleshooting](https://docs.aws.amazon.com/eks/latest/userguide/troubleshooting.html).
|
||||
|
||||
@@ -35,9 +35,9 @@ To activate a Grafana Enterprise license from AWS on a Grafana Enterprise instan
|
||||
|
||||
To install Grafana, refer to the documentation specific to your implementation.
|
||||
|
||||
- [Install Grafana]({{< relref "../../../../setup-grafana/installation/" >}}).
|
||||
- [Run Grafana Docker image]({{< relref "../../../../setup-grafana/installation/docker/" >}}).
|
||||
- [Deploy Grafana on Kubernetes]({{< relref "../../../../setup-grafana/installation/kubernetes/#deploy-grafana-enterprise-on-kubernetes" >}}).
|
||||
- [Install Grafana](../../../../setup-grafana/installation/).
|
||||
- [Run Grafana Docker image](../../../../setup-grafana/installation/docker/).
|
||||
- [Deploy Grafana on Kubernetes](../../../../setup-grafana/installation/kubernetes/#deploy-grafana-enterprise-on-kubernetes).
|
||||
|
||||
## Task 2: Create an AWS IAM user with access to your Grafana Enterprise license
|
||||
|
||||
@@ -110,7 +110,7 @@ To retrieve your license, Grafana Enterprise requires access to your AWS account
|
||||
|
||||
In this task you configure Grafana Enterprise to validate the license with AWS instead of Grafana Labs.
|
||||
|
||||
Choose one of the following options to update the [license_validation_type]({{< relref "../../../../setup-grafana/configure-grafana/enterprise-configuration/#license_validation_type" >}}) configuration to `aws`:
|
||||
Choose one of the following options to update the [license_validation_type](../../../../setup-grafana/configure-grafana/enterprise-configuration/#license_validation_type) configuration to `aws`:
|
||||
|
||||
- **Option 1:** In the `[enterprise]` section of the grafana.ini configuration file, add `license_validation_type=aws`.
|
||||
|
||||
@@ -131,4 +131,4 @@ Choose one of the following options to update the [license_validation_type]({{<
|
||||
|
||||
To activate Grafana Enterprise features, start (or restart) Grafana.
|
||||
|
||||
For information about restarting Grafana, refer to [Restart Grafana]({{< relref "../../../../setup-grafana/start-restart-grafana/" >}}).
|
||||
For information about restarting Grafana, refer to [Restart Grafana](../../../../setup-grafana/start-restart-grafana/).
|
||||
|
||||
@@ -42,4 +42,4 @@ You can use AWS Marketplace to make the following modifications to your Grafana
|
||||
|
||||
This action retrieves updated license information from AWS.
|
||||
|
||||
> To learn more about licensing and active users, refer to [Activate a Grafana Enterprise license purchased through AWS Marketplace]({{< relref "../" >}}).
|
||||
> To learn more about licensing and active users, refer to [Activate a Grafana Enterprise license purchased through AWS Marketplace](../).
|
||||
|
||||
@@ -19,7 +19,7 @@ For detailed information about particular features and how they operate, refer t
|
||||
## Manage feature toggles
|
||||
|
||||
In the **Administration** page, the **Feature Management** section enables authorized users to view and edit the various features that are active in their Grafana environment.
|
||||
Authorized users include administrators, and users with the [fixed roles]({{< relref "../roles-and-permissions/access-control#fixed-roles" >}}) `featuremgmt.read` and `featuremgmt.write`.
|
||||
Authorized users include administrators, and users with the [fixed roles](../roles-and-permissions/access-control/#fixed-roles) `featuremgmt.read` and `featuremgmt.write`.
|
||||
|
||||
There are different options for visibility and customization depending on the development stage of the feature.
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ The following table summarizes the resources you can share and/or isolate using
|
||||
|
||||
The member of one organization cannot view dashboards assigned to another organization. However, a user can belong to multiple organizations.
|
||||
|
||||
Grafana Server Administrators are responsible for creating organizations. For more information about the Grafana Server Administrator role, refer to [Grafana server administrators]({{< relref "../roles-and-permissions/#grafana-server-administrators" >}}).
|
||||
Grafana Server Administrators are responsible for creating organizations. For more information about the Grafana Server Administrator role, refer to [Grafana server administrators](../roles-and-permissions/#grafana-server-administrators).
|
||||
|
||||
## View a list of organizations
|
||||
|
||||
@@ -80,9 +80,9 @@ Create an organization when you want to isolate dashboards and other resources f
|
||||
|
||||
1. In the Preferences section, select a home dashboard, time zone, and week start.
|
||||
|
||||
For more information about preferences, refer to [Preferences]({{< relref "../organization-preferences/" >}}).
|
||||
For more information about preferences, refer to [Preferences](../organization-preferences/).
|
||||
|
||||
For more information about adding users to an organization, refer to [Add a user to an organization]({{< relref "../user-management/server-user-management/add-remove-user-to-org/" >}}).
|
||||
For more information about adding users to an organization, refer to [Add a user to an organization](../user-management/server-user-management/add-remove-user-to-org/).
|
||||
|
||||
## Delete an organization
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ Grafana preferences are basic settings. They control the Grafana UI theme, home
|
||||
|
||||
Preferences are sometimes confusing because they can be set at four different levels, listed from highest level to lowest:
|
||||
|
||||
- **Server -** Affects all users on the Grafana server. Set by a [Grafana server admin]({{< relref "../roles-and-permissions/#grafana-server-administrators" >}}).
|
||||
- **Organization -** Affects all users in an organization. Set by an [Organization admin]({{< relref "../roles-and-permissions/#organization-roles" >}}).
|
||||
- **Team -** Affects all users assigned to a team. Set by an Organization Admin or Team Admin. To learn more about these roles, refer to [Teams and permissions]({{< relref "../roles-and-permissions/#teams-and-permissions" >}}).
|
||||
- **Server -** Affects all users on the Grafana server. Set by a [Grafana server admin](../roles-and-permissions/#grafana-server-administrators).
|
||||
- **Organization -** Affects all users in an organization. Set by an [Organization admin](../roles-and-permissions/#organization-roles).
|
||||
- **Team -** Affects all users assigned to a team. Set by an Organization Admin or Team Admin. To learn more about these roles, refer to [Teams and permissions](../roles-and-permissions/#teams-and-permissions).
|
||||
- **User account -** Affects the individual user. Set by the user on their own account.
|
||||
|
||||
The lowest level always takes precedence. For example, if a user sets their theme to **Light**, then their visualization of Grafana displays the light theme. Nothing at any higher level can override that.
|
||||
@@ -33,7 +33,7 @@ If the user is aware of the change and intended it, then that's great! But if th
|
||||
|
||||
In Grafana, you can change your names and emails associated with groups or accounts in the Settings or Preferences. This topic provides instructions for each task.
|
||||
|
||||
Some tasks require certain permissions. For more information about roles, refer to [Roles and permissions]({{< relref "../roles-and-permissions/" >}}).
|
||||
Some tasks require certain permissions. For more information about roles, refer to [Roles and permissions](../roles-and-permissions/).
|
||||
|
||||
### Change organization name
|
||||
|
||||
@@ -75,13 +75,13 @@ To change the team name or email, follow these steps:
|
||||
|
||||
### Change user name or email
|
||||
|
||||
To learn how to edit your user information, refer to [Edit your profile]({{< relref "../user-management/user-preferences/#edit-your-profile" >}}).
|
||||
To learn how to edit your user information, refer to [Edit your profile](../user-management/user-preferences/#edit-your-profile).
|
||||
|
||||
## Change Grafana UI theme
|
||||
|
||||
In Grafana, you can modify the UI theme configured in the Settings or Preferences. Set the UI theme for the server, an organization, a team, or your personal user account using the instructions in this topic.
|
||||
|
||||
Some tasks require certain permissions. For more information about roles, refer to [Roles and permissions]({{< relref "../roles-and-permissions/" >}}).
|
||||
Some tasks require certain permissions. For more information about roles, refer to [Roles and permissions](../roles-and-permissions/).
|
||||
|
||||
### Theme options
|
||||
|
||||
@@ -105,9 +105,9 @@ Here is an example of the light theme.
|
||||
|
||||
### Change server UI theme
|
||||
|
||||
As a Grafana server administrator, you can change the default Grafana UI theme for all users who are on the server by setting the [default_theme]({{< relref "../../setup-grafana/configure-grafana/#default_theme" >}}) option in the Grafana configuration file.
|
||||
As a Grafana server administrator, you can change the default Grafana UI theme for all users who are on the server by setting the [default_theme](../../setup-grafana/configure-grafana/#default_theme) option in the Grafana configuration file.
|
||||
|
||||
To see what the current settings are, refer to [View server settings]({{< relref "../stats-and-license#view-server-settings" >}}).
|
||||
To see what the current settings are, refer to [View server settings](../stats-and-license/#view-server-settings).
|
||||
|
||||
### Change organization UI theme
|
||||
|
||||
@@ -141,11 +141,11 @@ You can change the UI theme for your user account. This setting overrides UI the
|
||||
|
||||
By default, Grafana uses the timezone in your web browser. However, you can override this setting at the server, organization, team, or individual user level. This topic provides instructions for each task.
|
||||
|
||||
Some tasks require certain permissions. For more information about roles, refer to [Roles and permissions]({{< relref "../roles-and-permissions/" >}}).
|
||||
Some tasks require certain permissions. For more information about roles, refer to [Roles and permissions](../roles-and-permissions/).
|
||||
|
||||
### Set server timezone
|
||||
|
||||
Grafana server administrators can choose a default timezone for all users on the server by setting the [default_timezone]({{< relref "../../setup-grafana/configure-grafana/#default_timezone" >}}) option in the Grafana configuration file.
|
||||
Grafana server administrators can choose a default timezone for all users on the server by setting the [default_timezone](../../setup-grafana/configure-grafana/#default_timezone) option in the Grafana configuration file.
|
||||
|
||||
### Set organization timezone
|
||||
|
||||
@@ -179,7 +179,7 @@ You can change the timezone for your user account. This setting overrides timezo
|
||||
|
||||
The home dashboard you set is the one all users will see by default when they log in. Click the Grafana icon or **Home** in the breadcrumb to return to it. You can set the home dashboard for the server, an organization, a team, or your personal user account. This topic provides instructions for each task.
|
||||
|
||||
Some tasks require certain permissions. For more information about roles, refer to [Roles and permissions]({{< relref "../roles-and-permissions/" >}}).
|
||||
Some tasks require certain permissions. For more information about roles, refer to [Roles and permissions](../roles-and-permissions/).
|
||||
|
||||
### Set the home dashboard for the server
|
||||
|
||||
@@ -194,7 +194,7 @@ Users with the Grafana Server Admin flag on their account or access to the confi
|
||||
#### Use a JSON file as the home dashboard
|
||||
|
||||
1. Save your JSON file somewhere that Grafana can access it. For example, in the Grafana `data` folder of Grafana.
|
||||
1. Update your configuration file to set the path to the JSON file. Refer to [default_home_dashboard_path]({{< relref "../../setup-grafana/configure-grafana/#default_home_dashboard_path" >}}) for more information about modifying the Grafana configuration files.
|
||||
1. Update your configuration file to set the path to the JSON file. Refer to [default_home_dashboard_path](../../setup-grafana/configure-grafana/#default_home_dashboard_path) for more information about modifying the Grafana configuration files.
|
||||
|
||||
```ini
|
||||
[dashboards]
|
||||
@@ -244,7 +244,7 @@ You can choose your own personal home dashboard. This setting overrides all home
|
||||
|
||||
### Change server language
|
||||
|
||||
Grafana server administrators can change the default Grafana UI language for all users on the server by setting the [default_language]({{< relref "../../setup-grafana/configure-grafana/#default_language" >}}) option in the Grafana configuration file.
|
||||
Grafana server administrators can change the default Grafana UI language for all users on the server by setting the [default_language](../../setup-grafana/configure-grafana/#default_language) option in the Grafana configuration file.
|
||||
|
||||
### Change organization language
|
||||
|
||||
|
||||
@@ -56,17 +56,17 @@ Use app plugins when you want an out-of-the-box monitoring experience.
|
||||
|
||||
### Managing access for app plugins
|
||||
|
||||
Customize access to app plugins with [RBAC]({{< relref "../roles-and-permissions/access-control/rbac-for-app-plugins" >}}).
|
||||
Customize access to app plugins with [RBAC](../roles-and-permissions/access-control/rbac-for-app-plugins/).
|
||||
|
||||
By default, the Viewer, Editor and Admin roles have access to all app plugins that their Organization role allows them to access. Access is granted by the `fixed:plugins.app:reader` role.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
To prevent users from seeing an app plugin, refer to [these permissions scenarios]({{< relref "../roles-and-permissions/access-control/plan-rbac-rollout-strategy#prevent-viewers-from-accessing-an-app-plugin" >}}).
|
||||
To prevent users from seeing an app plugin, refer to [these permissions scenarios](../roles-and-permissions/access-control/plan-rbac-rollout-strategy/#prevent-viewers-from-accessing-an-app-plugin).
|
||||
{{% /admonition %}}
|
||||
|
||||
## Plugin catalog
|
||||
|
||||
The Grafana plugin catalog allows you to browse and manage plugins from within Grafana. Only Grafana server administrators and Organization administrators can access and use the plugin catalog. For more information about Grafana roles and permissions, refer to [Roles and permissions]({{< relref "../administration/roles-and-permissions" >}}).
|
||||
The Grafana plugin catalog allows you to browse and manage plugins from within Grafana. Only Grafana server administrators and Organization administrators can access and use the plugin catalog. For more information about Grafana roles and permissions, refer to [Roles and permissions](../roles-and-permissions/).
|
||||
|
||||
The following access rules apply depending on the user role:
|
||||
|
||||
@@ -88,7 +88,7 @@ The Grafana plugin catalog is designed to work with a single Grafana server inst
|
||||
_Video shows the Plugin catalog in a previous version of Grafana._
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If required, the Grafana plugin catalog can be disabled using the `plugin_admin_enabled` flag in the [configuration]({{< relref "../../setup-grafana/configure-grafana/#plugin_admin_enabled" >}}) file.
|
||||
If required, the Grafana plugin catalog can be disabled using the `plugin_admin_enabled` flag in the [configuration](../../setup-grafana/configure-grafana/#plugin_admin_enabled) file.
|
||||
{{% /admonition %}}
|
||||
|
||||
<a id="#plugin-catalog-entry"></a>
|
||||
@@ -103,53 +103,45 @@ To browse for available plugins:
|
||||
|
||||
### Install a plugin
|
||||
|
||||
To install a plugin:
|
||||
The most common way to install a plugin is through the Grafana UI, but alternative methods are also available.
|
||||
|
||||
1. In Grafana, click **Administration > Plugins and data > Plugins** in the side navigation menu to view all plugins.
|
||||
1. Browse and find a plugin.
|
||||
1. Click the plugin's logo.
|
||||
1. Click **Install**.
|
||||
|
||||
When the update is complete, you'll see a confirmation message that the installation was successful.
|
||||
There are also additional ways to install plugins depending on your setup.
|
||||
|
||||
### Update a plugin
|
||||
#### Install a plugin using Grafana CLI
|
||||
|
||||
To update a plugin:
|
||||
Grafana CLI allows you to install, upgrade, and manage your Grafana plugins using a command line. For more information about Grafana CLI plugin commands, refer to [Plugin commands](../../cli/#plugins-commands).
|
||||
|
||||
1. In Grafana, click **Administration > Plugins and data > Plugins** in the side navigation menu to view all plugins.
|
||||
1. Click the **Installed** filter to show only installed plugins.
|
||||
1. Click the plugin's logo.
|
||||
1. Click **Update**.
|
||||
#### Install a plugin from a ZIP file
|
||||
|
||||
When the update is complete, you'll see a confirmation message that the update was successful.
|
||||
This method is typically used for plugins not available in the Plugin Catalog or in environments without internet access.
|
||||
|
||||
### Uninstall a plugin
|
||||
Download the archive containing the plugin assets, and install it by extracting the archive into the plugin directory. For example:
|
||||
|
||||
To uninstall a plugin:
|
||||
```bash
|
||||
unzip my-plugin-0.2.0.zip -d YOUR_PLUGIN_DIR/my-plugin
|
||||
```
|
||||
|
||||
1. In Grafana, click **Administration > Plugins and data > Plugins** in the side navigation menu to view all plugins.
|
||||
1. Click the plugin's logo.
|
||||
1. Click the **Installed** filter to show only installed plugins.
|
||||
1. Click **Uninstall**.
|
||||
The path to the plugin directory is defined in the configuration file. For more information, refer to [Configuration](../../setup-grafana/configure-grafana/#plugins).
|
||||
|
||||
When the update is complete, you'll see a confirmation message that the uninstall was successful.
|
||||
#### Install a plugin in air-gapped environment
|
||||
|
||||
## Install Grafana plugins
|
||||
Plugin installation usually requires an internet connection. You can check which endpoints are used during the installation on your instance and add them to your instance’s allowlist.
|
||||
|
||||
Grafana supports data source, panel, and app plugins.
|
||||
If this is not possible you can go via installing a plugin using [Grafana CLI](#install-a-plugin-using-grafana-cli) or as a [ZIP file](#install-a-plugin-from-a-zip-file).
|
||||
|
||||
1. In a web browser, navigate to the [Grafana plugin catalog](https://grafana.com/plugins) and find a plugin that you want to install.
|
||||
1. Click the plugin, and then click the **Installation** tab.
|
||||
You can fetch any plugin from Grafana.com API following the download link referenced in the API.
|
||||
Here is an example based on `grafana-lokiexplore-app` plugins.
|
||||
|
||||
### Install plugin on Grafana Cloud
|
||||
1. Open `https://grafana.com/api/plugins/grafana-lokiexplore-app` and look for `links` section
|
||||
1. Find a `download` url which looks something like `https://grafana.com/api/plugins/grafana-lokiexplore-app/versions/1.0.2/download`
|
||||
1. Use this URL to download the plugin ZIP file, which you can then install as described above.
|
||||
|
||||
On the **Installation tab**, in the **For** field, click the name of the Grafana instance on which you want to install the plugin.
|
||||
|
||||
Grafana Cloud handles the plugin installation automatically.
|
||||
|
||||
If you're logged in to Grafana Cloud when you add a plugin, log out and then log back in again to use the new plugin.
|
||||
|
||||
### Install plugins using the Grafana Helm chart
|
||||
#### Install plugins using the Grafana Helm chart
|
||||
|
||||
With the Grafana Helm chart, add the plugins you want to install as a list using the `plugins` field in the your values file. For more information about the configuration, refer to [the Helm chart configuration reference](https://github.com/grafana/helm-charts/tree/main/charts/grafana#configuration).
|
||||
|
||||
@@ -162,21 +154,29 @@ plugins:
|
||||
- redis-datasource
|
||||
```
|
||||
|
||||
### Install plugin on local Grafana
|
||||
When the update is complete, a confirmation message will indicate the installation was successful.
|
||||
|
||||
Follow the instructions on the **Install** tab. You can either install the plugin with a Grafana CLI command or by downloading and uncompressing a zip file into the Grafana plugins directory. We recommend using Grafana CLI in most instances. The zip option is available if your Grafana server doesn't have access to the internet.
|
||||
### Update a plugin
|
||||
|
||||
For more information about Grafana CLI plugin commands, refer to [Plugin commands]({{< relref "../../cli/#plugins-commands" >}}).
|
||||
To update a plugin:
|
||||
|
||||
#### Install a packaged plugin
|
||||
1. In Grafana, click **Administration > Plugins and data > Plugins** in the side navigation menu to view all plugins.
|
||||
1. Click the **Installed** filter to show only installed plugins.
|
||||
1. Click the plugin's logo.
|
||||
1. Click **Update**.
|
||||
|
||||
After the user has downloaded the archive containing the plugin assets, they can install it by extracting the archive into their plugin directory. For example:
|
||||
When the update is complete, a confirmation message will indicate the installation was successful.
|
||||
|
||||
```bash
|
||||
unzip my-plugin-0.2.0.zip -d YOUR_PLUGIN_DIR/my-plugin
|
||||
```
|
||||
### Uninstall a plugin
|
||||
|
||||
The path to the plugin directory is defined in the configuration file. For more information, refer to [Configuration]({{< relref "../../setup-grafana/configure-grafana/#plugins" >}}).
|
||||
To uninstall a plugin:
|
||||
|
||||
1. In Grafana, click **Administration > Plugins and data > Plugins** in the side navigation menu to view all plugins.
|
||||
1. Click the plugin's logo.
|
||||
1. Click the **Installed** filter to show only installed plugins.
|
||||
1. Click **Uninstall**.
|
||||
|
||||
When the update is complete, a confirmation message will indicate the installation was successful.
|
||||
|
||||
## Plugin signatures
|
||||
|
||||
@@ -216,7 +216,7 @@ All plugins are signed under a _signature level_. The signature level determines
|
||||
Unsigned plugins are not supported in Grafana Cloud.
|
||||
{{% /admonition %}}
|
||||
|
||||
We strongly recommend that you don't run unsigned plugins in your Grafana instance. However, if you're aware of the risks and you still want to load an unsigned plugin, refer to [Configuration]({{< relref "../../setup-grafana/configure-grafana/#allow_loading_unsigned_plugins" >}}).
|
||||
We strongly recommend that you don't run unsigned plugins in your Grafana instance. However, if you're aware of the risks and you still want to load an unsigned plugin, refer to [Configuration](../../setup-grafana/configure-grafana/#allow_loading_unsigned_plugins).
|
||||
|
||||
If you've allowed loading of an unsigned plugin, then Grafana writes a warning message to the server log:
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ This makes GitOps more natural since data sources and dashboards can be defined
|
||||
|
||||
## Configuration file
|
||||
|
||||
Refer to [Configuration]({{< relref "../../setup-grafana/configure-grafana/" >}}) for more information on what you can configure in `grafana.ini`.
|
||||
Refer to [Configuration](../../setup-grafana/configure-grafana/) for more information on what you can configure in `grafana.ini`.
|
||||
|
||||
### Configuration file locations
|
||||
|
||||
@@ -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`](../../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.
|
||||
|
||||
@@ -96,7 +96,7 @@ This prevents old configurations from overwriting newer ones if you have differe
|
||||
|
||||
### Example data source configuration file
|
||||
|
||||
This example provisions a [Graphite data source]({{< relref "../../datasources/graphite" >}}):
|
||||
This example provisions a [Graphite data source](../../datasources/graphite/):
|
||||
|
||||
```yaml
|
||||
# Configuration file version
|
||||
@@ -176,14 +176,14 @@ datasources:
|
||||
editable: false
|
||||
```
|
||||
|
||||
For provisioning examples of specific data sources, refer to that [data source's documentation]({{< relref "../../datasources" >}}).
|
||||
For provisioning examples of specific data sources, refer to that [data source's documentation](../../datasources/).
|
||||
|
||||
#### JSON data
|
||||
|
||||
Not all data sources have the same configuration settings. Only the most common fields are included in examples.
|
||||
To provision the rest of a data source's settings, include them as a JSON blob in the `jsonData` field.
|
||||
|
||||
Common settings in the [built-in core data sources]({{< relref "../../datasources#built-in-core-data-sources" >}}) include:
|
||||
Common settings in the [built-in core data sources](../../datasources/#built-in-core-data-sources) include:
|
||||
|
||||
{{< admonition type="note" >}}
|
||||
Data sources tagged with _HTTP\*_ communicate using the HTTP protocol, which includes all core data source plugins except MySQL, PostgreSQL, and MSSQL.
|
||||
@@ -244,11 +244,11 @@ Data sources tagged with _HTTP\*_ communicate using the HTTP protocol, which inc
|
||||
| implementation | string | AlertManager | The implementation of the AlertManager data source, such as `prometheus`, `cortex` or `mimir` |
|
||||
| handleGrafanaManagedAlerts | boolean | AlertManager | When enabled, Grafana-managed alerts are sent to this Alertmanager |
|
||||
|
||||
For examples of specific data sources' JSON data, refer to that [data source's documentation]({{< relref "../../datasources" >}}).
|
||||
For examples of specific data sources' JSON data, refer to that [data source's documentation](../../datasources/).
|
||||
|
||||
#### Secure JSON Data
|
||||
|
||||
Secure JSON data is a map of settings that are encrypted with a [secret key]({{< relref "../../setup-grafana/configure-grafana#secret_key" >}}) from the Grafana configuration.
|
||||
Secure JSON data is a map of settings that are encrypted with a [secret key](../../setup-grafana/configure-grafana/#secret_key) from the Grafana configuration.
|
||||
The encryption hides content from the users of the application.
|
||||
This should be used for storing the TLS Cert and password that Grafana appends to the request on the server side.
|
||||
All of these settings are optional.
|
||||
@@ -257,17 +257,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
|
||||
|
||||
@@ -289,7 +289,7 @@ datasources:
|
||||
|
||||
## Plugins
|
||||
|
||||
You can manage plugin applications in Grafana by adding one or more YAML configuration files in the [`provisioning/plugins`]({{< relref "../../setup-grafana/configure-grafana#provisioning" >}}) directory.
|
||||
You can manage plugin applications in Grafana by adding one or more YAML configuration files in the [`provisioning/plugins`](../../setup-grafana/configure-grafana/#provisioning) directory.
|
||||
Each configuration file can contain a list of `apps` that update during start up.
|
||||
Grafana updates each app to match the configuration file.
|
||||
|
||||
@@ -324,7 +324,7 @@ apps:
|
||||
|
||||
## Dashboards
|
||||
|
||||
You can manage dashboards in Grafana by adding one or more YAML configuration files in the [`provisioning/dashboards`]({{< relref "../../setup-grafana/configure-grafana#dashboards" >}}) directory.
|
||||
You can manage dashboards in Grafana by adding one or more YAML configuration files in the [`provisioning/dashboards`](../../setup-grafana/configure-grafana/#dashboards) directory.
|
||||
Each configuration file can contain a list of `dashboards providers` that load dashboards into Grafana from the local filesystem.
|
||||
|
||||
The dashboard provider configuration file looks somewhat like this:
|
||||
@@ -384,7 +384,7 @@ The JSON definition in the input field when using `Copy JSON to Clipboard` or `S
|
||||
|
||||
### Reusable dashboard URLs
|
||||
|
||||
If the dashboard in the JSON file contains an [UID]({{< relref "../../dashboards/build-dashboards/view-dashboard-json-model" >}}), Grafana forces insert/update on that UID.
|
||||
If the dashboard in the JSON file contains an [UID](../../dashboards/build-dashboards/view-dashboard-json-model/), Grafana forces insert/update on that UID.
|
||||
This allows you to migrate dashboards between Grafana instances and provisioning Grafana from configuration without breaking the URLs given because the new dashboard URL uses the UID as identifier.
|
||||
When Grafana starts, it updates and inserts all dashboards available in the configured folders.
|
||||
If you modify the file, then the dashboard is also updated.
|
||||
@@ -440,7 +440,7 @@ You can't create nested folders structures, where you have folders within folder
|
||||
|
||||
## Alerting
|
||||
|
||||
For information on provisioning Grafana Alerting, refer to [Provision Grafana Alerting resources]({{< relref "../../alerting/set-up/provision-alerting-resources/" >}}).
|
||||
For information on provisioning Grafana Alerting, refer to [Provision Grafana Alerting resources](../../alerting/set-up/provision-alerting-resources/).
|
||||
|
||||
### Supported settings
|
||||
|
||||
@@ -644,5 +644,5 @@ The following sections detail the supported settings and secure settings for eac
|
||||
|
||||
Grafana Enterprise supports:
|
||||
|
||||
- [Provisioning role-based access control with Grafana]({{< relref "../roles-and-permissions/access-control/rbac-grafana-provisioning/" >}})
|
||||
- [Provisioning role-based access control with Terraform]({{< relref "../roles-and-permissions/access-control/rbac-terraform-provisioning/" >}})
|
||||
- [Provisioning role-based access control with Grafana](../roles-and-permissions/access-control/rbac-grafana-provisioning/)
|
||||
- [Provisioning role-based access control with Terraform](../roles-and-permissions/access-control/rbac-terraform-provisioning/)
|
||||
|
||||
@@ -35,7 +35,7 @@ Recorded queries only work with backend data source plugins. Refer to [Backend d
|
||||
|
||||
- single row and column - A query that returns a single row and column.
|
||||
- row count - A query that returns meaningful rows to be counted.
|
||||
- expression - Any expression. To learn more about creating and using expressions, see [Write expression queries]({{< relref "../../panels-visualizations/query-transform-data/expression-queries" >}}).
|
||||
- expression - Any expression. To learn more about creating and using expressions, see [Write expression queries](../../panels-visualizations/query-transform-data/expression-queries/).
|
||||
- dataplane numeric - A query that returns [dataplane numeric kind](/developers/dataplane/numeric) data.
|
||||
|
||||
After a recorded query is created or enabled, it immediately creates a snapshot and continues to create snapshots at the set interval. The recorded query stops taking snapshots when it is disabled, deleted, or when Grafana is not running. Data points are gathered in the backend by running the recorded query and forwarding each result to a remote-write enabled Prometheus instance.
|
||||
@@ -48,7 +48,7 @@ To use a recorded query, create one and add it to a dashboard. After that, it ca
|
||||
|
||||
1. Find/create a query you want to record on a dashboard in an edit panel. The query must only return one row and column. If it returns more, you can still record the number of results returned using the “count” option.
|
||||
- The query's data source must be a backend data source.
|
||||
- Expressions can be used to aggregate data from a time series query. Refer to [Write expression queries]({{< relref "../../panels-visualizations/query-transform-data/expression-queries" >}}) to learn more about creating and using expressions.
|
||||
- Expressions can be used to aggregate data from a time series query. Refer to [Write expression queries](../../panels-visualizations/query-transform-data/expression-queries/) to learn more about creating and using expressions.
|
||||
1. Click the record query button located in the top right of the query editor.
|
||||
1. Enter recorded query information. All fields are required unless otherwise indicated.
|
||||
- Name - Name of the recorded query.
|
||||
@@ -68,7 +68,7 @@ You can add existing recorded queries to panels in a dashboard. For each recorde
|
||||
1. If you want to filter recorded queries by data source, select a data source from the filter by data source drop down menu.
|
||||
1. Click the `Add` button on your recorded query to add it to the panel.
|
||||
|
||||
After adding your recorded query to the panel, the panel data source will become `-- Mixed --`. Your recorded query is represented by a `Prometheus` query with a name label matching your recorded query name. Refer to [Prometheus]({{< relref "../../datasources/prometheus/" >}}) to learn more about the `Prometheus` data source.
|
||||
After adding your recorded query to the panel, the panel data source will become `-- Mixed --`. Your recorded query is represented by a `Prometheus` query with a name label matching your recorded query name. Refer to [Prometheus](../../datasources/prometheus/) to learn more about the `Prometheus` data source.
|
||||
|
||||
If after adding a recorded query, a query with a `-- Mixed --` data source instead of `Prometheus` data source appears, this could mean that a Prometheus remote write target was not set up for recorded queries. Refer to [Remote write target](#remote-write-target) to set up a remote write point.
|
||||
|
||||
|
||||
@@ -34,14 +34,14 @@ If you are running Grafana Enterprise, you can also control access to data sourc
|
||||
A Grafana server administrator manages server-wide settings and access to resources such as organizations, users, and licenses. Grafana includes a default server administrator that you can use to manage all of Grafana, or you can divide that responsibility among other server administrators that you create.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
The server administrator role does not mean that the user is also a Grafana [organization administrator]({{< relref "#organization-roles" >}}).
|
||||
The server administrator role does not mean that the user is also a Grafana [organization administrator](#organization-roles).
|
||||
{{% /admonition %}}
|
||||
|
||||
A server administrator can perform the following tasks:
|
||||
|
||||
- Manage users and permissions
|
||||
- Create, edit, and delete organizations
|
||||
- View server-wide settings defined in the [Configuration]({{< relref "../../setup-grafana/configure-grafana/" >}}) file
|
||||
- View server-wide settings defined in the [Configuration](../../setup-grafana/configure-grafana/) file
|
||||
- View Grafana server statistics, including total users and active sessions
|
||||
- Upgrade the server to Grafana Enterprise.
|
||||
|
||||
@@ -49,7 +49,7 @@ A server administrator can perform the following tasks:
|
||||
The server administrator role does not exist in Grafana Cloud.
|
||||
{{% /admonition %}}
|
||||
|
||||
To assign or remove server administrator privileges, see [Server user management]({{< relref "../user-management/server-user-management/assign-remove-server-admin-privileges/" >}}).
|
||||
To assign or remove server administrator privileges, see [Server user management](../user-management/server-user-management/assign-remove-server-admin-privileges/).
|
||||
|
||||
## Organization users and permissions
|
||||
|
||||
@@ -69,11 +69,11 @@ Permissions assigned to a user within an organization control the extent to whic
|
||||
- library panels
|
||||
- API keys
|
||||
|
||||
For more information about managing organization users, see [User management]({{< relref "../user-management/manage-org-users/" >}}).
|
||||
For more information about managing organization users, see [User management](../user-management/manage-org-users/).
|
||||
|
||||
### Organization roles
|
||||
|
||||
Organization role-based permissions are global, which means that each permission level applies to all Grafana resources within an given organization. For example, an editor can see and update _all_ dashboards in an organization, unless those dashboards have been specifically restricted using [dashboard permissions]({{< relref "../user-management/manage-dashboard-permissions/" >}}).
|
||||
Organization role-based permissions are global, which means that each permission level applies to all Grafana resources within an given organization. For example, an editor can see and update _all_ dashboards in an organization, unless those dashboards have been specifically restricted using [dashboard permissions](../user-management/manage-dashboard-permissions/).
|
||||
|
||||
Grafana uses the following roles to control user access:
|
||||
|
||||
@@ -117,9 +117,9 @@ You can specify the following permissions to dashboards and folders.
|
||||
|
||||
> Important: When a user creates a dashboard or a folder they are automatically granted **Admin** permissions for it.
|
||||
|
||||
For more information about assigning dashboard folder permissions, refer to [Grant dashboard folder permissions]({{< relref "../user-management/manage-dashboard-permissions/#grant-dashboard-folder-permissions" >}}).
|
||||
For more information about assigning dashboard folder permissions, refer to [Grant dashboard folder permissions](../user-management/manage-dashboard-permissions/#grant-dashboard-folder-permissions).
|
||||
|
||||
For more information about assigning dashboard permissions, refer to [Grant dashboard permissions]({{< relref "../user-management/manage-dashboard-permissions/#grant-dashboard-permissions" >}}).
|
||||
For more information about assigning dashboard permissions, refer to [Grant dashboard permissions](../user-management/manage-dashboard-permissions/#grant-dashboard-permissions).
|
||||
|
||||
## Editors with administrator permissions
|
||||
|
||||
@@ -131,18 +131,18 @@ This permission does not allow editors to manage folders, dashboards, and teams
|
||||
|
||||
This setting can be used to enable self-organizing teams to administer their own dashboards.
|
||||
|
||||
For more information about assigning administrator permissions to editors, refer to [Grant editors administrator permissions]({{< relref "../user-management/server-user-management/grant-editor-admin-permissions/" >}}).
|
||||
For more information about assigning administrator permissions to editors, refer to [Grant editors administrator permissions](../user-management/server-user-management/grant-editor-admin-permissions/).
|
||||
|
||||
## Viewers with dashboard preview and Explore permissions
|
||||
|
||||
If you have access to the Grafana server, you can modify the default viewer role so that viewers can:
|
||||
|
||||
- Edit and preview dashboards, but cannot save their changes or create new dashboards.
|
||||
- Access and use [Explore]({{< relref "../../explore" >}}).
|
||||
- Access and use [Explore](../../explore/).
|
||||
|
||||
Extending the viewer role is useful for public Grafana installations where you want anonymous users to be able to edit panels and queries, but not be able to save or create new dashboards.
|
||||
|
||||
For more information about assigning dashboard preview permissions to viewers, refer to [Enable viewers to preview dashboards and use Explore]({{< relref "../user-management/manage-dashboard-permissions/#enable-viewers-to-edit-but-not-save-dashboards-and-use-explore" >}}).
|
||||
For more information about assigning dashboard preview permissions to viewers, refer to [Enable viewers to preview dashboards and use Explore](../user-management/manage-dashboard-permissions/#enable-viewers-to-edit-but-not-save-dashboards-and-use-explore).
|
||||
|
||||
## Teams and permissions
|
||||
|
||||
@@ -153,15 +153,15 @@ You can assign a team member one of the following permissions:
|
||||
- **Member**: Includes the user as a member of the team. Members do not have team administrator privileges.
|
||||
- **Admin**: Administrators have permission to manage various aspects of the team, including team membership, permissions, and settings.
|
||||
|
||||
Because teams exist inside an organization, the organization administrator can manage all teams. When the `editors_can_admin` setting is enabled, editors can create teams and manage teams that they create. For more information about the `editors_can_admin` setting, refer to [Grant editors administrator permissions]({{< relref "../user-management/server-user-management/grant-editor-admin-permissions/" >}}).
|
||||
Because teams exist inside an organization, the organization administrator can manage all teams. When the `editors_can_admin` setting is enabled, editors can create teams and manage teams that they create. For more information about the `editors_can_admin` setting, refer to [Grant editors administrator permissions](../user-management/server-user-management/grant-editor-admin-permissions/).
|
||||
|
||||
For details on managing teams, see [Team management]({{< relref "../team-management/" >}}).
|
||||
For details on managing teams, see [Team management](../team-management/).
|
||||
|
||||
## Grafana Enterprise user permissions features
|
||||
|
||||
While Grafana OSS includes a robust set of permissions and settings that you can use to manage user access to server and organization resources, you might find that you require additional capabilities.
|
||||
|
||||
[Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise">}}) provides the following permissions-related features:
|
||||
[Grafana Enterprise](../../introduction/grafana-enterprise/) provides the following permissions-related features:
|
||||
|
||||
- Data source permissions
|
||||
- Role-based access control (RBAC)
|
||||
@@ -170,13 +170,13 @@ While Grafana OSS includes a robust set of permissions and settings that you can
|
||||
|
||||
By default, a user can query any data source in an organization, even if the data source is not linked to the user's dashboards.
|
||||
|
||||
Data source permissions enable you to restrict data source query permissions to specific **Users**, **Service Accounts**, and **Teams**. For more information about assigning data source permissions, refer to [Data source permissions]({{< relref "../data-source-management/#data-source-permissions/" >}}).
|
||||
Data source permissions enable you to restrict data source query permissions to specific **Users**, **Service Accounts**, and **Teams**. For more information about assigning data source permissions, refer to [Data source permissions](../data-source-management/#data-source-permissions/).
|
||||
|
||||
### Role-based access control
|
||||
|
||||
RBAC provides you a way of granting, changing, and revoking user read and write access to Grafana resources, such as users, reports, and authentication.
|
||||
|
||||
For more information about RBAC, refer to [Role-based access control]({{< relref "../roles-and-permissions/access-control/" >}}).
|
||||
For more information about RBAC, refer to [Role-based access control](access-control/).
|
||||
|
||||
### Learn more
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ The following list contains role-based access control actions.
|
||||
| `dashboards.permissions:write` | <ul><li>`dashboards:*`</li><li>`dashboards:uid:*`</li><li>`folders:*`</li><li>`folders:uid:*`</li></ul> | Update permissions for one or more dashboards. |
|
||||
| `dashboards:read` | <ul><li>`dashboards:*`</li><li>`dashboards:uid:*`</li><li>`folders:*`</li><li>`folders:uid:*`</li></ul> | Read one or more dashboards. |
|
||||
| `dashboards:write` | <ul><li>`dashboards:*`</li><li>`dashboards:uid:*`</li><li>`folders:*`</li><li>`folders:uid:*`</li></ul> | Update one or more dashboards. |
|
||||
| `dashboards.public:write` | <ul><li>`dashboards:*`</li><li>`dashboards:uid:*`</li></ul> | Write shared dashboard configuration. |
|
||||
| `dashboards.public:write` | <ul><li>`dashboards:*`</li><li>`dashboards:uid:*`</li></ul> | Write public dashboard configuration. |
|
||||
| `datasources.caching:read` | <ul><li>`datasources:*`</li><li>`datasources:uid:*`</li></ul> | Read data source query caching settings. |
|
||||
| `datasources.caching:write` | <ul><li>`datasources:*`</li><li>`datasources:uid:*`</li></ul> | Update data source query caching settings. |
|
||||
| `datasources:create` | None | Create data sources. |
|
||||
@@ -199,6 +199,26 @@ The following list contains role-based access control actions used by Grafana Ad
|
||||
| `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 enable these permissions, enable the `alertingApiServer` feature toggle.
|
||||
|
||||
| Action | Applicable scopes | Description |
|
||||
| -------------------------------------------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||
| `alert.notifications.receivers:read` | `receivers:*`<br>`receivers:uid:*` | Read contact points. None |
|
||||
| `alert.notifications.receivers.secrets:read` | `receivers:*`<br>`receivers:uid:*` | Export contact points with decrypted secrets.None |
|
||||
| `alert.notifications.receivers:create` | None | Create a new contact points. The creator is automatically granted full access to the created contact point.None |
|
||||
| `alert.notifications.receivers:write` | `receivers:*`<br>`receivers:uid:*` | Update existing contact points.None |
|
||||
| `alert.notifications.receivers:delete` | `receivers:*`<br>`receivers:uid:*` | Update and delete existing contact points.None |
|
||||
| `receivers.permissions:read` | `receivers:*`<br>`receivers:uid:*` | Read permissions for contact points.None |
|
||||
| `receivers.permissions:write` | `receivers:*`<br>`receivers:uid:*` | Manage permissions for contact points.None |
|
||||
| `alert.notifications.time-intervals:read` | None | Read mute time intervals.None |
|
||||
| `alert.notifications.time-intervals:write` | None | Create new or update existing mute time intervals.None |
|
||||
| `alert.notifications.time-intervals:delete` | None | Delete existing time intervals.None |
|
||||
| `alert.notifications.templates:read` | None | Read templates. |
|
||||
| `alert.notifications.templates:write` | None | Create new or update existing templates.None |
|
||||
| `alert.notifications.templates:delete` | None | Delete existing templates.None |
|
||||
|
||||
## Scope definitions
|
||||
|
||||
The following list contains role-based access control scopes.
|
||||
|
||||
@@ -98,7 +98,7 @@ To learn how to use the roles API to determine the role UUIDs, refer to [Manage
|
||||
| `fixed:dashboards.insights:reader` | `fixed_JlBJ2_gizP8zhgaeGE2rjyZe2Rs` | `dashboards.insights:read` | Read dashboard insights data and see presence indicators. |
|
||||
| `fixed:dashboards.permissions:reader` | `fixed_f17oxuXW_58LL8mYJsm4T_mCeIw` | `dashboards.permissions:read` | Read all dashboard permissions. |
|
||||
| `fixed:dashboards.permissions:writer` | `fixed_CcznxhWX_Yqn8uWMXMQ-b5iFW9k` | All permissions from `fixed:dashboards.permissions:reader` and <br>`dashboards.permissions:write` | Read and update all dashboard permissions. |
|
||||
| `fixed:dashboards.public:writer` | `fixed_f_GHHRBciaqESXfGz2oCcooqHxs` | `dashboards.public:write` | Create, update, delete or pause a shared dashboard. |
|
||||
| `fixed:dashboards.public:writer` | `fixed_f_GHHRBciaqESXfGz2oCcooqHxs` | `dashboards.public:write` | Create, update, delete or pause a public dashboard. |
|
||||
| `fixed:datasources:creator` | `fixed_XX8jHREgUt-wo1A-rPXIiFlX6Zw` | `datasources:create` | Create data sources. |
|
||||
| `fixed:datasources:explorer` | `fixed_qDzW9mzx9yM91T5Bi8dHUM2muTw` | `datasources:explore` | Enable the Explore feature. Data source permissions still apply, you can only query data sources for which you have query permissions. |
|
||||
| `fixed:datasources:reader` | `fixed_C2x8IxkiBc1KZVjyYH775T9jNMQ` | `datasources:read`<br>`datasources:query` | Read and query data sources. |
|
||||
|
||||
@@ -25,11 +25,11 @@ This setting contains information about tools that Grafana Server Admins can use
|
||||
|
||||
## View Grafana server settings
|
||||
|
||||
> Refer to [Role-based access control]({{< relref "../roles-and-permissions/access-control" >}}) in Grafana Enterprise to understand how you can control access with RBAC permissions.
|
||||
> Refer to [Role-based access control](../roles-and-permissions/access-control/) in Grafana Enterprise to understand how you can control access with RBAC permissions.
|
||||
|
||||
If you are a Grafana server administrator, use the Settings tab to view the settings that are applied to your Grafana server via the [Configuration]({{< relref "../../setup-grafana/configure-grafana#configuration-file-location" >}}) file and any environmental variables.
|
||||
If you are a Grafana server administrator, use the Settings tab to view the settings that are applied to your Grafana server via the [Configuration](../../setup-grafana/configure-grafana/#configuration-file-location) file and any environmental variables.
|
||||
|
||||
> **Note:** Only Grafana server administrators can access the **Server Admin** menu. For more information about about administrative permissions, refer to [Roles and permissions]({{< relref "../roles-and-permissions#grafana-server-administrators" >}}).
|
||||
> **Note:** Only Grafana server administrators can access the **Server Admin** menu. For more information about about administrative permissions, refer to [Roles and permissions](../roles-and-permissions/#grafana-server-administrators).
|
||||
|
||||
### View server settings
|
||||
|
||||
@@ -38,15 +38,15 @@ If you are a Grafana server administrator, use the Settings tab to view the sett
|
||||
|
||||
### Available settings
|
||||
|
||||
For a full list of server settings, refer to [Configuration]({{< relref "../../setup-grafana/configure-grafana#server" >}}).
|
||||
For a full list of server settings, refer to [Configuration](../../setup-grafana/configure-grafana/#server).
|
||||
|
||||
## View Grafana server stats
|
||||
|
||||
> Refer to [Role-based access control]({{< relref "../roles-and-permissions/access-control" >}}) in Grafana Enterprise to understand how you can control access with RBAC permissions.
|
||||
> Refer to [Role-based access control](../roles-and-permissions/access-control/) in Grafana Enterprise to understand how you can control access with RBAC permissions.
|
||||
|
||||
If you are a Grafana server admin, then you can view useful statistics about your Grafana server in the Stats & Licensing tab.
|
||||
|
||||
> **Note:** Only Grafana server administrators can access the **Server Admin** menu. For more information about about administrative permissions, refer to [Roles and permissions]({{< relref "../roles-and-permissions#grafana-server-administrators" >}}).
|
||||
> **Note:** Only Grafana server administrators can access the **Server Admin** menu. For more information about about administrative permissions, refer to [Roles and permissions](../roles-and-permissions/#grafana-server-administrators).
|
||||
|
||||
### View server stats
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ weight: 500
|
||||
|
||||
Dashboard and folder permissions enable you to grant a viewer the ability to edit and save dashboard changes, or limit an editor's permission to modify a dashboard.
|
||||
|
||||
For more information about dashboard permissions, refer to [Dashboard permissions]({{< relref "../../roles-and-permissions/#dashboard-permissions" >}}).
|
||||
For more information about dashboard permissions, refer to [Dashboard permissions](../../roles-and-permissions/#dashboard-permissions).
|
||||
|
||||
## Grant folder permissions
|
||||
|
||||
@@ -23,7 +23,7 @@ When you grant user permissions for folders, that setting applies to all dashboa
|
||||
### Before you begin
|
||||
|
||||
- Ensure you have organization administrator privileges
|
||||
- Identify the dashboard folder permissions you want to modify and the users, service accounts or teams to which you want to grant access. For more information about dashboard permissions, refer to [Dashboard permissions]({{< relref "../../roles-and-permissions/#dashboard-permissions" >}}).
|
||||
- Identify the dashboard folder permissions you want to modify and the users, service accounts or teams to which you want to grant access. For more information about dashboard permissions, refer to [Dashboard permissions](../../roles-and-permissions/#dashboard-permissions).
|
||||
|
||||
**To grant dashboard folder permissions**:
|
||||
|
||||
@@ -77,7 +77,7 @@ This modification is useful for public Grafana installations where you want anon
|
||||
|
||||
1. Open the Grafana configuration file.
|
||||
|
||||
For more information about the Grafana configuration file and its location, refer to [Configuration]({{< relref "../../../setup-grafana/configure-grafana/" >}}).
|
||||
For more information about the Grafana configuration file and its location, refer to [Configuration](../../../setup-grafana/configure-grafana/).
|
||||
|
||||
1. Locate the `viewers_can_edit` parameter.
|
||||
1. Set the `viewers_can_edit` value to `true`.
|
||||
@@ -85,7 +85,7 @@ This modification is useful for public Grafana installations where you want anon
|
||||
|
||||
## Edit dashboard permissions
|
||||
|
||||
Edit dashboard permissions when you are want to enhance or restrict a user's access to a dashboard. For more information about dashboard permissions, refer to [Dashboard permissions]({{< relref "../../roles-and-permissions/#dashboard-permissions" >}}).
|
||||
Edit dashboard permissions when you are want to enhance or restrict a user's access to a dashboard. For more information about dashboard permissions, refer to [Dashboard permissions](../../roles-and-permissions/#dashboard-permissions).
|
||||
|
||||
### Before you begin
|
||||
|
||||
@@ -155,4 +155,4 @@ Folder permissions settings:
|
||||
|
||||
Result: User1 has editor permissions for the folder because user1 has permissions on a folder that contains this folder.
|
||||
|
||||
> Refer to [Role-based access Control]({{< relref "../../roles-and-permissions/access-control/" >}}) in Grafana Enterprise to understand how to use RBAC permissions to restrict access to dashboards, folders, administrative functions, and other resources.
|
||||
> Refer to [Role-based access Control](../../roles-and-permissions/access-control/) in Grafana Enterprise to understand how to use RBAC permissions to restrict access to dashboards, folders, administrative functions, and other resources.
|
||||
|
||||
@@ -19,7 +19,7 @@ weight: 400
|
||||
|
||||
Organization administrators can invite users to join their organization. Organization users have access to organization resources based on their role, which is **Admin**, **Editor**, or **Viewer**. Permissions associated with each role determine the tasks a user can perform in the system.
|
||||
|
||||
For more information about organization user permissions, refer to [Organization users and permissions]({{< relref "../../roles-and-permissions/#organization-users-and-permissions" >}}).
|
||||
For more information about organization user permissions, refer to [Organization users and permissions](../../roles-and-permissions/#organization-users-and-permissions).
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Users added at the organization level will have access to all stacks and services by default, without the ability to be filtered by stack unless Single Sign-On (SSO) or Role-Based Access Control (RBAC) is implemented.
|
||||
@@ -41,15 +41,15 @@ You can see a list of users with accounts in your Grafana organization. If neces
|
||||
1. Navigate to **Administration > Users and access > Users**.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If you have [server administrator]({{< relref "../../roles-and-permissions/#grafana-server-administrators" >}}) permissions, you can also [view a global list of users]({{< relref "../server-user-management#view-a-list-of-users" >}}) in the Server Admin section of Grafana.
|
||||
If you have [server administrator](../../roles-and-permissions/#grafana-server-administrators) permissions, you can also [view a global list of users](../server-user-management/#view-a-list-of-users) in the Server Admin section of Grafana.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Change a user's organization permissions
|
||||
|
||||
Update user permissions when you want to enhance or restrict a user's access to organization resources. For more information about organization permissions, refer to [Organization roles]({{< relref "../../roles-and-permissions/#organization-roles" >}}).
|
||||
Update user permissions when you want to enhance or restrict a user's access to organization resources. For more information about organization permissions, refer to [Organization roles](../../roles-and-permissions/#organization-roles).
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Organization roles sync from the authentication provider on user sign-in. To prevent synchronization of organization roles from the authentication provider regardless of their role in the authentication provider, then refer to the `skip_org_role_sync` setting in your Grafana configuration. Refer to [skip org role sync]({{< relref "../../../setup-grafana/configure-grafana/#authgrafana_com-skip_org_role_sync" >}}) for more information.
|
||||
Organization roles sync from the authentication provider on user sign-in. To prevent synchronization of organization roles from the authentication provider regardless of their role in the authentication provider, then refer to the `skip_org_role_sync` setting in your Grafana configuration. Refer to [skip org role sync](../../../setup-grafana/configure-grafana/#authgrafana_com-skip_org_role_sync) for more information.
|
||||
{{% /admonition %}}
|
||||
|
||||
### Before you begin
|
||||
@@ -69,7 +69,7 @@ Organization roles sync from the authentication provider on user sign-in. To pre
|
||||
1. Click **Update**.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If you have [server administrator]({{< relref "../../roles-and-permissions/#grafana-server-administrators" >}}) permissions, you can also [change a user's organization permissions]({{< relref "../server-user-management/change-user-org-permissions/" >}}) in the Server Admin section.
|
||||
If you have [server administrator](../../roles-and-permissions/#grafana-server-administrators) permissions, you can also [change a user's organization permissions](../server-user-management/change-user-org-permissions/) in the Server Admin section.
|
||||
{{% /admonition %}}
|
||||
|
||||
## Invite a user to join an organization
|
||||
@@ -80,14 +80,14 @@ When you invite users to join an organization, you assign the **Admin**, **Edito
|
||||
- If the user is new to Grafana, then use their email address to issue an invitation. The system automatically creates the user account on first sign in.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If you have [server administrator]({{< relref "../../roles-and-permissions/#grafana-server-administrators" >}}) permissions, you can also manually [add a user to an organization]({{< relref "../server-user-management/add-remove-user-to-org/" >}}).
|
||||
If you have [server administrator](../../roles-and-permissions/#grafana-server-administrators) permissions, you can also manually [add a user to an organization](../server-user-management/add-remove-user-to-org/).
|
||||
{{% /admonition %}}
|
||||
|
||||
### Before you begin
|
||||
|
||||
- Ensure you have organization administrator privileges.
|
||||
- If the user already has access to Grafana, obtain their user name.
|
||||
- Determine the permissions you want to assign to the user. For more information about organization permissions, refer to [Organization roles]({{< relref "../../roles-and-permissions/#organization-roles" >}}).
|
||||
- Determine the permissions you want to assign to the user. For more information about organization permissions, refer to [Organization roles](../../roles-and-permissions/#organization-roles).
|
||||
|
||||
**To invite or add an existing user account to your organization**:
|
||||
|
||||
@@ -105,7 +105,7 @@ If you have [server administrator]({{< relref "../../roles-and-permissions/#graf
|
||||
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Email or username | Either the email or username that the user will use to sign in to Grafana. |
|
||||
| Name | The user's name. |
|
||||
| Role | Click the organization role to assign this user. For more information about organization roles, refer to [Organization roles]({{< relref "../../roles-and-permissions/#organization-roles" >}}).. |
|
||||
| Role | Click the organization role to assign this user. For more information about organization roles, refer to [Organization roles](../../roles-and-permissions/#organization-roles).. |
|
||||
| Send invite email | Switch to on if your organization has configured. The system sends an email to the user inviting them to sign in to Grafana and join the organization. Switch to off if you are not using email. The user can sign in to Grafana with the email or username you entered. |
|
||||
|
||||
1. Click **Submit**.
|
||||
@@ -156,4 +156,4 @@ This action does not remove the user account from the Grafana server.
|
||||
|
||||
1. Click the red **X** to remove the user from the organization.
|
||||
|
||||
> **Note:** If you have [server administrator]({{< relref "../../roles-and-permissions/#grafana-server-administrators" >}}) permissions, you can also [remove a user from an organization]({{< relref "../server-user-management/add-remove-user-to-org/#remove-a-user-from-an-organization" >}}) on the Users page of the Server Admin section.
|
||||
> **Note:** If you have [server administrator](../../roles-and-permissions/#grafana-server-administrators) permissions, you can also [remove a user from an organization](../server-user-management/add-remove-user-to-org/#remove-a-user-from-an-organization) on the Users page of the Server Admin section.
|
||||
|
||||
@@ -20,13 +20,13 @@ weight: 100
|
||||
|
||||
A _user_ is defined as any individual who can log in to Grafana. Each user is associated with a _role_ that includes _permissions_. Permissions determine the tasks a user can perform in the system.
|
||||
|
||||
If you have [server administrator]({{< relref "../../roles-and-permissions/#grafana-server-administrators" >}}) permissions in Grafana, you can manage all users for a Grafana instance in the Server Admin section:
|
||||
If you have [server administrator](../../roles-and-permissions/#grafana-server-administrators) permissions in Grafana, you can manage all users for a Grafana instance in the Server Admin section:
|
||||
|
||||
{{< section >}}
|
||||
|
||||
If you have [organization administrator]({{< relref "../../roles-and-permissions/#organization-roles" >}}) permissions and _not_ [server administrator]({{< relref "../../roles-and-permissions/#grafana-server-administrators" >}}) permissions, refer to [Manage users in a organization]({{< relref "../manage-org-users/" >}}).
|
||||
If you have [organization administrator](../../roles-and-permissions/#organization-roles) permissions and _not_ [server administrator](../../roles-and-permissions/#grafana-server-administrators) permissions, refer to [Manage users in a organization](../manage-org-users/).
|
||||
|
||||
For more information about user roles and permissions, refer to [Roles and permissions]({{< relref "../../roles-and-permissions/" >}}). For more information about managing users in general, see [User management]({{< relref "../" >}}).
|
||||
For more information about user roles and permissions, refer to [Roles and permissions](../../roles-and-permissions/). For more information about managing users in general, see [User management](../).
|
||||
|
||||
## View a list of users
|
||||
|
||||
@@ -42,7 +42,7 @@ You can see a list of users with accounts on your Grafana server. This action mi
|
||||
1. Click **Administration** in the left-side menu, **Users and access**, and then **Users**.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If you have [organization administrator]({{< relref "../../roles-and-permissions/#organization-roles" >}}) permissions and _not_ [server administrator]({{< relref "../../roles-and-permissions/#grafana-server-administrators" >}}) permissions, you can still [view of list of users in a given organization]({{< relref "../manage-org-users/#view-a-list-of-organization-users" >}}).
|
||||
If you have [organization administrator](../../roles-and-permissions/#organization-roles) permissions and _not_ [server administrator](../../roles-and-permissions/#grafana-server-administrators) permissions, you can still [view of list of users in a given organization](../manage-org-users/#view-a-list-of-organization-users).
|
||||
{{% /admonition %}}
|
||||
|
||||
## View user details
|
||||
@@ -104,7 +104,7 @@ Edit a user account when you want to modify user login credentials, or delete, d
|
||||
|
||||
Add users when you want to manually provide individuals with access to Grafana.
|
||||
|
||||
When you create a user using this method, you must create their password. The user does not receive a notification by email. To invite a user to Grafana and allow them to create their own password, [invite a user to join an organization]({{< relref "../manage-org-users#invite-a-user-to-join-an-organization" >}}).
|
||||
When you create a user using this method, you must create their password. The user does not receive a notification by email. To invite a user to Grafana and allow them to create their own password, [invite a user to join an organization](../manage-org-users/#invite-a-user-to-join-an-organization).
|
||||
|
||||
When you configure advanced authentication using Oauth, SAML, LDAP, or the Auth proxy, users are created automatically.
|
||||
|
||||
@@ -119,10 +119,10 @@ When you configure advanced authentication using Oauth, SAML, LDAP, or the Auth
|
||||
1. Click **New user**.
|
||||
1. Complete the fields and click **Create user**.
|
||||
|
||||
When you create a user, the system assigns the user viewer permissions in a default organization, which you can change. You can now [add a user to a second organization]({{< relref "add-remove-user-to-org/" >}}).
|
||||
When you create a user, the system assigns the user viewer permissions in a default organization, which you can change. You can now [add a user to a second organization](add-remove-user-to-org/).
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If you have [organization administrator]({{< relref "../../roles-and-permissions/#organization-roles" >}}) permissions and _not_ [server administrator]({{< relref "../../roles-and-permissions/#grafana-server-administrators" >}}) permissions, you can still add users by [inviting a user to join an organization]({{< relref "../manage-org-users#invite-a-user-to-join-an-organization" >}}).
|
||||
If you have [organization administrator](../../roles-and-permissions/#organization-roles) permissions and _not_ [server administrator](../../roles-and-permissions/#grafana-server-administrators) permissions, you can still add users by [inviting a user to join an organization](../manage-org-users/#invite-a-user-to-join-an-organization).
|
||||
{{% /admonition %}}
|
||||
|
||||
## Force a user to log out of Grafana
|
||||
|
||||
@@ -14,7 +14,7 @@ weight: 30
|
||||
|
||||
# Add or remove a user in an organization
|
||||
|
||||
Server administrators can add and remove users in organizations. To do this as an organization administrator, see [Manage users in an organization]({{< relref "../../manage-org-users/" >}}).
|
||||
Server administrators can add and remove users in organizations. To do this as an organization administrator, see [Manage users in an organization](../../manage-org-users/).
|
||||
|
||||
## Add a user to an organization
|
||||
|
||||
@@ -24,9 +24,9 @@ You are required to specify an Admin role for each organization. The first user
|
||||
|
||||
### Before you begin
|
||||
|
||||
- [Create an organization]({{< relref "../../../organization-management/#create-an-organization" >}})
|
||||
- [Add a user]({{< relref "./#add-a-user" >}}) to Grafana
|
||||
- Ensure you have [Grafana server administrator privileges]({{< relref "./assign-remove-server-admin-privileges" >}})
|
||||
- [Create an organization](../../../organization-management/#create-an-organization)
|
||||
- [Add a user](./#add-a-user) to Grafana
|
||||
- Ensure you have [Grafana server administrator privileges](../assign-remove-server-admin-privileges/)
|
||||
|
||||
**To add a user to an organization**:
|
||||
|
||||
@@ -36,14 +36,14 @@ You are required to specify an Admin role for each organization. The first user
|
||||
1. In the Organizations section, click **Add user to organization**.
|
||||
1. Select an organization and a role.
|
||||
|
||||
For more information about user permissions, refer to [Organization roles]({{< relref "../../../roles-and-permissions#organization-roles" >}}).
|
||||
For more information about user permissions, refer to [Organization roles](../../../roles-and-permissions/#organization-roles).
|
||||
|
||||
1. Click **Add to organization**.
|
||||
|
||||
The next time the user signs in, they will be able to navigate to their new organization using the Switch Organizations option in the user profile menu.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
If you have [organization administrator]({{< relref "../../../roles-and-permissions#organization-roles" >}}) permissions and _not_ [server administrator]({{< relref "../../../roles-and-permissions#grafana-server-administrators" >}}) permissions, you can still [invite a user to join an organization]({{< relref "../../manage-org-users#invite-a-user-to-join-an-organization" >}}).
|
||||
If you have [organization administrator](../../../roles-and-permissions/#organization-roles) permissions and _not_ [server administrator](../../../roles-and-permissions/#grafana-server-administrators) permissions, you can still [invite a user to join an organization](../../manage-org-users/#invite-a-user-to-join-an-organization).
|
||||
{{% /admonition %}}
|
||||
|
||||
## Remove a user from an organization
|
||||
@@ -62,4 +62,4 @@ Remove a user from an organization when they no longer require access to the das
|
||||
1. In the Organization section, click **Remove from organization** next to the organization from which you want to remove the user.
|
||||
1. Click **Confirm removal**.
|
||||
|
||||
> **Note:** If you have [organization administrator]({{< relref "../../../roles-and-permissions#organization-roles" >}}) permissions and _not_ [server administrator]({{< relref "../../../roles-and-permissions#grafana-server-administrators" >}}) permissions, you can still [remove a user from an organization]({{< relref "../../manage-org-users#remove-a-user-from-an-organization" >}}) in the Users section of organization configuration.
|
||||
> **Note:** If you have [organization administrator](../../../roles-and-permissions/#organization-roles) permissions and _not_ [server administrator](../../../roles-and-permissions/#grafana-server-administrators) permissions, you can still [remove a user from an organization](../../manage-org-users/#remove-a-user-from-an-organization) in the Users section of organization configuration.
|
||||
|
||||
@@ -13,7 +13,7 @@ weight: 20
|
||||
|
||||
# Assign or remove Grafana server administrator privileges
|
||||
|
||||
Grafana server administrators are responsible for creating users, organizations, and managing permissions. For more information about the server administration role, refer to [Grafana server administrators]({{< relref "../../../roles-and-permissions#grafana-server-administrators" >}}).
|
||||
Grafana server administrators are responsible for creating users, organizations, and managing permissions. For more information about the server administration role, refer to [Grafana server administrators](../../../roles-and-permissions/#grafana-server-administrators).
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Server administrators are "super-admins" with full permissions to create, read, update, and delete all resources and users in all organizations, as well as update global settings such as licenses. Only grant this permission to trusted users.
|
||||
@@ -21,7 +21,7 @@ Server administrators are "super-admins" with full permissions to create, read,
|
||||
|
||||
## Before you begin
|
||||
|
||||
- [Add a user]({{< relref "../#add-a-user" >}})
|
||||
- [Add a user](../#add-a-user)
|
||||
- Ensure you have Grafana server administrator privileges
|
||||
|
||||
**To assign or remove Grafana administrator privileges**:
|
||||
|
||||
@@ -11,11 +11,11 @@ weight: 50
|
||||
|
||||
# Change a user's organization permissions
|
||||
|
||||
Update organization permissions when you want to enhance or restrict a user's access to organization resources. For more information about organization permissions, refer to [Organization roles]({{< relref "../../../roles-and-permissions/#organization-roles" >}}).
|
||||
Update organization permissions when you want to enhance or restrict a user's access to organization resources. For more information about organization permissions, refer to [Organization roles](../../../roles-and-permissions/#organization-roles).
|
||||
|
||||
## Before you begin
|
||||
|
||||
- [Add a user to an organization]({{< relref "./add-remove-user-to-org/" >}})
|
||||
- [Add a user to an organization](../add-remove-user-to-org/)
|
||||
- Ensure you have Grafana server administrator privileges
|
||||
|
||||
**To change a user's organization permissions**:
|
||||
|
||||
@@ -13,7 +13,7 @@ weight: 60
|
||||
|
||||
By default, the editor organization role does not allow editors to creator and manage teams. You can allow them to do so using the `editors_can_admin` configuration option.
|
||||
|
||||
When `editors_can_admin` is enabled, users with the Editor role in an organization can create teams, and they are Administrators of the teams they create. To learn more about team permissions, refer to [Team management]({{< relref "../../../team-management/" >}}).
|
||||
When `editors_can_admin` is enabled, users with the Editor role in an organization can create teams, and they are Administrators of the teams they create. To learn more about team permissions, refer to [Team management](../../../team-management/).
|
||||
|
||||
## Before you begin
|
||||
|
||||
@@ -23,7 +23,7 @@ When `editors_can_admin` is enabled, users with the Editor role in an organizati
|
||||
|
||||
1. Log in to the Grafana server and open the Grafana configuration file.
|
||||
|
||||
For more information about the Grafana configuration file and its location, refer to [Configuration]({{< relref "../../../../setup-grafana/configure-grafana/" >}}).
|
||||
For more information about the Grafana configuration file and its location, refer to [Configuration](../../../../setup-grafana/configure-grafana/).
|
||||
|
||||
1. Locate the `editors_can_admin` parameter.
|
||||
1. Set the `editors_can_admin` value to `true`.
|
||||
|
||||
@@ -50,7 +50,7 @@ Your profile includes your name, user name, and email address, which you can upd
|
||||
|
||||
## Edit your preferences
|
||||
|
||||
You can choose the way you would like data to appear in Grafana, including the UI theme, home dashboard, timezone, and first day of the week. You can set these preferences for your own account, for a team, for an organization, or Grafana-wide using configuration settings. Your user preferences take precedence over team, organization, and Grafana default preferences. For more information, see [Grafana preferences]({{< relref "../../organization-preferences/" >}}).
|
||||
You can choose the way you would like data to appear in Grafana, including the UI theme, home dashboard, timezone, and first day of the week. You can set these preferences for your own account, for a team, for an organization, or Grafana-wide using configuration settings. Your user preferences take precedence over team, organization, and Grafana default preferences. For more information, see [Grafana preferences](../../organization-preferences/).
|
||||
|
||||
- **UI theme** determines whether Grafana appears in light mode or dark mode. By default, UI theme is set to dark mode.
|
||||
- **Home dashboard** refers to the dashboard you see when you sign in to Grafana. By default, this is set to the Home dashboard.
|
||||
@@ -85,7 +85,7 @@ Every user is a member of at least one organization. You can have different role
|
||||
1. Click the user icon in the top right corner of the page and select **Profile**.
|
||||
1. Scroll down to the Organizations section and review the following information:
|
||||
- **Name**: The name of the organizations of which you are a member.
|
||||
- **Role**: The role to which you are assigned in the organization. For more information about roles and permissions, refer to [Organization users and permissions]({{< relref "../../roles-and-permissions/#organization-users-and-permissions" >}}).
|
||||
- **Role**: The role to which you are assigned in the organization. For more information about roles and permissions, refer to [Organization users and permissions](../../roles-and-permissions/#organization-users-and-permissions).
|
||||
- **Current**: Grafana indicates the organization that you are currently signed into as _Current_. If you are a member of multiple organizations, you can click **Select** to switch to that organization.
|
||||
|
||||
## View your Grafana sessions
|
||||
|
||||
@@ -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,21 @@ 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/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/datasources/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/time-series/
|
||||
- destination: /docs/grafana-cloud/connect-externally-hosted/data-sources/
|
||||
compatible-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-managed alert rules
|
||||
@@ -84,6 +89,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 +101,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).
|
||||
2. 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 +272,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:
|
||||
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
|
||||
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:reference-labels) and [`$values`](ref:reference-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 that triggered the alert.
|
||||
- Highlighting label information that identifies the alert, such as the environment, instance, or region.
|
||||
- Providing specific instructions based on query values.
|
||||
- Customizing runbook links depending on query labels.
|
||||
- Including contact information based on query 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)
|
||||
310
docs/sources/alerting/alerting-rules/templates/examples.md
Normal file
310
docs/sources/alerting/alerting-rules/templates/examples.md
Normal file
@@ -0,0 +1,310 @@
|
||||
---
|
||||
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 using the [`$labels`](ref:reference-labels) variable.
|
||||
|
||||
For instance, the previous case could also include 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.
|
||||
```
|
||||
|
||||
You can incorporate any labels returned by the query into the template. For instance, the following template includes information about the environment and region where the alert occurred.
|
||||
|
||||
```
|
||||
Alert triggered in {{ $labels.environment }} on {{ $labels.region }} region.
|
||||
```
|
||||
|
||||
```template_output
|
||||
Alert triggered in production on AMER region.
|
||||
```
|
||||
|
||||
### 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>" >}}
|
||||
450
docs/sources/alerting/alerting-rules/templates/reference.md
Normal file
450
docs/sources/alerting/alerting-rules/templates/reference.md
Normal file
@@ -0,0 +1,450 @@
|
||||
---
|
||||
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:
|
||||
label-types:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#label-types
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#label-types
|
||||
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, only query labels. |
|
||||
| [$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. It excludes [user-configured and reserved labels](ref:label-types), containing only query labels.
|
||||
|
||||
{{< figure src="/media/docs/alerting/query-labels-and-values.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
|
||||
@@ -27,7 +27,7 @@ Before you begin, ensure you have the following:
|
||||
- **AWS SNS Topic**: An SNS topic to send notifications to.
|
||||
- **AWS IAM Identity with necessary access**: An IAM identity (e.g. user, role) with the necessary permissions to publish messages to the SNS topic.
|
||||
|
||||
For an example setup, see [Example Minimal Setup Using Assumed IAM Role]({{< relref "#example-minimal-setup-using-assumed-iam-role" >}}).
|
||||
For an example setup, see [Example Minimal Setup Using Assumed IAM Role](#example-minimal-setup-using-assumed-iam-role).
|
||||
|
||||
## Adding the SNS Contact Point in Grafana
|
||||
|
||||
@@ -181,7 +181,7 @@ This section outlines a minimal setup to configure SNS with Grafana using an ass
|
||||
|
||||
### 5. Add the SNS Contact Point in Grafana
|
||||
|
||||
After creating the IAM user and obtaining the necessary credentials, proceed to [configure the SNS contact point in Grafana]({{< relref "#adding-the-sns-contact-point-in-grafana" >}}) using the following details:
|
||||
After creating the IAM user and obtaining the necessary credentials, proceed to [configure the SNS contact point in Grafana](#adding-the-sns-contact-point-in-grafana) using the following details:
|
||||
|
||||
- **The Amazon SNS API URL**: `https://sns.us-east-1.amazonaws.com`
|
||||
- **Signature Version (sigv4)**:
|
||||
@@ -200,4 +200,4 @@ Replace the placeholder values (`https://sns.us-east-1.amazonaws.com`, `us-east-
|
||||
- [Amazon SNS Documentation](https://docs.aws.amazon.com/sns/index.html)
|
||||
- [AWS IAM Documentation](https://docs.aws.amazon.com/iam/index.html)
|
||||
- [Prometheus Alertmanager SNS Integration](https://prometheus.io/docs/alerting/configuration/#sns_config)
|
||||
- [Cloudwatch AWS Authentication]({{< relref "../../../../datasources/aws-cloudwatch/aws-authentication" >}})
|
||||
- [Cloudwatch AWS Authentication](../../../../../datasources/aws-cloudwatch/aws-authentication/)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -139,7 +145,11 @@ The webhook notification is a simple way to send information about a state chang
|
||||
| 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)
|
||||
```
|
||||
@@ -14,7 +14,8 @@ labels:
|
||||
- enterprise
|
||||
- oss
|
||||
title: Use images in notifications
|
||||
weight: 500
|
||||
menuTitle: Use images
|
||||
weight: 105
|
||||
---
|
||||
|
||||
# Use images in notifications
|
||||
@@ -55,6 +56,8 @@ Refer to the table at the end of this page for a list of contact points and thei
|
||||
|
||||
8. Grafana does not delete screenshots uploaded to its internal web server. To delete screenshots from `static_root_path/images/attachments` after a certain amount of time, we recommend setting up a CRON job.
|
||||
|
||||
9. Note you cannot adjust the number and size of images or their placement in notifications.
|
||||
|
||||
## Configuration
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
@@ -130,7 +133,7 @@ If Grafana has been set up to send images in notifications, however notification
|
||||
5. If images cannot be taken because of mis-configuration or an issue with image rendering there are logs for `Failed to take an image` including the Dashboard UID, Panel ID, and the error message.
|
||||
6. Check that the contact point supports images in notifications and whether it supports uploading images to the receiving service or referencing images that have been uploaded to a cloud storage service.
|
||||
|
||||
## Metrics
|
||||
## Monitor
|
||||
|
||||
Grafana provides the following metrics to observe the performance and failure rate of images in notifications.
|
||||
For example, if a screenshot could not be taken within the expected time (10 seconds) then the counter `grafana_screenshot_failures_total` is updated.
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../manage-notifications/template-notifications/using-go-templating-language/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/template-notifications/using-go-templating-language/
|
||||
- ../../configure-notifications/template-notifications/using-go-templating-language/ # /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/using-go-templating-language/
|
||||
weight: 104
|
||||
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 context, 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.
|
||||
|
||||
```
|
||||
{{ $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).
|
||||
|
||||
```
|
||||
{{ .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>" >}}
|
||||
@@ -0,0 +1,131 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../manage-notifications/template-notifications/create-notification-templates/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/template-notifications/create-notification-templates/
|
||||
- ../../manage-notifications/template-notifications/use-notification-templates/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/template-notifications/use-notification-templates/
|
||||
- ../../configure-notifications/template-notifications/use-notification-templates/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/template-notifications/use-notification-templates/
|
||||
- ../../configure-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/manage-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: Manage notification templates
|
||||
menuTitle: Manage templates
|
||||
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/
|
||||
---
|
||||
|
||||
# Manage notification templates
|
||||
|
||||
In contact points, you can select notification templates to customize the notification messages sent.
|
||||
|
||||
By default, Grafana provides a template for the notification title (`default.title`) and a template for the notification message (`default.message`). Both default templates display common alert details.
|
||||
|
||||
You can also create custom templates to customize the content and format of notification messages, which can then be applied to one or more contact points.
|
||||
|
||||
This documentation provides step-by-step instructions for selecting templates in contact points, previewing templates, and creating custom templates using the Grafana UI.
|
||||
|
||||
## Select a notification template for a contact point
|
||||
|
||||
To add an existing notification template to your 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. Click **Select existing template** to select a template and [preview](#preview-a-notification-template) it using the default payload.
|
||||
|
||||
You can also copy the selected template and use it in the custom tab.
|
||||
|
||||
1. Click **Enter custom message** to customize and edit the field directly. Note that the title changes depending on the field you are editing.
|
||||
|
||||
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**.
|
||||
|
||||
## Create a notification template
|
||||
|
||||
Create notification templates to customize notification messages and reuse them in contact points.
|
||||
|
||||
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 in Grafana, 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.
|
||||
|
||||
If `{{ define }}` is not included in the content, `{{ define "<NOTIFICATION_TEMPLATE_NAME>" }}` and `{{ end }}` is automatically added to the start and end.
|
||||
|
||||
To create a notification template that contains more than one template, complete the following steps.
|
||||
|
||||
1. Click **+ Add notification template**.
|
||||
|
||||
1. Enter a name for the notification template.
|
||||
|
||||
1. Write each template in the Content field, including `{{ define "name-of-template" }}` and `{{ end }}` at the start and end of each template.
|
||||
|
||||
1. Save your changes.
|
||||
|
||||
For more details on how to write notification templates, refer to the [template reference](ref:notification-template-reference) and [examples](ref:notification-template-examples).
|
||||
|
||||
## Preview a notification template
|
||||
|
||||
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.
|
||||
|
||||
{{% admonition type="note" %}}
|
||||
Notification template preview is only for Grafana Alertmanager.
|
||||
{{% /admonition %}}
|
||||
|
||||
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.
|
||||
@@ -13,80 +13,249 @@ labels:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Reference
|
||||
weight: 400
|
||||
title: Notification template reference
|
||||
menuTitle: Template reference
|
||||
weight: 102
|
||||
refs:
|
||||
label-types:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/fundamentals/alert-rules/annotation-label/#label-types
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/fundamentals/alert-rules/annotation-label/#label-types
|
||||
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-grouping:
|
||||
- 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/
|
||||
template-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/
|
||||
template-language-functions:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/language/#functions
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/language/#functions
|
||||
---
|
||||
|
||||
# Reference
|
||||
# Notification template reference
|
||||
|
||||
## Data
|
||||
By default, Grafana provides predefined templates to format notification messages.
|
||||
|
||||
### Alert
|
||||
You can also customize your notifications with custom templates, which are based on the [Go template language](ref:template-language).
|
||||
|
||||
| Name | Kind | Description | Example |
|
||||
| ------------ | -------- | ------------------------------------------------------------------------------------ | --------------------- |
|
||||
| Status | `string` | Firing or resolved | `{{ .Status }}` |
|
||||
| Labels | `KV` | The labels for this alert | `{{ .Labels }}` |
|
||||
| Annotations | `KV` | The annotations for this alert | `{{ .Annotations }}` |
|
||||
| Values | `KV` | The values of all expressions, including Classic Conditions | `{{ .Values }}` |
|
||||
| StartsAt | `Time` | The time the alert fired | `{{ .StartsAt }}` |
|
||||
| EndsAt | `Time` | | `{{ .EndsAt }}` |
|
||||
| GeneratorURL | `string` | A link to Grafana, or the Alertmanager if using an external Alertmanager | `{{ .GeneratorURL }}` |
|
||||
| SilenceURL | `string` | A link to silence the alert | `{{ .SilenceURL }}` |
|
||||
| DashboardURL | `string` | A link to the Grafana Dashboard if the alert has a Dashboard UID annotation | `{{ .DashboardURL }}` |
|
||||
| PanelURL | `string` | A link to the panel if the alert has a Panel ID annotation | `{{ .PanelURL }}` |
|
||||
| Fingerprint | `string` | A unique string that identifies the alert | `{{ .Fingerprint }}` |
|
||||
| ValueString | `string` | A string that contains the labels and value of each reduced expression in the alert. | `{{ .ValueString }}` |
|
||||
This documentation lists the data available for use in notification templates.
|
||||
|
||||
### ExtendedData
|
||||
## Notification Data
|
||||
|
||||
| Name | Kind | Description | Example |
|
||||
| ----------------- | --------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
|
||||
| Receiver | `string` | The name of the contact point sending the notification | `{{ .Receiver }}` |
|
||||
| Status | `string` | The status is `firing` if at least one alert is firing, otherwise `resolved` | `{{ .Status }}` |
|
||||
| Alerts | `[]Alert` | List of all firing and resolved alerts in this notification | `There are {{ len .Alerts }} alerts` |
|
||||
| Firing alerts | `[]Alert` | List of all firing alerts in this notification | `There are {{ len .Alerts.Firing }} firing alerts` |
|
||||
| Resolved alerts | `[]Alert` | List of all resolved alerts in this notification | `There are {{ len .Alerts.Resolved }} resolved alerts` |
|
||||
| GroupLabels | `KV` | The labels that group these alerts in this | `{{ .GroupLabels }}` |
|
||||
| CommonLabels | `KV` | The labels common to all alerts in this notification | `{{ .CommonLabels }}` |
|
||||
| CommonAnnotations | `KV` | The annotations common to all alerts in this notification | `{{ .CommonAnnotations }}` |
|
||||
| ExternalURL | `string` | A link to Grafana, or the Alertmanager that sent this notification if using an external Alertmanager | `{{ .ExternalURL }}` |
|
||||
In notification templates, dot (`.`) is initialized with the following data:
|
||||
|
||||
### KV
|
||||
| Name | Type | Description |
|
||||
| ------------------- | ----------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| `Receiver` | string | The name of the contact point sending the notification |
|
||||
| `Status` | string | The status is `firing` if at least one alert is firing, otherwise `resolved`. |
|
||||
| `Alerts` | [][Alert](#alert) | List of all firing and resolved alerts in this notification. |
|
||||
| `Alerts.Firing` | [][Alert](#alert) | List of all firing alerts in this notification. |
|
||||
| `Alerts.Resolved` | [][Alert](#alert) | List of all resolved alerts in this notification. |
|
||||
| `GroupLabels` | [KV](#kv) | The labels that group these alerts in this notification based on the `Group by` option. |
|
||||
| `CommonLabels` | [KV](#kv) | The labels common to all alerts in this notification. |
|
||||
| `CommonAnnotations` | [KV](#kv) | The annotations common to all alerts in this notification. |
|
||||
| `ExternalURL` | string | A link to Grafana, or the Alertmanager that sent this notification if using an external Alertmanager. |
|
||||
|
||||
`KV` is a set of key value pairs, where each key and value is a string. If a KV happens to contain numbers or bools then these are string representations of the numeric or boolean value.
|
||||
It's important to remember that [a single notification can group multiple alerts](ref:alert-grouping) to reduce the number of alerts you receive. `Alerts` is an array that includes all the alerts in the notification.
|
||||
|
||||
Here is an example of a KV, the annotations of an alert:
|
||||
Here's an example that prints all available notification data from dot (`.`):
|
||||
|
||||
```yaml
|
||||
summary: 'A summary of the alert'
|
||||
description: 'A description of the alert'
|
||||
```go
|
||||
{{ define "custom_template" }}
|
||||
{{ .Receiver }}
|
||||
{{ .Status }}
|
||||
There are {{ len .Alerts }} alerts
|
||||
There are {{ len .Alerts.Firing }} firing alerts
|
||||
There are {{ len .Alerts.Resolved }} resolved alerts
|
||||
{{ .GroupLabels }}
|
||||
{{ .CommonLabels }}
|
||||
{{ .CommonAnnotations }}
|
||||
{{ .ExternalURL }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
In addition to iterating over each key value pair, you can sort the pairs, remove keys, and iterate over just the keys or the values.
|
||||
## Alert
|
||||
|
||||
| Name | Description | Arguments | Returns | Example |
|
||||
| ----------- | ---------------------------------------------- | --------- | ------- | ------------------------------------- |
|
||||
| SortedPairs | Sorts | | | `{{ .Annotations.SortedPairs }}` |
|
||||
| Remove | Returns a copy of the KV with the keys removed | []string | | `{{ .Annotations.Remove "summary" }}` |
|
||||
| Names | A list of the names | | | `{{ .Names }}` |
|
||||
| Values | A list of the values | | | `{{ .Values }}` |
|
||||
`Alert` contains data for an individual alert:
|
||||
|
||||
### Time
|
||||
| Name | Type | Description |
|
||||
| -------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `Status` | string | Firing or resolved. |
|
||||
| `Labels` | [KV](#kv) | The labels for this alert. It includes all [types of labels](ref:label-types). |
|
||||
| `Annotations` | [KV](#kv) | The annotations for this alert. |
|
||||
| `StartsAt` | [Time](#time) | The time the alert fired |
|
||||
| `EndsAt` | [Time](#time) | Only set if the end time of an alert is known. Otherwise set to a configurable timeout period from the time since the last alert was received. |
|
||||
| `GeneratorURL` | string | A link to Grafana, or the source of the alert if using an external alert generator. |
|
||||
| `Fingerprint` | string | A unique string that identifies the alert. |
|
||||
|
||||
Time is from the Go [`time`](https://pkg.go.dev/time#Time) package.
|
||||
Grafana-managed alerts include these additional properties:
|
||||
|
||||
You can format a time in a number of different formats using the `date` function.
|
||||
For example, to print the time that an alert fired in the format `15:04:05 MST`:
|
||||
| Name | Type | Description |
|
||||
| -------------- | --------- | ------------------------------------------------------------------------------------ |
|
||||
| `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. |
|
||||
| `SilenceURL` | string | A link to silence the alert. |
|
||||
| `Values` | [KV](#kv) | The values of all expressions, including Classic Conditions. |
|
||||
| `ValueString` | string | A string that contains the labels and value of each reduced expression in the alert. |
|
||||
|
||||
```
|
||||
{{ .StartsAt | date "15:04:05 MST" }}
|
||||
This example iterates over the list of firing and resolved alerts (`.Alerts`) in the notification and prints the data for each alert:
|
||||
|
||||
```go
|
||||
{{ define "custom_template" }}
|
||||
{{ range .Alerts }}
|
||||
{{ .Status }}
|
||||
{{ .Labels }}
|
||||
{{ .Annotations }}
|
||||
{{ .StartsAt }}
|
||||
{{ .EndsAt }}
|
||||
{{ .GeneratorURL }}
|
||||
{{ .Fingerprint }}
|
||||
|
||||
{{/* Only available for Grafana-managed alerts */}}
|
||||
{{ .DashboardURL }}
|
||||
{{ .PanelURL }}
|
||||
{{ .SilenceURL }}
|
||||
{{ .Values }}
|
||||
{{ .ValueString }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
You can also use the `tz` function to change the timezone from UTC to a local time. For example:
|
||||
## KV
|
||||
|
||||
```
|
||||
{{ .StartsAt | tz "Europe/Paris" | date "15:04:05 MST" }}
|
||||
`KV` is a set of key value pairs, where each key and value is a string.
|
||||
|
||||
Similarly to accessing variable properties, you can use `.` to retrieve the value of a value. For example:
|
||||
|
||||
```go
|
||||
{{ define "custom_template" }}
|
||||
{{ .CommonLabels.grafana_folder }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
You can find a reference for Go's time format [here](https://pkg.go.dev/time#pkg-constants).
|
||||
If a KV happens to contain numbers or bools then these are string representations of the numeric or boolean value.
|
||||
|
||||
Additionally, KV provides methods to sort the pairs, remove keys, and iterate over just the keys or values:
|
||||
|
||||
| Method name | Description | Arguments | Returns |
|
||||
| ----------- | ---------------------------------------------- | --------- | --------- |
|
||||
| SortedPairs | Returns a sorted list of key/value pairs. | | Pairs |
|
||||
| Remove | Returns a copy of the KV with the keys removed | []string | [KV](#kv) |
|
||||
| Names | Return the names of the label names | | []string |
|
||||
| Values | Return a list of the values | | []string |
|
||||
|
||||
Here's an example of using these methods:
|
||||
|
||||
```go
|
||||
{{ define "custom_template" }}
|
||||
{{ .CommonLabels.SortedPairs }}
|
||||
{{ .CommonLabels.Names }}
|
||||
{{ .CommonLabels.Values }}
|
||||
{{ .CommonLabels.Remove (stringSlice "grafana_folder") }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
## Time
|
||||
|
||||
Some template functions and properties return a `Time` object, which refers to the [type `Time`](https://pkg.go.dev/time#Time) in Go's time package.
|
||||
|
||||
When accessing a `Time` object, you can use various [`Time` functions](https://pkg.go.dev/time#Time) in your templates as follows.
|
||||
|
||||
```go
|
||||
{{ define "custom_template" }}
|
||||
{{ range .Alerts }}
|
||||
{{ .StartsAt }}
|
||||
{{ .StartsAt.Add 6000000000000 }}
|
||||
{{ .StartsAt.Add -6000000000000 }}
|
||||
{{ .StartsAt.AddDate 1 0 0 }}
|
||||
{{ .StartsAt.Year }}/{{ .StartsAt.Month }}/{{ .StartsAt.Day }}
|
||||
{{ .StartsAt.Hour }}:{{ .StartsAt.Minute }}:{{ .StartsAt.Second }}
|
||||
{{ .StartsAt.YearDay }}-{{ .StartsAt.Weekday }}
|
||||
{{ .StartsAt.Unix }} {{ .StartsAt.UnixMilli }}
|
||||
{{ end}}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
Functions can perform actions in templates such as transforming or formatting data.
|
||||
|
||||
Note that the [functions provided by Go's template language](ref:template-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 notifications:
|
||||
|
||||
| Name | Arguments | Returns | Description |
|
||||
| -------------- | -------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `title` | string | string | Capitalizes the first character of each word. |
|
||||
| `toUpper` | string | string | Returns all text in uppercase. |
|
||||
| `toLower` | string | string | Returns all text in lowercase. |
|
||||
| `trimSpace` | string | string | Removes leading and trailing white spaces. |
|
||||
| `match` | pattern, text | boolean | Matches the text against a regular expression pattern. |
|
||||
| `reReplaceAll` | pattern, replacement, text | string | Replaces text matching the regular expression. |
|
||||
| `join` | sep string, s []string | string | Concatenates the elements of s to create a single string. The separator string sep is placed between elements in the resulting string. |
|
||||
| `safeHtml` | string | string | Marks string as HTML not requiring auto-escaping. |
|
||||
| `stringSlice` | ...string | string | Returns the passed strings as a slice of strings. auto-escaping. |
|
||||
| `date` | string, [Time](#time) | string | Format a time in the specified format. For format options, refer to [Go's time format documentation](https://pkg.go.dev/time#pkg-constants). |
|
||||
| `tz` | string, [Time](#time) | [Time](#time) | Returns the time in the specified timezone, such as `Europe/Paris`. For available timezone options, refer to the [list of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). |
|
||||
|
||||
Here's an example using some functions to format text:
|
||||
|
||||
```go
|
||||
{{ define "custom_template" }}
|
||||
{{ title "hello, world!" }}
|
||||
{{ toUpper "Hello, world!" }}
|
||||
{{ toLower "Hello, world!" }}
|
||||
{{ trimSpace "Hello, world!" }}
|
||||
{{ match "a.*" "abc" }}
|
||||
{{ reReplaceAll "localhost:(.*)" "example.com:$1" "localhost:8080" }}
|
||||
{{ join "-" (stringSlice "a" "b" "c") }}
|
||||
{{ safeHtml "<b>Text</b>"}}
|
||||
{{ stringSlice "a" "b" "c" }}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
`date` and `tz` can format times. For example, to print the time an alert fired in the format `15:04:05 MST`:
|
||||
|
||||
```go
|
||||
{{ define "custom_template" }}
|
||||
{{ range .Alerts }}
|
||||
{{ .StartsAt | date "15:04:05 MST" }}
|
||||
{{ end}}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
You can then use `tz` to change the timezone from UTC to local time, such as `Europe/Paris`.
|
||||
|
||||
```go
|
||||
{{ define "custom_template" }}
|
||||
{{ range .Alerts }}
|
||||
{{ .StartsAt | tz "Europe/Paris" }}
|
||||
{{ .StartsAt | tz "Europe/Paris" | date "15:04:05 MST" }}
|
||||
{{ end}}
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
```template-output
|
||||
2024-10-30 21:01:45.227 +0100 CET
|
||||
21:01:45 CET
|
||||
```
|
||||
|
||||
## Differences with annotation and label templates
|
||||
|
||||
In the alert rule, you can also template annotations and labels to include additional information. For example, you might add a `summary` annotation that displays the query value triggering the alert.
|
||||
|
||||
Annotation and label templates add relevant information to individual alert instances, while notification templates inform about a group of alert instances.
|
||||
|
||||
Since both types of templates operate in distinct contexts, the [functions and variables available in annotation and label templates](ref:alert-rule-template-reference) differ from those used in notification templates.
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
---
|
||||
aliases:
|
||||
- ../../manage-notifications/template-notifications/use-notification-templates/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/template-notifications/use-notification-templates/
|
||||
canonical: https://grafana.com/docs/grafana/latest/alerting/configure-notifications/template-notifications/use-notification-templates/
|
||||
description: Use notification templates in contact points to customize your notifications
|
||||
keywords:
|
||||
- grafana
|
||||
- alerting
|
||||
- notifications
|
||||
- templates
|
||||
- use templates
|
||||
labels:
|
||||
products:
|
||||
- cloud
|
||||
- enterprise
|
||||
- oss
|
||||
title: Use notification templates
|
||||
weight: 300
|
||||
refs:
|
||||
create-notification-templates:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/create-notification-templates/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/create-notification-templates/
|
||||
using-go-templating-language:
|
||||
- pattern: /docs/grafana/
|
||||
destination: /docs/grafana/<GRAFANA_VERSION>/alerting/configure-notifications/template-notifications/using-go-templating-language/
|
||||
- pattern: /docs/grafana-cloud/
|
||||
destination: /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/template-notifications/using-go-templating-language/
|
||||
---
|
||||
|
||||
# Use notification templates
|
||||
|
||||
Use templates in contact points to customize your notifications.
|
||||
|
||||
Complete the following steps to add templates to your contact point.
|
||||
|
||||
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. Click **Select existing template** to select a template and preview it using the default payload.
|
||||
|
||||
You can also copy the selected template and use it in the custom tab.
|
||||
|
||||
1. Click **Enter custom message** to customize and edit the field directly. Note that the title changes depending on the field you are editing.
|
||||
|
||||
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**.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user