Compare commits

...

109 Commits

Author SHA1 Message Date
Jack Baldry
16b670492a Actually remove the plugins docs now that all the links are redirected to https://grafana.com/developers/ (#75632)
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2023-09-28 17:27:43 +01:00
Jack Baldry
d7ac94907c [v8.3.x] Remove plugins (#75575)
* Fix all links to "Sign a plugin" pages

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* [publish_dashboards]

* Fix metadata links

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* [publish-technical-documentation-next] Publish from grafana/agent:main/docs/sources

* Fix data-frames redirect

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* add collapse shortcode (#15422)

* Add note about missing rewrites

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix all data-frames links

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix links to "plugins"

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix "plugin-sdk-go" links

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix backend links

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix "Add query editor help" links

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix value mappings links

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix some stray links

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* [publish_plugins]

* Add missing redirects and fix a couple more links

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

---------

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2023-09-27 18:37:05 +01:00
Jack Baldry
a666a772f3 [v8.3.x] Fix links (#75419)
* Fix links in Grafana v7.x documentation

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix links in Grafana v8.x documentation

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

---------

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2023-09-26 13:59:34 +01:00
Jack Baldry
8e078d2dd8 [v8.3.x] Update docs/shared shortcode usage to use keyword argument interface (#73771)
* Enable legacy shortcode usage logging to allow future template simplification

Once all legacy usage is removed, this logical branch can also be
removed.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Update all use of docs/shared in Grafana to use keyword arguments

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

---------

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2023-09-05 09:39:13 +01:00
Grot (@grafanabot)
78c80ceb5a [v8.3.x] [v9.0.x] docs: update broken elasticsearch metrics play link (#62727)
[v9.0.x] docs: update broken elasticsearch metrics play link (#62720)

update broken elasticsearch metrics play link

(cherry picked from commit 9d659f0851)

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-02-06 09:44:42 +00:00
Grot (@grafanabot)
f2a6e8c36a [v8.3.x] Remove packages path from branch filter (#60942)
Remove packages path from branch filter (#60128)

That directory is no longer used in published docs and causes this
workflow to fail when changes only affect the packages directory.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit 1516aa2762)

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2023-01-04 10:40:06 +00:00
Grot (@grafanabot)
3f40ee29b2 [v8.3.x] Fix branch filter for release workflows (#60118)
Fix branch filter for release workflows (#59963)

Ensures the workflow is run on every push to all version branches.

This was thought to be working because it was tested with a manual
dispatch, however, that trigger does not consider filters and was not
an accurate test.

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit 6f9ee7acf9)

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2022-12-09 15:16:34 -04:00
Grot (@grafanabot)
e2311454ec [v8.3.x] Restrict workflow to grafana/grafana repository (#59751)
Restrict workflow to grafana/grafana repository (#59740)

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit e7bdcb4ba8)

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2022-12-02 17:28:00 -04:00
Grot (@grafanabot)
5bd1418a81 [v8.3.x] Automate docs publishing steps (#59561)
* Automate docs publishing steps (#59550)

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit 10a83714c8)

* Remove dependency on test job (#59575)

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix release_branch_regexp (#59590)

Apparently the non-capturing group was incorrect.

I verified the logic in a branch in grafana-github-actions:
https://github.com/grafana/grafana-github-actions/compare/jdb/2022-11-prove-grafana-regexp-behaves-correctly?expand=1

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2022-11-30 15:05:55 -04:00
Grot (@grafanabot)
bddcefe517 "Release: Updated versions in package to 8.3.11" (#54455) 2022-08-30 20:09:11 +02:00
Joan López de la Franca Beltran
ad3aaff617 Rendering: Add support for renderer token (#54425) (#54436)
(cherry picked from commit a4f75cc0438712c90b02d24740416f8615e3a0cb)
(cherry picked from commit 6ec06f66b9)
2022-08-30 15:01:19 +02:00
Ieva
b8eb142e85 Security: Fixes for CVE-2022-31107 and CVE-2022-31097 (#52236)
* Fix XSS in runbook URL (#383)

* "Release: Updated versions in package to 8.3.8" (#385)

* Fix: Choose Lookup params per auth module v8.3.x (#401)

* Fix: Choose Lookup params per auth module

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: Prefer pointer to struct in lookup

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: user email for ldap

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: Use only login for lookup in LDAP

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: use user email for ldap

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

fix remaining test

fix nit picks

* update lock

* fix integration tests

* [v8.3.x] Merge 'release-8.3.9` branch (#404)

* Fix: Choose Lookup params per auth module

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: Prefer pointer to struct in lookup

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: user email for ldap

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: Use only login for lookup in LDAP

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: use user email for ldap

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

fix remaining test

fix nit picks

(cherry picked from commit 09ca54d4665583b5648fea5726a19e0b58df4ec0)

* fix integration tests

(cherry picked from commit 16c3077bb39f41acacbef4b13c65c7c907c54de7)

* Release: Bump version to 8.3.9 (#403)

* Change bump-version.yml

* "Release: Updated versions in package to 8.3.9"

Co-authored-by: dsotirakis <dimitrios.sotirakis@grafana.com>

* Update yarn.lock

Co-authored-by: jguer <joao.guerreiro@grafana.com>
Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com>

* "Release: Updated versions in package to 8.3.10" (#409)

* Update grabpl

* update grabpl

* CI: Update `grabpl` version - remove `--no-pull-enterprise` flag (#47013)

* Update grabpl version

* Sign drone

* Remove --no-pull-enterprise flag

* Sign drone

* Update grabpl

* update drone, cherry-pick some ci updates

* update PR pipeline

Co-authored-by: George Robinson <george.robinson@grafana.com>
Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com>
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
Co-authored-by: Dimitris Sotirakis <sotirakis.dim@gmail.com>
2022-07-15 15:23:55 +00:00
Alexander Weaver
7c2cb0786c Alerting: Remove double quotes from matchers (#50042)
* Alerting: Remove double quotes from matchers (#50038)

* Alerting: Remove double quotes from matchers

With #38629 a new Alertmanager configuration object was introduced with `object_matchers`, it was meant to circumvent around the fact that Prometheus label names don't support a set of characters that Grafana needs to support for alerts, silences, matchers, etc. (with a common example being elasticsearch's `.`).
This new object does not include the label of sanitzation or validation that its Prometheus equivalent supports in `matchers` and therefore are semantically not equivalent.

This triggered the problem that when the migration is run, we use `matchers` as the object to populate in configuration for routing policies, but when the UI does its first save this object is transformed to `object_matchers`.

Matchers that were previously running just fine would immediately stop working as soon as the configuration is saved.

This problem surfaced with the introduction of #49952 where we stopped stripping double quotes from matchers (not just regex but _all_ of them).

* Add comment explaining rationale and future removal

Co-authored-by: Alex Weaver <weaver.alex.d@gmail.com>
(cherry picked from commit 1a50b0dbb7)

* Drop changelog

Co-authored-by: gotjosh <josue.abreu@gmail.com>
2022-06-01 16:51:42 -05:00
Grot (@grafanabot)
4b68c86160 Fix typo in curl command (#46729) (#49816)
* Fix typo in curl command

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Fix typo in another curl command

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>
(cherry picked from commit 0a23299878)

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
2022-05-30 14:36:14 +02:00
Dimitris Sotirakis
be27409c4c [v8.3.x] CI: Sync CI changes (#46085)
* CI: Introduce `build-frontend-packages` step (#45824)

* Split frontend build

* Fix command name

* Update grabpl

(cherry picked from commit 2f6c827f5d)

* CI: Add docs pipeline for `main` pipelines (#45740)

* Add docs pipeline for main

* Extract trigger docs

* Change trigger for main

(cherry picked from commit ea3e41ea62)

* CI: Add more checks to standalone docs pipeline (#46449)

* Add build frontend package step

* Reorder dependencies

* Add codespell and prettier checks

(cherry picked from commit 82b436afee)

* Update golang (#46458)

(cherry picked from commit a29159f362)
2022-04-05 12:54:48 +03:00
Adela Almasan
f3e01a2860 Geomap: Display legend (#46886) (#47077)
* Display legend for fixed colors and field; Hide tooltip on base layer;

(cherry picked from commit 118b87ee8f)

# Conflicts:
#	public/app/plugins/panel/geomap/GeomapPanel.tsx
#	public/app/plugins/panel/geomap/editor/layerEditor.tsx
2022-03-30 16:21:22 -05:00
Todd Treece
87e2fa0dd4 Chore: Update go version used in CI to 1.17.8 (#46591) (#46632)
(cherry picked from commit 3f58abe9bd)
2022-03-16 10:01:03 -04:00
Todd Treece
a18b0e3899 Prometheus: Fix timestamp truncation (#46302) (#46331)
(cherry picked from commit db5f480a8f)
2022-03-08 17:40:24 +00:00
Timur Olzhabayev
1020e52f29 Backporting bump version fixes (#46231) 2022-03-04 10:38:34 +01:00
Sriram
89eb74730e ReleaseNotes: Updated changelog and release notes for 8.3.7 (#46028) (#46029)
(cherry picked from commit 3ea6c8cf64)

Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com>
2022-03-01 14:31:08 +00:00
Grot (@grafanabot)
26c5992298 "Release: Updated versions in package to 8.3.7" (#46027) 2022-03-01 13:57:56 +00:00
Grot (@grafanabot)
433ff19f77 Histogram: auto-skip x tick labels to avoid overlap (#45996) (#46000)
(cherry picked from commit b491d6b4dc)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2022-03-01 09:11:53 +01:00
Grot (@grafanabot)
03e8428caa BarChart: fix single group rendering (#45953) (#45991)
(cherry picked from commit 1c4b20b268)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2022-02-28 15:34:53 -06:00
Grot (@grafanabot)
274cd740a5 Middleware: Fix IPv6 host parsing in CSRF check (#45911) (#45983)
- Also create tests for this middleware

Co-authored-by: Kyle Brandt <kyle@grafana.com>
(cherry picked from commit 06ed5efdf0)

Co-authored-by: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com>
2022-02-28 20:34:26 +01:00
Dimitris Sotirakis
6e75734bd5 DockerHub: Use grafana(-oss)-image-tags to push to grafana(-oss)-dev DockerHub repo (#45708) (#45711)
* Revert back changes - changes are done on grabpl

* Sync drone

(cherry picked from commit 3db331402d)
2022-02-28 12:25:46 +02:00
Grot (@grafanabot)
1db431b5cf bump go version to 1.17.7 (#45772) (#45782)
(cherry picked from commit b512a3d75f)

Co-authored-by: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com>
2022-02-23 14:47:09 +01:00
Dimitris Sotirakis
b688a9dede CI: Introduce docs pipeline (#45454) (#45670) 2022-02-21 16:50:16 +02:00
Dimitris Sotirakis
b48b55dc14 Update grabpl (#45520) (#45526)
(cherry picked from commit af1691dbfb)
2022-02-18 11:51:40 +02:00
Andrej Ocenas
d748a2d1e0 Docs: Remove docs publish GitHub action (#45539) 2022-02-17 16:40:23 +01:00
Dimitris Sotirakis
3bcf3f50b7 CI: Remove manual gcloud authentication (#44986) (#45445)
* Remove manual gcloud auth from store-packages

* Update grabpl

(cherry picked from commit 163b570f5d)
2022-02-16 09:54:30 +01:00
Grot (@grafanabot)
c9411b4d57 Alerting: do not unescape external AM label values (#45334) (#45393)
(cherry picked from commit 651bb773db)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2022-02-15 14:08:09 +01:00
Dimitris Sotirakis
2adf2a1584 [v8.3.x] Bug: Update upload-cdn command args (#44979)
* CI: Update `GCP_GRAFANA_UPLOAD_KEY` var name (#44303)

* Update GCP_KEY var name

* Rename GCP_GRAFANA_UPLOAD_KEY for upload-packages

* Update grabpl

(cherry picked from commit f96a6c10c5)

* Update upload-cdn command args (#44966)

(cherry picked from commit 67225d9cfc)
2022-02-15 12:07:07 +00:00
Dimitris Sotirakis
027e345231 CI: Remove grafana/drone-grafana-docker image (#44983) (#45091)
* CI: Remove `grafana/drone-grafana-docker` image (#44983)

* Remove grafana/drone-grafana-docker image

* Rename step

* Remove manual gcloud authentication

(cherry picked from commit 329b1a1ef3903c7e2c3ec1f286f9b0f00fcd023e)

* Add publish command for main

* Fix TAG variable parsing

* Remove shouldSave from main builds

* Reorder dependencies

* Update grabpl version

(cherry picked from commit 5543ad883d)

* Sign drone
2022-02-15 12:04:12 +02:00
Grot (@grafanabot)
26289304f2 Alerting: Fix updating notification channels in legacy (#45302) (#45330)
The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available.

(cherry picked from commit 8bf2e642aa)

Co-authored-by: gotjosh <josue.abreu@gmail.com>
2022-02-11 17:52:01 +01:00
malcolmholmes
85edf78a46 Build: only specify github-token when needed (#45326) (#45329)
(cherry picked from commit 9a7438c720)
2022-02-11 16:25:31 +00:00
Carl Bergquist
588dc422ab make drone (#45318)
Signed-off-by: bergquist <carl.bergquist@gmail.com>

Co-authored-by: malcolmholmes <42545407+malcolmholmes@users.noreply.github.com>
2022-02-11 15:59:08 +01:00
Grot (@grafanabot)
3a95cdd78e Update geomap.md (#43527) (#45268)
(cherry picked from commit d97e74d80f)

Co-authored-by: JJgitGit <JJgitGit@users.noreply.github.com>
2022-02-10 17:50:51 -05:00
Grot (@grafanabot)
76460e790d Alerting: support ok state in alert migration (#45264) (#45266)
(cherry picked from commit c59567a236)

Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
2022-02-10 22:12:47 +01:00
Grot (@grafanabot)
c6e6309bc5 Update latest.json (#45171) (#45172)
(cherry picked from commit 67423f42a5)

Co-authored-by: Shirley <4163034+fridgepoet@users.noreply.github.com>
2022-02-09 18:26:22 +01:00
Grot (@grafanabot)
30d3523138 Release: Bump version to 8.3.6 (#45168)
* "Release: Updated versions in package to 8.3.6"

* Update yarn.lock

Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com>
2022-02-09 17:55:11 +01:00
Grot (@grafanabot)
c79cdf97d9 Tempo: Fix visual service graph bug by setting upper bound for failed arc (#45009) (#45155)
* Fix visual service graph bug by setting upper bound for failed arc calculation

(cherry picked from commit e94b7f45a1)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2022-02-09 15:41:57 +01:00
Grot (@grafanabot)
db4f50171f Provisioning: Ensure that the default value for orgID is set when provisioning datasources to be deleted (#44244) (#45129)
Fixes #44243

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
(cherry picked from commit 8e03541228)

Co-authored-by: maicon <maiconscosta@gmail.com>
2022-02-09 12:49:15 +01:00
Grot (@grafanabot)
2f9f74b221 Rework template docs and add examples (#43178) (#43179)
(cherry picked from commit 8206802f19)

Co-authored-by: David Parrott <stomp.box.yo@gmail.com>
2022-02-09 09:57:56 +01:00
Grot (@grafanabot)
62ff483d13 Alerting: remove error banner when Prometheus ruler is not supported (#44571)
(cherry picked from commit 3d0cff5410)

Co-authored-by: Roy C <crosscent@gmail.com>
2022-02-08 22:27:31 +01:00
Grot (@grafanabot)
4806851ae3 pkg/web: X-Forwarded-For multi-IP handling (#45098) (#45103)
It is conventionally common for the X-Forwarded-For header to contain a
comma-separated list of IP addresses, with each intermediate proxy
adding an additional item as a request passes through it. This change
makes the web framework handle this case appropriately, always selecting
the first item in the list.

(cherry picked from commit 6a2255abe7)

Co-authored-by: sam boyer <sdboyer@grafana.com>
2022-02-08 14:57:43 -05:00
Konrad Lalik
c44af3ca20 Alerting: Improve Contact Points error handling (#44888) (#45093)
* Add 400 and 408 errors handling to display useful error message

* Add generic error handling

* Improve type guard

(cherry picked from commit 1cf48618de)
2022-02-08 17:40:11 +01:00
Grot (@grafanabot)
4a29cf13f0 update snapshots server url (#44563) (#44566)
* update snapshots server url
* update all old references to snapshot.raintank.io

(cherry picked from commit 1e89fc157d)

Co-authored-by: Dan Cech <dcech@grafana.com>
2022-02-08 17:05:20 +01:00
Dimitris Sotirakis
883977bc3a [v8.3.x] Update changelog for 8.3.5 and 7.5.15 (#45078) (#45086)
* Update changelog for 8.3.5 and 7.5.15 (#45078)

(cherry picked from commit b2a8487684)

* Remove 8.4.0-beta1 additions
2022-02-08 16:29:54 +01:00
Dimitris Sotirakis
f42d0b9beb [v8.3.x] Sync security changes (#45067)
* "Release: Updated versions in package to 8.3.5"

* [v8.3.x] Fix for CVE-2022-21702 (#225)

Fix for CVE-2022-21702

* Update yarn.lock for 8.3.5

* resolve conflicts

(cherry picked from commit bb38cfcba4b4f824060ff385d858c63f50b72d74)

* csrf checks for v8.3.5 (#234)

* Fix lint

* Cherry pick e2e test server changes

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
2022-02-08 15:35:38 +01:00
Grot (@grafanabot)
667f884db1 LibraryPanels: Removes save errors for panels changed to library panels (#45033) (#45034)
(cherry picked from commit 9e1cb8c12a)

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2022-02-08 07:13:02 +01:00
achatterjee-grafana
0ac23b0446 Fix link to user API (#44930) 2022-02-05 18:46:05 +01:00
Grot (@grafanabot)
acdf2ec806 Alerting: validate namespace and groupname for Grafana manages and Lotex alerts (#44872) (#44909)
(cherry picked from commit 1680e284e5)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2022-02-04 15:17:22 +01:00
Dimitris Sotirakis
2c033a6540 CI: Make e2e tests depend on binary builds (#44647) (#44833)
* Make e2e test depend on binary builds

* Search for binary in the correct folders

* Remove package file var

* Add ARCH var

(cherry picked from commit 7bb5a5b318)
2022-02-04 10:08:19 +02:00
Grot (@grafanabot)
9cddb216d3 Alerting: Fix alert notification template (#44761) (#44838)
(cherry picked from commit bb88cf683c)

Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
2022-02-03 14:34:41 +01:00
Grot (@grafanabot)
c051c5d423 Alerting: load correct unified alerting tab (#44794) (#44831)
(cherry picked from commit 29b97361f7)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2022-02-03 14:09:12 +01:00
Grot (@grafanabot)
e38d8cd8af Library Elements API GET by name returns array (#44743) (#44751)
* Library Elements API GET by name returns array

Making a GET request to the Library Elements HTTP API `api/library-elements/name/:name` will return an **array** of Library Element objects, but the documentation says it will return a Library Element object.

Example cURL POST request:
`curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer XXXXXXXXXXX" -d @request.json "https://my.grafana.net/api/library-elements/"`

request.json
```json
{
  "model": {},
  "kind": 1,
  "name": "testing description3",
  "uid": "basic3",
  "id": 12345,
  "version": 2
}
```

Example cURL GET request:
`curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer XXXXXXXX" -d @request "https://my/api/library-elements/name/testing description3"`

Example response:
```json
{
    "result": [
        {
            . . .
        }
    ]
}
```

* Library Elements API fix bracket spacing

(cherry picked from commit 925333bfa4)

Co-authored-by: JM <justintmai@gmail.com>
2022-02-02 18:46:03 +01:00
Grot (@grafanabot)
9464ffa86b Fix Discord Webhook URL for invalid template (#44763) (#44772)
This commit fixes an issue where an invalid template for Discord would change the Webhook URL to "" and cause "unsupported protocol scheme" errors.
2022-02-02 14:48:27 +01:00
Konrad Lalik
60a25b4022 Alerting: Split legacy and unified routing configuration (#44641) (#44757)
* Disable add alert menu entry for legacy alerting

* Split legacy and unified routing configuration

* Fix fallback routes configuration

(cherry picked from commit 69e4796504)
2022-02-02 11:37:06 +01:00
Grot (@grafanabot)
6beca4317e [v8.3.x] Logs Panel: fix timestamp parsing for string dates without timezone (#44754)
Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2022-02-02 11:09:07 +01:00
Grot (@grafanabot)
c9a619e364 Tempo: Show error if transformTrace() is passed bad data to parse to JSON (#44684) (#44741)
* Surface errors if transformTrace() is passed bad data to parse

(cherry picked from commit a86d7a5a90)

Co-authored-by: Cat Perry <000.perry@gmail.com>
2022-02-01 23:59:10 +01:00
Connor Lindsey
9b628f4742 [v8.3.x] Tempo: Add request histogram to service graph datalink 2022-02-01 20:07:44 +01:00
Tania B
2bd51b506e add links between encryption docs (#42549) (#44705)
(cherry picked from commit b7e1f5f9ce)

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>
2022-02-01 15:12:21 +02:00
Grot (@grafanabot)
b88f3a909e Add concept about envelope encryption (#41860) (#44703)
* Add concept about envelope-encryption.

* remove comma

* separate warning note into steps

* remove steps from warning note

* Fix lint

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
(cherry picked from commit ed0f3100b3)

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2022-02-01 14:49:27 +02:00
Grot (@grafanabot)
4f2ffc434f Alerting: Fix moving alert rules to a different folder (#44533) (#44644)
* Prevent rule deletion when creation in a new folder fails

* Fix handling duplication of rules when moving between folders

* Add unit test for unique name generator

* Fix typo

(cherry picked from commit 88f3dff6d2)

Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
2022-02-01 10:33:22 +01:00
Grot (@grafanabot)
8f7c031d1d Docs: Add section about limitations alerting in "Time range controls" (#44680) (#44682)
* Added section about syntaxes not supported by Grafana. Also updated missing image name.

* Fixed image name again.

(cherry picked from commit 133e34d52a)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2022-01-31 18:46:33 -05:00
Andrej Ocenas
30d5482a48 Prometheus: Fix some of the alerting queries that use reduce/math operation (#44380) (#44672)
* Prometheus: Dont fill response with nulls for alerting queries

* Refactor based on reviews

(cherry picked from commit 780591cc12)
2022-01-31 13:51:30 -05:00
Grot (@grafanabot)
5af06db660 NodeGraph: Update no data message to show if no nodes (#44483) (#44674)
* Display error if no service graph data is returned

* Remove error message and update node graph no data logic

* Check processed nodes instead of rendered nodes for no data message

* Remove console.log

(cherry picked from commit 4f44ff7ce8)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2022-01-31 19:45:40 +01:00
Grot (@grafanabot)
8343e79f3e Add metrics to ngalert scheduler (#44602) (#44670)
This pull request adds metrics to the ngalert scheduler so we can see how long it takes to evaluate a tick.

(cherry picked from commit 5e2280ceee)

Co-authored-by: George Robinson <george.robinson@grafana.com>
2022-01-31 17:40:19 +00:00
Will Browne
ac8f1b5b6b [v8.3.x] Plugins: Refactor Grafana and Plugin version update checkers (#44662)
* 44529

* fix test
2022-01-31 16:49:29 +01:00
Grot (@grafanabot)
5b37d14b7f Tempo: Display start time in search results as relative time (#44568) (#44661)
* Explore: modify tempo trace start time to human readable format in table output

Signed-off-by: tharun <rajendrantharun@live.com>

* add unit tests

Signed-off-by: tharun <rajendrantharun@live.com>
(cherry picked from commit de1661e877)

Co-authored-by: Tharun Rajendran <rajendrantharun@live.com>
2022-01-31 16:22:46 +01:00
Grot (@grafanabot)
3ce1ca5ac1 Variables: Fix for constant variables in self referencing links (#44631) (#44651)
* Variables: Fix for constant variables in self referencing links

* Chore: adds bettercomment

(cherry picked from commit 5a5f5cacc8)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2022-01-31 14:20:40 +01:00
Karl Persson
cdcbf64b67 quote reserved keyword (#43652) (#44649)
(cherry picked from commit 2425828a0b)
2022-01-31 13:24:29 +01:00
Grot (@grafanabot)
f35f826525 TablePanel: Fix ad-hoc variabes not working on default datasources (#44314) (#44626)
* Dashboards: Fix ad-hoc variabes not working on default datasources

* not async

* Update comment

(cherry picked from commit b1b6205651)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2022-01-31 01:36:39 +01:00
Grot (@grafanabot)
30c7df22ee Docs: Added information about Prometheus write permission requirement. (#44616) (#44618)
* Added note.

* Fixed typo.

(cherry picked from commit d584a27055)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2022-01-28 20:22:32 -05:00
Grot (@grafanabot)
0d469694c6 Tempo: Auto-clear results when changing query type (#44390) (#44596)
* Auto-clear results when changing query type

* Move clear results to function

(cherry picked from commit 45a435ad78)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2022-01-28 08:57:32 -07:00
Grot (@grafanabot)
9ddcb16298 fix: multiple queries in alerting regression (#44585) (#44599)
(cherry picked from commit 26ddeaf3d7)

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
2022-01-28 16:37:55 +01:00
Grot (@grafanabot)
2c1a590752 fix typo (#44564) (#44567)
(cherry picked from commit 7b476c19c2)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2022-01-28 08:42:43 -05:00
Connor Lindsey
a61b1e4285 NodeGraph: fix rendering of node graph in dashboard panel (#44552) (#44558)
Signed-off-by: tharun <rajendrantharun@live.com>
(cherry picked from commit 5721933e4b)

Co-authored-by: Tharun Rajendran <rajendrantharun@live.com>
2022-01-27 19:48:53 +01:00
Grot (@grafanabot)
7c2b1cc9d0 CloudMonitoring: Fix resource labels in query editor (#44550) (#44555)
(cherry picked from commit d3b8fc53aa)

Co-authored-by: Isabella Siu <Isabella.siu@grafana.com>
2022-01-27 11:57:29 -05:00
Grot (@grafanabot)
872727e745 Chore: Remove unused AWS KMS provider's token setting (#44531) (#44548)
(cherry picked from commit 1a9c293984)

Co-authored-by: Tania B <yalyna.ts@gmail.com>
2022-01-27 16:30:57 +01:00
Grot (@grafanabot)
2585ad1ddc TimeSeries: disable fill when fillBelowTo field is missing (#44498) (#44500)
(cherry picked from commit 6533eb9244)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2022-01-27 00:22:37 +01:00
Grot (@grafanabot)
7c9c60b853 Cloud Monitoring: Reduce request size when listing labels (#44365) (#44473)
(cherry picked from commit d1083b9597)

Co-authored-by: Mitsuhiro Tanda <mitsuhiro.tanda@gmail.com>
2022-01-26 12:18:30 +01:00
Grot (@grafanabot)
e016d4eb1b Formatters: speed up toDuration() (#44345) (#44461)
(cherry picked from commit a20894c261)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2022-01-26 02:09:15 -06:00
Grot (@grafanabot)
9727ba084c Tempo: Add time range to tempo search query behind a feature flag (#43811) (#44445)
(cherry picked from commit ef12028a68)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2022-01-25 18:16:32 +01:00
Dimitris Sotirakis
e80194610c Update grabpl version (#44410) (#44412)
(cherry picked from commit ef35cb5318)
2022-01-25 10:00:06 +01:00
Grot (@grafanabot)
a2f97a68c6 QueryEditors: Restore query editor margin to what old value (#44384) (#44409)
(cherry picked from commit 566556fea2)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2022-01-25 09:39:09 +01:00
Carl Bergquist
8aa31fd2d6 Update dependency github.com/influxdata/influxdb-client-go/v2 to v2.6.0 (#44225) (#44295)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
(cherry picked from commit 3d865a3687)

Co-authored-by: Dave Henderson <dhenderson@gmail.com>
2022-01-24 18:29:20 +01:00
Grot (@grafanabot)
eccd87a564 Explore: show scalar data result in a table instead of graph (#44362) (#44366)
Signed-off-by: tharun <rajendrantharun@live.com>
(cherry picked from commit 732c2ebb37)

Co-authored-by: Tharun Rajendran <rajendrantharun@live.com>
2022-01-24 10:37:24 +01:00
Grot (@grafanabot)
f5abd72785 TimeSeries: prevent threshold line color from affecting grid lines (#44337) (#44346)
(cherry picked from commit 79ec3ec54c)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2022-01-22 00:39:14 +01:00
Grot (@grafanabot)
db1b31d542 docs: Fix URL for Github callback in OAuth. (#41122) (#44332)
(cherry picked from commit 5d0bc9e933)

Co-authored-by: Jason Walton <github@lucid.thedreaming.org>
2022-01-21 12:03:36 -05:00
Grot (@grafanabot)
7fd39889fa AzureMonitor: Allow template variables in the subscription field (#44312) (#44331)
(cherry picked from commit addeba7f05)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2022-01-21 17:02:49 +01:00
Grot (@grafanabot)
64fc2ecb0e Docs: add API pages to HTTP API list (#42997) (#44328)
* add API pages to HTTP API list

* fix capitalization of page names

(cherry picked from commit 8a21385481)

Co-authored-by: JM <justintmai@gmail.com>
2022-01-21 10:31:55 -05:00
Grot (@grafanabot)
42668a5e89 Alerting: recognize Cortex datasources correctly in the frontend (#44316) (#44325)
* Alerting: always use msg field for user facing errors

* fix: revert front-end Cortex detection

Co-authored-by: gillesdemey <gilles.de.mey@gmail.com>
(cherry picked from commit 8ee3f59cd4)

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
2022-01-21 16:03:55 +01:00
Armand Grillet
c335538765 Create only one folder per dashboard with ACL (#44317)
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
2022-01-21 14:59:18 +01:00
Grot (@grafanabot)
3d453a6104 Only modify table spacing (#44313) (#44320)
(cherry picked from commit e1af78954f)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-01-21 14:52:47 +01:00
Dimitris Sotirakis
918cb580e8 E2E: Rename end-to-end-tests-server to grafana-server (#44249) (#44282)
* Rename to grafana-server / move scripts into new directory

* Change grafana-server step command

* Change scripts paths

* Use test grabpl version

* Update run-suite script

* Further name updates

* Update grabpl version

* Update contribute/style-guides/e2e-core.md

Co-authored-by: Maria Alexandra <239999+axelavargas@users.noreply.github.com>

Co-authored-by: Maria Alexandra <239999+axelavargas@users.noreply.github.com>
(cherry picked from commit 22eb2df602)
2022-01-21 11:09:31 +02:00
Dominik Prokop
6863f49bd0 [v8.3.x] Cursor sync: Apply the settings without saving the dashboard (#44270) (#44279)
* Cursor sync: Apply the settings without saving the dashboard

* Remove unnecessary code

* Lint god damn

(cherry picked from commit 7bf25f62e1)
2022-01-21 09:27:15 +01:00
Grot (@grafanabot)
2c502f4b36 MixedDatasource: Fixes infinite loop with empty query panel (#44265) (#44268)
* MixedDatasource: Fixes infinite loop with empty query panel

(cherry picked from commit a728e9b4dd)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2022-01-20 13:49:05 +00:00
Grot (@grafanabot)
05ccdac63a TablePanel: Makes footer not overlap table content (#44210) (#44247)
(cherry picked from commit 9f0889c402)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2022-01-20 01:37:44 -08:00
Grot (@grafanabot)
5ab2ebade3 DashboardSettings: Prevent Dashboard permissions from linking to folder permissions when user does not have sufficient permissions (#44212) (#44223)
* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* add tests

* fix up

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
(cherry picked from commit 9f97f05fcc)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2022-01-20 09:29:35 +00:00
Dimitris Sotirakis
bce40bfcf1 [v8.3.x] Remove test-release pipelines (#44220) (#44228)
* Remove test-release pipelines (#44220)

(cherry picked from commit 27fbe82bf1)

* Remove accidentally added lines upon cherry-picking

* Remove unused var
2022-01-20 00:02:56 +02:00
Grot (@grafanabot)
5bc1a0ad06 docs: Move password information on password smtp section (#42370) (#44229)
*What this PR does / why we need it:*

The password information is on [enabled section](https://grafana.com/docs/grafana/latest/administration/configuration/#enabled), I move it on [password section](https://grafana.com/docs/grafana/latest/administration/configuration/#password-1).

(cherry picked from commit f6b385f0ca)

Co-authored-by: kosssi <github@fafaru.com>
2022-01-19 14:29:05 -05:00
Grot (@grafanabot)
a23bacc3e2 Dashboard: Prevent Mixed datasources using the test datasource crashing (#44128) (#44215)
* Special case mixed datasources... :/

* Revert "Special case mixed datasources... :/"

This reverts commit dd0e3ea4a8.

* Ensure testdata persists datasource when switching scenario

* Add a unit test to prevent regressions

* kick drone

(cherry picked from commit d4d306d825)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-01-19 14:19:45 +01:00
Dimitris Sotirakis
67a3609cb8 [v8.3.x] CI: Release automations fixes (#44194)
* Change bucket

* Make publish-packages depend on publish-artifacts pipeline

* Change bucket for windows .msi installers
2022-01-19 15:13:16 +02:00
Gleb Goncharov
f63ec0f43d Fix WebSockets configuration for Nginx (#44148) 2022-01-19 15:47:01 +03:00
Dimitris Sotirakis
42bffe2310 [v8.3.x] Update changelog and lockfile for 8.3.4 (#44168)
* ReleaseNotes: Updated changelog and release notes for 8.3.4 (#218)

(cherry picked from commit d5a5360328)

Co-authored-by: grafanabot <bot@grafana.com>
(cherry picked from commit de38ed8d67985c2da189007d44eaa17769c772ab)
(cherry picked from commit c39413645f)

* "Release: Updated versions in package to 8.3.4" (#216)

(cherry picked from commit 39d66dcc8af875313c99beda2f46fb9c6d5443fb)
(cherry picked from commit 82a2acf00b)

* Update lockfile

(cherry picked from commit a551d74b11)

Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com>
2022-01-18 17:09:27 +01:00
Dimitris Sotirakis
d3756d38ee [v8.3.x] GetUserInfo: return an error if no user was found (#211) (#44166)
* return an error if no user was found

* update condition

(cherry picked from commit ec87405543fe8032a0c2769d3ec97536b7a749ef)

Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
2022-01-18 16:53:03 +01:00
Dimitris Sotirakis
db94117d84 Replace docker-puppeteer with the one in grafana dockerhub repo (#44145) (#44147)
(cherry picked from commit 118cc0d735)
2022-01-18 11:43:05 +00:00
Grot (@grafanabot)
2b967ad8ec Circleci: remove unused config (#44136) (#44141)
CircleCI is being triggered but there are no workflows being executed.
CI is driven by Drone.

(cherry picked from commit bc74d44cee)

Co-authored-by: Javier Palomo <javier.palomo@grafana.com>
2022-01-18 09:18:15 +00:00
504 changed files with 5131 additions and 7408 deletions

View File

@@ -1,11 +0,0 @@
version: 2.1
jobs:
build:
docker:
- image: alpine:3.7
steps:
- run:
name: The First Step
command: |
echo 'Fake step!'

View File

@@ -6,7 +6,8 @@
load('scripts/drone/pipelines/pr.star', 'pr_pipelines')
load('scripts/drone/pipelines/main.star', 'main_pipelines')
load('scripts/drone/pipelines/release.star', 'release_pipelines', 'test_release_pipelines', 'publish_image_pipelines', 'publish_artifacts_pipelines', 'publish_npm_pipelines', 'publish_packages_pipeline')
load('scripts/drone/pipelines/docs.star', 'docs_pipelines')
load('scripts/drone/pipelines/release.star', 'release_pipelines', 'publish_image_pipelines', 'publish_artifacts_pipelines', 'publish_npm_pipelines', 'publish_packages_pipeline')
load('scripts/drone/version.star', 'version_branch_pipelines')
load('scripts/drone/pipelines/cron.star', 'cronjobs')
load('scripts/drone/vault.star', 'secrets')
@@ -17,4 +18,4 @@ def main(ctx):
publish_image_pipelines('public') + publish_image_pipelines('security') + \
publish_artifacts_pipelines('security') + publish_artifacts_pipelines('public') + \
publish_npm_pipelines('public') + publish_packages_pipeline() + \
test_release_pipelines() + version_branch_pipelines() + cronjobs(edition=edition) + secrets()
version_branch_pipelines() + cronjobs(edition=edition) + secrets()

2364
.drone.yml

File diff suppressed because it is too large Load Diff

View File

@@ -6,5 +6,6 @@ devenv
data
dist
e2e/tmp
scripts/grafana-server/tmp
public/lib/monaco
deployment_tools_config.json

View File

@@ -4,7 +4,9 @@ on:
inputs:
version:
required: true
default: '7.x.x'
default: '8.x.x'
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
jobs:
main:
runs-on: ubuntu-latest
@@ -33,12 +35,6 @@ jobs:
echo "::set-output name=branch_name::v${{steps.regex-match.outputs.group1}}"
echo "::set-output name=branch_exist::$(git ls-remote --heads https://github.com/grafana/grafana.git v${{ steps.regex-match.outputs.group1 }}.x | wc -l)"
- name: Check input version is aligned with branch(not main)
if: steps.intermedia.outputs.branch_exist != '0' && !contains(steps.intermedia.outputs.short_ref, steps.intermedia.outputs.branch_name)
run: |
echo " You need to run the workflow on branch v${{steps.regex-match.outputs.group1}}.x
exit 1
- name: Check input version is aligned with branch(main)
if: steps.intermedia.outputs.branch_exist == '0' && !contains(steps.intermedia.outputs.short_ref, 'main')
run: |
@@ -55,7 +51,7 @@ jobs:
ref: main
- uses: actions/setup-node@v2.4.1
with:
node-version: '14'
node-version: '16'
- name: Install Actions
run: npm install --production --prefix ./actions
- name: Run bump version

View File

@@ -0,0 +1,30 @@
name: "publish-technical-documentation-next"
on:
push:
branches:
- "main"
paths:
- "docs/sources/**"
workflow_dispatch:
jobs:
sync:
if: "github.repository == 'grafana/grafana'"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Grafana repo"
uses: "actions/checkout@v3"
- name: "Clone website-sync Action"
run: "git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.GH_BOT_ACCESS_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync"
- name: "Publish to website repository (next)"
uses: "./.github/actions/website-sync"
id: "publish-next"
with:
repository: "grafana/website"
branch: "master"
host: "github.com"
github_pat: "${{ secrets.GH_BOT_ACCESS_TOKEN }}"
source_folder: "docs/sources"
target_folder: "content/docs/grafana/next"

View File

@@ -0,0 +1,60 @@
name: "publish-technical-documentation-release"
on:
push:
branches:
- v[0-9]+.[0-9]+.x
tags:
- v[0-9]+.[0-9]+.[0-9]+
paths:
- "docs/sources/**"
workflow_dispatch:
jobs:
sync:
if: "github.repository == 'grafana/grafana'"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout Grafana repo"
uses: "actions/checkout@v3"
with:
fetch-depth: 0
- name: "Checkout Actions library"
uses: "actions/checkout@v3"
with:
repository: "grafana/grafana-github-actions"
path: "./actions"
- name: "Install Actions from library"
run: "npm install --production --prefix ./actions"
- name: "Determine if there is a matching release tag"
id: "has-matching-release-tag"
uses: "./actions/has-matching-release-tag"
with:
ref_name: "${{ github.ref_name }}"
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$"
- name: "Determine technical documentation version"
if: "steps.has-matching-release-tag.outputs.bool == 'true'"
uses: "./actions/docs-target"
id: "target"
with:
ref_name: "${{ github.ref_name }}"
- name: "Clone website-sync Action"
if: "steps.has-matching-release-tag.outputs.bool == 'true'"
run: "git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.GH_BOT_ACCESS_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync"
- name: "Publish to website repository (release)"
if: "steps.has-matching-release-tag.outputs.bool == 'true'"
uses: "./.github/actions/website-sync"
id: "publish-release"
with:
repository: "grafana/website"
branch: "master"
host: "github.com"
github_pat: "${{ secrets.GH_BOT_ACCESS_TOKEN }}"
source_folder: "docs/sources"
target_folder: "content/docs/grafana/${{ steps.target.outputs.target }}"

View File

@@ -1,49 +0,0 @@
name: publish_docs
on:
push:
branches:
- v8.3.x
paths:
- 'docs/sources/**'
- 'packages/grafana-*/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.GH_BOT_ACCESS_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync
- name: generate-packages-docs
uses: actions/setup-node@v2.4.1
id: generate-docs
with:
node-version: '14'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2.1.6
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-
- run: yarn install --immutable
- run: ./scripts/ci-reference-docs-build.sh
- name: publish-to-git
uses: ./.github/actions/website-sync
id: publish
with:
repository: grafana/website
branch: master
host: github.com
github_pat: '${{ secrets.GH_BOT_ACCESS_TOKEN }}'
source_folder: docs/sources
target_folder: content/docs/grafana/latest
allow_no_changes: 'true'
- shell: bash
run: |
test -n "${{ steps.publish.outputs.commit_hash }}"
test -n "${{ steps.publish.outputs.working_directory }}"

4
.gitignore vendored
View File

@@ -13,6 +13,7 @@ public/dist/tsconfig.tsbuildinfo
/emails/dist
/reports
/e2e/tmp
/scripts/grafana-server/tmp
vendor/
/docs/menu.yaml
/requests
@@ -137,6 +138,9 @@ compilation-stats.json
!/e2e/**/screenshots/expected/*
/e2e/**/videos/*
# grafana server
/scripts/grafana-server/server.log
# a11y tests
/pa11y-ci-results.json
/pa11y-ci-report

View File

@@ -7,6 +7,7 @@ public/vendor/
vendor/
/data/
e2e/tmp
scripts/grafana-server/tmp
public/build/
public/sass/*.generated.scss
devenv/

View File

@@ -1,3 +1,86 @@
<!-- 8.3.7 START -->
# 8.3.7 (2022-03-01)
### Bug fixes
- **Provisioning:** Ensure that the default value for orgID is set when provisioning datasources to be deleted. [#44244](https://github.com/grafana/grafana/pull/44244), [@filewalkwithme](https://github.com/filewalkwithme)
<!-- 8.3.7 END -->
<!-- 8.3.6 START -->
# 8.3.6 (2022-02-09)
### Features and enhancements
- **Cloud Monitoring:** Reduce request size when listing labels. [#44365](https://github.com/grafana/grafana/pull/44365), [@mtanda](https://github.com/mtanda)
- **Explore:** Show scalar data result in a table instead of graph. [#44362](https://github.com/grafana/grafana/pull/44362), [@tharun208](https://github.com/tharun208)
- **Snapshots:** Updates the default external snapshot server URL. [#44563](https://github.com/grafana/grafana/pull/44563), [@DanCech](https://github.com/DanCech)
- **Table:** Makes footer not overlap table content. [#44210](https://github.com/grafana/grafana/pull/44210), [@dprokop](https://github.com/dprokop)
- **Tempo:** Add request histogram to service graph datalink. [#44671](https://github.com/grafana/grafana/pull/44671), [@connorlindsey](https://github.com/connorlindsey)
- **Tempo:** Add time range to tempo search query behind a feature flag. [#43811](https://github.com/grafana/grafana/pull/43811), [@connorlindsey](https://github.com/connorlindsey)
- **Tempo:** Auto-clear results when changing query type. [#44390](https://github.com/grafana/grafana/pull/44390), [@connorlindsey](https://github.com/connorlindsey)
- **Tempo:** Display start time in search results as relative time. [#44568](https://github.com/grafana/grafana/pull/44568), [@tharun208](https://github.com/tharun208)
### Bug fixes
- **CloudMonitoring:** Fix resource labels in query editor. [#44550](https://github.com/grafana/grafana/pull/44550), [@iwysiu](https://github.com/iwysiu)
- **Cursor sync:** Apply the settings without saving the dashboard. [#44270](https://github.com/grafana/grafana/pull/44270), [@dprokop](https://github.com/dprokop)
- **LibraryPanels:** Fix for Error while cleaning library panels. [#45033](https://github.com/grafana/grafana/pull/45033), [@hugohaggmark](https://github.com/hugohaggmark)
- **Logs Panel:** fix timestamp parsing for string dates without timezone. [#44664](https://github.com/grafana/grafana/pull/44664), [@Elfo404](https://github.com/Elfo404)
- **Prometheus:** Fix some of the alerting queries that use reduce/math operation. [#44380](https://github.com/grafana/grafana/pull/44380), [@ivanahuckova](https://github.com/ivanahuckova)
- **TablePanel:** Fix ad-hoc variables not working on default datasources. [#44314](https://github.com/grafana/grafana/pull/44314), [@joshhunt](https://github.com/joshhunt)
- **Text Panel:** Fix alignment of elements. [#44313](https://github.com/grafana/grafana/pull/44313), [@ashharrison90](https://github.com/ashharrison90)
- **Variables:** Fix for constant variables in self referencing links. [#44631](https://github.com/grafana/grafana/pull/44631), [@hugohaggmark](https://github.com/hugohaggmark)
<!-- 8.3.6 END -->
<!-- 8.3.5 START -->
# 8.3.5 (2022-02-08)
- **Security**: Fixes CVE-2022-21702. For more information, see our [blog](https://grafana.com/blog/2022/02/08/grafana-7.5.15-and-8.3.5-released-with-moderate-severity-security-fixes/)
- **Security**: Fixes CVE-2022-21703. For more information, see our [blog](https://grafana.com/blog/2022/02/08/grafana-7.5.15-and-8.3.5-released-with-moderate-severity-security-fixes/)
- **Security**: Fixes CVE-2022-21713. For more information, see our [blog](https://grafana.com/blog/2022/02/08/grafana-7.5.15-and-8.3.5-released-with-moderate-severity-security-fixes/)
<!-- 8.3.5 END -->
<!-- 8.3.4 START -->
# 8.3.4 (2022-01-17)
### Features and enhancements
- **Alerting:** Allow configuration of non-ready alertmanagers. [#43063](https://github.com/grafana/grafana/pull/43063), [@alexweav](https://github.com/alexweav)
- **Alerting:** Allow customization of Google chat message. [#43568](https://github.com/grafana/grafana/pull/43568), [@alexweav](https://github.com/alexweav)
- **Alerting:** Allow customization of Google chat message (#43568). [#43723](https://github.com/grafana/grafana/pull/43723), [@alexweav](https://github.com/alexweav)
- **AppPlugins:** Support app plugins with only default nav. [#43016](https://github.com/grafana/grafana/pull/43016), [@torkelo](https://github.com/torkelo)
- **InfluxDB:** InfluxQL: query editor: skip fields in metadata queries. [#42543](https://github.com/grafana/grafana/pull/42543), [@gabor](https://github.com/gabor)
- **Postgres/MySQL/MSSQL:** Cancel in-flight SQL query if user cancels query in grafana. [#43890](https://github.com/grafana/grafana/pull/43890), [@mdvictor](https://github.com/mdvictor)
- **Prometheus:** Forward oauth tokens after prometheus datasource migration. [#43686](https://github.com/grafana/grafana/pull/43686), [@MasslessParticle](https://github.com/MasslessParticle)
### Bug fixes
- **Azure Monitor:** Bug fix for variable interpolations in metrics dropdowns. [#43251](https://github.com/grafana/grafana/pull/43251), [@sarahzinger](https://github.com/sarahzinger)
- **Azure Monitor:** Improved error messages for variable queries. [#43213](https://github.com/grafana/grafana/pull/43213), [@sunker](https://github.com/sunker)
- **CloudMonitoring:** Fixes broken variable queries that use group bys. [#43914](https://github.com/grafana/grafana/pull/43914), [@sunker](https://github.com/sunker)
- **Configuration:** You can now see your expired API keys if you have no active ones. [#42452](https://github.com/grafana/grafana/pull/42452), [@ashharrison90](https://github.com/ashharrison90)
- **Elasticsearch:** Fix handling multiple datalinks for a single field. [#44029](https://github.com/grafana/grafana/pull/44029), [@Elfo404](https://github.com/Elfo404)
- **Export:** Fix error being thrown when exporting dashboards using query variables that reference the default datasource. [#44034](https://github.com/grafana/grafana/pull/44034), [@ashharrison90](https://github.com/ashharrison90)
- **ImportDashboard:** Fixes issue with importing dashboard and name ending up in uid. [#43451](https://github.com/grafana/grafana/pull/43451), [@torkelo](https://github.com/torkelo)
- **Login:** Page no longer overflows on mobile. [#43739](https://github.com/grafana/grafana/pull/43739), [@ashharrison90](https://github.com/ashharrison90)
- **Plugins:** Set backend metadata property for core plugins. [#43349](https://github.com/grafana/grafana/pull/43349), [@marefr](https://github.com/marefr)
- **Prometheus:** Fill missing steps with null values. [#43622](https://github.com/grafana/grafana/pull/43622), [@ivanahuckova](https://github.com/ivanahuckova)
- **Prometheus:** Fix interpolation of $\_\_rate_interval variable. [#44035](https://github.com/grafana/grafana/pull/44035), [@ivanahuckova](https://github.com/ivanahuckova)
- **Prometheus:** Interpolate variables with curly brackets syntax. [#42927](https://github.com/grafana/grafana/pull/42927), [@ivanahuckova](https://github.com/ivanahuckova)
- **Prometheus:** Respect the http-method data source setting. [#42753](https://github.com/grafana/grafana/pull/42753), [@gabor](https://github.com/gabor)
- **Table:** Fixes issue with field config applied to wrong fields when hiding columns. [#43376](https://github.com/grafana/grafana/pull/43376), [@torkelo](https://github.com/torkelo)
- **Toolkit:** Fix bug with rootUrls not being properly parsed when signing a private plugin. [#43014](https://github.com/grafana/grafana/pull/43014), [@dessen-xu](https://github.com/dessen-xu)
- **Variables:** Fix so data source variables are added to adhoc configuration. [#43881](https://github.com/grafana/grafana/pull/43881), [@hugohaggmark](https://github.com/hugohaggmark)
### Plugin development fixes & changes
- **Toolkit:** Revert build config so tslib is bundled with plugins to prevent plugins from crashing. [#43556](https://github.com/grafana/grafana/pull/43556), [@mckn](https://github.com/mckn)
<!-- 8.3.4 END -->
<!-- 8.3.3 START -->
# 8.3.3 (2021-12-10)
@@ -29,7 +112,7 @@
# 8.3.2 (2021-12-10)
- **Security**: Fixes CVE-2021-43813 and CVE-2021-PENDING. For more information, see our [blog](https://grafana.com/blog/2021/12/10/grafana-8.3.2-and-7.5.12-released-with-moderate-severity-security-fix/
- **Security**: Fixes CVE-2021-43813 and CVE-2021-43815. For more information, see our [blog](https://grafana.com/blog/2021/12/10/grafana-8.3.2-and-7.5.12-released-with-moderate-severity-security-fix/
<!-- 8.3.2 END -->
@@ -213,6 +296,14 @@ The access mode "browser" is deprecated in the following data sources and will b
- **grafana/ui:** Enable slider marks display. [#41275](https://github.com/grafana/grafana/pull/41275), [@dprokop](https://github.com/dprokop)
<!-- 8.2.7 START -->
# 8.2.7 (2021-12-07)
- **Security**: Fixes CVE-2021-43798. For more information, see our [blog](https://grafana.com/blog/2021/12/07/grafana-8.3.1-8.2.7-8.1.8-and-8.0.7-released-with-high-severity-security-fix/)
<!-- 8.2.7 END -->
<!-- 8.2.6 START -->
# 8.2.6 (2021-12-02)
@@ -492,6 +583,14 @@ Panel queries and/or annotation queries that used more than one statistic will b
<!-- 8.2.0-beta1 END -->
<!-- 8.1.8 START -->
# 8.1.8 (2021-12-07)
- **Security**: Fixes CVE-2021-43798. For more information, see our [blog](https://grafana.com/blog/2021/12/07/grafana-8.3.1-8.2.7-8.1.8-and-8.0.7-released-with-high-severity-security-fix/)
<!-- 8.1.8 END -->
<!-- 8.1.7 START -->
# 8.1.7 (2021-10-06)
@@ -766,6 +865,14 @@ Issue [#33879](https://github.com/grafana/grafana/issues/33879)
<!-- 8.1.0-beta1 END -->
<!-- 8.0.7 START -->
# 8.0.7 (2021-12-07)
- **Security**: Fixes CVE-2021-43798. For more information, see our [blog](https://grafana.com/blog/2021/12/07/grafana-8.3.1-8.2.7-8.1.8-and-8.0.7-released-with-high-severity-security-fix/)
<!-- 8.0.7 END -->
<!-- 8.0.6 START -->
# 8.0.6 (2021-07-14)
@@ -1197,6 +1304,24 @@ Issue [#33352](https://github.com/grafana/grafana/issues/33352)
- **AGPL License:** Update license from Apache 2.0 to the GNU Affero General Public License (AGPL). [#33184](https://github.com/grafana/grafana/pull/33184)
<!-- 8.0.0-beta1 END -->
<!-- 7.5.15 START -->
# 7.5.15 (2022-02-08)
- **Security**: Fixes CVE-2022-21702. For more information, see our [blog](https://grafana.com/blog/2022/02/08/grafana-7.5.15-and-8.3.5-released-with-moderate-severity-security-fixes/)
- **Security**: Fixes CVE-2022-21703. For more information, see our [blog](https://grafana.com/blog/2022/02/08/grafana-7.5.15-and-8.3.5-released-with-moderate-severity-security-fixes/)
- **Security**: Fixes CVE-2022-21713. For more information, see our [blog](https://grafana.com/blog/2022/02/08/grafana-7.5.15-and-8.3.5-released-with-moderate-severity-security-fixes/)
<!-- 7.5.15 END -->
<!-- 7.5.13 START -->
# 7.5.13 (2022-01-18)
### Bug fixes
- **[v7.5.x] Alerting:** Fix NoDataFound for alert rules using AND operator (#41305). [#44066](https://github.com/grafana/grafana/pull/44066), [@armandgrillet](https://github.com/armandgrillet)
<!-- 7.5.13 END -->
<!-- 7.5.11 START -->

View File

@@ -20,7 +20,7 @@ COPY emails emails
ENV NODE_ENV production
RUN yarn build
FROM golang:1.17.6-alpine3.15 as go-builder
FROM golang:1.17.8-alpine3.15 as go-builder
RUN apk add --no-cache gcc g++ make

View File

@@ -21,7 +21,7 @@ COPY emails emails
ENV NODE_ENV production
RUN yarn build
FROM golang:1.17.6 AS go-builder
FROM golang:1.17.8 AS go-builder
WORKDIR /src/grafana

View File

@@ -288,8 +288,8 @@ content_security_policy_template = """script-src 'self' 'unsafe-eval' 'unsafe-in
[snapshots]
# snapshot sharing options
external_enabled = true
external_snapshot_url = https://snapshots-origin.raintank.io
external_snapshot_name = Publish to snapshot.raintank.io
external_snapshot_url = https://snapshots.raintank.io
external_snapshot_name = Publish to snapshots.raintank.io
# Set to true to enable this Grafana instance act as an external snapshot server and allow unauthenticated requests for
# creating and deleting snapshots.
@@ -957,6 +957,8 @@ container_name =
server_url =
# If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.
callback_url =
# An auth token that will be sent to and verified by the renderer. The renderer will deny any request without an auth token matching the one configured on the renderer side.
renderer_token = -
# Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
# which this setting can help protect against by only allowing a certain amount of concurrent requests.
concurrent_render_request_limit = 30

View File

@@ -282,8 +282,8 @@
[snapshots]
# snapshot sharing options
;external_enabled = true
;external_snapshot_url = https://snapshots-origin.raintank.io
;external_snapshot_name = Publish to snapshot.raintank.io
;external_snapshot_url = https://snapshots.raintank.io
;external_snapshot_name = Publish to snapshots.raintank.io
# Set to true to enable this Grafana instance act as an external snapshot server and allow unauthenticated requests for
# creating and deleting snapshots.
@@ -931,6 +931,8 @@
;server_url =
# If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.
;callback_url =
# An auth token that will be sent to and verified by the renderer. The renderer will deny any request without an auth token matching the one configured on the renderer side.
;renderer_token = -
# Concurrent render request limit affects when the /render HTTP endpoint is used. Rendering many images at the same time can overload the server,
# which this setting can help protect against by only allowing a certain amount of concurrent requests.
;concurrent_render_request_limit = 30

View File

@@ -16,8 +16,8 @@ BASE_URL=http://172.0.10.2:3333 yarn e2e
The above commands use some utils scripts under [_\<repo-root>/e2e_](../../e2e) that can also be used for more control.
- `./e2e/start-server` This creates a fresh new grafana server working dir, setup's config and starts the server. It will also kill any previously started server that is still running using pid file at _\<repo-root>/e2e/tmp/pid_.
- `./e2e/wait-for-grafana` waits for `$HOST` and `$PORT` to be available. Per default localhost and 3001.
- `./scripts/grafana-server/start-server` This creates a fresh new grafana server working dir, setup's config and starts the server. It will also kill any previously started server that is still running using pid file at _\<repo-root>/scripts/grafana-server/tmp/pid_.
- `./scripts/grafana-server/wait-for-grafana` waits for `$HOST` and `$PORT` to be available. Per default localhost and 3001.
- `./e2e/run-suite <debug|dev|noarg>` Starts cypress in different modes.
## Test suites

View File

@@ -2,7 +2,7 @@
title = "Grafana documentation"
description = "Guides, Installation and Feature Documentation"
keywords = ["grafana", "installation", "documentation"]
aliases = ["/docs/grafana/v1.1", "/docs/grafana/latest/guides/reference/admin", "/docs/grafana/v3.1"]
aliases = ["/docs/grafana/v1.1", "/docs/grafana/v8.3/guides/reference/admin", "/docs/grafana/v3.1"]
+++
# Grafana documentation

View File

@@ -2,7 +2,7 @@
title = "Configuration"
description = "Configuration documentation"
keywords = ["grafana", "configuration", "documentation"]
aliases = ["/docs/grafana/latest/installation/configuration/"]
aliases = ["/docs/grafana/v8.3/installation/configuration/"]
weight = 150
+++
@@ -565,11 +565,11 @@ Set to `false` to disable external snapshot publish endpoint (default `true`).
### external_snapshot_url
Set root URL to a Grafana instance where you want to publish external snapshots (defaults to https://snapshots-origin.raintank.io).
Set root URL to a Grafana instance where you want to publish external snapshots (defaults to https://snapshots.raintank.io).
### external_snapshot_name
Set name for external snapshot button. Defaults to `Publish to snapshot.raintank.io`.
Set name for external snapshot button. Defaults to `Publish to snapshots.raintank.io`.
### public_mode
@@ -869,8 +869,6 @@ Email server settings.
Enable this to allow Grafana to send email. Default is `false`.
If the password contains `#` or `;`, then you have to wrap it with triple quotes. Example: """#password;"""
### host
Default is `localhost:25`.
@@ -881,7 +879,7 @@ In case of SMTP auth, default is `empty`.
### password
In case of SMTP auth, default is `empty`.
In case of SMTP auth, default is `empty`. If the password contains `#` or `;`, then you have to wrap it with triple quotes. Example: """#password;"""
### cert_file

View File

@@ -2,7 +2,7 @@
title = "Configure Grafana Docker image"
description = "Guide for configuring the Grafana Docker image"
keywords = ["grafana", "configuration", "documentation", "docker"]
aliases = ["/docs/grafana/latest/installation/configure-docker/"]
aliases = ["/docs/grafana/v8.3/installation/configure-docker/"]
weight = 200
+++

View File

@@ -12,4 +12,6 @@ Grafanas database contains secrets, which are used to query data sources, sen
Grafana encrypts these secrets before they are written to the database, by using a symmetric-key encryption algorithm called Advanced Encryption Standard (AES), and using a [secret key]({{< relref "../administration/configuration/#secret_key" >}}) that you can change when you configure a new Grafana instance.
You can also use envelope encryption, which complements a KMS integration by adding a layer of indirection to the encryption process.
You can choose to use [envelope encryption]({{< relref "./envelope-encryption.md" >}}), which complements a [KMS integration]({{< relref "../enterprise/kms-integration/_index.md" >}}) in Grafana Enterprise by adding a layer of indirection to the encryption process.
In Grafana Enterprise, you can also choose to [encrypt secrets in AES-GCM mode]({{< relref "../administration/database-encryption-enterprise.md" >}}) instead of AES-CFB.

View File

@@ -0,0 +1,21 @@
+++
title = "Envelope encryption"
description = "Envelope encryption"
keywords = ["grafana", "envelope encryption", "documentation"]
aliases = [""]
weight = 430
+++
# Envelope encryption
In Grafana, you can choose to use envelope encryption. Instead of
encrypting all secrets with a single key, Grafana uses a set of keys
called data encryption keys (DEKs) to encrypt them. These data
encryption keys are themselves encrypted with a single key encryption
key (KEK).
To turn on envelope encryption, add the term `envelopeEncryption` to the list of feature toggles in your [Grafana configuration]({{< relref "../administration/configuration/#feature_toggles" >}}).
> **Note:** Avoid turning off envelope encryption once you have turned it on, and back up your database before turning it on for the first time. If you turn envelope encryption on, create new secrets or update your existing secrets (for example, by creating a new data source or alert notification channel), and then turn envelope encryption off, then those data sources, alert notification channels, and other resources using envelope encryption will stop working and you will experience errors. This is because the secrets encrypted with envelope encryption cannot be decrypted or used by Grafana when envelope encryption is turned off.
Refer to [Database encryption]({{< relref "../administration/database-encryption.md" >}}) to learn more about how Grafana encrypts secrets in the database.

View File

@@ -1,6 +1,6 @@
+++
title = "Preferences"
aliases =["/docs/grafana/latest/administration/preferences.md"]
aliases =["/docs/grafana/v8.3/administration/preferences.md"]
weight = 50
+++

View File

@@ -8,7 +8,7 @@ weight = 100
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.
{{< docs/shared "preferences/some-tasks-require-permissions.md" >}}
{{< docs/shared lookup="preferences/some-tasks-require-permissions.md" source="grafana" version="<GRAFANA VERSION>" >}}
## Change organization name
@@ -19,7 +19,7 @@ Grafana server administrators and organization administrators can change organiz
Follow these instructions if you are a Grafana Server Admin.
{{< docs/list >}}
{{< docs/shared "manage-users/view-server-org-list.md" >}}
{{< docs/shared lookup="manage-users/view-server-org-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
1. In the organization list, click the name of the organization that you want to change.
1. In **Name**, enter the new organization name.
@@ -31,7 +31,7 @@ Follow these instructions if you are a Grafana Server Admin.
If you are an Organization Admin, follow these steps:
{{< docs/list >}}
{{< docs/shared "preferences/org-preferences-list.md" >}}
{{< docs/shared lookup="preferences/org-preferences-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
1. In **Organization name**, enter the new name.
1. Click **Update organization name**.

View File

@@ -9,7 +9,7 @@ weight = 200
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.
{{< docs/shared "preferences/some-tasks-require-permissions.md" >}}
{{< docs/shared lookup="preferences/some-tasks-require-permissions.md" source="grafana" version="<GRAFANA VERSION>" >}}
## Theme options
@@ -42,8 +42,8 @@ To see what the current settings are, refer to [View server settings]({{< relref
Organization administrators can change the UI theme for all users in an organization.
{{< docs/list >}}
{{< docs/shared "preferences/org-preferences-list.md" >}}
{{< docs/shared "preferences/select-ui-theme-list.md" >}}
{{< docs/shared lookup="preferences/org-preferences-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="preferences/select-ui-theme-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< /docs/list >}}
## Change team UI theme
@@ -51,10 +51,10 @@ Organization administrators can change the UI theme for all users in an organiza
Organization and team administrators can change the UI theme for all users in a team.
{{< docs/list >}}
{{< docs/shared "manage-users/view-team-list.md" >}}
{{< docs/shared lookup="manage-users/view-team-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
1. Click on the team that you want to change the UI theme for and then navigate to the **Settings** tab.
{{< docs/shared "preferences/select-ui-theme-list.md" >}}
{{< docs/shared lookup="preferences/select-ui-theme-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< /docs/list >}}
## Change your personal UI theme
@@ -62,6 +62,6 @@ Organization and team administrators can change the UI theme for all users in a
You can change the UI theme for your user account. This setting overrides UI theme settings at higher levels.
{{< docs/list >}}
{{< docs/shared "preferences/navigate-user-preferences-list.md" >}}
{{< docs/shared "preferences/select-ui-theme-list.md" >}}
{{< docs/shared lookup="preferences/navigate-user-preferences-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="preferences/select-ui-theme-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< /docs/list >}}

View File

@@ -9,7 +9,7 @@ weight = 400
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.
{{< docs/shared "preferences/some-tasks-require-permissions.md" >}}
{{< docs/shared lookup="preferences/some-tasks-require-permissions.md" source="grafana" version="<GRAFANA VERSION>" >}}
## Set server timezone
@@ -20,8 +20,8 @@ Grafana server administrators can choose a default timezone for all users on the
Organization administrators can choose a default timezone for their organization.
{{< docs/list >}}
{{< docs/shared "preferences/org-preferences-list.md" >}}
{{< docs/shared "preferences/select-timezone-list.md" >}}
{{< docs/shared lookup="preferences/org-preferences-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="preferences/select-timezone-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< /docs/list >}}
## Set team timezone
@@ -29,10 +29,10 @@ Organization administrators can choose a default timezone for their organization
Organization administrators and team administrators can choose a default timezone for all users in a team.
{{< docs/list >}}
{{< docs/shared "manage-users/view-team-list.md" >}}
{{< docs/shared lookup="manage-users/view-team-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
1. Click on the team you that you want to change the timezone for and then navigate to the **Settings** tab.
{{< docs/shared "preferences/select-timezone-list.md" >}}
{{< docs/shared lookup="preferences/select-timezone-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< /docs/list >}}
## Set your personal timezone
@@ -40,6 +40,6 @@ Organization administrators and team administrators can choose a default timezon
You can change the timezone for your user account. This setting overrides timezone settings at higher levels.
{{< docs/list >}}
{{< docs/shared "preferences/navigate-user-preferences-list.md" >}}
{{< docs/shared "preferences/select-timezone-list.md" >}}
{{< docs/shared lookup="preferences/navigate-user-preferences-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="preferences/select-timezone-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< /docs/list >}}

View File

@@ -2,7 +2,7 @@
title = "Change home dashboard"
description = "How to replace the default home dashboard"
keywords = ["grafana", "configuration", "documentation", "home"]
aliases = ["/docs/grafana/latest/administration/change-home-dashboard/"]
aliases = ["/docs/grafana/v8.3/administration/change-home-dashboard/"]
weight = 300
+++
@@ -10,7 +10,7 @@ weight = 300
The home dashboard you set is the one all users will see by default when they log in. 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.
{{< docs/shared "preferences/some-tasks-require-permissions.md" >}}
{{< docs/shared lookup="preferences/some-tasks-require-permissions.md" source="grafana" version="<GRAFANA VERSION>" >}}
## Navigate to the home dashboard
@@ -47,9 +47,9 @@ default_home_dashboard_path = data/main-dashboard.json
Organization administrators can choose a home dashboard for their organization.
{{< docs/list >}}
{{< docs/shared "preferences/navigate-to-the-dashboard-list.md" >}}
{{< docs/shared "preferences/org-preferences-list.md" >}}
{{< docs/shared "preferences/select-home-dashboard-list.md" >}}
{{< docs/shared lookup="preferences/navigate-to-the-dashboard-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="preferences/org-preferences-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="preferences/select-home-dashboard-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< /docs/list >}}
## Set home dashboard for your team
@@ -57,11 +57,11 @@ Organization administrators can choose a home dashboard for their organization.
Organization administrators and Team Admins can choose a home dashboard for a team.
{{< docs/list >}}
{{< docs/shared "preferences/navigate-to-the-dashboard-list.md" >}}
{{< docs/shared "manage-users/view-team-list.md" >}}
{{< docs/shared lookup="preferences/navigate-to-the-dashboard-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="manage-users/view-team-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
1. Click on the team that you want to change the home dashboard for and then navigate to the **Settings** tab.
{{< docs/shared "preferences/select-home-dashboard-list.md" >}}
{{< docs/shared lookup="preferences/select-home-dashboard-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< /docs/list >}}
## Set your personal home dashboard
@@ -69,7 +69,7 @@ Organization administrators and Team Admins can choose a home dashboard for a te
You can choose your own personal home dashboard. This setting overrides all home dashboards set at higher levels.
{{< docs/list >}}
{{< docs/shared "preferences/navigate-to-the-dashboard-list.md" >}}
{{< docs/shared "preferences/navigate-user-preferences-list.md" >}}
{{< docs/shared "preferences/select-home-dashboard-list.md" >}}
{{< docs/shared lookup="preferences/navigate-to-the-dashboard-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="preferences/navigate-user-preferences-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared lookup="preferences/select-home-dashboard-list.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< /docs/list >}}

View File

@@ -2,7 +2,7 @@
title = "Provisioning"
description = ""
keywords = ["grafana", "provisioning"]
aliases = ["/docs/grafana/latest/installation/provisioning"]
aliases = ["/docs/grafana/v8.3/installation/provisioning"]
weight = 800
+++

View File

@@ -2,7 +2,7 @@
title = "Security"
description = "Security Docs"
keywords = ["grafana", "security", "documentation"]
aliases = ["/docs/grafana/latest/installation/security/"]
aliases = ["/docs/grafana/v8.3/installation/security/"]
weight = 500
+++

View File

@@ -1,7 +1,7 @@
+++
title = "Set up Grafana for high availability"
keywords = ["grafana", "tutorials", "HA", "high availability"]
aliases = ["/docs/grafana/latest/tutorials/ha_setup/"]
aliases = ["/docs/grafana/v8.3/tutorials/ha_setup/"]
weight = 1200
+++

View File

@@ -2,7 +2,7 @@
title = "Internal Grafana metrics"
description = "Internal metrics exposed by Grafana"
keywords = ["grafana", "metrics", "internal metrics"]
aliases = ["/docs/grafana/latest/admin/metrics/"]
aliases = ["/docs/grafana/v8.3/admin/metrics/"]
weight = 200
+++

View File

@@ -2,7 +2,7 @@
title = "View server settings"
description = "How to view server settings in the Grafana UI"
keywords = ["grafana", "configuration", "server", "settings"]
aliases = ["/docs/grafana/latest/admin/view-server-settings/"]
aliases = ["/docs/grafana/v8.3/admin/view-server-settings/"]
weight = 300
+++

View File

@@ -1,7 +1,7 @@
+++
title = "View server stats"
keywords = ["grafana", "server", "statistics"]
aliases = ["/docs/grafana/latest/admin/view-server-stats/"]
aliases = ["/docs/grafana/v8.3/admin/view-server-stats/"]
weight = 400
+++

View File

@@ -23,4 +23,4 @@ You can perform the following tasks for alerts:
- [Test alert rules and troubleshoot]({{< relref "troubleshoot-alerts.md" >}})
- [Add or edit an alert contact point]({{< relref "notifications.md" >}})
{{< docs/shared "alerts/grafana-managed-alerts.md" >}}
{{< docs/shared lookup="alerts/grafana-managed-alerts.md" source="grafana" version="<GRAFANA VERSION>" >}}

View File

@@ -2,7 +2,7 @@
title = "Alert notification templating"
keywords = ["grafana", "documentation", "alerting", "alerts", "notification", "templating"]
weight = 110
aliases = ["/docs/grafana/latest/alerting/add-notification-template/"]
aliases = ["/docs/grafana/v8.3/alerting/add-notification-template/"]
+++
# Alert notification templating

View File

@@ -3,7 +3,7 @@ title = "Create alerts"
description = "Configure alert rules"
keywords = ["grafana", "alerting", "guide", "rules"]
weight = 200
aliases = ["/docs/grafana/latest/alerting/create-alerts/"]
aliases = ["/docs/grafana/v8.3/alerting/create-alerts/"]
+++
# Create alerts

View File

@@ -3,7 +3,7 @@ title = "Alert notifications"
description = "Alerting notifications guide"
keywords = ["Grafana", "alerting", "guide", "notifications"]
weight = 100
aliases = ["/docs/grafana/latest/alerting/notifications/"]
aliases = ["/docs/grafana/v8.3/alerting/notifications/"]
+++
# Alert notifications

View File

@@ -3,7 +3,7 @@ title = "Pause alert rule"
description = "Pause an existing alert rule"
keywords = ["grafana", "alerting", "guide", "rules", "view"]
weight = 400
aliases = ["/docs/grafana/latest/alerting/pause-an-alert-rule/"]
aliases = ["/docs/grafana/v8.3/alerting/pause-an-alert-rule/"]
+++
# Pause an alert rule

View File

@@ -3,7 +3,7 @@ title = "Troubleshoot alerts"
description = "Troubleshoot alert rules"
keywords = ["grafana", "alerting", "guide", "rules", "troubleshoot"]
weight = 500
aliases = ["/docs/grafana/latest/alerting/troubleshoot-alerts/"]
aliases = ["/docs/grafana/v8.3/alerting/troubleshoot-alerts/"]
+++
# Troubleshoot alerts

View File

@@ -3,7 +3,7 @@ title = "View alerts"
description = "View existing alert rules"
keywords = ["grafana", "alerting", "guide", "rules", "view"]
weight = 400
aliases = ["/docs/grafana/latest/alerting/view-alerts/"]
aliases = ["/docs/grafana/v8.3/alerting/view-alerts/"]
+++
# View existing alert rules

View File

@@ -1,6 +1,6 @@
+++
title = "Grafana alerts"
aliases = ["/docs/grafana/latest/alerting/metrics/"]
aliases = ["/docs/grafana/v8.3/alerting/metrics/"]
weight = 113
+++

View File

@@ -1,6 +1,6 @@
+++
title = "Create and manage rules"
aliases = ["/docs/grafana/latest/alerting/rules/"]
aliases = ["/docs/grafana/v8.3/alerting/rules/"]
weight = 130
+++

View File

@@ -7,54 +7,32 @@ weight = 401
# Annotations and labels for alerting rules
Annotations and labels help customize alert messages so that you can quickly identify the service or application that needs attention.
Annotations and labels are key value pairs associated with alerts originating from the alerting rule, datasource response, and as a result of alerting rule evaluation. They can be used in alert notifications directly or in [templates]({{< relref "../message-templating/" >}}) and [template functions]({{< relref "../message-templating/template-functions" >}}) to create notification contact dynamically.
## Annotations
Annotations are key-value pairs that provide additional meta-information about an alert. For example: a description, a summary, and runbook URL. These are displayed in rule and alert details in the UI and can be used in contact type message templates. Annotations can also be templated, for example `Instance {{ $labels.instance }} down` will have the evaluated `instance` label value added for every alert this rule produces.
Annotations are key-value pairs that provide additional meta-information about an alert. For example: a description, a summary, and runbook URL. These are displayed in rule and alert details in the UI and can be used in contact point message templates.
## Labels
Labels are key-value pairs that categorize or identify an alert. Labels are used to match alerts in silences or match and groups alerts in notification policies. Labels are also shown in rule or alert details in the UI and can be used in contact type message templates. For example, you can add a `severity` label, then configure a separate notification policy for each severity. You can also add, for example, a `team` label and configure notification policies specific to the team or silence all alerts for a particular team. Labels can also be templated like annotations, for example, `{{ $labels.namespace }}/{{ $labels.job }}` will produce a new rule label that will have the evaluated `namespace` and `job` label value added for every alert this rule produces. The rule labels take precedence over the labels produced by the query/condition.
Labels are key-value pairs that contain information about, and are used to uniquely identify an alert. The label set for an alert is generated and added to throughout the alerting evaluation and notification process.
### How are labels used?
- The complete set of labels for an alert is what uniquely identifies an alert within Grafana Alerts.
- The Alertmanager uses labels to match alerts for [silences]({{< relref "../silences/" >}}) and [alert groups]({{< relref "../alert-groups/" >}}) in [notification policies]({{< relref "../notification-policies/" >}}).
- The alerting UI displays labels for every alert instance generated by the evaluation of that rule.
- Contact points can access labels to dynamically generate notifications that contain information specific to the alert that is resulting in a notification.
- Labels can be added to an [alerting rule]({{< relref "../alerting-rules/" >}}). These manually configured labels are able to use template functions and reference other labels. Labels added to an alerting rule here take precedence in the event of a collision between labels.
{{< figure src="/static/img/docs/alerting/unified/rule-edit-details-8-0.png" max-width="550px" caption="Alert details" >}}
#### Template variables
#### Variables available to alerting rule labels and annotations
The following template variables are available when expanding annotations and labels.
| Name | Description |
| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| $labels | The labels from the query or condition. For example, `{{ $labels.instance }}` and `{{ $labels.job }}`. This is unavailable when the rule uses a classic condition. |
| $values | The values of all reduce and math expressions that were evaluated for this alert rule. For example, `{{ $values.A }}`, `{{ $values.A.Labels }}` and `{{ $values.A.Value }}` where `A` is the `refID` of the expression. This is unavailable when the rule uses a [classic condition]({{< relref "./create-grafana-managed-rule/#single-and-multi-dimensional-rule" >}}) |
| $value | The value string of the alert instance. For example, `[ var='A' labels={instance=foo} value=10 ]`. |
#### Template functions
The following template functions are available when expanding annotations and labels.
| Name | Argument | Return | Description |
| ------------------ | ------------------------------------------------------------ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| humanize | number or string | string | Converts a number to a more readable format, using metric prefixes. |
| humanize1024 | number or string | string | Like humanize, but uses 1024 as the base rather than 1000. |
| humanizeDuration | number or string | string | Converts a duration in seconds to a more readable format. |
| humanizePercentage | number or string | string | Converts a ratio value to a fraction of 100. |
| humanizeTimestamp | number or string | string | Converts a Unix timestamp in seconds to a more readable format. |
| title | string | string | strings.Title, capitalises first character of each word. |
| toUpper | string | string | strings.ToUpper, converts all characters to upper case. |
| toLower | string | string | strings.ToLower, converts all characters to lower case. |
| match | pattern, text | boolean | regexp.MatchString Tests for a unanchored regexp match. |
| reReplaceAll | pattern, replacement, text | string | Regexp.ReplaceAllString Regexp substitution, unanchored. |
| graphLink | string - JSON Object with `"expr"` and `"datasource"` fields | string | Returns the path to graphical view in [Explore](https://grafana.com/docs/grafana/latest/explore/) for the given expression and data source. |
| tableLink | string- JSON Object with `"expr"` and `"datasource"` fields | string | Returns the path to tabular view in [Explore](https://grafana.com/docs/grafana/latest/explore/) for the given expression and data source. |
| args | []interface{} | map[string]interface{} | Converts a list of objects to a map with keys, for example, arg0, arg1. Use this function to pass multiple arguments to templates. |
| externalURL | nothing | string | Returns a string representing the external URL. |
| pathPrefix | nothing | string | Returns the path of the external URL. |
| tmpl | string, []interface{} | nothing | Not supported |
| safeHtml | string | string | Not supported |
| query | query string | []sample | Not supported |
| first | []sample | sample | Not supported |
| label | label, sample | string | Not supported |
| strvalue | []sample | string | Not supported |
| value | sample | float64 | Not supported |
| sortByLabel | label, []samples | []sample | Not supported |
| Name | Description |
| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| $labels | The labels from the query or condition. For example, `{{ $labels.instance }}` and `{{ $labels.job }}`. This is unavailable when the rule uses a [classic condition]({{< relref "./create-grafana-managed-rule/#single-and-multi-dimensional-rule" >}}). |
| $values | The values of all reduce and math expressions that were evaluated for this alert rule. For example, `{{ $values.A }}`, `{{ $values.A.Labels }}` and `{{ $values.A.Value }}` where `A` is the `refID` of the expression. This is unavailable when the rule uses a classic condition |
| $value | The value string of the alert instance. For example, `[ var='A' labels={instance=foo} value=10 ]`. |

View File

@@ -29,10 +29,10 @@ For Cortex and Loki data sources to work with Grafana 8.0 alerting, enable the r
- From the **Select data source** drop-down, select an external Prometheus, an external Loki, or a Grafana Cloud data source.
- From the **Namespace** drop-down, select an existing rule namespace. Otherwise, click **Add new** and enter a name to create a new one. Namespaces can contain one or more rule groups and only have an organizational purpose.
- From the **Group** drop-down, select an existing group within the selected namespace. Otherwise, click **Add new** and enter a name to create 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.
{{< figure src="/static/img/docs/alerting/unified/rule-edit-cortex-alert-type-8-0.png" max-width="550px" caption="Alert details" >}}
{{< figure src="/static/img/docs/alerting/unified/rule-edit-mimir-alert-type-8-0.png" max-width="550px" caption="Alert details" >}}
1. In Step 2, add the query to evaluate.
- Enter a PromQL or LogQL expression. The rule fires if the evaluation result has at least one series with a value that is greater than 0. An alert is created for each series.
{{< figure src="/static/img/docs/alerting/unified/rule-edit-cortex-query-8-0.png" max-width="550px" caption="Alert details" >}}
{{< figure src="/static/img/docs/alerting/unified/rule-edit-mimir-query-8-0.png" max-width="550px" caption="Alert details" >}}
1. In Step 3, add additional metadata associated with the rule.
- Add a description and summary to customize alert messages. Use the guidelines in [Annotations and labels for alerting]({{< relref "./alert-annotation-label.md" >}}).
- Add Runbook URL, panel, dashboard, and alert IDs.

View File

@@ -11,11 +11,13 @@ Grafana allows you to create alerting rules for an external Cortex or Loki insta
## Before you begin
For Cortex and Loki data sources to work with Grafana 8.0 alerting, enable the ruler API by configuring their respective services.
- Verify that you have write permission to the Prometheus data source. Otherwise, you will not be able to create or update Cortex managed alerting rules.
**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.
- For Cortex and Loki data sources, enable the ruler API by configuring their respective services.
**Cortex** - When configuring a Grafana Prometheus data source to point to Cortex, use the [legacy `/api/prom` prefix](https://cortexmetrics.io/docs/api/#path-prefixes), not `/prometheus`. The Prometheus data source supports both Cortex and Prometheus, and Grafana expects that both the [Query API](https://cortexmetrics.io/docs/api/#querier--query-frontend) and [Ruler API](https://cortexmetrics.io/docs/api/#ruler) are under the same URL. You cannot provide a separate URL for the Ruler API.
- **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.
- **Cortex** - use the [legacy `/api/prom` prefix](https://cortexmetrics.io/docs/api/#path-prefixes), not `/prometheus`. The Prometheus data source supports both Cortex and Prometheus, and Grafana expects that both the [Query API](https://cortexmetrics.io/docs/api/#querier--query-frontend) and [Ruler API](https://cortexmetrics.io/docs/api/#ruler) are under the same URL. You cannot provide a separate URL for the Ruler API.
> **Note:** If you do not want to manage alerting rules for a particular Loki or Prometheus data source, go to its settings and clear the **Manage alerts via Alerting UI** checkbox.
@@ -29,10 +31,10 @@ For Cortex and Loki data sources to work with Grafana 8.0 alerting, enable the r
- From the **Select data source** drop-down, select an external Prometheus, an external Loki, or a Grafana Cloud data source.
- From the **Namespace** drop-down, select an existing rule namespace. Otherwise, click **Add new** and enter a name to create a new one. Namespaces can contain one or more rule groups and only have an organizational purpose. For more information, see [Cortex or Loki rule groups and namespaces]({{< relref "./edit-cortex-loki-namespace-group.md" >}}).
- From the **Group** drop-down, select an existing group within the selected namespace. Otherwise, click **Add new** and enter a name to create 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.
{{< figure src="/static/img/docs/alerting/unified/rule-edit-cortex-alert-type-8-0.png" max-width="550px" caption="Alert details" >}}
{{< figure src="/static/img/docs/alerting/unified/rule-edit-mimir-alert-type-8-0.png" max-width="550px" caption="Alert details" >}}
1. In Step 2, add the query to evaluate.
- Enter a PromQL or LogQL expression. The rule fires if the evaluation result has at least one series with a value that is greater than 0. An alert is created for each series.
{{< figure src="/static/img/docs/alerting/unified/rule-edit-cortex-query-8-0.png" max-width="550px" caption="Alert details" >}}
{{< figure src="/static/img/docs/alerting/unified/rule-edit-mimir-query-8-0.png" max-width="550px" caption="Alert details" >}}
1. In Step 3, add conditions.
- In the **For** text box, specify the duration for which the condition must be true before an alert fires. If you specify `5m`, the condition must be true for 5 minutes before the alert fires.
> **Note:** 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.

View File

@@ -9,9 +9,9 @@ weight = 405
A namespace contains one or more groups. The rules within a group are run sequentially at a regular interval. The default interval is one (1) minute. You can rename Cortex or Loki rule namespaces and groups, and edit group evaluation intervals.
![Group list](/static/img/docs/alerting/unified/rule-list-edit-cortex-loki-icon-8-2.png 'Rule group list screenshot')
![Group list](/static/img/docs/alerting/unified/rule-list-edit-mimir-loki-icon-8-2.png 'Rule group list screenshot')
{{< figure src="/static/img/docs/alerting/unified/rule-list-edit-cortex-loki-icon-8-2.png" max-width="550px" caption="Alert details" >}}
{{< figure src="/static/img/docs/alerting/unified/rule-list-edit-mimir-loki-icon-8-2.png" max-width="550px" caption="Alert details" >}}
## Rename a namespace
@@ -36,4 +36,4 @@ The rules within a group are run sequentially at a regular interval, the default
When you rename the group, a new group with all the rules from the old group is created. The old group is deleted.
![Group edit modal](/static/img/docs/alerting/unified/rule-list-cortex-loki-edit-ns-group-8-2.png 'Rule group edit modal screenshot')
![Group edit modal](/static/img/docs/alerting/unified/rule-list-mimir-loki-edit-ns-group-8-2.png 'Rule group edit modal screenshot')

View File

@@ -1,6 +1,6 @@
+++
title = "Alerting fundamentals"
aliases = ["/docs/grafana/latest/alerting/metrics/"]
aliases = ["/docs/grafana/v8.3/alerting/metrics/"]
weight = 120
+++

View File

@@ -1,6 +1,6 @@
+++
title = "Alertmanager"
aliases = ["/docs/grafana/latest/alerting/metrics/"]
aliases = ["/docs/grafana/v8.3/alerting/metrics/"]
weight = 116
+++

View File

@@ -1,6 +1,6 @@
+++
title = "Alerting on numeric data"
aliases = ["/docs/grafana/latest/alerting/metrics/"]
aliases = ["/docs/grafana/v8.3/alerting/metrics/"]
weight = 116
+++
@@ -17,7 +17,7 @@ Grafana managed alerts query the following backend data sources that have alerti
- built-in data sources or those developed and maintained by Grafana: `Graphite`, `Prometheus`, `Loki`, `InfluxDB`, `Elasticsearch`,
`Google Cloud Monitoring`, `Cloudwatch`, `Azure Monitor`, `MySQL`, `PostgreSQL`, `MSSQL`, `OpenTSDB`, `Oracle`, and `Azure Monitor`
- community developed backend data sources with alerting enabled (`backend` and `alerting` properties are set in the [plugin.json]({{< relref "../../../developers/plugins/metadata.md" >}}))
- community developed backend data sources with alerting enabled (`backend` and `alerting` properties are set in the [plugin.json](https://grafana.com/developers/plugin-tools/reference-plugin-json))
### Metrics from the alerting engine

View File

@@ -1,7 +1,7 @@
+++
title = "Message templating"
description = "Message templating"
aliases = ["/docs/grafana/latest/alerting/message-templating/"]
aliases = ["/docs/grafana/v8.3/alerting/message-templating/"]
keywords = ["grafana", "alerting", "guide", "contact point", "templating"]
weight = 440
+++

View File

@@ -59,17 +59,3 @@ In addition to direct access of data (labels and annotations) stored as KeyValue
| Remove | []string | KeyValue | Returns a copy of the Key/Value map without the given keys. |
| Names | | []string | List of label names |
| Values | | []string | List of label values |
## Functions
Some functions to transform values are also available, along with [default functions provided by Go templating](https://golang.org/pkg/text/template/#hdr-Functions).
| Name | Arguments | Returns |
| ------------ | ---------------------------- | ------------------------------------------------------------------------------------------------------------ |
| title | string | Capitalizes first character of each word. |
| toUpper | string | Converts all characters to upper case. |
| match | pattern, string | Match a string using RegExp. |
| reReplaceAll | pattern, replacement, string | RegExp substitution, unanchored. |
| join | string, []string | Concatenates the elements of the second argument to create a single string. First argument is the separator. |
| safeHtml | string | Marks string as HTML, not requiring auto-escaping. |
| stringSlice | ...string | Returns passed strings as slice of strings. |

View File

@@ -0,0 +1,138 @@
+++
title = "Template functions"
keywords = ["grafana", "alerting", "guide", "contact point", "templating"]
+++
# Template Functions
Template functions allow you to process labels and annotations to generate dynamic notifications.
| Name | Argument type | Return type | Description |
| ----------------------------------------- | ------------------------------------------------------------ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| [humanize](#humanize) | number or string | string | Converts a number to a more readable format, using metric prefixes. |
| [humanize1024](#humanize1024) | number or string | string | Like humanize, but uses 1024 as the base rather than 1000. |
| [humanizeDuration](#humanizeduration) | number or string | string | Converts a duration in seconds to a more readable format. |
| [humanizePercentage](#humanizepercentage) | number or string | string | Converts a ratio value to a fraction of 100. |
| [humanizeTimestamp](#humanizetimestamp) | number or string | string | Converts a Unix timestamp in seconds to a more readable format. |
| [title](#title) | string | string | strings.Title, capitalises first character of each word. |
| [toUpper](#toupper) | string | string | strings.ToUpper, converts all characters to upper case. |
| [toLower](#tolower) | string | string | strings.ToLower, converts all characters to lower case. |
| [match](#match) | pattern, text | boolean | regexp.MatchString Tests for a unanchored regexp match. |
| [reReplaceAll](#rereplaceall) | pattern, replacement, text | string | Regexp.ReplaceAllString Regexp substitution, unanchored. |
| [graphLink](#graphlink) | string - JSON Object with `"expr"` and `"datasource"` fields | string | Returns the path to graphical view in [Explore](https://grafana.com/docs/grafana/v8.3/explore/) for the given expression and data source. |
| [tableLink](#tablelink) | string- JSON Object with `"expr"` and `"datasource"` fields | string | Returns the path to tabular view in [Explore](https://grafana.com/docs/grafana/v8.3/explore/) for the given expression and data source. |
| [args](#args) | []interface{} | map[string]interface{} | Converts a list of objects to a map with keys, for example, arg0, arg1. Use this function to pass multiple arguments to templates. |
| [externalURL](#externalurl) | nothing | string | Returns a string representing the external URL. |
| [pathPrefix](#pathprefix) | nothing | string | Returns the path of the external URL. |
## Examples
### humanize
**Template string** `{ humanize $value }`
**Input** `1234567.0`
**Expected** `1.235M`
### humanize1024
**TemplateString** `{ humanize1024 $value } `
**Input** `1048576.0`
**Expected** `1Mi`
### humanizeDuration
**TemplateString** `{ humanizeDuration $value }`
**Input** `899.99`
**Expected** `14m 59s`
### humanizePercentage
**TemplateString** `{ humanizePercentage $value }`
**Input** `0.1234567`
**Expected** `12.35%`
### humanizeTimestamp
**TemplateString** `{ $value | humanizeTimestamp }`
**Input** `1435065584.128`
**Expected** `2015-06-23 13:19:44.128 +0000 UTC`
### title
**TemplateString** `{ $value | title }`
**Input** `aa bb CC`
**Expected** `Aa Bb Cc`
### toUpper
**TemplateString** `{ $value | toUpper }`
**Input** `aa bb CC`
**Expected** `AA BB CC`
### toLower
**TemplateString** `{ $value | toLower }`
**Input** `aA bB CC`
**Expected** `aa bb cc`
### match
**TemplateString** `{ match "a+" $labels.instance }`
**Input** `aa`
**Expected** `true`
### reReplaceAll
**TemplateString** `{{ reReplaceAll "localhost:(.*)" "my.domain:$1" $labels.instance }}`
**Input** `localhost:3000`
**Expected** `my.domain:3000`
### graphLink
**TemplateString** `{{ graphLink "{\"expr\": \"up\", \"datasource\": \"gdev-prometheus\"}" }}`
**Expected** `/explore?left=["now-1h","now","gdev-prometheus",{"datasource":"gdev-prometheus","expr":"up","instant":false,"range":true}]`
### tableLink
**TemplateString** `{{ tableLink "{\"expr\": \"up\", \"datasource\": \"gdev-prometheus\"}" }}`
**Expected** `/explore?left=["now-1h","now","gdev-prometheus",{"datasource":"gdev-prometheus","expr":"up","instant":true,"range":false}]`
### args
**TemplateString** `{{define "x"}}{{.arg0}} {{.arg1}}{{end}}{{template "x" (args 1 "2")}}`
**Expected** `1 2`
### externalURL
**TemplateString** `{ externalURL }`
**Expected** `http://localhost/path/prefix`
### pathPrefix
**TemplateString** `{ pathPrefix }`
**Expected** `/path/prefix`

View File

@@ -2,7 +2,7 @@
title = "Auth Proxy"
description = "Grafana Auth Proxy Guide "
keywords = ["grafana", "configuration", "documentation", "proxy"]
aliases = ["/docs/grafana/latest/tutorials/authproxy/"]
aliases = ["/docs/grafana/v8.3/tutorials/authproxy/"]
weight = 200
+++

View File

@@ -16,7 +16,7 @@ settings page). When you create the application you will need to specify
a callback URL. Specify this as callback:
```bash
http://<my_grafana_server_name_or_ip>:<grafana_server_port>/login/github
http://<my_grafana_server_name_or_ip>:<grafana_server_port>/grafana/login/github
```
This callback URL must match the full HTTP address that you use in your

View File

@@ -2,7 +2,7 @@
title = "LDAP Authentication"
description = "Grafana LDAP Authentication Guide "
keywords = ["grafana", "configuration", "documentation", "ldap", "active directory"]
aliases = ["/docs/grafana/latest/installation/ldap/"]
aliases = ["/docs/grafana/v8.3/installation/ldap/"]
weight = 300
+++

View File

@@ -2,7 +2,7 @@
title = "SAML Authentication"
description = "Grafana SAML Authentication"
keywords = ["grafana", "saml", "documentation", "saml-auth"]
aliases = ["/docs/grafana/latest/auth/saml/"]
aliases = ["/docs/grafana/v8.3/auth/saml/"]
weight = 1100
+++

View File

@@ -2,7 +2,7 @@
title = "Team Sync"
description = "Grafana Team Sync"
keywords = ["grafana", "auth", "documentation"]
aliases = ["/docs/grafana/latest/auth/saml/"]
aliases = ["/docs/grafana/v8.3/auth/saml/"]
weight = 1200
+++

View File

@@ -7,8 +7,8 @@ weight = 15
This section provides basic information about observability topics in general and Grafana in particular. These topics will help people who are just starting out with observability and monitoring.
{{< docs/shared "basics/what-is-grafana.md" >}}
{{< docs/shared lookup="basics/what-is-grafana.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared "basics/grafana-cloud.md" >}}
{{< docs/shared lookup="basics/grafana-cloud.md" source="grafana" version="<GRAFANA VERSION>" >}}
{{< docs/shared "basics/grafana-enterprise.md" >}}
{{< docs/shared lookup="basics/grafana-enterprise.md" source="grafana" version="<GRAFANA VERSION>" >}}

View File

@@ -2,7 +2,7 @@
title = "Glossary"
description = "Grafana glossary"
keywords = ["grafana", "intro", "glossary", "dictionary"]
aliases = ["/docs/grafana/latest/guides/glossary", "/docs/grafana/latest/getting-started/glossary"]
aliases = ["/docs/grafana/v8.3/guides/glossary", "/docs/grafana/v8.3/getting-started/glossary"]
weight = 800
+++
@@ -44,7 +44,7 @@ This topic lists words and abbreviations that are commonly used in the Grafana d
<tr>
<td style="vertical-align: top">Explore</td>
<td>
Explore allows a user to focus on building a query. Users can refine the query to return the expected metrics before building a dashboard. For more information, refer to the <a href="https://grafana.com/docs/grafana/latest/explore">Explore</a> topic.
Explore allows a user to focus on building a query. Users can refine the query to return the expected metrics before building a dashboard. For more information, refer to the <a href="https://grafana.com/docs/grafana/v8.3/explore">Explore</a> topic.
</td>
</tr>
<tr>
@@ -116,7 +116,7 @@ This topic lists words and abbreviations that are commonly used in the Grafana d
<tr>
<td style="vertical-align: top">transformation</td>
<td>
Transformations process the result set of a query before its passed on for visualization. For more information, refer to the <a href="https://grafana.com/docs/grafana/latest/panels/transformations">Transformations overview</a> topic.
Transformations process the result set of a query before its passed on for visualization. For more information, refer to the <a href="https://grafana.com/docs/grafana/v8.3/panels/transformations">Transformations overview</a> topic.
</td>
</tr>
<tr>

View File

@@ -2,7 +2,7 @@
title = "Histograms and heatmaps"
description = "An introduction to histograms and heatmaps"
keywords = ["grafana", "heatmap", "panel", "documentation", "histogram"]
aliases = ["/docs/grafana/latest/getting-started/intro-histograms"]
aliases = ["/docs/grafana/v8.3/getting-started/intro-histograms"]
weight = 700
+++

View File

@@ -2,7 +2,7 @@
title = "Time series dimensions"
description = "time series dimensions"
keywords = ["grafana", "intro", "guide", "concepts", "timeseries", "labels"]
aliases = ["/docs/grafana/latest/guides/timeseries-dimensions", "/docs/grafana/latest/getting-started/timeseries-dimensions"]
aliases = ["/docs/grafana/v8.3/guides/timeseries-dimensions", "/docs/grafana/v8.3/getting-started/timeseries-dimensions"]
weight = 600
+++
@@ -82,4 +82,4 @@ In this case the labels that represent the dimensions will have two keys based o
In the case of SQL-like data sources, more than one numeric column can be selected, with or without additional string columns to be used as dimensions. For example, `AVG(Temperature) AS AvgTemp, MAX(Temperature) AS MaxTemp`. This, if combined with multiple dimensions, can result in a lot of series. Selecting multiple values is currently only designed to be used with visualization.
Additional technical information on tabular time series formats and how dimensions are extracted can be found in [the developer documentation on data frames as time series]({{< relref "../developers/plugins/data-frames.md#data-frames-as-time-series" >}}).
Additional technical information on tabular time series formats and how dimensions are extracted can be found in [the developer documentation on data frames as time series](https://grafana.com/developers/plugin-tools/introduction/data-frames#data-frames-as-time-series).

View File

@@ -2,7 +2,7 @@
title = "Common observability strategies"
description = "Common observability strategies"
keywords = ["grafana", "intro", "guide", "concepts", "methods"]
aliases = ["/docs/grafana/latest/getting-started/strategies/"]
aliases = ["/docs/grafana/v8.3/getting-started/strategies/"]
weight = 300
+++

View File

@@ -1,6 +1,6 @@
+++
title = "Dashboards"
aliases = ["/docs/grafana/latest/features/dashboard/dashboards/"]
aliases = ["/docs/grafana/v8.3/features/dashboard/dashboards/"]
weight = 80
+++

View File

@@ -1,7 +1,7 @@
+++
title = "Annotations"
keywords = ["grafana", "annotations", "documentation", "guide"]
aliases = ["/docs/grafana/latest/reference/annotations/"]
aliases = ["/docs/grafana/v8.3/reference/annotations/"]
weight = 2
+++

View File

@@ -1,7 +1,7 @@
+++
title = "Dashboard Folders"
keywords = ["grafana", "dashboard", "dashboard folders", "folder", "folders", "documentation", "guide"]
aliases = ["/docs/grafana/latest/reference/dashboard_folders/"]
aliases = ["/docs/grafana/v8.3/reference/dashboard_folders/"]
weight = 3
+++

View File

@@ -1,7 +1,7 @@
+++
title = "Dashboard Version History"
keywords = ["grafana", "dashboard", "documentation", "version", "history"]
aliases = ["/docs/grafana/latest/reference/dashboard_history/"]
aliases = ["/docs/grafana/v8.3/reference/dashboard_history/"]
weight = 100
+++

View File

@@ -1,7 +1,7 @@
+++
title = "Export and import"
keywords = ["grafana", "dashboard", "documentation", "export", "import"]
aliases = ["/docs/grafana/latest/reference/export_import/"]
aliases = ["/docs/grafana/v8.3/reference/export_import/"]
weight = 800
+++

View File

@@ -1,7 +1,7 @@
+++
title = "JSON model"
keywords = ["grafana", "dashboard", "documentation", "json", "model"]
aliases = ["/docs/grafana/latest/reference/dashboard/"]
aliases = ["/docs/grafana/v8.3/reference/dashboard/"]
weight = 1200
+++

View File

@@ -1,7 +1,7 @@
+++
title = "Playlist"
keywords = ["grafana", "dashboard", "documentation", "playlist"]
aliases = ["/docs/grafana/latest/reference/playlist/"]
aliases = ["/docs/grafana/v8.3/reference/playlist/"]
weight = 4
+++

View File

@@ -2,7 +2,7 @@
title = "Reporting"
description = ""
keywords = ["grafana", "reporting"]
aliases = ["/docs/grafana/latest/administration/reports"]
aliases = ["/docs/grafana/v8.3/administration/reports"]
weight = 8
+++

View File

@@ -1,7 +1,7 @@
+++
title = "Scripted dashboards"
keywords = ["grafana", "dashboard", "documentation", "scripted"]
aliases = ["/docs/grafana/latest/reference/scripting/"]
aliases = ["/docs/grafana/v8.3/reference/scripting/"]
weight = 1500
+++

View File

@@ -1,7 +1,7 @@
+++
title = "Search"
keywords = ["grafana", "dashboard", "documentation", "search"]
aliases =["/docs/grafana/latest/reference/search/"]
aliases =["/docs/grafana/v8.3/reference/search/"]
weight = 5
+++

View File

@@ -1,13 +1,13 @@
+++
title = "Time range controls"
keywords = ["grafana", "dashboard", "documentation", "time range"]
aliases = ["/docs/grafana/latest/reference/timerange/"]
aliases = ["/docs/grafana/v8.3/reference/timerange/"]
weight = 7
+++
# Time range controls
Grafana provides several ways to manage the time ranges of the data being visualized, both at the dashboard level and the panel level.
Grafana provides several ways to manage the time ranges of the data being visualized, for dashboard, panels and also for alerting.
This page describes supported time units and relative ranges, the common time controls, dashboard-wide time settings, and panel-specific time settings.
@@ -34,11 +34,18 @@ Here are some examples:
| This Year | `now/Y` | `now/Y` |
| Previous fiscal year | `now-1y/fy` | `now-1y/fy` |
### Note about Grafana alerting
For Grafana alerting, we do not support are the following syntaxes at this time.
- now+n for future timestamps.
- now-1n/n for "start of n until end of n" since this is an absolute timestamp.
## Common time range controls
The dashboard and panel time controls have a common user interface (UI).
<img class="no-shadow" src="/static/img/docs/time-range-controls/common-time-controls-8-2.png" max-width="700px">
<img class="no-shadow" src="/static/img/docs/time-range-controls/common-time-controls-7-0.png" max-width="700px">
The options are defined below.

View File

@@ -1,6 +1,6 @@
+++
title = "Data sources"
aliases = ["/docs/grafana/latest/datasources/overview/"]
aliases = ["/docs/grafana/v8.3/datasources/overview/"]
weight = 60
+++

View File

@@ -1,6 +1,6 @@
+++
title = "Add data source"
aliases = ["/docs/grafana/latest/features/datasources/add-a-data-source/"]
aliases = ["/docs/grafana/v8.3/features/datasources/add-a-data-source/"]
weight = 100
+++

View File

@@ -2,13 +2,13 @@
title = "Alertmanager"
description = "Guide for using Alertmanager in Grafana"
keywords = ["grafana", "prometheus", "guide"]
aliases = ["/docs/grafana/latest/features/datasources/alertmanager"]
aliases = ["/docs/grafana/v8.3/features/datasources/alertmanager"]
weight = 150
+++
# Alertmanager data source
Grafana includes built-in support for Prometheus Alertmanager. It is presently in alpha and not accessible unless [alpha plugins are enabled in Grafana settings](https://grafana.com/docs/grafana/latest/administration/configuration/#enable_alpha). Once you add it as a data source, you can use the [Grafana alerting UI](https://grafana.com/docs/grafana/latest/alerting/) to manage silences, contact points as well as notification policies. A drop-down option in these pages allows you to switch between Grafana and any configured Alertmanager data sources.
Grafana includes built-in support for Prometheus Alertmanager. It is presently in alpha and not accessible unless [alpha plugins are enabled in Grafana settings](https://grafana.com/docs/grafana/v8.3/administration/configuration/#enable_alpha). Once you add it as a data source, you can use the [Grafana alerting UI](https://grafana.com/docs/grafana/v8.3/alerting/) to manage silences, contact points as well as notification policies. A drop-down option in these pages allows you to switch between Grafana and any configured Alertmanager data sources.
## Alertmanager implementations

View File

@@ -2,7 +2,7 @@
title = "AWS CloudWatch"
description = "Guide for using CloudWatch in Grafana"
keywords = ["grafana", "cloudwatch", "guide"]
aliases = ["/docs/grafana/latest/datasources/cloudwatch"]
aliases = ["/docs/grafana/v8.3/datasources/cloudwatch"]
weight = 200
+++
@@ -119,7 +119,7 @@ You can monitor a dynamic list of metrics by using the asterisk (\*) wildcard fo
In this example, the query returns all metrics in the namespace `AWS/EC2` with a metric name of `CPUUtilization` and ANY value for the `InstanceId` dimension are queried. This can help you monitor metrics for AWS resources, like EC2 instances or containers. When new instances are created as part of an auto scaling event, they will automatically appear in the graph without you having to track the new instance IDs. This capability is currently limited to retrieving up to 100 metrics.
You can expand the [Query inspector](https://grafana.com/docs/grafana/latest/panels/queries/#query-inspector-button) button and click `Meta Data` to see the search expression that is automatically built to support wildcards. To learn more about search expressions, visit the [CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/search-expression-syntax.html). By default, the search expression is defined in such a way that the queried metrics must match the defined dimension names exactly. This means that in the example only metrics with exactly one dimension with the name InstanceId will be returned.
You can expand the [Query inspector](https://grafana.com/docs/grafana/v8.3/panels/queries/#query-inspector-button) button and click `Meta Data` to see the search expression that is automatically built to support wildcards. To learn more about search expressions, visit the [CloudWatch documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/search-expression-syntax.html). By default, the search expression is defined in such a way that the queried metrics must match the defined dimension names exactly. This means that in the example only metrics with exactly one dimension with the name InstanceId will be returned.
![CloudWatch Meta Inspector](/static/img/docs/cloudwatch/cloudwatch-meta-inspector-8.3.0.png)
@@ -261,11 +261,11 @@ For more information on Grafana alerts, refer to [Alerting]({{< relref "../../al
The Grafana [configuration]({{< relref "../../administration/configuration.md#aws" >}}) file includes an `AWS` section where you can customize the data source.
| Configuration option | Description |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allowed_auth_providers` | Specifies which authentication providers are allowed for the CloudWatch data source. The following providers are enabled by default in OSS Grafana: `default` (AWS SDK default), keys (Access and secret key), credentials (Credentials file), ec2_IAM_role (EC2 IAM role). |
| `assume_role_enabled` | Allows you to disable `assume role (ARN)` in the CloudWatch data source. By default, assume role (ARN) is enabled for OSS Grafana. |
| `list_metrics_page_limit` | When a custom namespace is specified in the query editor, the [List Metrics API](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html) is used to populate the _Metrics_ field and the _Dimension_ fields. The API is paginated and returns up to 500 results per page. The CloudWatch data source also limits the number of pages to 500. However, you can change this limit using the `list_metrics_page_limit` variable in the [grafana configuration file](https://grafana.com/docs/grafana/latest/administration/configuration/#aws). |
| Configuration option | Description |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `allowed_auth_providers` | Specifies which authentication providers are allowed for the CloudWatch data source. The following providers are enabled by default in OSS Grafana: `default` (AWS SDK default), keys (Access and secret key), credentials (Credentials file), ec2_IAM_role (EC2 IAM role). |
| `assume_role_enabled` | Allows you to disable `assume role (ARN)` in the CloudWatch data source. By default, assume role (ARN) is enabled for OSS Grafana. |
| `list_metrics_page_limit` | When a custom namespace is specified in the query editor, the [List Metrics API](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html) is used to populate the _Metrics_ field and the _Dimension_ fields. The API is paginated and returns up to 500 results per page. The CloudWatch data source also limits the number of pages to 500. However, you can change this limit using the `list_metrics_page_limit` variable in the [grafana configuration file](https://grafana.com/docs/grafana/v8.3/administration/configuration/#aws). |
## Pricing

View File

@@ -2,7 +2,7 @@
title = "Authentication"
description = "AWS authentication"
keywords = ["grafana", "aws", "authentication"]
aliases = ["/docs/grafana/latest/datasources/cloudwatch"]
aliases = ["/docs/grafana/v8.3/datasources/cloudwatch"]
weight = 5
+++

View File

@@ -2,7 +2,7 @@
title = "Curated CloudWatch dashboards"
description = "Guide for using AWS CloudWatch in Grafana"
keywords = ["grafana", "stackdriver", "google", "guide", "cloud", "monitoring"]
aliases = ["/docs/grafana/latest/datasources/cloudwatch"]
aliases = ["/docs/grafana/v8.3/datasources/cloudwatch"]
weight = 15
+++

View File

@@ -2,7 +2,7 @@
title = "Provision CloudWatch"
description = "Guide for provisioning CloudWatch"
weight = 400
aliases = ["/docs/grafana/latest/datasources/cloudwatch"]
aliases = ["/docs/grafana/v8.3/datasources/cloudwatch"]
+++
# Provision CloudWatch data source

View File

@@ -2,7 +2,7 @@
title = "Template variables in CloudWatch query"
description = "Template variables in CloudWatch queryh"
weight = 10
aliases = ["/docs/grafana/latest/datasources/cloudwatch"]
aliases = ["/docs/grafana/v8.3/datasources/cloudwatch"]
+++
# Using template variables in CloudWatch queries

View File

@@ -2,7 +2,7 @@
title = "Azure Monitor"
description = "Guide for using Azure Monitor in Grafana"
keywords = ["grafana", "microsoft", "azure", "monitor", "application", "insights", "log", "analytics", "guide"]
aliases = ["/docs/grafana/latest/features/datasources/azuremonitor"]
aliases = ["/docs/grafana/v8.3/features/datasources/azuremonitor"]
weight = 300
+++
@@ -265,7 +265,7 @@ See the following topics to learn more about the Azure Monitor data source:
Customers who host Grafana in Azure (e.g. App Service, Azure Virtual Machines) and have managed identity enabled on their VM, will now be able to use the managed identity to configure Azure Monitor in Grafana. This will simplify the data source configuration, requiring the data source to be securely authenticated without having to manually configure credentials via Azure AD App Registrations for each data source. For more details on Azure managed identities, refer to the [Azure documentation](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview).
To enable managed identity for Grafana, set the `managed_identity_enabled` flag in the `[azure]` section of the [Grafana server config](https://grafana.com/docs/grafana/latest/administration/configuration/#azure).
To enable managed identity for Grafana, set the `managed_identity_enabled` flag in the `[azure]` section of the [Grafana server config](https://grafana.com/docs/grafana/v8.3/administration/configuration/#azure).
```ini
[azure]

View File

@@ -2,7 +2,7 @@
title = "Elasticsearch"
description = "Guide for using Elasticsearch in Grafana"
keywords = ["grafana", "elasticsearch", "guide"]
aliases = ["/docs/grafana/latest/features/datasources/elasticsearch"]
aliases = ["/docs/grafana/v8.3/features/datasources/elasticsearch"]
weight = 325
+++

View File

@@ -2,7 +2,7 @@
title = "Google Cloud Monitoring"
description = "Guide for using Google Cloud Monitoring in Grafana"
keywords = ["grafana", "stackdriver", "google", "guide", "cloud", "monitoring"]
aliases = ["/docs/grafana/latest/features/datasources/stackdriver", "/docs/grafana/next/datasources/cloudmonitoring/", "/docs/grafana/next/features/datasources/cloudmonitoring/"]
aliases = ["/docs/grafana/v8.3/features/datasources/stackdriver", "/docs/grafana/next/datasources/cloudmonitoring/", "/docs/grafana/next/features/datasources/cloudmonitoring/"]
weight = 350
+++

View File

@@ -2,7 +2,7 @@
title = "Preconfigured dashboards"
description = "Guide for using Google Cloud Monitoring in Grafana"
keywords = ["grafana", "stackdriver", "google", "guide", "cloud", "monitoring"]
aliases = ["/docs/grafana/latest/features/datasources/stackdriver", "/docs/grafana/next/features/datasources/cloudmonitoring/"]
aliases = ["/docs/grafana/v8.3/features/datasources/stackdriver", "/docs/grafana/next/features/datasources/cloudmonitoring/"]
weight = 10
+++

View File

@@ -2,7 +2,7 @@
title = "Graphite"
description = "Guide for using graphite in Grafana"
keywords = ["grafana", "graphite", "guide"]
aliases = ["/docs/grafana/latest/features/datasources/graphite"]
aliases = ["/docs/grafana/v8.3/features/datasources/graphite"]
weight = 600
+++

View File

@@ -2,13 +2,13 @@
title = "InfluxDB data source"
description = "Guide for using InfluxDB in Grafana"
keywords = ["grafana", "influxdb", "guide", "flux"]
aliases = ["/docs/grafana/latest/features/datasources/influxdb", "/docs/grafana/latest/datasources/influxdb"]
aliases = ["/docs/grafana/v8.3/features/datasources/influxdb", "/docs/grafana/v8.3/datasources/influxdb"]
weight = 700
+++
# InfluxDB data source
{{< docs/shared "influxdb/intro.md" >}}
{{< docs/shared lookup="influxdb/intro.md" source="grafana" version="<GRAFANA VERSION>" >}}
This topic explains options, variables, querying, and other options specific to this data source. Refer to [Add a data source]({{< relref "../add-a-data-source.md" >}}) for instructions on how to add a data source to Grafana. Only users with the organization admin role can add data sources.

View File

@@ -2,7 +2,7 @@
title = "Jaeger"
description = "Guide for using Jaeger in Grafana"
keywords = ["grafana", "jaeger", "guide", "tracing"]
aliases = ["/docs/grafana/latest/features/datasources/jaeger"]
aliases = ["/docs/grafana/v8.3/features/datasources/jaeger"]
weight = 800
+++

View File

@@ -2,7 +2,7 @@
title = "Loki"
description = "Guide for using Loki in Grafana"
keywords = ["grafana", "loki", "logging", "guide"]
aliases = ["/docs/grafana/latest/features/datasources/loki"]
aliases = ["/docs/grafana/v8.3/features/datasources/loki"]
weight = 800
+++

View File

@@ -2,7 +2,7 @@
title = "Microsoft SQL Server"
description = "Guide for using Microsoft SQL Server in Grafana"
keywords = ["grafana", "MSSQL", "Microsoft", "SQL", "guide", "Azure SQL Database"]
aliases = ["/docs/grafana/latest/features/datasources/mssql/"]
aliases = ["/docs/grafana/v8.3/features/datasources/mssql/"]
weight = 900
+++
@@ -170,7 +170,7 @@ The resulting table panel:
If you set Format as to _Time series_, then the query must have a column named time that returns either a SQL datetime or any numeric datatype representing Unix epoch in seconds. In addition, result sets of time series queries must be sorted by time for panels to properly visualize the result.
A time series query result is returned in a [wide data frame format]({{< relref "../developers/plugins/data-frames.md#wide-format" >}}). Any column except time or of type string transforms into value fields in the data frame query result. Any string column transforms into field labels in the data frame query result.
A time series query result is returned in a [wide data frame format](https://grafana.com/developers/plugin-tools/introduction/data-frames#wide-format). Any column except time or of type string transforms into value fields in the data frame query result. Any string column transforms into field labels in the data frame query result.
> For backward compatibility, there's an exception to the above rule for queries that return three columns including a string column named metric. Instead of transforming the metric column into field labels, it becomes the field name, and then the series name is formatted as the value of the metric column. See the example with the metric column below.

View File

@@ -2,7 +2,7 @@
title = "MySQL"
description = "Guide for using MySQL in Grafana"
keywords = ["grafana", "mysql", "guide"]
aliases = ["/docs/grafana/latest/features/datasources/mysql/"]
aliases = ["/docs/grafana/v8.3/features/datasources/mysql/"]
weight = 1000
+++
@@ -182,7 +182,7 @@ The resulting table panel:
If you set Format as to _Time series_, then the query must have a column named time that returns either a SQL datetime or any numeric datatype representing Unix epoch in seconds. In addition, result sets of time series queries must be sorted by time for panels to properly visualize the result.
A time series query result is returned in a [wide data frame format]({{< relref "../developers/plugins/data-frames.md#wide-format" >}}). Any column except time or of type string transforms into value fields in the data frame query result. Any string column transforms into field labels in the data frame query result.
A time series query result is returned in a [wide data frame format](https://grafana.com/developers/plugin-tools/introduction/data-frames#wide-format). Any column except time or of type string transforms into value fields in the data frame query result. Any string column transforms into field labels in the data frame query result.
> For backward compatibility, there's an exception to the above rule for queries that return three columns including a string column named metric. Instead of transforming the metric column into field labels, it becomes the field name, and then the series name is formatted as the value of the metric column. See the example with the metric column below.

View File

@@ -2,7 +2,7 @@
title = "OpenTSDB"
description = "Guide for using OpenTSDB in Grafana"
keywords = ["grafana", "opentsdb", "guide"]
aliases = ["/docs/grafana/latest/features/opentsdb", "/docs/grafana/latest/features/datasources/opentsdb/"]
aliases = ["/docs/grafana/v8.3/features/opentsdb", "/docs/grafana/v8.3/features/datasources/opentsdb/"]
weight = 1100
+++

View File

@@ -2,7 +2,7 @@
title = "PostgreSQL"
description = "Guide for using PostgreSQL in Grafana"
keywords = ["grafana", "postgresql", "guide"]
aliases = ["/docs/grafana/latest/features/datasources/postgres/"]
aliases = ["/docs/grafana/v8.3/features/datasources/postgres/"]
weight = 1200
+++
@@ -12,7 +12,7 @@ Grafana ships with a built-in PostgreSQL data source plugin that allows you to q
## PostgreSQL settings
To access PostgreSQL settings, hover your mouse over the **Configuration** (gear) icon, then click **Data Sources**, and then click the Prometheus data source.
To access PostgreSQL settings, hover your mouse over the **Configuration** (gear) icon, then click **Data Sources**, and then click the PostgreSQL data source.
| Name | Description |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -187,7 +187,7 @@ The resulting table panel:
If you set Format as to _Time series_, then the query must have a column named time that returns either a SQL datetime or any numeric datatype representing Unix epoch in seconds. In addition, result sets of time series queries must be sorted by time for panels to properly visualize the result.
A time series query result is returned in a [wide data frame format]({{< relref "../developers/plugins/data-frames.md#wide-format" >}}). Any column except time or of type string transforms into value fields in the data frame query result. Any string column transforms into field labels in the data frame query result.
A time series query result is returned in a [wide data frame format](https://grafana.com/developers/plugin-tools/introduction/data-frames#wide-format). Any column except time or of type string transforms into value fields in the data frame query result. Any string column transforms into field labels in the data frame query result.
> For backward compatibility, there's an exception to the above rule for queries that return three columns including a string column named metric. Instead of transforming the metric column into field labels, it becomes the field name, and then the series name is formatted as the value of the metric column. See the example with the metric column below.

View File

@@ -2,7 +2,7 @@
title = "Prometheus"
description = "Guide for using Prometheus in Grafana"
keywords = ["grafana", "prometheus", "guide"]
aliases = ["/docs/grafana/latest/features/datasources/prometheus"]
aliases = ["/docs/grafana/v8.3/features/datasources/prometheus"]
weight = 1300
+++
@@ -10,7 +10,7 @@ weight = 1300
Grafana includes built-in support for Prometheus. This topic explains options, variables, querying, and other options specific to the Prometheus data source. Refer to [Add a data source]({{< relref "add-a-data-source.md" >}}) for instructions on how to add a data source to Grafana. Only users with the organization admin role can add data sources.
> **Note:** You can use [Grafana Cloud](https://grafana.com/products/cloud/features/#cloud-logs) to avoid the overhead of installing, maintaining, and scaling your observability stack. The free forever plan includes Grafana, 10K Prometheus series, 50 GB logs, and more.[Create a free account to get started](https://grafana.com/auth/sign-up/create-user?pg=docs-grafana-install&plcmt=in-text).
> **Note:** You can use [Grafana Cloud](https://grafana.com/products/cloud/features/#cloud-logs) to avoid the overhead of installing, maintaining, and scaling your observability stack. The free forever plan includes Grafana, 10K Prometheus series, 50 GB logs, and more. [Create a free account to get started](https://grafana.com/auth/sign-up/create-user?pg=docs-grafana-install&plcmt=in-text).
## Prometheus settings

View File

@@ -2,7 +2,7 @@
title = "Tempo"
description = "High volume, minimal dependency trace storage. OSS tracing solution from Grafana Labs."
keywords = ["grafana", "tempo", "guide", "tracing"]
aliases = ["/docs/grafana/latest/features/datasources/tempo"]
aliases = ["/docs/grafana/v8.3/features/datasources/tempo"]
weight = 1400
+++
@@ -130,7 +130,7 @@ To display the service graph:
- Select the **Service Graph** query type and run the query
- Optionally, filter by service name
You can pan and zoom the view with buttons or you mouse. For details about the visualization, refer to [Node graph panel](https://grafana.com/docs/grafana/latest/panels/visualizations/node-graph/).
You can pan and zoom the view with buttons or you mouse. For details about the visualization, refer to [Node graph panel](https://grafana.com/docs/grafana/v8.3/panels/visualizations/node-graph/).
Each service in the graph is represented as a circle. Numbers on the inside shows average time per request and request per second.

View File

@@ -1,7 +1,7 @@
+++
title = "TestData"
keywords = ["grafana", "dashboard", "documentation", "panels", "testdata"]
aliases = ["/docs/grafana/latest/features/datasources/testdata"]
aliases = ["/docs/grafana/v8.3/features/datasources/testdata"]
weight = 1500
+++

View File

@@ -2,7 +2,7 @@
title = "Zipkin"
description = "Guide for using Zipkin in Grafana"
keywords = ["grafana", "zipkin", "guide", "tracing"]
aliases = ["/docs/grafana/latest/datasources/zipkin"]
aliases = ["/docs/grafana/v8.3/datasources/zipkin"]
weight = 1600
+++

View File

@@ -1,6 +1,6 @@
+++
title = "Developers"
aliases = ["/docs/grafana/latest/plugins/developing/"]
aliases = ["/docs/grafana/v8.3/plugins/developing/"]
weight = 190
+++

View File

@@ -1,7 +1,7 @@
+++
title = "Contributor License Agreement (CLA)"
description = "Contributor License Agreement (CLA)"
aliases = ["/docs/grafana/latest/project/cla", "docs/contributing/cla.html"]
aliases = ["/docs/grafana/v8.3/project/cla", "docs/contributing/cla.html"]
+++
# Grafana Labs Software Grant and Contributor License Agreement ("Agreement")

View File

@@ -1,87 +0,0 @@
+++
title = "Build a plugin"
aliases = ["/docs/grafana/latest/plugins/developing/"]
+++
# Build a plugin
For more information on the types of plugins you can build, refer to the [Plugin Overview]({{< relref "../../plugins/_index.md" >}}).
## Get started
The easiest way to start developing Grafana plugins is to use the [Grafana Toolkit](https://www.npmjs.com/package/@grafana/toolkit).
Open the terminal, and run the following command in your [plugin directory]({{< relref "../../administration/configuration.md#plugins" >}}):
```bash
npx @grafana/toolkit plugin:create my-grafana-plugin
```
> **Note:** If running NPM 7+ the `npx` commands mentioned in this article may hang. The workaround is to use `npx --legacy-peer-deps <command to run>`.
If you want a more guided introduction to plugin development, check out our tutorials:
- [Build a panel plugin]({{< relref "/tutorials/build-a-panel-plugin.md" >}})
- [Build a data source plugin]({{< relref "/tutorials/build-a-data-source-plugin.md" >}})
## Go further
Learn more about specific areas of plugin development.
### Tutorials
If you're looking to build your first plugin, check out these introductory tutorials:
- [Build a panel plugin]({{< relref "/tutorials/build-a-panel-plugin.md" >}})
- [Build a data source plugin]({{< relref "/tutorials/build-a-data-source-plugin.md" >}})
- [Build a data source backend plugin]({{< relref "/tutorials/build-a-data-source-backend-plugin.md" >}})
Ready to learn more? Check out our other tutorials:
- [Build a panel plugin with D3.js]({{< relref "/tutorials/build-a-panel-plugin-with-d3.md" >}})
### Guides
Improve an existing plugin with one of our guides:
- [Add authentication for data source plugins]({{< relref "add-authentication-for-data-source-plugins" >}})
- [Add support for annotations]({{< relref "add-support-for-annotations.md" >}})
- [Add support for Explore queries]({{< relref "add-support-for-explore-queries.md" >}})
- [Add support for variables]({{< relref "add-support-for-variables.md" >}})
- [Add a query editor help component]({{< relref "add-query-editor-help.md" >}})
- [Build a logs data source plugin]({{< relref "build-a-logs-data-source-plugin.md" >}})
- [Build a streaming data source plugin]({{< relref "build-a-streaming-data-source-plugin.md" >}})
- [Error handling]({{< relref "error-handling.md" >}})
- [Working with data frames]({{< relref "working-with-data-frames.md" >}})
### Concepts
Deepen your knowledge through a series of high-level overviews of plugin concepts:
- [Data frames]({{< relref "data-frames.md" >}})
### UI library
Explore the many UI components in our [Grafana UI library](https://developers.grafana.com/ui).
### Examples
For inspiration, check out our [plugin examples](https://github.com/grafana/grafana-plugin-examples).
### API reference
Learn more about Grafana options and packages.
#### Metadata
- [Plugin metadata]({{< relref "metadata.md" >}})
#### Typescript
- Grafana Data
- Grafana Runtime
- Grafana UI
#### Go
- [Grafana Plugin SDK for Go]({{< relref "backend/grafana-plugin-sdk-for-go" >}})

View File

@@ -1,307 +0,0 @@
+++
title = "Add authentication for data source plugins"
aliases = ["/docs/grafana/latest/plugins/developing/auth-for-datasources/", "/docs/grafana/next/developers/plugins/authentication/"]
+++
# Add authentication for data source plugins
This page explains how to configure your data source plugin to authenticate against a third-party API.
There are two ways you can perform authenticated requests from your plugin—using the [_data source proxy_](#authenticate-using-the-data-source-proxy), or by building a [_backend plugin_](#authenticate-using-a-backend-plugin). The one you choose depends on how your plugin authenticates against the third-party API.
- Use the data source proxy if you need to authenticate using Basic Auth or API keys
- Use the data source proxy if the API supports OAuth 2.0 using client credentials
- Use a backend plugin if the API uses a custom authentication method that isn't supported by the data source proxy, or if your API communicates over a different protocol than HTTP
Regardless of which approach you use, you first need to encrypt any sensitive information that the plugin needs to store.
## Encrypt data source configuration
Data source plugins have two ways of storing custom configuration: `jsonData` and `secureJsonData`.
Users with the _Viewer_ role can access data source configuration—such as the contents of `jsonData`—in cleartext. If you've enabled anonymous access, anyone that can access Grafana in their browser can see the contents of `jsonData`. **Only use `jsonData` to store non-sensitive configuration.**
> **Note:** You can see the settings that the current user has access to by entering `window.grafanaBootData` in the developer console of your browser.
> **Note:** Users of [Grafana Enterprise](https://grafana.com/products/enterprise/grafana/) can restrict access to data sources to specific users and teams. For more information, refer to [Data source permissions](https://grafana.com/docs/grafana/latest/enterprise/datasource_permissions).
If you need to store sensitive information, such as passwords, tokens and API keys, use `secureJsonData` instead. Whenever the user saves the data source configuration, the secrets in `secureJsonData` are sent to the Grafana server and encrypted before they're stored.
Once the secure configuration has been encrypted, it can no longer be accessed from the browser. The only way to access secrets after they've been saved is by using the [_data source proxy_](#authenticate-using-the-data-source-proxy).
#### Add secret configuration to your data source plugin
To demonstrate how you can add secrets to a data source plugin, let's add support for configuring an API key.
Create a new interface in `types.go` to hold the API key.
```ts
export interface MySecureJsonData {
apiKey?: string;
}
```
Add type information to your `secureJsonData` object by updating the props for your `ConfigEditor` to accept the interface as a second type parameter.
```ts
interface Props extends DataSourcePluginOptionsEditorProps<MyDataSourceOptions, MySecureJsonData> {}
```
You can access the value of the secret from the `options` prop inside your `ConfigEditor` until the user saves the configuration. When the user saves the configuration, Grafana clears the value. After that, you can use the `secureJsonFields` to determine whether the property has been configured.
```ts
const { secureJsonData, secureJsonFields } = options;
const { apiKey } = secureJsonData;
```
To securely update the secret in your plugin's configuration editor, update the `secureJsonData` object using the `onOptionsChange` prop.
```ts
const onAPIKeyChange = (event: ChangeEvent<HTMLInputElement>) => {
onOptionsChange({
...options,
secureJsonData: {
apiKey: event.target.value,
},
});
};
```
Next, define a component that can accept user input.
```ts
<Input
type="password"
placeholder={secureJsonFields?.apiKey ? 'configured' : ''}
value={secureJsonData.apiKey ?? ''}
onChange={onAPIKeyChange}
/>
```
Finally, if you want the user to be able to reset the API key, then you need to set the property to `false` in the `secureJsonFields` object.
```ts
const onResetAPIKey = () => {
onOptionsChange({
...options,
secureJsonFields: {
...options.secureJsonFields,
apiKey: false,
},
secureJsonData: {
...options.secureJsonData,
apiKey: '',
},
});
};
```
Now that users can configure secrets, the next step is to see how we can add them to our requests.
## Authenticate using the data source proxy
Once the user has saved the configuration for a data source, any secret data source configuration will no longer be available in the browser. Encrypted secrets can only be accessed on the server. So how do you add them to you request?
The Grafana server comes with a proxy that lets you define templates for your requests. We call them _proxy routes_. Grafana sends the proxy route to the server, decrypts the secrets along with other configuration, and adds them to the request before sending it off.
> **Note:** Be sure not to confuse the data source proxy with the [auth proxy]({{< relref "../../auth/auth-proxy.md" >}}). The data source proxy is used to authenticate a data source, while the auth proxy is used to log into Grafana itself.
### Add a proxy route to your plugin
To forward requests through the Grafana proxy, you need to configure one or more proxy routes. A proxy route is a template for any outgoing request that is handled by the proxy. You can configure proxy routes in the [plugin.json](https://grafana.com/docs/grafana/latest/developers/plugins/metadata/) file.
1. Add the route to plugin.json. Note that you need to restart the Grafana server every time you make a change to your plugin.json file.
```json
"routes": [
{
"path": "example",
"url": "https://api.example.com"
}
]
```
1. In the `DataSource`, extract the proxy URL from `instanceSettings` to a class property called `url`.
```ts
export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
url?: string;
constructor(instanceSettings: DataSourceInstanceSettings<MyDataSourceOptions>) {
super(instanceSettings);
this.url = instanceSettings.url;
}
// ...
}
```
1. In the `query` method, make a request using `BackendSrv`. The first section of the URL path needs to match the `path` of your proxy route. The data source proxy replaces `this.url + routePath` with the `url` of the route. The following request will be made to `https://api.example.com/v1/users`.
```ts
import { getBackendSrv } from '@grafana/runtime';
```
```ts
const routePath = '/example';
getBackendSrv().datasourceRequest({
url: this.url + routePath + '/v1/users',
method: 'GET',
});
```
### Add a dynamic proxy route to your plugin
Grafana sends the proxy route to the server, where the data source proxy decrypts any sensitive data and interpolates the template variables with the decrypted data before making the request.
To add user-defined configuration to your routes, add `{{ .JsonData.apiKey }}` to the route, where `apiKey` is the name of a property in the `jsonData` object.
```json
"routes": [
{
"path": "example",
"url": "https://api.example.com/projects/{{ .JsonData.projectId }}"
}
]
```
You can also configure your route to use sensitive data by using `.SecureJsonData`.
```json
"routes": [
{
"path": "example",
"url": "https://{{ .JsonData.username }}:{{ .SecureJsonData.password }}@api.example.com"
}
]
```
In addition to the URL, you can also add headers, URL parameters, and a request body, to a proxy route.
#### Add HTTP headers to a proxy route
```json
"routes": [
{
"path": "example",
"url": "https://api.example.com",
"headers": [
{
"name": "Authorization",
"content": "Bearer {{ .SecureJsonData.apiToken }}"
}
]
}
]
```
#### Add URL parameters to a proxy route
```json
"routes": [
{
"path": "example",
"url": "http://api.example.com",
"urlParams": [
{
"name": "apiKey",
"content": "{{ .SecureJsonData.apiKey }}"
}
]
}
]
```
#### Add a request body to a proxy route
```json
"routes": [
{
"path": "example",
"url": "http://api.example.com",
"body": {
"username": "{{ .JsonData.username }}",
"password": "{{ .SecureJsonData.password }}"
}
}
]
```
### Add a OAuth 2.0 proxy route to your plugin
The data source proxy supports OAuth 2.0 authentication.
Since the request to each route is made server-side, only machine-to-machine authentication is supported. In order words, if you need to use a different grant than client credentials, you need to implement it yourself.
To authenticate using OAuth 2.0, add a `tokenAuth` object to the proxy route definition. If necessary, Grafana performs a request to the URL defined in `tokenAuth` to retrieve a token before making the request to the URL in your proxy route. Grafana automatically renews the token when it expires.
Any parameters defined in `tokenAuth.params` are encoded as `application/x-www-form-urlencoded` and sent to the token URL.
```json
{
"routes": [
{
"path": "api",
"url": "https://api.example.com/v1",
"tokenAuth": {
"url": "https://api.example.com/v1/oauth/token",
"params": {
"grant_type": "client_credentials",
"client_id": "{{ .SecureJsonData.clientId }}",
"client_secret": "{{ .SecureJsonData.clientSecret }}"
}
}
}
]
}
```
## Authenticate using a backend plugin
While the data source proxy supports the most common authentication methods for HTTP APIs, using proxy routes has a few limitations:
- Proxy routes only support HTTP or HTTPS
- Proxy routes don't support custom token authentication
If any of these limitations apply to your plugin, you need to add a [backend plugin]({{< relref "./backend/_index.md" >}}). Since backend plugins run on the server they can access decrypted secrets, which makes it easier to implement custom authentication methods.
The decrypted secrets are available from the `DecryptedSecureJSONData` field in the instance settings.
```go
func (ds *dataSource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
instanceSettings := req.PluginContext.DataSourceInstanceSettings
if apiKey, exists := settings.DecryptedSecureJSONData["apiKey"]; exists {
// Use the decrypted API key.
}
// ...
}
```
## Forward OAuth identity for the logged-in user
If your data source uses the same OAuth provider as Grafana itself, for example using [Generic OAuth Authentication]({{< relref "../../auth/generic-oauth.md" >}}), your data source plugin can reuse the access token for the logged-in Grafana user.
To allow Grafana to pass the access token to the plugin, update the data source configuration and set the` jsonData.oauthPassThru` property to `true`. The [DataSourceHttpSettings](https://developers.grafana.com/ui/latest/index.html?path=/story/data-source-datasourcehttpsettings--basic) provides a toggle, the **Forward OAuth Identity** option, for this. You can also build an appropriate toggle to set `jsonData.oauthPassThru` in your data source configuration page UI.
When configured, Grafana will pass the user's token to the plugin in an Authorization header, available on the `QueryDataRequest` object on the `QueryData` request in your backend data source.
```go
func (ds *dataSource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error) {
for _, q := range req.Queries {
token := strings.Fields(q.Headers.Get("Authorization"))
var (
tokenType = token[0]
accessToken = token[1]
)
// ...
}
}
```
> **Note:** Due to a bug in Grafana, using this feature with PostgreSQL can cause a deadlock. For more information, refer to [Grafana causes deadlocks in PostgreSQL, while trying to refresh users token](https://github.com/grafana/grafana/issues/20515).

Some files were not shown because too many files have changed in this diff Show More