Compare commits

..

242 Commits

Author SHA1 Message Date
Grot (@grafanabot)
41f0542c1e Release: Bump version to 8.0.0 (#35341)
* "Release: Updated versions in package to 8.0.0"

* Update whats new & release notes URL

Co-authored-by: Elfo404 <me@giordanoricci.com>
2021-06-08 07:05:23 +01:00
Grot (@grafanabot)
c82ac69dff Docs: expand unified alerting silences docs page (#35332) (#35349)
(cherry picked from commit eb9e7d9fb9)

Co-authored-by: Domas <domas.lapinskas@grafana.com>
2021-06-08 07:26:46 +02:00
Grot (@grafanabot)
904dcdd2d7 AzureMonitor: Update documentation and v8 Whats New (#35275) (#35348)
* AzureMonitor: Update documentation and v8 Whats New

* update docs, provisioning:

* minor updates, mainly images

* fix typos

* fixes

* few other minor fixes

* Update docs/sources/datasources/azuremonitor.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update azuremonitor.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
(cherry picked from commit 8a0cef9954)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-06-07 23:23:44 +02:00
Grot (@grafanabot)
03023af9c9 Fix alerting docs (#35340) (#35345)
* First commit.

* More changes, to make sure all alert information flows.

* Updated a title

(cherry picked from commit 1f012871b4)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-06-07 19:32:21 +02:00
Torkel Ödegaard
6362bb2f36 Docs: Sync all doc changes in main to v8.0.x (#35333) 2021-06-07 18:38:48 +02:00
Grot (@grafanabot)
df42e49d06 Login: Fixes Unauthorized message showing when on login page or snapshot page (#35311) (#35315)
(cherry picked from commit ce513e4637)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-07 12:06:37 +02:00
Grot (@grafanabot)
94e9c0ea48 Prometheus: Metrics browser layout (#35035) (#35267)
* Metrics browser layout

* Simplified layout

(cherry picked from commit aae6e86547)

Co-authored-by: David <david.kaltschmidt@gmail.com>
2021-06-07 08:29:21 +02:00
Grot (@grafanabot)
1d721107c3 Expressions: updating copy from experimental to beta. (#35149) (#35247)
(cherry picked from commit 456b356f21)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-06-07 06:13:24 +02:00
Grot (@grafanabot)
4c2822e5b7 Alerting: Allow rules with same title across folders (#35270) (#35281)
* Alerting: Allow rules with same title across folders

* Add test

(cherry picked from commit 8cda1f5153)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-05 19:49:34 +03:00
Grot (@grafanabot)
d25695b1e3 Histogram: reduce default bucket size, fix rendering (#35294) (#35297)
(cherry picked from commit 36925ef521)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-06-05 00:26:20 -05:00
Grot (@grafanabot)
2108faff7c Grafana-ui: explicitly set storybook control types (#35265) (#35274)
(cherry picked from commit c39d0fa8c3)

Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
2021-06-04 22:07:37 +01:00
Grot (@grafanabot)
d76bcd082f Panels: avoid crash while switching between panels types (#35286) (#35289)
(cherry picked from commit 351400b82e)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-06-04 21:36:57 +02:00
Grot (@grafanabot)
557c310c8c Alerting: Recact html responses (#35277) (#35282)
(cherry picked from commit fba90b8f9b)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-04 21:29:23 +03:00
Grot (@grafanabot)
a95c3419b7 Histogram: support units on the x axis (#35218) (#35280)
(cherry picked from commit 99a6337e1f)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-06-04 20:11:49 +02:00
Grot (@grafanabot)
6b9f067bf2 [v8.0.x] Catalog: Show message prompting user to refresh browser (#35271) (#35279)
(cherry picked from commit 3bbe6473b6)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-06-04 19:45:39 +02:00
Grot (@grafanabot)
c882b7a525 Caching: document memory limit settings (#35189) (#35269)
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
(cherry picked from commit 0a28304d2a)

Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
2021-06-04 10:07:02 -07:00
Grot (@grafanabot)
7f410cceee Elasticsearch: Fix min_doc_count value when alerting (#35254) (#35264)
* Elasticsearch: Fix min_doc_count value when alerting

* Add tests

(cherry picked from commit 7a304223e6)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-06-04 17:10:02 +02:00
Grot (@grafanabot)
74eb38e2fc Graph: fixes storybook crashing when using the story (#35251) (#35259)
* Graph: fixes storybook crashing when using the story

* fixes the GraphWithLegend story too

(cherry picked from commit 70155c7fd0)

Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
2021-06-04 16:52:58 +02:00
Jack Westbrook
1aaed7c2fe Card: Defend against conditional action buttons (#35204) (#35256)
* fix(card): defend against invalid elements types passed to BaseActions

* test(card): add test to support conditional buttons being passed in

* fix(playlistpage): remove disabled prop from LinkButton for editors

* chore(playlistpage): remove title from edit button

(cherry picked from commit c13f247a94)
2021-06-04 17:38:36 +03:00
Grot (@grafanabot)
7f6f9fbce9 Grafana-UI: Allow Card consumers to override disabled prop for action (#34664) (#35249)
(cherry picked from commit 8afb15296a)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-06-04 16:06:24 +02:00
Grot (@grafanabot)
7eda7945d3 Alerting: Fix notification channel migration and handle case when Alertmanager default configuration is absent (#35086) (#35246)
* Fix dashboard alert and nootifier migration for MySQL

* Fix POSTing Alertmanager configuration if no current configuration exists

in case the default configuration has not be stored yet
or has failed to get stored

* Change CreatedAt field type

(cherry picked from commit 15c55b0115)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-04 16:41:28 +03:00
Grot (@grafanabot)
da8d9e6854 Renderer: add version information (#34964) (#35245)
* Renderer: add version information

* fix alerting test

(cherry picked from commit 5f6c172b5a)

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2021-06-04 14:27:58 +02:00
Grot (@grafanabot)
e3ffea3f1b AzureMonitor: fix Azure Resource Graph queries in Azure China (#35235) (#35244)
* Optimize Azure Monitor routes

* Update API version compatible with Azure China

(cherry picked from commit 412bcf1fb0)

Co-authored-by: Sergey Kostrukov <sekost@microsoft.com>
2021-06-04 13:57:14 +02:00
Grot (@grafanabot)
7b64b6f140 Remove extra margin for checkboxes (#35169) (#35242)
(cherry picked from commit bfcc6a2248)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-06-04 13:34:29 +02:00
Grot (@grafanabot)
3fa0811d6b Add missing select options for controls (#35178) (#35237)
(cherry picked from commit f683a497eb)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-06-04 11:53:40 +02:00
Grot (@grafanabot)
bc49ceddb7 remove incorrect use of grafana-cli logger (#35228) (#35236)
(cherry picked from commit 2e9ad871b3)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-06-04 11:32:06 +02:00
Grot (@grafanabot)
f5c55ffbe3 NodeGraph: Make grid view responsive (#35047) (#35234)
(cherry picked from commit aa7dbd7a69)

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2021-06-04 11:25:41 +02:00
Grot (@grafanabot)
ebc38afce5 Annotations: Fix so annotations work in panel edit (#35195) (#35233)
(cherry picked from commit a7606d130e)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-06-04 11:18:30 +02:00
Grot (@grafanabot)
64b58cc3a1 Library Panels: Fix refresh when changing to angular library panel (#35048) (#35160)
Closes #34874

(cherry picked from commit 7c0158cdff)
2021-06-04 11:09:39 +02:00
Grot (@grafanabot)
a817a8ac52 Chore: Update drone pipeline failure message to include target branch (#35170) (#35171)
(cherry picked from commit 56e0efbb56)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2021-06-04 11:53:09 +03:00
Grot (@grafanabot)
b052edf8ba Use laher/mergefs - remove custom code (#34571) (#35161)
(cherry picked from commit 6970c9ebfd)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2021-06-04 11:52:11 +03:00
Grot (@grafanabot)
956f728f61 SSE: Change math expression to accept any value convertible to float (#34996) (#35202)
* SSE: Change math expression to accept any scalar value

* Apply suggestions from code review

* Update test

* Remove TODO

(cherry picked from commit eeb84d09c2)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-04 11:49:33 +03:00
Grot (@grafanabot)
1647073a00 DevEnv: Fix docker-driver plugin installation direction url (#35227)
(cherry picked from commit e6c53e4bcd)

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-06-04 10:30:30 +02:00
Grot (@grafanabot)
7b67612f7d Scuemata: Checking json validity by enabling skipped tests (#34385) (#35226)
* Make sure we don't skip any tests - refactoring

* Remove commented lines

* Move test folder

(cherry picked from commit 4c8ce8a450)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2021-06-04 10:03:58 +02:00
Grot (@grafanabot)
9439b6acba NodeGraph: Fix sorting markers in grid view (#35200) (#35216)
* Fix test data field label

* Fix sorting

* Changed icon for sorting

(cherry picked from commit 1dc387536e)

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2021-06-04 09:55:03 +02:00
Grot (@grafanabot)
6f9ecceb9f Chore: Upgrade golangci-lint (#35188) (#35192)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
(cherry picked from commit 4d1cbe551f)

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-06-04 07:45:15 +02:00
Grot (@grafanabot)
6c512e1414 Alerting: Expand {{$labels.xyz}} template in labels and annotations (#35159) (#35208)
* Alerting: Expand `{{$labels.xyz}}` template in labels and annotations

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix annotation not updating for same alert

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit 8417088969)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-06-04 11:05:19 +05:30
Grot (@grafanabot)
e6c2291a44 Annotations: Fix so adds, updates and deletes are shown correctly (#35184) (#35198)
* Annotations: Fix for update/save/delete annotation not appearing/disappearing

* Annotations: Fix so adds, updates and deletes are shown correctly

* Chore: updates after PR comments

(cherry picked from commit abd4e70792)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-06-04 05:55:08 +02:00
Grot (@grafanabot)
ccc0a52d4a Histogram: enable client-side zoom (with bucket snapping) (#35220) (#35221)
(cherry picked from commit 43d3d97562)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-06-04 03:28:49 +02:00
Grot (@grafanabot)
c8d6168bbf Timeseries: move join field to index zero (#35217) (#35219)
(cherry picked from commit e1af571efd)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-06-04 01:36:05 +02:00
Gabriel MABILLE
e49bf5926a Provisioning: Update accesscontrol sample file (#35203)
(cherry picked from commit 134dba5101)
2021-06-03 17:46:23 +02:00
Grot (@grafanabot)
4aa622f7f1 influxdb: docs: add new screenshot (#35156) (#35201)
(cherry picked from commit b558d32502)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-06-03 17:31:00 +02:00
Grot (@grafanabot)
a8b2415b1f Timeline: tooltip fixups (#35145) (#35191)
(cherry picked from commit a3ba605aff)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-06-03 09:50:16 -05:00
Grot (@grafanabot)
4fe55be39e Alerting: Do not hard fail on templating errors in channels (#35165) (#35193)
* Alerting: Do not hard fail on templating errors in channels

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix review

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit a30e60a0b8)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-06-03 16:48:37 +02:00
Grot (@grafanabot)
d78e78c2f4 AzureMonitor: Fix permissions issue with Logs template variable queries (#35181) (#35194)
(cherry picked from commit 5fb37ad5dc)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-06-03 16:47:24 +02:00
Grot (@grafanabot)
69dc4b281d Grafana-UI: Fix checkbox vertical alignment (#35124) (#35174)
* Grafana-UI: Fix Checkbox vertical layout issues

* reorganise css

* revert my 'fix' and just go back to setting a min height :(

(cherry picked from commit 32d9b04666)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-06-03 16:44:15 +02:00
Grot (@grafanabot)
681c2b3338 Chore: Remove endpoints that contain the slug field (#35104) (#35182)
* Chore: Remove endpoints that contain the slug field

* More cleanups

* Lint fixes

* Remove unnecessary funcs

* Cleanup frontend code

* Remove deprecated endpoints from docs

* Revert change according to reviewer's comments

(cherry picked from commit 1c49986b2f)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2021-06-03 15:57:25 +02:00
Grot (@grafanabot)
c0b872aae1 Timeline/Status grid panel: Add tooltip support (#35005) (#35183)
* Timeline/Status grid tooltip support first pass

* Tooltips workin

* Use getValueFormat to get the duration

* Separate boxes highlight from tooltip interpolation

* Separate state timeline tooltip component, rely on field display color to retrieve color of series

* create an onHover/onLeave API and optimize implementation

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
(cherry picked from commit 7359ba44d0)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-06-03 15:50:49 +02:00
Grot (@grafanabot)
5d772ffbe0 Alerting: Don't save Alertmanager config on migration when 0 channels (#35119) (#35180)
* Alerting: Don't save Alertmanager config on migration when 0 channels

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix review

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit aa4c5bbfe4)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-06-03 19:14:30 +05:30
Grot (@grafanabot)
b04a21b002 Add verbose version flag to list dependencies as well as the version (#34741) (#35176)
* add verbose version flag to list dependencies as well as the version

* Fix typo in the println message

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
(cherry picked from commit 9d33a06b4e)

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
2021-06-03 15:21:13 +02:00
Grot (@grafanabot)
5fe040d26b Chore: Refactor backend plugin manager/tsdb query data (#34944) (#35172)
Move QueryData method into backend plugin manager which HandleRequest uses to
query data from plugin SDK supported data sources. This allowed us to remove a lot
of code no longer needed.

Ref #21510

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
(cherry picked from commit b3e9087557)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-06-03 14:41:42 +02:00
Torkel Ödegaard
57060a2276 PanelEdit: Add data source label to data source picker dropdown (#34605) (#35148)
* PanelEdit: Add data source label to data source picker dropdown

* Updated based on ux feedback

(cherry picked from commit ec33bae8d4)
2021-06-03 14:32:50 +02:00
Grot (@grafanabot)
7feb7dab38 GraphNG: uPlot 1.6.11 (#35146) (#35158)
(cherry picked from commit 433f11a78c)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-06-03 07:28:17 -05:00
Grot (@grafanabot)
6a08652891 DashboardRow: fixes time variable not updating when used in row title (#34523) (#35168)
* DashboardRow: fixes time variable not updating when used in row title

* adds test cases for subscribe event

(cherry picked from commit 395d7eb74c)

Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
2021-06-03 14:02:41 +02:00
Grot (@grafanabot)
cf02cb2987 VizLegendTable: fixes column spacing to span to the right side (#35045) (#35167)
* VizLegendTable: fixes column spacing to span to the right side

* reverted text alignment to right

* implemented a more readable solution for tabble legend spacing

(cherry picked from commit 4d574bb8aa)

Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
2021-06-03 13:52:49 +02:00
Grot (@grafanabot)
aa6355b6ea NodeGraph: Don't check for preferredVisualisationType (#35116) (#35163)
* Don't check for preferredVisualisationType inside the NodeGraph

* Fix layout worker mocking

(cherry picked from commit 0b94f33813)

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2021-06-03 13:22:15 +02:00
Grot (@grafanabot)
1e533f37ed Security: Update default CSP template and fix firefox CSP issues (#34836) (#35162)
* Security: Update default content_security_policy_template
- Add 'strict-dynamic' back to script-src
- Add ws(s)://$ROOT_PATH to connect-src
- Change onEvent to on-event in angular templates to fix CSP issues in firefox.
- Add blob: to style-src

(cherry picked from commit 8143991b94)
2021-06-03 12:11:14 +01:00
Grot (@grafanabot)
7083577a4a Chore: Bump sanitize-url to 5.0.2 (#35088) (#35151)
(cherry picked from commit 9df23b8fff)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-06-03 11:34:29 +02:00
Grot (@grafanabot)
ada0a52a0f fix bad log format (#35150) (#35153)
(cherry picked from commit 057ba4a6e7)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-06-03 10:55:43 +02:00
Grot (@grafanabot)
0546486f31 plugin: add signature status plugin build info (#35128) (#35132)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
(cherry picked from commit ba7aca69f6)

Co-authored-by: Carl Bergquist <carl.bergquist@gmail.com>
2021-06-03 08:24:20 +02:00
Grot (@grafanabot)
dd8bf2afa8 State-timeline: support migrating from discrete panel (#35071) (#35134)
(cherry picked from commit a9b5aa1088)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-06-02 21:45:36 +02:00
Grot (@grafanabot)
553a8d0e55 Live: fix field filtering and survive reconnect (#35122) (#35133)
(cherry picked from commit f7893ca5cf)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-06-02 21:36:14 +02:00
Grot (@grafanabot)
56dff33244 Histogram: Adds histogram test dashboard & test data (#34821) (#35130)
* Added test data that contains normal distribution

* Added histogram test dashboard

* Fixed so panels share same data

(cherry picked from commit 119dbc4d76)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-02 20:52:44 +02:00
Grot (@grafanabot)
865ae950ae FieldDisplay: add cache to reuse field value calculations (#35072) (#35127)
* add timeline value cache

* add timeline value cache

* with console logs

* cleanup

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
(cherry picked from commit 744ca8d439)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-06-02 11:42:09 -07:00
Grot (@grafanabot)
d97bc8c0a9 SSE: Refactor to simplify Series type (#35063) (#35123)
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
(cherry picked from commit 4093fae99a)

Co-authored-by: Kyle Brandt <kyle@grafana.com>
2021-06-02 19:24:54 +02:00
Grot (@grafanabot)
0924f4e268 live: log error on dashboard subscribe (#35095) (#35117)
(cherry picked from commit 7aee0deb38)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-06-02 18:54:26 +03:00
Grot (@grafanabot)
d9cc16af41 Tempo: search fixes (#35004) (#35114)
* Tempo: search fixes

Add custom width to time and trace id
Run and show query in search after page refresh

* Iterate through all response data

* Don't store linkedQuery as a property

(cherry picked from commit bf96f5e285)

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-06-02 17:02:16 +02:00
Grot (@grafanabot)
29eb1c1149 InfluxDB: deprecate direct browser access in data source (#35105) (#35113)
* influxdb: deperacate direct browser-access

* better docs-formatting

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
(cherry picked from commit 89fc92947c)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-06-02 17:00:54 +02:00
Grot (@grafanabot)
151cfc9693 Chore: Upgrade prometheus/alertmanager dependency to v0.22.2 (#35102) (#35109)
* Chore: Upgrade prometheus/alertmanager dependency to v0.22.2

* go mod tidy

(cherry picked from commit 5d41e83896)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-06-02 16:29:43 +02:00
Grot (@grafanabot)
949662ee5e VizLegend: add readonly prop (#35096) (#35107)
* VizLegend: add readonly prop

* Update packages/grafana-ui/src/components/VizLegend/VizLegendTableItem.tsx

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
(cherry picked from commit a08ee057eb)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-06-02 16:04:03 +02:00
Grot (@grafanabot)
ebe4596c75 ChangeTracker: Unified unsaved changes handling with library panels (#34989) (#35091)
* UnsavedChanges: Move Change tracker to use Prompt

* Fix a lot of race conditions and stacking of changes in onConfirm and onDismiss

* Listen to save event

* add missing delay argument

* migrated the change tracker unit tests

* Updated snapshot

* Removed unessary action

* removed updateSourcePanel

* Fix hiding save library panel modal prompt when clicking discard

* change saved libray panel title and buttons so they are a bit different as Prompt and when used from save button

* Fixed issue with saving new dashboard

* Now all scenarios work

* increase wait time

* Fixed one more race condition

(cherry picked from commit e6f2b10a36)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-02 13:20:13 +02:00
Grot (@grafanabot)
38f58cc42b AzureMonitor: Use resource type display names in the UI (#35060) (#35094)
* AzureMonitor: Use display names for resource types and locations

* de-pluralize resource types

* Rename Namespace field to Resource Type, and use display names

* add comments

(cherry picked from commit 3be0a2d328)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-06-02 13:15:36 +02:00
Grot (@grafanabot)
159953e258 Cleanup the options initialization (#35080) (#35089)
(cherry picked from commit f052f10289)

Co-authored-by: Sergey Kostrukov <sekost@microsoft.com>
2021-06-02 12:25:01 +02:00
Grot (@grafanabot)
78cabc2e39 Docs: Add datalinks example to ElasticSearch docs (#34956) (#35081)
(cherry picked from commit 9ebe585ec8)

Co-authored-by: Fabian Gonzalez <fabiangonz98@gmail.com>
2021-06-02 09:44:14 +02:00
Grot (@grafanabot)
17e92cc436 Chore: Make drone failed nightly checks send slack messages to #grafana-backend (#35076) (#35079)
(cherry picked from commit 27ad970c2b)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2021-06-02 09:14:07 +02:00
Grot (@grafanabot)
4344975654 Variables: Support raw values of boolean type (#34727) (#35075)
(cherry picked from commit 4137534650)

Co-authored-by: Simon Podlipsky <simon@podlipsky.net>
2021-06-02 07:03:38 +02:00
Grot (@grafanabot)
5bb876f414 Chore: Refactor short url api test (#35051) (#35066) 2021-06-01 20:58:45 +02:00
Grot (@grafanabot)
adfb3d4e21 InfluxDB: Flux: timestamp-column has to be first in dataframes (#35036) (#35053)
(cherry picked from commit 38b030e2a4)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-06-01 18:09:30 +02:00
Grot (@grafanabot)
d1b02d524c Debounce location update (#35033) (#35056)
(cherry picked from commit 486ab7c639)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-06-01 16:45:53 +02:00
Grot (@grafanabot)
2f5d699a3e Checkbox: Fixes vertical layout isssue with Checkboxes due to fixed height (#35022) (#35055)
(cherry picked from commit dc5e7695e4)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-01 16:37:57 +02:00
Grot (@grafanabot)
7727ba3f69 ReleaseNotes: Updated changelog and release notes for 8.0.0-beta3 (#35049) (#35054)
* ReleaseNotes: Updated changelog and release notes for 8.0.0-beta3

* Docs: adds Beta3 to index

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
(cherry picked from commit 046de10cd7)
2021-06-01 16:32:04 +02:00
Grot (@grafanabot)
abc13765b9 Short URL: Fix so that orgId is included in generated short URL (#34696) (#35042)
Fixes #33813

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
(cherry picked from commit 0d1b35f99e)

Co-authored-by: Jan Jansen <farodin91@users.noreply.github.com>
2021-06-01 15:00:11 +02:00
Grot (@grafanabot)
a489759271 Dashboard: Fix Table view when editing causes the panel data to not update (#34998) (#35041)
* Dashboard: Fix Table view when editing causes the panel data to not update

- Add event subscription on PanelEditorTableView
- Extract runAllPanelQueries into Panel Model in order to use it on PanelChrome and PanelEditorTableView
- Add simple unit test for runAllQueryPaneQueries

(cherry picked from commit ff03b456f1)

Co-authored-by: Maria Alexandra <239999+axelavargas@users.noreply.github.com>
2021-06-01 14:45:32 +02:00
Grot (@grafanabot)
f99e87f2ed Fix enterprise autodeploy (#34889) (#35037)
Config file needs to be copied over

No-op for OSS grafana

(cherry picked from commit 22544bd135)

Co-authored-by: Julien Duchesne <julienduchesne@live.com>
2021-06-01 14:00:27 +02:00
Grot (@grafanabot)
a606cb9b1e Chore: Add Circle CI empty config (#35020) (#35032)
* Fix Circle CI check with adding an empty config

* Add version

* Add empty jobs and workflows

* Add job with docker image

* Add step

(cherry picked from commit ec29c3b84f)

Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>
2021-06-01 13:42:08 +02:00
Grot (@grafanabot)
bd6f91fa83 Add docs for Tempo search (#34526) (#35034)
* Add docs for Tempo search

* Apply suggestions from code review

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Update docs/sources/datasources/tempo.md

Co-authored-by: Robby Milo <robby.milo@grafana.com>

* Apply suggestions from code review

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Robby Milo <robby.milo@grafana.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
(cherry picked from commit b211b3a63c)

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-06-01 12:34:24 +02:00
Grot (@grafanabot)
10cdbad0ad "Release: Updated versions in package to 8.0.0-beta.3" (#35030) 2021-06-01 11:49:11 +02:00
Grot (@grafanabot)
a7d22e4b45 Table: datalink to have text underline and support for image datalink (#34635) (#35029)
* Table: datalink to have text underline and support for image datalink

* fixes image oversize issue when using both image and link in a column

* fixes small nit

* extracted the getLink logic to be a standalone utility function

* Updates table tests to suit current structure

* fixes small syntax nit

* fixes bad typing issue

* annotes the getCellLinks logic as an internal utility function

* removes blank whitespace

* Tests: updates test cases to use getByRole

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
(cherry picked from commit 865eac309c)

Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
2021-06-01 11:29:06 +02:00
Grot (@grafanabot)
3f839c734c Docs: Add query caching to enterprise docs page (#34751) (#35026)
* add query caching to enterprise docs page

* Update docs/sources/enterprise/_index.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
(cherry picked from commit 9bd823bac3)

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>
2021-06-01 11:06:34 +02:00
Grot (@grafanabot)
cb0ffc3ba3 NodeGraph: Make web worker inline fixing error when assets are loaded with different origin (#35013) (#35019)
(cherry picked from commit cb4f5b249f)

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2021-06-01 10:33:44 +02:00
Domas
a108647836 Alerting: check upstream response content type in lotex proxy (#34760) (#34842)
(cherry picked from commit 347273cdea)
2021-06-01 11:25:16 +03:00
Grot (@grafanabot)
a96a58a305 Chore: Remove CircleCI (#35014) (#35017)
(cherry picked from commit a9f652ab7a)

Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>
2021-06-01 10:17:07 +02:00
Grot (@grafanabot)
e777729f6f TimeSeries: Migration from old graph legend values (#34997) (#35018)
* fix(timeseries): filter enabled graph legend values when migrating

* test(timeseries): update snapshots

* test(timeseries): add additional tests for legend

(cherry picked from commit cb3c317e81)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-06-01 10:15:40 +02:00
Grot (@grafanabot)
e555bcdd01 Logs: Use GraphNG to plot log histograms (#34531) (#35016)
* Switch to GraphNG for Logs Histogram

* Remove redundant timeZone

It was used just to format timestamp in the tooltip but it's not needed anymore.

* Add tests for creating logs histogram data

* Update decoractors tests

* Adjust bar width to be more like in the old graph

* Fix tooltip pointer color

* Test tooltip pointer color

* Decouple graph config from uPlot internals

* Ensure nested properties are not mutated when overrides are applied

* Add legend toggling for Explore graphs

* Remove unused component

ExploreGraphNGPanel is now used in Explore

* Code formatting

* allow multiple bars pathBuilders to be globally cached with different settings

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
(cherry picked from commit f4a40a4d85)

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-06-01 09:56:49 +02:00
Arve Knudsen
1c87edb7cf Drone: Sync with main (#35015)
* Drone: Sync with main

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-06-01 09:45:39 +02:00
Grot (@grafanabot)
0727a3a66b Reporting: update docs (#34740) (#35011)
* Reporting: update dcos

* Add info about pausing reports

* Add version note

* Update docs/sources/enterprise/reporting.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Docs: update report form information

* Docs: update report scheduling

* Docs: re-order reporting sections

* Update docs/sources/enterprise/reporting.md

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

* Update docs/sources/enterprise/reporting.md

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

* Update docs/sources/enterprise/reporting.md

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

* Update docs/sources/enterprise/reporting.md

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

* Update docs/sources/enterprise/reporting.md

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

* Update docs/sources/enterprise/reporting.md

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

* Update docs/sources/enterprise/reporting.md

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

* Update docs/sources/enterprise/reporting.md

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

* Update docs/sources/enterprise/reporting.md

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Agnès Toulet <agnes.toulet@gmail.com>
Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>
(cherry picked from commit c6a78a6bd7)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-06-01 09:03:22 +02:00
Grot (@grafanabot)
ec170be577 Collapse: Fixes icon (angle down/right) positioning (#34930) (#35009)
(cherry picked from commit ce63da63db)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-01 08:53:15 +02:00
Grot (@grafanabot)
3eca7864ed NodeGraph: Fix error when clicking link in a context menu (#34817) (#34830)
* Add prevent default if onClick exists

* Apply field overrides

(cherry picked from commit fcdab32750)

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2021-06-01 08:43:49 +02:00
Grot (@grafanabot)
d2c9c33d41 Color: Remove the default color scale logic (#34913) (#34918)
(cherry picked from commit 179bfecb3e)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-01 06:29:08 +02:00
Grot (@grafanabot)
b5f2e6ae0f Plugins: Update plugin signing copy + docs (#34716) (#35008) 2021-05-31 22:20:52 +02:00
Grot (@grafanabot)
b06b3d5a61 add missing statis assets prefix (#34999) (#35007)
(cherry picked from commit 28ccf2c880)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-05-31 21:42:36 +02:00
Grot (@grafanabot)
8ba26e2f09 Secure from custom config being undefined in PlotLegend (#34975) (#35006)
(cherry picked from commit 823581add8)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-05-31 20:44:24 +02:00
Grot (@grafanabot)
0b02a7e918 Test datasource: Returns always float values (#34986) (#35001)
(cherry picked from commit 51afde34bd)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-05-31 20:19:09 +03:00
Grot (@grafanabot)
f70ffc30e7 Plugins: Check for Grafana admin instead of Org admin (#35000) (#35003)
* check for grafana admin where necessary

* fix

(cherry picked from commit aba1801193)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-05-31 19:10:41 +02:00
Grot (@grafanabot)
eae88f8ce8 Alerting: Migrate tags as labels and not annotations (#34990) (#34992)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit a23674ef99)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-05-31 16:43:10 +02:00
Grot (@grafanabot)
735630f364 Admin: hide per role counts for licensed users (#34984) (#34991)
* Hide per-role counts for licensed users

* Hide totals

(cherry picked from commit 05f3161f8e)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-05-31 16:30:38 +02:00
Grot (@grafanabot)
ddb6922773 Oauth: Assign role from GF_USERS_AUTO_ASSIGN_ORG_ROLE for Azure AD Oauth (#34838) (#34938)
* 30555:Assign correct role with environment variable GF_USERS_AUTO_ASSIGN_ORG_ROLE

* 30555:Remove unused condition

(cherry picked from commit 48f6d6f7e6)

Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>
2021-05-31 15:18:24 +02:00
Grot (@grafanabot)
d8c4981b77 Alerting: New alert list panel component (#34614) (#34988)
(cherry picked from commit 7dd5a065ba)

Co-authored-by: Nathan Rodman <nathanrodman@gmail.com>
2021-05-31 14:35:37 +02:00
Grot (@grafanabot)
765655fefd Alerting: Migrate paused alerts to silences (#34898) (#34987)
* Alerting: Migrate paused alerts to silences

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix lint

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit 7c25465b3a)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-05-31 14:32:41 +02:00
Grot (@grafanabot)
727119f9ce PluginsList Panel: Redirect to catalog app for updating plugins (#34893) (#34985)
* feat(pluginlistpanel): if catalog app is enabled redirect user if plugin is upgradable

* refactor(catalog): update copy if plugin is disabled

(cherry picked from commit 8c93899b15)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-05-31 14:26:20 +02:00
Grot (@grafanabot)
ba313788d5 fix permissions + add link for admins (#34906) (#34981)
(cherry picked from commit 98c849d4cc)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-05-31 12:54:59 +02:00
Grot (@grafanabot)
8168629948 Explore: Fix show all series (#34968) (#34979)
(cherry picked from commit 6e5d349ae8)

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-05-31 11:41:47 +02:00
Grot (@grafanabot)
0df47643fd [Alerting]: fix/cleanup API examples (#34588) (#34970)
(cherry picked from commit 355be158b7)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-05-31 11:56:00 +03:00
Grot (@grafanabot)
c24d507800 InfluxDB: InfluxQL: apply on enter not on blur (#34963) (#34969)
(cherry picked from commit 618dc6a2f6)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-05-31 10:35:47 +02:00
Grot (@grafanabot)
3884cfe270 GraphNG: Remove fieldName and hideInLegend properties from UPlotSeriesBuilder (#34901) (#34965)
* Remove fieldName and hideInLegend properties from UPlotSeriesBuilder

* Fix test

(cherry picked from commit 573d7b8893)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-05-31 10:29:57 +02:00
Grot (@grafanabot)
a7a9d002cb Make sure ConfirmButton cannot be clicked when closed (#34818) (#34967)
(cherry picked from commit e38c6d73a0)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-05-31 10:07:31 +02:00
Grot (@grafanabot)
dfff63da1b Add custom icons for layout options (#34890) (#34966)
(cherry picked from commit 10f6638d9e)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-05-31 10:02:08 +02:00
Grot (@grafanabot)
7206d16352 DataLinks: Fixes an issue __series.name is not working in data link (#34932) (#34960)
(cherry picked from commit c7076c9e19)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-31 09:32:13 +02:00
Grot (@grafanabot)
fdd80b1b4c StatPanel: Fixes data link tooltip not showing for single value (#34934) (#34962)
(cherry picked from commit d9e9e4744d)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-31 09:31:18 +02:00
Grot (@grafanabot)
bf3ce22358 DashboardLinks: Fix dropdown positioning (#34909) (#34961)
(cherry picked from commit fd028fd798)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-05-31 09:26:43 +02:00
Grot (@grafanabot)
f6b0cd714d ConfirmModal: Auto focus delete button (#34917) (#34959)
(cherry picked from commit ef13f7ece1)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-31 09:06:32 +02:00
Grot (@grafanabot)
2335c3d0d5 Alerting: Add support for configuring avatar URL for the Discord notifier (#33355) (#34940)
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
(cherry picked from commit badec6c6ad)

Co-authored-by: Chip Wolf ‮ <hello@chipwolf.uk>
2021-05-31 09:02:32 +02:00
Grot (@grafanabot)
bfb3e90750 BarChart: make sure tooltip closes when user presses E (#34884) (#34941)
(cherry picked from commit dfc466052d)

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-05-31 09:01:37 +02:00
Grot (@grafanabot)
bee8b0a9dd Table: Fixes sorting for number fields (#34722) (#34957)
* Table: Fixes sorting for number fields

* Refactor: changes after PR comments

* Refactor: found a bug

(cherry picked from commit 37ab5ec7f4)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-05-31 06:35:57 +02:00
Grot (@grafanabot)
fb9f1a3b04 State timeline: defer quadtree construction until first mousemove (#34949) (#34954)
(cherry picked from commit 13768da417)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-05-29 15:18:27 -05:00
Grot (@grafanabot)
216f018377 Rename: Status grid to history (#34864) (#34953)
(cherry picked from commit 4972e0f6a1)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-05-29 21:03:37 +02:00
Grot (@grafanabot)
5e46bbe823 [Dashboard] Revert feature toggle trimdefaults (#34888) (#34937)
* Revert "solve comments and retrigger the test"

This reverts commit f08d2d9eca.

* Revert "update api doc"

This reverts commit cc09ceb853.

* Revert "remove post trim"

This reverts commit 46fe8ed596.

* Revert "fix typo"

This reverts commit 3b3ceee16e.

* Revert "Apply suggestions from code review"

This reverts commit 3b7f3b8e15.

* Revert "update comments"

This reverts commit b9c6260876.

* Revert "update doc"

This reverts commit 8e4c4d7c93.

* Revert "remove feature toggle + add libraryPaneldefinition"

This reverts commit d01cfcc2ed.

* fix some typos

* Update public/app/features/dashboard/components/ShareModal/ShareExport.tsx

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Update docs/sources/dashboards/export-import.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* fix comments

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
(cherry picked from commit b391e43472)

Co-authored-by: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com>
2021-05-29 16:59:06 +02:00
Grot (@grafanabot)
55cbd415a2 Themes: Add border to sidemenu, and reduce border in dark theme a tiny bit (#34737) (#34950)
* Themes: Add border to sidemenu, and reduce border in dark theme a tiny bit

* Updated

(cherry picked from commit d6a9a9b975)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-29 07:34:25 +02:00
Grot (@grafanabot)
e9b6b66a46 Add key for DataLinkButtons (#34935) (#34936)
(cherry picked from commit f16b2c40c1)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-05-28 22:20:54 +02:00
Grot (@grafanabot)
5a68094a45 Loki: Add formatting for annotations (#34774) (#34876)
* add formatting for loki annotations

based/copied from the same features from the prometheus datasource

(cherry picked from commit 261319a4be)

Co-authored-by: Fredrik Enestad <fredrik@enestad.com>
2021-05-28 19:00:45 +02:00
Grot (@grafanabot)
8fef4d7a8a alerting: fixes per-receiver metric cardinality (#34915) (#34924)
(cherry picked from commit cc38613ba4)

Co-authored-by: Owen Diehl <ow.diehl@gmail.com>
2021-05-28 18:54:30 +02:00
Grot (@grafanabot)
4a67bfc102 Alerting/consistent api errors (#34858) (#34920)
* consolidates alertmanager api errors

* util & testing consistent errors

* consistent errors for rest of ngalert apis

* updates expected errors in testware

* bump ci

* linting

* unrelated: dashboard.go lint

(cherry picked from commit 9aca032d10)

Co-authored-by: Owen Diehl <ow.diehl@gmail.com>
2021-05-28 12:20:46 -04:00
Joan López de la Franca Beltran
6dc4e4d563 Usage Stats: Make the UsageStatsService extension point more flexible (#34778) (#34895)
* Usage Stats: Rename service to use a more idiomatic name

* Usage Stats: Update MetricsFunc definition and implementations

* Revert "Usage Stats: Rename service to use a more idiomatic name"

This reverts commit 910ecce3e8.

* Usage Stats: Update MetricsFunc definition and implementations

(cherry picked from commit f601921670)
2021-05-28 17:47:47 +02:00
Joan López de la Franca Beltran
2ca76fa8ae Docs: Settings updates at runtime (#34169) (#34892)
* Docs: Settings updates on runtime docs skeleton

* Docs: Settings HTTP API

* Docs: Minor changes on settings updates at runtime docs

* Docs: Settings updates at runtime description

* Docs: Minor fix

* Docs: Move PUT /api/admin/settings docs into Admin API page

* Docs: Added longer explanation into 'Settings updates at runtime' page

* Apply suggestions from code review

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Leonard Gram <leo@xlson.com>

* Docs: Include order of precedence description at settings updates page

* Update docs/sources/http_api/admin.md

* Docs: Add link to main configuration page from Settings updates at runtime

* Apply suggestions from code review

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>
(cherry picked from commit 886f6fc55b)
2021-05-28 17:44:35 +02:00
Grot (@grafanabot)
aa48f0f6a0 Prometheus: Add info that using Loki as Prometheus data source is no longer supported and might stop working (#34650) (#34911)
* Add information that Loki as Prometheus data source is not supported

* Fix ugly error when loki as prometheus used

* Refactor, add test

* Fix type error

* Fix test by passing missing method

* Update public/app/plugins/datasource/prometheus/query_hints.ts

* Remove optionality in prop

(cherry picked from commit add1b827ae)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-05-28 17:36:21 +02:00
Grot (@grafanabot)
4c967fe718 Alerting: Extract values from MD expr alerts (#34757) (#34908)
When using mulit-dimensional Grafana managed alerts (e.g. SSE math) extract refIds values and labels so they can be shown in the notification and dashboards.

(cherry picked from commit b47e7d12e6)

Co-authored-by: Kyle Brandt <kyle@grafana.com>
2021-05-28 11:34:59 -04:00
Grot (@grafanabot)
0101d3a51d Add info about logs histogram (#34886) (#34910)
(cherry picked from commit 6adcfa9e50)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-05-28 17:31:53 +02:00
Grot (@grafanabot)
3652af9e0b Plugins: Add missing docs for plugin catalog (#34679) (#34907)
* add missing docs for plugin catalog

* apply PR feedback

* use mp4 instead of gif

* update wording

* Add note about org admins

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* apply pr feedback

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
(cherry picked from commit 244d3f61c3)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-05-28 17:08:25 +02:00
Robby Milo
5f4379a24d cleanup shortcodes, asset paths (#34826) (#34900)
(cherry picked from commit 327fa124a4)
2021-05-28 16:43:49 +02:00
Grot (@grafanabot)
e1eebdcf75 Alerting: Do no hard fail on finding discontinued channels on migration (#34894) (#34902)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit ad6648b649)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-05-28 16:39:45 +02:00
Grot (@grafanabot)
c767dedffd live: fix log message (#34879) (#34883)
(cherry picked from commit b73d168753)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-05-28 17:25:23 +03:00
Grot (@grafanabot)
f704fa423d Prometheus: exemplars show different symbols (#34763) (#34899)
* Show different symbols for different queries

* Only run different exemplars

* Address review comment

* Do the same for dashboard + tests

(cherry picked from commit 4435895833)

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-05-28 16:05:33 +02:00
Grot (@grafanabot)
6d6e875a84 Prometheus: Add metadata to metrics in Metrics browser (#34708) (#34896)
* Prometheus: Add metadata to metrics in Metrics browser

- use the available metadata to enhance the tooltip on metric items in the metrics browser
- added meta info for histogram metrics (was missing before)
- also added one for ALERTS

* fix test

(cherry picked from commit 2205464a8d)

Co-authored-by: David <david.kaltschmidt@gmail.com>
2021-05-28 15:32:07 +02:00
Grot (@grafanabot)
a0e0414720 Alerting: Fix flaky TestNotificationChannels take 2 (#34880) (#34885)
* Alerting: Fix flaky TestNotificationChannels take 2

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix nits

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix lint

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit 8278c7bf77)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-05-28 12:19:39 +02:00
Grot (@grafanabot)
ad1498e30c AzureMonitor: remove requirement for default subscription (#34787) (#34881)
* Do not require default subscription for Azure Monitor

* Fix explore URLs when default subscription not set

* Test datasource fixes

* Added comment

* Fix first or default subscription/workspace

* SubscriptionField doesn't depend on Log Analytics

* Tests fixed

* Select default subscription only when user clicked

(cherry picked from commit 179eb0898e)

Co-authored-by: Sergey Kostrukov <sekost@microsoft.com>
2021-05-28 11:46:16 +02:00
Grot (@grafanabot)
1ccca4b187 AzureMonitor: Deprecate using separate credentials for Logs (#34758) (#34877)
* Hide switch for using different credentials in AzureMonitor

* Apply feedback. Use @testing-library

(cherry picked from commit 48dc78fd48)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2021-05-28 10:40:13 +02:00
Grot (@grafanabot)
8415398b2e AzureMonitor: Support querying Subscriptions and Resource Groups in Logs (#34766) (#34875)
* AzureMonitor: Support querying Subscriptions and Resource Groups in Logs

* cleanup

(cherry picked from commit 888cddb834)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-05-28 10:23:42 +02:00
Grot (@grafanabot)
638735a37c Clarify that Threema Gateway Alerts support only Basic IDs (#34828) (#34871)
Threema Gateway supports two types of IDs: Basic IDs (where the
encryption is managed by the API server) and End-to-End IDs (where the
keys are managed by the user).

This plugin currently does not support End-to-End IDs (since it's much
more complex to implement, because the encryption needs to happen
locally). Add a few clarifications to the UI.

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
(cherry picked from commit 83a83de10a)

Co-authored-by: Danilo Bargen <mail@dbrgn.ch>
2021-05-28 09:29:12 +02:00
Grot (@grafanabot)
fbee5f402e Dashboard: Fix multi-value variables in share links (#33216) (#33576) (#34868)
(cherry picked from commit 48fe3feae7)

Co-authored-by: MrSummat <gonzamborge@gmail.com>
2021-05-28 08:46:24 +02:00
Grot (@grafanabot)
6f5f36d305 PieChart: Support row data in pie chart (#34755) (#34865)
* PieChart: Support row data in pie chart

* Make color override work

* removed thing

* Minor refactoring

(cherry picked from commit 658cc5dd2d)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-28 08:04:02 +02:00
Grot (@grafanabot)
d76104fedf Fix flaky TestNotificationChannels (#34831) (#34866)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit 89262ac64d)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-05-28 07:56:57 +02:00
Grot (@grafanabot)
fe968a329e AzureMonitor: Hide App Insights for data sources not using it (#34725) (#34854)
* AzureMonitor: Hide Application Insights and Insights Analytics for panels not using them

* AzureMonitor: Hide Application Insights config

* simplify

* fix test

(cherry picked from commit 7646246d8c)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-05-27 23:09:03 +01:00
Grot (@grafanabot)
e6cad0f415 fixes toggleDownloadForExcel function (#34685) (#34852)
(cherry picked from commit f05bddae43)

Co-authored-by: Matt Abrams <37156449+zuchka@users.noreply.github.com>
2021-05-27 22:26:44 +02:00
Grot (@grafanabot)
04741642c5 Live: max_connections option with strict default (#34634) (#34853)
this should help Live to be enabled by default but still
do not affect setups with lots of simultenious users. To
properly handle many WS connections Grafana administrators
should tune infrastructure a bit - for example increase a
number of open files for a process. Will be in more details
in documentation.

(cherry picked from commit 6d750c000e)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-05-27 21:47:40 +02:00
Grot (@grafanabot)
f44c41fde8 AzureMonitor: reset default subscription when credentials change (#34707) (#34850)
* Update default subscription on credentials change

* Fix secret reset when subscription selected

* Remove unused exports

(cherry picked from commit de86114b66)

Co-authored-by: Sergey Kostrukov <sekost@microsoft.com>
2021-05-27 20:20:29 +01:00
Grot (@grafanabot)
5bf678bcf0 AddPanelWidget: Add padding to prevent top being cut off (#34806) (#34829)
* fix(dashboardpage): add padding so add panel chrome isnt cut off

* fix(addpanelwidget): introduce wrapping element to cater for pulsate animation offset

* refactor(addpanelwidget): use spacing.xs rather than spacing.sm

* test(addpanelwidget): update snapshot

(cherry picked from commit 8ced249c91)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-05-27 18:38:55 +02:00
Grot (@grafanabot)
ed29c58d8b Timeline: Default line width to 0 (#34802) (#34840)
(cherry picked from commit 52f3025901)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-27 18:01:18 +02:00
Grot (@grafanabot)
e2c03cf843 Overrides: Hide from visualization should be available as a manual override option (#34783) (#34841)
* Visualization: Hide from option should be available as a manual override option

* Fix misaligned type

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
(cherry picked from commit f07366690e)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-27 17:54:34 +02:00
Grot (@grafanabot)
9364ec4404 Alerting: Set max width on alerting query rows (#34749) (#34833)
(cherry picked from commit e085b2316c)

Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
2021-05-27 16:40:51 +02:00
Grot (@grafanabot)
0f27ab2d8f Alerting: improved error message and change styling of relative button. (#34730) (#34832)
* improved error message and change styling of relative button.

* minor adjustments.

* adding clock icon.

(cherry picked from commit da6236d89a)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-05-27 16:38:36 +02:00
Marcus Andersson
4a876b6986 Alerting: rename type to make it obvious what part of the code base it belongs to. (#34714) (#34824)
* renamed grafana query to grafana alert query.

* renamed according to feedback in PR.

(cherry picked from commit 1ded9a37c1)
2021-05-27 16:23:01 +02:00
Grot (@grafanabot)
b8aeab41de fix the url of API (#34808) (#34823)
(cherry picked from commit 006135c028)

Co-authored-by: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com>
2021-05-27 21:18:41 +08:00
Grot (@grafanabot)
fea7355e75 Tempo: Fix the test data source implementation (#34762) (#34825)
Fixes #32677

(cherry picked from commit ec3f8ce04c)

Co-authored-by: Koenraad Verheyden <koenraad.verheyden@posteo.net>
2021-05-27 15:12:31 +02:00
Grot (@grafanabot)
922b34817c Chore: additional check when decrypting values (#34637) (#34671)
* Chore: additional check when decrypting values

* Apply suggestions from code review

(cherry picked from commit a5082ab112)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-05-27 15:42:54 +03:00
Grot (@grafanabot)
337bce75a5 Alerting/testing promql extraction (#34665) (#34819)
* promql compat for marshaling

* extracts upstream instant queries into data frame for alerting

* eval string parity

(cherry picked from commit 0e0ed43153)

Co-authored-by: Owen Diehl <ow.diehl@gmail.com>
2021-05-27 08:36:37 -04:00
Grot (@grafanabot)
b3a1a063fe Time series panel: Position tooltip correctly when window scrolled or resized (#34782) (#34794)
* Position GraphNG tooltip correctly when window scrolled or resized

* Use syncRect uPlot hook instead of polling

* update snap?!

(cherry picked from commit 1fa755bada)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-05-27 13:53:58 +02:00
Grot (@grafanabot)
6d44eb8954 Alerting: Move Visualization to QueryRow (#34658) (#34792)
* move visualization to queryeditorrow

* add prop to hide disable query

* move panel plugin state outside the vizwrapper

(cherry picked from commit 23cf31a567)

Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
2021-05-27 13:47:28 +02:00
Grot (@grafanabot)
986e54c127 SSE/Chore: cleanup some error messages (#34738) (#34743)
removes "rpc error: code = InvalidArgument desc =" like strings from error messages.

This came from old grpc stuff left from when SSE was a plugin (that probably should
not have been used even when it was a plugin)

(cherry picked from commit 9016d20c4c)

Co-authored-by: Kyle Brandt <kyle@grafana.com>
2021-05-27 07:47:05 -04:00
Grot (@grafanabot)
8b0109c095 sort alert instance, "datasource" -> "data source" (#34724) (#34812)
(cherry picked from commit 871e476e41)

Co-authored-by: Domas <domasx2@gmail.com>
2021-05-27 13:26:31 +02:00
Grot (@grafanabot)
8633344706 Plugins: Enable catalog management link to gcom (#34673) (#34811)
* click out to gcom when config enabled

* set to false

* fix styling for uninstall

* remove advertising config + simplify callout URL

* add entry to configuration.md

* update config name

* update lingo

(cherry picked from commit c7b58fe186)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-05-27 13:12:38 +02:00
Grot (@grafanabot)
f37d9bf13a check if alertmanager being configured is cortex or vanilla (#34726) (#34813)
(cherry picked from commit 5660bb585f)

Co-authored-by: Domas <domasx2@gmail.com>
2021-05-27 13:11:40 +02:00
Grot (@grafanabot)
c0d87c9779 PanelChrome: Fix issue with empty panel after adding a non data panel and coming back from panel edit (#34765) (#34804)
* PanelChrome: Fix issue with empty panel after adding a non data panel and coming back from panel edit

* Removed the console.log

(cherry picked from commit ca79d08dd8)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-27 12:43:52 +02:00
Grot (@grafanabot)
dc27360a89 Live: check schema equality between push messages (#34548) (#34801)
(cherry picked from commit 67028af99e)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-05-27 12:20:39 +02:00
Grot (@grafanabot)
d41bfec2f8 GraphNG: uPlot 1.6.10 (#34759) (#34800)
(cherry picked from commit 1dd5d6ffb0)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-05-27 12:13:17 +02:00
Grot (@grafanabot)
1c7e55085c AzureMonitor: Display variables in Logs resource picker (#34648) (#34719)
* AzureMonitor: Display variables in Resource Picker

* tests

* hide template variable group when there's no template variables

(cherry picked from commit b4ce068f0e)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-05-27 12:09:00 +02:00
Grot (@grafanabot)
48b74313b5 remove feature toggle + add libraryPaneldefinition (#34488) (#34798)
* remove feature toggle + add libraryPaneldefinition

* update doc

* update comments

* Apply suggestions from code review

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* fix typo

* remove post trim

* update api doc

* solve comments and retrigger the test

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
(cherry picked from commit c59a2e1bcf)

Co-authored-by: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com>
2021-05-27 18:03:54 +08:00
Grot (@grafanabot)
0d0a795d02 check is grafana admin (#34773) (#34797)
(cherry picked from commit dbef103fb9)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-05-27 11:32:39 +02:00
Grot (@grafanabot)
47cf96dfee Plugins: Adds back getMappedValue to @grafana/data (#34746) (#34793)
* Plugins: Adds back getMappedValue to @grafana/data

* Chore: fixes doc errors

* Tests: fixes snapshot

* Tests: dummy change to restart Drone

* Tests: tries to fix snapshot

(cherry picked from commit 3a68409e5d)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-05-27 11:13:39 +02:00
Grot (@grafanabot)
13473eae6d PanelEdit: Allow standard field config properties extensions without altering order of standard options (#34669) (#34791)
* Render tooltip options in correct category

* Allow custom field config properties that extend standard categories

(cherry picked from commit 811704fd2e)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-05-27 11:08:30 +02:00
Grot (@grafanabot)
15c09dcd68 Histogram: Fix crash when state was undefined (when combine was enabled) (#34514) (#34520)
(cherry picked from commit d0769397b2)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-27 10:59:57 +02:00
Grot (@grafanabot)
c3bc0a861f [v8.0.x] Explore: Fix Browser title not updated on Navigation to Explore (#34764)
* Explore: Fix Browser title not updated on Navigation to Explore (#34651)

- Update document.title on Explore page
- Add unit test and snapshot for Wrapper component

(cherry picked from commit cebe67ab01)

* fix: remove snapshot for wrapper test

Co-authored-by: Maria Alexandra <239999+axelavargas@users.noreply.github.com>
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
2021-05-27 10:48:01 +02:00
Grot (@grafanabot)
eba521f12b Chore: bump Acorn and Underscore (#34302) (#34562)
(cherry picked from commit 68513b9a3f)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-05-27 10:45:07 +02:00
Grot (@grafanabot)
3acfa1b8d0 Dashboard: Fixes issue with title or folder change has no effect after exiting settings view (#34677) (#34786)
* Dashboard: Fixes issue with title or folder change has no effect after existing settings view

* Updates snapshot

(cherry picked from commit 6394a60a08)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-27 10:35:10 +02:00
Grot (@grafanabot)
631b2f08a8 Catalog: set library as active tab when viewing (#34753) (#34761)
(cherry picked from commit 6f652e39cb)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-05-27 10:11:11 +02:00
Grot (@grafanabot)
f45f160ab8 Live: grafana_live namespace for centrifuge prom metrics (#34712) (#34767)
(cherry picked from commit 4221f2d147)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-05-26 15:31:48 -07:00
Grot (@grafanabot)
d99847423b set state correctly and test (#34680) (#34770)
(cherry picked from commit 20d356947c)

Co-authored-by: David Parrott <stomp.box.yo@gmail.com>
2021-05-26 15:04:40 -07:00
Grot (@grafanabot)
653a3bdfbf Expose folder UID in dashboards API response (#33991) (#34772)
* expose folder UID in dashboards API response, import dashboards into folders by folder UID

* handle bad folder UID as 400 error

* 12591:Add tests for request with folderUid

* Use more descriptive error status for missing folders

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* return 400 when folder id is missing

* put error checking in the right place this time

* mention folderUid in the docs

* Clarify usage of folderUid and folderId when both present

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Capitalise UID

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* mention folder UID in the metadata for a GET response

Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
(cherry picked from commit ef0fab9aa5)

Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
2021-05-26 22:10:59 +02:00
Grot (@grafanabot)
fca62d20d6 hide caching settings when its disabled (#34756) (#34769)
(cherry picked from commit 3aba08f708)

Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
2021-05-26 15:06:29 -05:00
Grot (@grafanabot)
52e2a2403f NodeGraph: Show node graph collapsed by default with trace view (#34491) (#34742)
* Show node graph collapsed by default with trace view

* Fix rename variable

* Change the message

* Add test

* Fix e2e test

* Remove expect in exemplars test

* Align icon

* review fixes

(cherry picked from commit 9dafd4f863)

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2021-05-26 18:53:47 +02:00
Grot (@grafanabot)
cb9a36b91f Transformations: Prevent FilterByValue transform crashing panel edit (#34747) (#34754)
(cherry picked from commit 515c73d8e6)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-05-26 17:54:22 +02:00
Grot (@grafanabot)
72b3478935 NGAlert: Update the default template to include more URLs (#34715) (#34750)
* NGAlert: Update the default template to include more URLs

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>

* Fix tests

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit d69c21acb6)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-05-26 17:14:15 +02:00
Grot (@grafanabot)
81f2f68535 NGAlert: Add integration tests for remaining notification channels (#34662) (#34728)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit b168223029)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-05-26 19:59:34 +05:30
Grot (@grafanabot)
ebe20d1998 TestData: Some simple small test data and first draft of what's new in v8 demo dashboard (#34731) (#34736)
* TestData: More test data

* Added v8 demo dashboard

(cherry picked from commit 6fb0560a84)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-26 14:36:01 +02:00
Grot (@grafanabot)
771013904a CustomScrollbar: Invoke setScrollTop callback only after scrolling finishes (#34263) (#34564)
* Invoke setScrollTop callback only after scrolling finishes

When the state is updated while scroll events are being dispatched (like in QueryGroup) it may cause resetting the scroll position to the first emitted event because setting the scroll happens only after render (useEffect).

* Memoize onScrollStop callback

(cherry picked from commit 8d05df83ed)

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-05-26 13:38:52 +02:00
Grot (@grafanabot)
ba85b954e1 Access control: Rename predefined roles to fixed roles (code) (#34469) (#34663)
* s/grafana:roles:/fixed:/

* Update free text references to predefined roles

(cherry picked from commit 0f4806db8a)

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-05-26 13:22:44 +02:00
Grot (@grafanabot)
b23bd2c105 PageToolbar: add bottom padding (#34602) (#34711)
* fix(pagetoolbar): pad elements top and bottom to keep vertical align and wrapper padding

* fix(sidemenu): prevent mobile sidemenu squashing dashboard, vertically align mobile sidemenu icon

* fix(dashboardsettings): prevent subheader overlap

* fix(pagetoolbar): center align all toolbar elements vertically

* refactor(pagetoolbar): combine vertical paddings to bring back original padding values

* refactor: update padding values for components that use PageToolbar

* fix(playlists): update Empty cta link route to prevent 404

* test(dashboard): update snapshot

(cherry picked from commit ad3b0b2272)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-05-26 12:13:10 +02:00
Grot (@grafanabot)
02dd5a6f0e VisualisationPicker: allow scrolling in Safari (#34717) (#34721)
(cherry picked from commit bcc7bd9dd3)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-05-26 12:12:20 +02:00
Grot (@grafanabot)
ea84eb499a Datasource: Use intervalMs field of query model in GetIntervalFrom if interval field is not set (#34270) (#34720)
The /api/ds/query and /api/tsdb/query endpoints extract the intervalMs field from
each query in the request, but it currently seems to be ignored, at
least for queries to a Prometheus datasource. This changes
GetIntervalFrom function to check for the presence of intervalMs in the
query model if interval is missing.

(cherry picked from commit b7ea66b00d)

Co-authored-by: Ben Sully <ben.sully@grafana.com>
2021-05-26 12:09:04 +02:00
Grot (@grafanabot)
e3d25450ed AzureMonitor: ResourceMonitor children refactor (#34591) (#34713)
* AzureMonitor: Refactor children to be an arrayu

* Add some resourcePickerData tests

* update tests

* some quick NestedResourceTable tests

(cherry picked from commit 1d3bcb0e90)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-05-26 11:22:43 +02:00
Grot (@grafanabot)
d149b2aae3 TestData: Support for csv files & csv content (#34674) (#34709)
* initial implementation of csv support for test data source

* CSV file & content scenarios working

* Removing categorical data

* fixing handler names

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/testdatasource/csv_data.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fixed lint issues

* updated so it uses the same parsing

* more CSV tests

* lint fixes

* more lint

* lint

* support time field

* migrate manual entry to csv

* more test output

* more test output

* missing file

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
(cherry picked from commit 987bffe482)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-26 11:15:41 +02:00
Grot (@grafanabot)
1de3c88c0e Chore: Upgrade opentelemetry.io/collector dependency (#34700) (#34706)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
(cherry picked from commit 796590a1aa)

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-05-26 10:43:14 +02:00
Grot (@grafanabot)
17f3a5a4a3 Alerting: added possibility to preview grafana managed alert rules. (#34600) (#34704)
* starting to add eval logic.

* wip

* first version of test rule.

* reverted file.

* add info colum to result to show error or (with CC evalmatches)

* fix labels in evalmatch

* fix be test

* refactored using observables.

* moved widht/height div to outside panel rendere.

* adding docs api level.

* adding container styles to error div.

* increasing size of preview.

Co-authored-by: kyle <kyle@grafana.com>
(cherry picked from commit e19b3df1a9)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-05-26 10:31:56 +02:00
Grot (@grafanabot)
1a18413505 Alerting: making sure we use the updated queries when querying for data. (#34631) (#34705)
(cherry picked from commit 70efaa5582)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-05-26 10:30:36 +02:00
Grot (@grafanabot)
21ea2e2e6f Security: Upgrade Thrift dependency (#34698) (#34701)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
(cherry picked from commit 42f33630c7)

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-05-26 09:59:14 +02:00
Grot (@grafanabot)
f7c144f957 Add missing AWS/AppSync metrics (#34691) (#34695)
(cherry picked from commit 80c05becc5)

Co-authored-by: Evan Sosenko <razorx@evansosenko.com>
2021-05-26 09:02:15 +02:00
Grot (@grafanabot)
0d6135dccb CloudWatch: Add Lambda@Edge Amazon CloudFront metrics (#34561) (#34694)
* Add LambdaExecutionError to AWS/CloudFront

* Add LambdaValidationError to AWS/CloudFront

* Add LambdaLimitExceededErrors to AWS/CloudFront

(cherry picked from commit f9b8f3777a)

Co-authored-by: Evan Sosenko <razorx@evansosenko.com>
2021-05-26 09:01:47 +02:00
Ivana Huckova
df3b68e659 Prometheus: Update default HTTP method to POST for existing data sources (#34599) (#34676)
* Change default method to POST

* Update comment

* Add tests

* Update Whats new

* Update docs/sources/whatsnew/whats-new-in-v8-0.md

Co-authored-by: Julien Pivotto <roidelapluie@inuits.eu>

* Update docs/sources/whatsnew/whats-new-in-v8-0.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/whatsnew/whats-new-in-v8-0.md

Co-authored-by: Julien Pivotto <roidelapluie@inuits.eu>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
(cherry picked from commit 93c5c8345c)
2021-05-25 20:29:59 +02:00
Grot (@grafanabot)
e2b6820d42 Live: use latest changes in Go SDK to deal with streaming frames (#34668) (#34678)
(cherry picked from commit 063e1b5ff5)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-05-25 20:16:54 +02:00
Grot (@grafanabot)
ef05f687ca InfluxDB: Flux: handle boolean data-columns (#34479) (#34670)
* InfluxDB: Flux: handle boolean data-columns

* normalize data-type strings based on documentation

* reference missing data type

(cherry picked from commit ab26c4dfa4)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-05-25 17:54:26 +02:00
Grot (@grafanabot)
7319caaa63 API: Use SettingsProvider on GET settings handler (#34632) (#34661)
(cherry picked from commit b74a502dc4)

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
2021-05-25 16:50:11 +02:00
Grot (@grafanabot)
8dd3cd15e4 Admin: Fixes infinite loading edit profile page (#34627) (#34654)
* UserProfile: Fixes infinite loading spinner

* Refactor: some clean up

* Refactor: some more cleanup

* Tests: Adds tests for UserProfileEditPage

* Chore: updates after PR comments

* Refactor: removes unnecessary unmount/mount

(cherry picked from commit 881abb3af8)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-05-25 15:44:46 +02:00
Grot (@grafanabot)
b1177e2f8f expose azure settings as env variables (#34484) (#34647)
(cherry picked from commit 92ac2c40d3)

Co-authored-by: Erik Sundell <erik.sundell@grafana.com>
2021-05-25 14:11:16 +02:00
Grot (@grafanabot)
c8ae5539bc Grafana-UI: Make card figure honor align prop (#34639) (#34644)
(cherry picked from commit a8fa5f1796)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-05-25 14:07:22 +02:00
Grot (@grafanabot)
0822375888 fix modified yarn.lock (#34640) (#34643)
(cherry picked from commit a9b88bc72c)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-05-25 13:23:24 +02:00
Grot (@grafanabot)
587c9677bb Alerting: Move query components to unified folder (#34587) (#34636)
(cherry picked from commit dcef87fd79)

Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
2021-05-25 12:32:12 +02:00
Grot (@grafanabot)
7294dbc2a7 Alerting: misc ui fixes volume 4 (#34503) (#34625)
(cherry picked from commit d666defaea)

Co-authored-by: Domas <domasx2@gmail.com>
2021-05-25 12:58:47 +03:00
Grot (@grafanabot)
45048ebc4b Alerting: Remove unused NGAlerting components (#34568) (#34583)
(cherry picked from commit a0b78313f3)

Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
2021-05-25 11:19:11 +02:00
Grot (@grafanabot)
3956e2b422 [v8.0.x] HTTP Client: Make ResponseHeaderTimeout default timeout in http client (#34629)
* HTTP Client: Make `ResponseHeaderTimeout` default timeout in http client (#34597)

* HTTP Client: Add `ResponseHeaderTimeout` - split from `DialContext` timeout

* Fixes according to reviewer's comments

* Use grafana-plugin-sdk-go v0.100.0

(cherry picked from commit 91657dad18)

* Small change

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
2021-05-25 10:59:24 +02:00
Grot (@grafanabot)
d678865934 AzureMonitor: Fix Azure token provider national clouds (#34615) (#34617)
* Fix AAD authority for sovereign clouds

* Update Azure SDK with scopes fix

* Credential initialization in cache

(cherry picked from commit a337f70469)

Co-authored-by: Sergey Kostrukov <sekost@microsoft.com>
2021-05-25 08:46:03 +02:00
Grot (@grafanabot)
44204a745c RowOptions: Fix enter key updating row options (#34586) (#34598)
(cherry picked from commit 888683a8ad)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-24 17:48:01 +02:00
Grot (@grafanabot)
ec09a5995d [Alerting]: alertmanager notifier fixes (#34575) (#34589)
(cherry picked from commit b48832c0f7)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-05-24 17:32:52 +03:00
Grot (@grafanabot)
01c5587eda InfluxDB: InfluxQL query editor: better handling of slow queries (#34507) (#34596)
* InfluxDB: InfluxQL query editor: better handling of slow queries

* adjusted message to be similar to other messages

* simplify code

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
(cherry picked from commit 0afc4c0361)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-05-24 16:31:52 +02:00
Grot (@grafanabot)
ea1dae55e8 Elasticsearch: fix NewClient not passing httpClientProvider to client impl (#34539) (#34594)
* Update client.go

fix missing "httpClientProvider" in NewClient

* Update client.go

(cherry picked from commit 530072fce7)

Co-authored-by: wangjian <wj0360@foxmail.com>
2021-05-24 15:22:27 +01:00
Grot (@grafanabot)
bac7b5ad6d Form: Expose all return values from useForm (#34380) (#34581)
(cherry picked from commit e9e438ee2f)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-05-24 14:34:58 +02:00
Grot (@grafanabot)
6f8763f03d Explore: Add caching for queries run from logs navigation (#34297) (#34580)
* WIP: Implement simple caching

* If results are cached, don't run new query and use those results

* Add duplicate key check

* Clean up

* Clean up

* Add tests for caching

* Remove unused variables

* Update public/app/features/explore/state/query.test.ts

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* Update public/app/features/explore/state/query.test.ts

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* Use decorateData to apply all decorators

* Remove unused variables

* Change loading stte to Done

* Clear cache when running query from navigation

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
(cherry picked from commit 247bdc2f9b)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-05-24 14:23:24 +02:00
Grot (@grafanabot)
ee46b14371 Add @public release tag to Spinner component (#34576) (#34578)
(cherry picked from commit b5de6e7a1d)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-05-24 13:56:41 +02:00
Grot (@grafanabot)
8a677b0ae4 Loki: Bring back processed bytes as meta info (#34092) (#34574)
* Loki: Bring back processed bytes as meta info

* style: Lint

(cherry picked from commit 6796a89e9d)

Co-authored-by: mmenbawy <elmenabawym@gmail.com>
2021-05-24 12:51:33 +02:00
Grot (@grafanabot)
7e05261dfe influxdb: influxql: make measurement-autocomplete case insensitive (#34563) (#34573)
(cherry picked from commit e21b90681f)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-05-24 12:48:22 +02:00
Grot (@grafanabot)
603cff9491 LibraryPanels: Fixes error when importing plugin dashboard (#34557) (#34559)
(cherry picked from commit 7b17801047)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-05-24 09:56:15 +02:00
Grot (@grafanabot)
52d6afbae7 [Alerting]: namespace fixes (#34470) (#34489)
* [Alerting]: forbid viewers for updating rules if viewers can edit

check for CanSave instead of CanEdit

* Clear ngalert tables when deleting the folder

* Apply suggestions from code review

* Log failure to check save permission

Co-authored-by: gotjosh <josue@grafana.com>
(cherry picked from commit 23939eab10)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-05-24 10:42:56 +03:00
Grot (@grafanabot)
7f919c0e55 LibraryElements: Creates usage stats for panels and variables (#34476) (#34555)
* LibraryPanels: Adds usage collection

* Refactor: renames Panel and Variable consts

* Chore: initialize stats

* Refactor: moves library element migrations to migration namespace

(cherry picked from commit 7204a64717)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-05-24 06:35:35 +02:00
Grot (@grafanabot)
34a1621a5c Timeline: use full row height with one series (#34532) (#34536)
(cherry picked from commit 11b2f0ee4d)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-05-21 01:28:01 +02:00
Grot (@grafanabot)
0577e4b119 Chore: Increase number of backend test retries in grabpl to 5 in release pipelines (#34493) (#34521)
* Increase number of backend test retries to 5

* Exclude release-branch pipelines

* Fixes according to reviewer's comments

* Refactor

* Remove unused arguments

* Remove magic number

(cherry picked from commit 292789ba2d)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2021-05-20 18:20:35 +02:00
Grot (@grafanabot)
50041c8138 Elasticsearch: fix flaky test (#34517) (#34518)
(cherry picked from commit e2e78f14d2)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-05-20 16:50:19 +01:00
Grot (@grafanabot)
5c2ae8fbf4 InfluxDB: InfluxQL query editor: generate better HTML (#34467) (#34516)
(cherry picked from commit d95cc4a08f)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-05-20 17:24:04 +02:00
Grot (@grafanabot)
255b91b2ba Timeline: Fix y-axis being cropped (#34508) (#34515)
(cherry picked from commit dbe281530c)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-20 17:08:41 +02:00
Grot (@grafanabot)
57f5b34038 Chore: Upgrade loki dependency (#34487) (#34512)
Upgrades loki dependency to include grafana/loki#3743.

(cherry picked from commit b76dfc8ed0)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-05-20 17:00:12 +02:00
Grot (@grafanabot)
126b7f8049 Timeline: Fixes crash when there was only 1 threshold step (#34471) (#34486)
(cherry picked from commit fd6e338651)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-05-20 16:43:34 +02:00
Grot (@grafanabot)
3a75fb635d Update _index.md (#34500) (#34501)
(cherry picked from commit a7c5636948)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-05-20 15:46:19 +02:00
Grot (@grafanabot)
d86e725369 Plugins: Improve plugin installer error messages (#34437) (#34495)
* fix and improve error messages

* enrich error message

* ignore previous changes

* revert manual version bump

* remove condition

* fix version param

(cherry picked from commit c4dcfdef56)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-05-20 15:34:31 +02:00
Grot (@grafanabot)
d15419ef5b ReleaseNotes: Updated changelog and release notes for 8.0.0-beta2 (#34481) (#34499)
(cherry picked from commit fc9c5ec873)
2021-05-20 15:26:42 +02:00
Grot (@grafanabot)
9d4c719205 "Release: Updated versions in package to 8.0.0-beta.2" (#34478) 2021-05-20 11:51:41 +02:00
2190 changed files with 33207 additions and 104324 deletions

View File

@@ -1,9 +1,3 @@
# To generate the .drone.yml file:
# 1. Modify the *.star definitions
# 2. Login to drone and export the env variables (token and server) shown here: https://drone.grafana.net/account
# 3. Run `make drone`
# More information about this process here: https://github.com/grafana/deployment_tools/blob/master/docs/infrastructure/drone/signing.md
load('scripts/pr.star', 'pr_pipelines')
load('scripts/main.star', 'main_pipelines')
load('scripts/release.star', 'release_pipelines', 'test_release_pipelines')

File diff suppressed because it is too large Load Diff

6
.github/CODEOWNERS vendored
View File

@@ -11,9 +11,9 @@
# In each subsection folders are ordered first by depth, then alphabetically.
# This should make it easy to add new rules without breaking existing ones.
# Documentation owner: Jita Chatterjee
/docs/ @grafana/docs-squad @pkolyvas
/contribute/ @marcusolsson @grafana/docs-squad @pkolyvas
# Documentation owner: Diana Payton
/docs/ @grafana/docs-squad
/contribute/ @marcusolsson @grafana/docs-squad
/docs/sources/developers/plugins/ @marcusolsson @grafana/docs-squad
/docs/sources/enterprise/ @osg-grafana @grafana/docs-squad

View File

@@ -0,0 +1,11 @@
---
name: Enhancement request
about: Suggest an enhancement or new feature for the Grafana project
labels: 'type: feature request'
---
<!-- Please only use this template for submitting feature requests -->
**What would you like to be added**:
**Why is this needed**:

View File

@@ -1,8 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Feature Request
url: https://github.com/grafana/grafana/discussions/new
about: Discuss ideas for new features of changes
- name: Questions & Help
url: https://community.grafana.com
about: Please ask and answer questions here.

View File

@@ -3,7 +3,7 @@ name: publish_docs
on:
push:
branches:
- v8.1.x
- main
paths:
- 'docs/sources/**'
- 'packages/grafana-*/**'
@@ -36,7 +36,7 @@ jobs:
host: github.com
github_pat: '${{ secrets.GH_BOT_ACCESS_TOKEN }}'
source_folder: docs/sources
target_folder: content/docs/grafana/latest
target_folder: content/docs/grafana/next
allow_no_changes: 'true'
- shell: bash
run: |

1
.gitignore vendored
View File

@@ -50,7 +50,6 @@ public/css/*.min.css
*.tmp
.DS_Store
.vscode/
!.vscode/launch.json
.vs/
.eslintcache

View File

@@ -10,4 +10,3 @@ e2e/tmp
public/build/
public/sass/*.generated.scss
devenv/
public/lib/monaco

14
.vscode/launch.json vendored
View File

@@ -1,14 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Server",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/pkg/cmd/grafana-server/",
"env": {},
"args": ["--homepath", "${workspaceFolder}", "--packaging", "dev"]
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
FROM node:16-alpine3.14 as js-builder
FROM node:14.16.0-alpine3.13 as js-builder
WORKDIR /usr/src/app/
@@ -17,25 +17,25 @@ COPY emails emails
ENV NODE_ENV production
RUN yarn build
FROM golang:1.16.1-alpine3.14 as go-builder
FROM golang:1.16.1-alpine3.13 as go-builder
RUN apk add --no-cache gcc g++
WORKDIR $GOPATH/src/github.com/grafana/grafana
COPY go.mod go.sum embed.go ./
RUN go mod verify
COPY cue cue
COPY cue.mod cue.mod
COPY packages/grafana-schema packages/grafana-schema
COPY public/app/plugins public/app/plugins
COPY pkg pkg
COPY build.go package.json ./
RUN go mod verify
RUN go run build.go build
# Final stage
FROM alpine:3.14.2
FROM alpine:3.13
LABEL maintainer="Grafana team <hello@grafana.com>"

View File

@@ -22,14 +22,14 @@ FROM golang:1.16 AS go-builder
WORKDIR /src/grafana
COPY go.mod go.sum embed.go ./
RUN go mod verify
COPY build.go package.json ./
COPY pkg pkg/
COPY cue cue/
COPY cue.mod cue.mod/
COPY packages/grafana-schema packages/grafana-schema/
COPY public/app/plugins public/app/plugins/
RUN go mod verify
RUN go run build.go build
FROM ubuntu:20.04

View File

@@ -78,7 +78,6 @@ The current team members are:
- Diana Sarlinska ([Grafana Labs](https://grafana.com/))
- Dominik Prokop ([Grafana Labs](https://grafana.com/))
- Emil Tullstedt ([Grafana Labs](https://grafana.com/))
- Erik Sundell ([Grafana Labs](https://grafana.com/))
- Fredrik Enestad ([Soundtrack Your Brand](https://www.soundtrackyourbrand.com/))
- Hugo Häggmark ([Grafana Labs](https://grafana.com/))
- Ivana Huckova ([Grafana Labs](https://grafana.com/))
@@ -103,8 +102,6 @@ The current team members are:
- Tobias Skarhed ([Grafana Labs](https://grafana.com/))
- Torkel Ödegaard ([Grafana Labs](https://grafana.com/))
- Utkarsh Bhatnagar ([Tinder](https://www.tinder.com/))
- Will Browne ([Grafana Labs](https://grafana.com/))
- Zoltán Bedi ([Grafana Labs](https://grafana.com/))
### Maintainers

View File

@@ -6,7 +6,7 @@ The default license for this project is [AGPL-3.0-only](LICENSE).
## Apache-2.0
The following directories and their subdirectories are licensed under Apache-2.0:
The following folders and their subfolders are licensed under Apache-2.0:
```
packages/grafana-data/
@@ -20,9 +20,3 @@ packaging/
grafana-mixin/
cue/
```
The following directories and their subdirectories are the original upstream licenses:
```
public/vendor/
```

View File

@@ -4,9 +4,9 @@
-include local/Makefile
.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go golangci-lint test-go test-js test run run-frontend clean devenv devenv-down protobuf drone help
.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go golangci-lint test-go test-js test run run-frontend clean devenv devenv-down protobuf help
GO = go
GO = GO111MODULE=on go
GO_FILES ?= ./pkg/...
SH_FILES ?= $(shell find ./scripts -name *.sh)
@@ -36,7 +36,7 @@ build-server: ## Build Grafana server.
$(GO) run build.go build-server
build-cli: ## Build Grafana CLI application.
@echo "build grafana-cli"
@echo "build in CI environment"
$(GO) run build.go build-cli
build-js: ## Build frontend assets.
@@ -51,7 +51,7 @@ scripts/go/bin/bra: scripts/go/go.mod
$(GO) build -o ./bin/bra github.com/unknwon/bra
run: scripts/go/bin/bra ## Build and run web server on filesystem changes.
@scripts/go/bin/bra run
@GO111MODULE=on scripts/go/bin/bra run
run-frontend: deps-js ## Fetch js dependencies and watch frontend for rebuild
yarn start
@@ -91,7 +91,7 @@ shellcheck: $(SH_FILES) ## Run checks for shell scripts.
build-docker-dev: ## Build Docker image for development (fast).
@echo "build development container"
@echo "\033[92mInfo:\033[0m the frontend code is expected to be built already."
$(GO) run build.go -goos linux -pkg-arch amd64 ${OPT} build latest
$(GO) run build.go -goos linux -pkg-arch amd64 ${OPT} build pkg-archive latest
cp dist/grafana-latest.linux-x64.tar.gz packaging/docker
cd packaging/docker && docker build --tag grafana/grafana:dev .
@@ -140,13 +140,5 @@ clean: ## Clean up intermediate build artifacts.
rm -rf node_modules
rm -rf public/build
# This repository's configuration is protected (https://readme.drone.io/signature/).
# Use this make target to regenerate the configuration YAML files when
# you modify starlark files.
drone:
drone starlark
drone lint
drone --server https://drone.grafana.net sign --save grafana/grafana
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)

View File

@@ -4,14 +4,14 @@ Upgrading Go or Node.js requires making changes in many different files. See bel
## Go
- Drone
- CircleCi
- `grafana/build-container`
- Appveyor
- Dockerfile
## Node.js
- Drone
- CircleCI
- `grafana/build-container`
- Appveyor
- Dockerfile
@@ -20,29 +20,28 @@ Upgrading Go or Node.js requires making changes in many different files. See bel
The Grafana project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages. This requires a working Go environment with version 1.11 or greater installed.
> **Note:** Since most developers of Grafana still use the `GOPATH` we need to specify `GO111MODULE=on` to make `go mod` and `got get` work as intended. If you have setup Grafana outside of the `GOPATH` on your machine you can skip `GO111MODULE=on` when running the commands below.
To add or update a new dependency, use the `go get` command:
```bash
go get example.com/some/module/pkg
# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
# Pick the latest tagged release.
GO111MODULE=on go get example.com/some/module/pkg
# Pick a specific version.
go get example.com/some/module/pkg@vX.Y.Z
GO111MODULE=on go get example.com/some/module/pkg@vX.Y.Z
```
Tidy up the `go.mod` and `go.sum` files:
```bash
go mod tidy
# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
GO111MODULE=on go mod tidy
```
You have to commit the changes to `go.mod` and `go.sum` before submitting the pull request.
To understand what the actual dependencies of `grafana-server` are, one could run it with `-vv` flag. This might produce an output, different from `go.mod` contents and `-vv` option is the source of truth here. It lists the modules _compiled_ into the executable, while `go.mod` lists also test and weak transitive dependencies (modules, used in some package, which is not in use by itself). If you are interested in reporting a vulnerability in a dependency module - please consult `-vv` output, maybe the "dependency" is not a dependency as such.
### Upgrading dependencies
If you need to upgrade a direct or indirect dependency, you can do it like so, $MODULE being the dependency in question: `go get -u $MODULE`. The corresponding entry in go.mod should then have the version you specified; if it's an indirect dependency, the entry should have the `// indirect` comment. Follow this by executing `go mod tidy`, to ensure that go.mod and go.sum are up to date. If the indirect dependency turns out to not be used (transitively) by any of our packages, `go mod tidy` will actually strip it from go.mod. In that case, you can just ignore it since it isn't used in the end.
## Node.js dependencies
Updated using `yarn`.
@@ -51,9 +50,9 @@ Updated using `yarn`.
## Where to make changes
### Drone
### CircleCI
Our CI builds run on Drone.
Our builds run on CircleCI through our build script.
#### Files
@@ -67,7 +66,7 @@ Our CI builds run on Drone.
### grafana/build-container
The main build steps (in Drone) happen using a custom Docker image that comes pre-baked with some of the necessary dependencies.
The main build step (in CircleCI) is built using a custom build container that comes pre-baked with some of the necessary dependencies.
Link: [grafana/build-container](https://github.com/grafana/grafana/tree/main/scripts/build/ci-build)

View File

@@ -342,6 +342,9 @@ func setBuildEnv() {
} else {
os.Setenv("GOARCH", goarch)
}
if goarch == "386" {
os.Setenv("GO386", "387")
}
if cgo {
os.Setenv("CGO_ENABLED", "1")
}
@@ -393,6 +396,7 @@ func runError(cmd string, args ...string) ([]byte, error) {
func runPrint(cmd string, args ...string) {
log.Println(cmd, strings.Join(args, " "))
ecmd := exec.Command(cmd, args...)
ecmd.Env = append(os.Environ(), "GO111MODULE=on")
ecmd.Stdout = os.Stdout
ecmd.Stderr = os.Stderr
err := ecmd.Run()

View File

@@ -158,14 +158,12 @@ tls_handshake_timeout_seconds = 10
# waiting for the server to approve.
expect_continue_timeout_seconds = 1
# Optionally limits the total number of connections per host, including connections in the dialing,
# active, and idle states. On limit violation, dials will block.
# A value of zero (0) means no limit.
max_conns_per_host = 0
# The maximum number of idle connections that Grafana will keep alive.
max_idle_connections = 100
# The maximum number of idle connections per host that Grafana will keep alive.
max_idle_connections_per_host = 2
# How many seconds the data proxy keeps an idle connection open before timing out.
idle_conn_timeout_seconds = 90
@@ -196,12 +194,6 @@ google_analytics_ua_id =
# Google Tag Manager ID, only enabled if you specify an id here
google_tag_manager_id =
# Rudderstack write key, enabled only if rudderstack_data_plane_url is also set
rudderstack_write_key =
# Rudderstack data plane url, enabled only if rudderstack_write_key is also set
rudderstack_data_plane_url =
#################################### Security ############################
[security]
# disable creation of admin user on first start of grafana
@@ -496,7 +488,6 @@ login_attribute_path =
name_attribute_path =
role_attribute_path =
role_attribute_strict = false
groups_attribute_path =
id_token_attribute_name =
auth_url =
token_url =
@@ -595,8 +586,7 @@ startTLS_policy =
[emails]
welcome_email_on_sign_up = false
templates_pattern = emails/*.html, emails/*.txt
content_types = text/html
templates_pattern = emails/*.html
#################################### Logging ##########################
[log]
@@ -892,7 +882,7 @@ disable_sanitize_html = false
[plugins]
enable_alpha = false
app_tls_skip_verify_insecure = false
# Enter a comma-separated list of plugin identifiers to identify plugins to load even if they are unsigned. Plugins with modified signatures are never loaded.
# Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature.
allow_loading_unsigned_plugins =
# Enable or disable installing plugins directly from within Grafana.
plugin_admin_enabled = false
@@ -906,21 +896,6 @@ plugin_catalog_url = https://grafana.com/grafana/plugins/
# tuning. 0 disables Live, -1 means unlimited connections.
max_connections = 100
# allowed_origins is a comma-separated list of origins that can establish connection with Grafana Live.
# If not set then origin will be matched over root_url. Supports wildcard symbol "*".
allowed_origins =
# engine defines an HA (high availability) engine to use for Grafana Live. By default no engine used - in
# this case Live features work only on a single Grafana server.
# Available options: "redis".
# Setting ha_engine is an EXPERIMENTAL feature.
ha_engine =
# ha_engine_address sets a connection address for Live HA engine. Depending on engine type address format can differ.
# For now we only support Redis connection address in "host:port" format.
# This option is EXPERIMENTAL.
ha_engine_address = "127.0.0.1:6379"
#################################### Grafana Image Renderer Plugin ##########################
[plugin.grafana-image-renderer]
# Instruct headless browser instance to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert.
@@ -1011,10 +986,3 @@ default_timezone = browser
[expressions]
# Enable or disable the expressions functionality.
enabled = true
[geomap]
# Set the JSON configuration for the default basemap
default_baselayer_config =
# Enable or disable loading other base map layers
enable_custom_baselayers = true

View File

@@ -164,14 +164,12 @@
# waiting for the server to approve.
;expect_continue_timeout_seconds = 1
# Optionally limits the total number of connections per host, including connections in the dialing,
# active, and idle states. On limit violation, dials will block.
# A value of zero (0) means no limit.
;max_conns_per_host = 0
# The maximum number of idle connections that Grafana will keep alive.
;max_idle_connections = 100
# The maximum number of idle connections per host that Grafana will keep alive.
;max_idle_connections_per_host = 2
# How many seconds the data proxy keeps an idle connection open before timing out.
;idle_conn_timeout_seconds = 90
@@ -488,7 +486,6 @@
;allowed_organizations =
;role_attribute_path =
;role_attribute_strict = false
;groups_attribute_path =
;tls_skip_verify_insecure = false
;tls_client_cert =
;tls_client_key =
@@ -578,8 +575,7 @@
[emails]
;welcome_email_on_sign_up = false
;templates_pattern = emails/*.html, emails/*.txt
;content_types = text/html
;templates_pattern = emails/*.html
#################################### Logging ##########################
[log]
@@ -872,7 +868,7 @@
[plugins]
;enable_alpha = false
;app_tls_skip_verify_insecure = false
# Enter a comma-separated list of plugin identifiers to identify plugins to load even if they are unsigned. Plugins with modified signatures are never loaded.
# Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature.
;allow_loading_unsigned_plugins =
# Enable or disable installing plugins directly from within Grafana.
;plugin_admin_enabled = false
@@ -886,20 +882,6 @@
# tuning. 0 disables Live, -1 means unlimited connections.
;max_connections = 100
# allowed_origins is a comma-separated list of origins that can establish connection with Grafana Live.
# If not set then origin will be matched over root_url. Supports wildcard symbol "*".
;allowed_origins =
# engine defines an HA (high availability) engine to use for Grafana Live. By default no engine used - in
# this case Live features work only on a single Grafana server. Available options: "redis".
# Setting ha_engine is an EXPERIMENTAL feature.
;ha_engine =
# ha_engine_address sets a connection address for Live HA engine. Depending on engine type address format can differ.
# For now we only support Redis connection address in "host:port" format.
# This option is EXPERIMENTAL.
;ha_engine_address = "127.0.0.1:6379"
#################################### Grafana Image Renderer Plugin ##########################
[plugin.grafana-image-renderer]
# Instruct headless browser instance to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert.
@@ -991,16 +973,3 @@
[expressions]
# Enable or disable the expressions functionality.
;enabled = true
[geomap]
# Set the JSON configuration for the default basemap
;default_baselayer_config = `{
; "type": "xyz",
; "config": {
; "attribution": "Open street map",
; "url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
; }
;}`
# Enable or disable loading other base map layers
;enable_custom_baselayers = true

View File

@@ -12,7 +12,7 @@ An event is something that happened in the past. Since an event has already happ
### Subscribe to an event
In order to react to an event, you first need to _subscribe_ to it.
In order to react to an event, you first need to _subscribe_ to it.
To subscribe to an event, register an _event listener_ in the service's `Init` method:
@@ -51,16 +51,14 @@ A command is a request for an action to be taken. Unlike an event's fire-and-for
### Dispatch a command
To dispatch a command, pass the `context.Context` and object to the `DispatchCtx` method:
To dispatch a command, pass the object to the `Dispatch` method:
```go
// context.Context from caller
ctx := req.Request.Context()
cmd := &models.SendStickersCommand {
UserID: "taylor",
Count: 1,
}
if err := s.bus.DispatchCtx(ctx, cmd); err != nil {
if err := s.bus.Dispatch(cmd); err != nil {
if err == bus.ErrHandlerNotFound {
return nil
}
@@ -68,9 +66,7 @@ if err := s.bus.DispatchCtx(ctx, cmd); err != nil {
}
```
> **Note:** `DispatchCtx` will return an error if no handler is registered for that command.
> **Note:** `Dispatch` currently exists and requires no `context.Context` to be provided, but it's strongly suggested to not use this since there's an ongoing refactoring to remove usage of non-context-aware functions/methods and use context.Context everywhere.
> **Note:** `Dispatch` will return an error if no handler is registered for that command.
**Tip:** Browse the available commands in the `models` package.
@@ -82,34 +78,30 @@ To handle a command, register a command handler in the `Init` function.
```go
func (s *MyService) Init() error {
s.bus.AddHandlerCtx(s.SendStickers)
s.bus.AddHandler(s.SendStickers)
return nil
}
func (s *MyService) SendStickers(ctx context.Context, cmd *models.SendStickersCommand) error {
func (s *MyService) SendStickers(cmd *models.SendStickersCommand) error {
// ...
}
```
> **Note:** The handler method may return an error if unable to complete the command.
> **Note:** `AddHandler` currently exists and requires no `context.Context` to be provided, but it's strongly suggested to not use this since there's an ongoing refactoring to remove usage of non-context-aware functions/methods and use context.Context everywhere.
## Queries
A command handler can optionally populate the command sent to it. This pattern is commonly used to implement _queries_.
### Making a query
To make a query, dispatch the query instance just like you would a command. When the `DispatchCtx` method returns, the `Results` field contains the result of the query.
To make a query, dispatch the query instance just like you would a command. When the `Dispatch` method returns, the `Results` field contains the result of the query.
```go
// context.Context from caller
ctx := req.Request.Context()
query := &models.FindDashboardQuery{
ID: "foo",
}
if err := bus.DispatchCtx(ctx, query); err != nil {
if err := bus.Dispatch(query); err != nil {
return err
}
// The query now contains a result.
@@ -118,14 +110,12 @@ for _, item := range query.Results {
}
```
> **Note:** `Dispatch` currently exists and requires no `context.Context` to be provided, but it's strongly suggested to not use this since there's an ongoing refactoring to remove usage of non-context-aware functions/methods and use context.Context everywhere.
### Return query results
To return results for a query, set any of the fields on the query argument before returning:
```go
func (s *MyService) FindDashboard(ctx context.Context, query *models.FindDashboardQuery) error {
func (s *MyService) FindDashboard(query *models.FindDashboardQuery) error {
// ...
query.Result = dashboard
return nil

View File

@@ -33,18 +33,18 @@ To register a handler:
```go
func init() {
bus.AddHandlerCtx("sql", DeleteDashboard)
bus.AddHandler("sql", DeleteDashboard)
}
func DeleteDashboard(ctx context.Context, cmd *models.DeleteDashboardCommand) error {
return inTransactionCtx(ctx, func(sess *DBSession) error {
func DeleteDashboard(cmd *models.DeleteDashboardCommand) error {
return inTransaction(func(sess *DBSession) error {
_, err := sess.Exec("DELETE FROM dashboards WHERE dashboard_id=?", cmd.DashboardID)
return err
})
}
```
Here, `inTransactionCtx` is a helper function in the `sqlstore` package that provides a session, that lets you execute SQL statements.
Here, `inTransaction` is a helper function in the `sqlstore` package that provides a session, that lets you execute SQL statements.
## `SQLStore`
@@ -61,7 +61,7 @@ type MyService struct {
You can now make SQL queries in any of your [command handlers](communication.md#handle-commands) or [event listeners](communication.md#subscribe-to-an-event):
```go
func (s *MyService) DeleteDashboard(ctx context.Context, cmd *models.DeleteDashboardCommand) error {
func (s *MyService) DeleteDashboard(cmd *models.DeleteDashboardCommand) error {
if err := s.SQLStore.WithDbSession(ctx, func(sess *sqlstore.DBSession) error {
_, err := sess.Exec("DELETE FROM dashboards WHERE dashboard_id=?", cmd.DashboardID)
return err

View File

@@ -1,6 +1,6 @@
# Services
A Grafana _service_ encapsulates and exposes application logic to the rest of the application, through a set of related operations.
A Grafana _service_ encapsulates and exposes application logic to the rest of the application, through a set of related operations.
Before a service can start communicating with the rest of Grafana, it needs to be registered in the _service registry_.
@@ -48,7 +48,7 @@ import _ "github.com/grafana/grafana/pkg/services/mysvc"
## Dependencies
Grafana uses the [inject](https://github.com/facebookgo/inject) package to inject dependencies during runtime.
Grafana uses the [inject](https://github.com/facebookgo/inject) package to inject dependencies during runtime.
For example, to access the [bus](communication.md), add it to the `MyService` struct:
@@ -67,7 +67,3 @@ type MyService struct {
```
> **Note:** Any injected dependency needs to be an exported field. Any unexported fields result in a runtime error.
## Methods
Any public method of a service should take `context.Context` as its first argument. If the method calls the bus, other services or the database the context should be propagated, if possible.

View File

@@ -16,7 +16,7 @@ If this is your first time contributing to an open-source project on GitHub, mak
To increase the chance of having your pull request accepted, make sure your pull request follows these guidelines:
- Title and description matches the implementation.
- Commits within the pull request follow the [Formatting guidelines](#Formatting-guidelines).
- Commits within the pull request follow the [Formatting guidelines](#Formatting-guidelines).
- The pull request closes one related issue.
- The pull request contains necessary tests that verify the intended behavior.
- If your pull request has conflicts, rebase your branch onto the main branch.
@@ -43,18 +43,6 @@ Pull requests for Redux contributions must:
- Not contain code that mutates state in reducers or thunks.
- Not contain code that accesses the reducers state slice directly. Instead, the code should use state selectors to access state.
Pull requests that add or modify unit tests that are written in Jest must adhere to these guidelines:
- Don't add snapshots tests. We are incrementally removing existing snapshot tests, we don't want more.
- If an existing unit test is written in Enzyme, migrate it to RTL (React Testing Library), unless youre fixing a bug. Bug fixes usually shouldn't include any bigger refactoring, so its ok to skip migrating the test to RTL.
Pull requests that create new UI components or modify existing ones must adhere to the following accessibility guidelines:
- Use semantic HTML.
- Use ARIA roles, labels and other accessibility attributes correctly. Accessibility attributes should only be used when semantic HTML doesn't satisfy your use case.
- Use the [Grafana theme palette](/contribute/style-guides/themes.md) for styling. It contains colors with good contrast which aids accessibility.
- Use [RTL](https://testing-library.com/docs/dom-testing-library/api-accessibility/) for writing unit tests. It helps to create accessible components.
### Backend-specific guidelines
Please refer to the [backend style guidelines](/contribute/style-guides/backend.md).
@@ -114,6 +102,6 @@ Make sure that the title for your pull request uses the same format as the subje
If your PR includes configuration changes, all of the following files must be changed correspondingly:
- conf/defaults.ini
- conf/sample.ini
- docs/sources/administration/configuration.md
* conf/defaults.ini
* conf/sample.ini
* docs/sources/administration/configuration.md

View File

@@ -10,14 +10,8 @@ Make sure you have the following dependencies installed before setting up your d
- [Git](https://git-scm.com/)
- [Go](https://golang.org/dl/) (see [go.mod](../go.mod#L3) for minimum required version)
Additionally you'll need:
- [Node.js](https://nodejs.org) (see `volta.node` property in [package.json](../package.json) for the correct version).
- [Yarn](https://yarnpkg.com) (see `volta.yarn` property in [package.json](../package.json) for the correct version).
We recommend using [Volta](https://github.com/volta-cli/volta) to manage your JS toolchain.
Refer to the [Volta Getting Started Guide](https://docs.volta.sh/guide/getting-started) for setup instructions for your operating system.
- [Node.js (Long Term Support)](https://nodejs.org)
- [Yarn](https://yarnpkg.com)
### macOS
@@ -26,6 +20,9 @@ We recommend using [Homebrew](https://brew.sh/) for installing any missing depen
```
brew install git
brew install go
brew install node@14
npm install -g yarn
```
### Windows

View File

@@ -160,41 +160,3 @@ describe('List test', () => {
});
});
```
## Aria-Labels vs data-testid
Our selectors are set up to work with both aria-labels and data-testid attributes. Aria-labels help assistive technologies such as screenreaders identify interactive elements of a page for our users.
A good example of a time to use an aria-label might be if you have a button with an X to close:
```
<button aria-label="close">X<button>
```
It might be clear visually that the X closes the modal, but audibly it would not be clear for example.
```
<button aria-label="close">Close<button>
```
The above example for example might read aloud to a user "Close, Close" or something similar.
However adding aria-labels to elements that are already clearly labeled or not interactive can be confusing and redundant for users with assistive technologies.
In such cases rather than adding unnecessary aria-labels to components so as to make them selectable for testing, it is preferable to use a data attribute that would not be read aloud with an assistive technology for example:
```
<button data-testid="modal-close-button">Close<button>
```
We have added support for this in our selectors, to use:
Prefix your selector string with "data-testid":
```typescript
export const Components = {
Login: {
openButton: "data-testid-open", // this would look for a data-testid
closeButton: "close-button" // this would look for an aria-label
},
};
```
and in your component, import the selectors and add the data test id:
```
<button data-testid={Selectors.Components.Login.openButton}>
```

View File

@@ -4,8 +4,11 @@
**Themes are implemented in Typescript.** That's because our goal is to share variables between Grafana TypeScript and [Sass](https://sass-lang.com/) code. Theme definitions are located in the following files:
- [packages/grafana-data/src/themes/createTheme.ts](../../packages/grafana-data/src/themes/createTheme.ts)
- [packages/grafana-data/src/themes/createColors.ts](../../packages/grafana-data/src/themes/createColors.ts)
- [packages/grafana-ui/src/themes/dark.ts](../../packages/grafana-ui/src/themes/dark.ts)
- [packages/grafana-ui/src/themes/default.ts](../../packages/grafana-ui/src/themes/default.ts)
- [packages/grafana-ui/src/themes/light.ts](../../packages/grafana-ui/src/themes/light.ts)
The `default.ts` file holds common variables like typography and spacing definitions, while `[light|dark].ts` primarily specify colors used in themes.
## Usage
@@ -15,22 +18,23 @@ This section provides usage guidelines.
Here's how to use Grafana themes in React components.
#### useStyles2 hook
#### useStyles hook
`useStyles2` memoizes the function and provides access to the theme.
`useStyles` memoizes the function and provides access to the theme.
```tsx
import React, { FC } from 'react';
import { GrafanaTheme2 } from '@grafana/data';
import { useStyles2 } from '@grafana/ui';
import { GrafanaTheme } from '@grafana/data';
import { useStyles } from '@grafana/ui';
import { css } from '@emotion/css';
const getComponentStyles = (theme: GrafanaTheme2) => css`
const getComponentStyles = (theme: GrafanaTheme) => css`
padding: ${theme.spacing.md};
`;
const Foo: FC<FooProps> = () => {
const styles = useStyles2(getComponentsStyles);
const styles = useStyles(getComponentsStyles);
// Use styles with className
};
```
@@ -39,89 +43,15 @@ const Foo: FC<FooProps> = () => {
```tsx
import React, { FC } from 'react';
import { useTheme2 } from '@grafana/ui';
import { useTheme } from '@grafana/ui';
const Foo: FC<FooProps> = () => {
const theme = useTheme2();
const theme = useTheme();
// Your component has access to the theme variables now
};
```
## Picking the right variable
### The rich color object and the state colors
The theme.colors object has 6 rich color objects for `primary`, `secondary`, `info`, `success`, `warning` and `error`. These all
have the same sub colors that have different use cases.
| Property | When to use |
| ------------ | ---------------------------------------------------------- |
| main | For backgrounds |
| shade | For hover highlight |
| text | For text color |
| border | For borders, currently always the same as text color |
| contrastText | Text color to use for text placed on top of the main color |
Example use cases:
- Want a `red` background? Use `theme.colors.error.main`
- Want `green` text? Use `theme.colors.success.text`
- Want text to be visible when placed inside a background that uses `theme.colors.error.main` then use `theme.colors.error.contrastText`.
### Text colors
| Property | When to use |
| ----------------------------- | ------------------------------------------------------------------------------ |
| theme.colors.text.primary | The default text color |
| theme.colors.text.secondary | Text color for things that should be a bit less prominent |
| theme.colors.text.disabled | Text color for disabled / faint things |
| theme.colors.text.link | Text link color |
| theme.colors.text.maxContrast | Maximum contrast (absolute white in dark theme, absolute black in white theme) |
### Background colors
| Property | When to use |
| --------------------------------- | ------------------------------------------------------------------------------------------------- |
| theme.colors.background.canvas | Think dashboard background. A background surface for panels and panes that use primary background |
| theme.colors.background.primary | The default content background for content panes and panels |
| theme.colors.background.secondary | For cards and other surfaces that need to stand out when placed on top of the primary background |
### Borders
| Property | When to use |
| -------------------------- | ------------------------------------------------------------ |
| theme.colors.border.weak | Primary border for panels and panes and other subtle borders |
| theme.colors.border.medium | For stronger borders like inputs |
| theme.colors.border.strong | For even stronger border like hover highighted border |
### Actions
| Property | When to use |
| ---------------------------- | ----------------------------------------------------- |
| theme.colors.action.hover | Background color for hover on card, menu or list item |
| theme.colors.action.focus | Background color for focused card, menu or list item |
| theme.colors.action.selected | Background color for selected card, menu or list item |
### Paddings and margins
| Example | Result |
| --------------------------- | ----------------- |
| theme.spacing(1) | 8px |
| theme.spacing(1, 2) | 8px 16px |
| theme.spacing(1, 2, 0.5, 4) | 8px 16px 4px 32px |
### Border radius
| Example | Result |
| --------------------------- | ------ |
| theme.shape.borderRadius(1) | 2px |
| theme.shape.borderRadius(2) | 4px |
### Typography
For font family, font sizes and line heights use the variables under `theme.typography`.
#### Using `ThemeContext` directly
```tsx
@@ -137,25 +67,39 @@ With this method your component will be automatically wrapped in `ThemeContext.C
```ts
import { ThemeContext, Themeable } from '@grafana/ui';
interface FooProps extends Themeable2 {}
interface FooProps extends Themeable {}
const Foo: React.FunctionComponent<FooProps> = () => ...
export default withTheme2(Foo);
export default withTheme(Foo);
```
### Using theme in tests
### Test components that use `ThemeContext`
If you need to pass a theme object to a function under test just import `createTheme` and call it without
any arguments.
When implementing snapshot tests for components that use the `withTheme` HOC, the snapshot will contain the entire theme object. Any change to the theme renders the snapshot outdated.
To make your snapshot theme independent, use the `mockThemeContext` helper function:
```tsx
import { createTheme } from '@grafana/data';
import { mockThemeContext } from '@grafana/ui';
import { MyComponent } from './MyComponent';
describe('MyComponent', () => {
it('should work', () => {
result = functionThatNeedsTheme(createTheme());
expect(result).toBe(true);
let restoreThemeContext;
beforeAll(() => {
// Create ThemeContext mock before any snapshot test is executed
restoreThemeContext = mockThemeContext({ type: GrafanaThemeType.Dark });
});
afterAll(() => {
// Make sure the theme is restored after snapshot tests are performed
restoreThemeContext();
});
it('renders correctly', () => {
const wrapper = mount(<MyComponent />);
expect(wrapper).toMatchSnapshot();
});
});
```
@@ -172,5 +116,36 @@ This section provides insight into frequently-asked questions.
`[_variables|_variables.dark|_variables.light].generated.scss` files are the ones that are referenced in the main Sass files for Sass variables to be available. **These files are automatically generated and should never be modified by hand!**
If you need to modify the sass variable files be sure to update the files that end with `.tmpl.ts` and
not the `.generated.scss` files.
#### If you need to modify a _Sass variable value_ you need to modify the corresponding Typescript file that is the source of the variables:
- `_variables.generated.scss` - modify `grafana-ui/src/themes/default.ts`
- `_variables.light.generated.scss` - modify `grafana-ui/src/themes/light.ts`
- `_variables.dark.generated.scss` - modify `grafana-ui/src/themes/dark.ts`
#### If you need to _add new variable_ to Sass variables you need to modify corresponding template file:
- `_variables.generated.scss` - modify `grafana-ui/src/themes/_variables.scss.tmpl.ts`
- `_variables.light.generated.scss` - modify `grafana-ui/src/themes/_variables.light.scss.tmpl.ts`
- `_variables.dark.generated.scss` - modify `grafana-ui/src/themes/_variables.dark.scss.tmpl.ts`
## Limitations
This section describes limitations with Grafana's theming system.
### You must ensure `ThemeContext` provider is available in a React tree
By default all react2angular directives have `ThemeContext.Provider` ensured. But, there are cases where we create another React tree via `ReactDOM.render`. This happens in the case of graph legend rendering and the `ReactContainer` directive. In such cases theme consumption will fail. To make sure theme context is available in such cases, you need to wrap your rendered component with ThemeContext.Provider using the `provideTheme` function:
```ts
// graph.ts
import { provideTheme } from 'app/core/utils/ConfigProvider';
// Create component with ThemeContext.Provider first.
// Otherwise React will create new components every time it renders!
const LegendWithThemeProvider = provideTheme(Legend);
const legendReactElem = React.createElement(LegendWithThemeProvider, legendProps);
ReactDOM.render(legendReactElem, this.legendElem, () => this.renderPanel());
```
`provideTheme` makes current theme available via ThemeContext by checking if user has `lightTheme` set in her boot data.

View File

@@ -80,6 +80,7 @@ Family: scuemata.#Family & {
// synthetic Family to represent them in Go, for ease of generating
// e.g. JSON Schema.
#Panel: {
...
// The panel plugin type id.
type: !=""
@@ -134,6 +135,7 @@ Family: scuemata.#Family & {
options: {...}
fieldConfig: {
defaults: {
...
// The display value for this field. This supports template variables blank is auto
displayName?: string
@@ -187,7 +189,7 @@ Family: scuemata.#Family & {
// Can always exist. Valid fields within this are
// defined by the panel plugin - that's the
// PanelFieldConfig that comes from the plugin.
custom?: {}
custom?: {...}
}
overrides: [...{
matcher: {

View File

@@ -57,10 +57,13 @@ Jaeger block runs both Jaeger and Loki container. Loki container sends traces to
## Troubleshooting
### Containers that read from log files fail to start (Mac OS)
If you are running Mac OSX, containers that read from the log files (e.g. Telegraf, Fileabeat, Promtail) can fail to start. This is because the default Docker for Mac does not have permission to create `grafana` folder at the `/var/log` location, as it runs as the current user. To solve this issue, manually create the folder `/var/log/grafana`, then start the containers again.
### Containers fail to start (Mac OS)
```
sudo mkdir /var/log/grafana
ERROR: for <service_name> Cannot start service <service_name>: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting ... merged/var/log/grafana: operation not permitted\\\"\"": unknown
ERROR: Encountered errors while bringing up the project.
```
If running Mac OSX the above error might be encountered when starting certain Docker containers that mount `/var/log/`. When first run this causes Docker to try to create the folder `/var/log/grafana` however by default Docker for Mac does not have permission to create folders at this location as it runs as the current user.
To solve this issue manually create the folder `/var/log/grafana` and give your user write permissions then try starting the containers again.

View File

@@ -84,14 +84,6 @@ datasources:
tsdbResolution: 1
tsdbVersion: 1
- name: gdev-opentsdb-v2.3
type: opentsdb
access: proxy
url: http://localhost:4242
jsonData:
tsdbResolution: 1
tsdbVersion: 3
- name: gdev-elasticsearch-v2-metrics
type: elasticsearch
access: proxy

View File

@@ -1,258 +0,0 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 3151,
"links": [],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "gdev-opentsdb-v2.3",
"fieldConfig": {
"defaults": {
"links": []
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.1.0-pre",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"aggregator": "sum",
"alias": "$tag_hostname",
"currentFilterGroupBy": false,
"currentFilterKey": "",
"currentFilterType": "literal_or",
"currentFilterValue": "",
"disableDownsampling": false,
"downsampleAggregator": "avg",
"downsampleFillPolicy": "none",
"explicitTags": false,
"filters": [
{
"filter": "*",
"groupBy": true,
"tagk": "hostname",
"type": "wildcard"
}
],
"metric": "cpu",
"refId": "A",
"shouldComputeRate": false
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "CPU per host",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "gdev-opentsdb-v2.3",
"fieldConfig": {
"defaults": {
"links": []
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 0
},
"hiddenSeries": false,
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.1.0-pre",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"aggregator": "sum",
"alias": "$tag_hostname",
"currentFilterGroupBy": false,
"currentFilterKey": "",
"currentFilterType": "literal_or",
"currentFilterValue": "",
"downsampleAggregator": "avg",
"downsampleFillPolicy": "none",
"filters": [
{
"filter": "*",
"groupBy": true,
"tagk": "hostname",
"type": "wildcard"
}
],
"metric": "logins.count",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Login Count per host",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"schemaVersion": 30,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Datasource tests - OpenTSDB v2.3",
"uid": "rZRUGik7k",
"version": 3
}

View File

@@ -8,12 +8,6 @@
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
@@ -24,26 +18,21 @@
"links": [],
"panels": [
{
"datasource": null,
"folderId": null,
"gridPos": {
"h": 26,
"w": 6,
"x": 0,
"y": 0
},
"headings": true,
"id": 7,
"limit": 100,
"links": [],
"options": {
"folderId": null,
"maxItems": 100,
"query": "",
"showHeadings": true,
"showRecentlyViewed": true,
"showSearch": false,
"showStarred": true,
"tags": []
},
"pluginVersion": "8.1.0-pre",
"query": "",
"recent": true,
"search": false,
"starred": true,
"tags": [],
"timeFrom": null,
"timeShift": null,
@@ -51,167 +40,95 @@
"type": "dashlist"
},
{
"datasource": null,
"folderId": null,
"gridPos": {
"h": 13,
"w": 6,
"x": 6,
"y": 0
},
"headings": false,
"id": 2,
"limit": 1000,
"links": [],
"options": {
"maxItems": 1000,
"query": "",
"showHeadings": false,
"showRecentlyViewed": false,
"showSearch": true,
"showStarred": false,
"tags": [
"panel-tests"
]
},
"pluginVersion": "8.1.0-pre",
"tags": [
"panel-tests"
],
"query": "",
"recent": false,
"search": true,
"starred": false,
"tags": ["panel-tests"],
"timeFrom": null,
"timeShift": null,
"title": "tag: panel-tests",
"type": "dashlist"
},
{
"datasource": null,
"folderId": null,
"gridPos": {
"h": 13,
"h": 26,
"w": 6,
"x": 12,
"y": 0
},
"headings": false,
"id": 3,
"limit": 1000,
"links": [],
"options": {
"folderId": null,
"maxItems": 1000,
"query": "",
"showHeadings": false,
"showRecentlyViewed": false,
"showSearch": true,
"showStarred": false,
"tags": [
"gdev",
"demo"
]
},
"pluginVersion": "8.1.0-pre",
"tags": [
"gdev",
"demo"
],
"query": "",
"recent": false,
"search": true,
"starred": false,
"tags": ["gdev", "demo"],
"timeFrom": null,
"timeShift": null,
"title": "tag: dashboard-demo",
"type": "dashlist"
},
{
"datasource": null,
"folderId": null,
"gridPos": {
"h": 26,
"w": 6,
"x": 18,
"y": 0
},
"headings": false,
"id": 5,
"limit": 1000,
"links": [],
"options": {
"folderId": null,
"maxItems": 1000,
"query": "",
"showHeadings": false,
"showRecentlyViewed": false,
"showSearch": true,
"showStarred": false,
"tags": [
"gdev",
"datasource-test"
]
},
"pluginVersion": "8.1.0-pre",
"tags": [
"gdev",
"datasource-test"
],
"query": "",
"recent": false,
"search": true,
"starred": false,
"tags": ["gdev", "datasource-test"],
"timeFrom": null,
"timeShift": null,
"title": "Data source tests",
"type": "dashlist"
},
{
"datasource": null,
"folderId": null,
"gridPos": {
"h": 13,
"w": 6,
"x": 6,
"y": 13
},
"headings": false,
"id": 4,
"limit": 1000,
"links": [],
"options": {
"maxItems": 1000,
"query": "",
"showHeadings": false,
"showRecentlyViewed": false,
"showSearch": true,
"showStarred": false,
"tags": [
"templating",
"gdev"
]
},
"pluginVersion": "8.1.0-pre",
"tags": [
"templating",
"gdev"
],
"query": "",
"recent": false,
"search": true,
"starred": false,
"tags": ["templating", "gdev"],
"timeFrom": null,
"timeShift": null,
"title": "tag: templating ",
"type": "dashlist"
},
{
"datasource": null,
"gridPos": {
"h": 13,
"w": 6,
"x": 12,
"y": 13
},
"id": 8,
"links": [],
"options": {
"maxItems": 1000,
"query": "",
"showHeadings": false,
"showRecentlyViewed": false,
"showSearch": true,
"showStarred": false,
"tags": [
"gdev",
"transform"
]
},
"pluginVersion": "8.1.0-pre",
"tags": [
"gdev",
"demo"
],
"timeFrom": null,
"timeShift": null,
"title": "tag: transforms",
"type": "dashlist"
}
],
"schemaVersion": 30,
"schemaVersion": 18,
"style": "dark",
"tags": [],
"templating": {
@@ -222,32 +139,11 @@
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"],
"time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"]
},
"timezone": "",
"title": "Grafana Dev Overview & Home",
"uid": "j6T00KRZz",
"version": 2
}
}

View File

@@ -8,12 +8,6 @@
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
@@ -39,8 +33,7 @@
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -112,8 +105,7 @@
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -185,8 +177,7 @@
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -257,8 +248,7 @@
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -329,8 +319,7 @@
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -401,12 +390,10 @@
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
"decimals": 7,
"mappings": [],
"thresholds": {
"mode": "absolute",
@@ -450,7 +437,7 @@
},
"targets": [
{
"csvContent": "Name,Stat1,Stat2\nStockholm, 10, 15\nNew York, 19, -5\nLondon, 10, 1\nLong value, 15,10",
"csvContent": "Name,Stat1,Stat2\nStockholm, 10, 15\nNew York, 19, 5\nLondon, 10, 1\nLong value, 15,10",
"refId": "A",
"scenarioId": "csv_content"
}
@@ -475,8 +462,7 @@
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -551,5 +537,5 @@
"timezone": "",
"title": "BarChart - Panel Tests - Value sizing",
"uid": "WFlOM-jM1",
"version": 9
"version": 3
}

View File

@@ -1,862 +0,0 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"links": [],
"panels": [
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 37,
"gradientMode": "scheme",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 3,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"max": 50,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "orange",
"value": 15
},
{
"color": "red",
"value": 30
}
]
},
"unit": "degree"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 8,
"x": 0,
"y": 0
},
"id": 11,
"maxDataPoints": 45,
"options": {
"legend": {
"calcs": [],
"displayMode": "hidden",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"refId": "A",
"scenarioId": "csv_metric_values",
"stringInput": "1,10,20,30,40,50"
}
],
"title": "15 orange, 30 red",
"type": "timeseries"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 37,
"gradientMode": "scheme",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 3,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"max": 50,
"min": 20,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "orange",
"value": 15
},
{
"color": "red",
"value": 30
}
]
},
"unit": "degree"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 8,
"x": 8,
"y": 0
},
"id": 12,
"maxDataPoints": 45,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"refId": "A",
"scenarioId": "csv_metric_values",
"stringInput": "1,10,20,30,40,50"
}
],
"title": "15 orange, 30 red",
"type": "timeseries"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 37,
"gradientMode": "scheme",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 2,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"max": 50,
"min": 20,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "orange",
"value": 15
},
{
"color": "red",
"value": 50
}
]
},
"unit": "degree"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 8,
"x": 16,
"y": 0
},
"id": 13,
"maxDataPoints": 45,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"refId": "A",
"scenarioId": "csv_metric_values",
"stringInput": "1,10,20,30,40,50"
}
],
"title": "15 orange, 50 red",
"type": "timeseries"
},
{
"datasource": "-- Dashboard --",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 5,
"gradientMode": "scheme",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 3,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"max": 50,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "orange",
"value": 20
},
{
"color": "red",
"value": 30
}
]
},
"unit": "degree"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 7
},
"id": 9,
"maxDataPoints": 45,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"panelId": 4,
"refId": "A"
}
],
"title": "Color line by discrete tresholds",
"type": "timeseries"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 84,
"gradientMode": "scheme",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 0,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"max": 50,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "orange",
"value": 20
},
{
"color": "red",
"value": 30
}
]
},
"unit": "degree"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 7
},
"id": 4,
"interval": "80s",
"maxDataPoints": 42,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"max": 40,
"min": 0,
"noise": 1,
"refId": "A",
"scenarioId": "random_walk",
"spread": 20,
"startValue": 1
}
],
"timeFrom": null,
"title": "Color bars by discrete thresholds",
"type": "timeseries"
},
{
"datasource": "-- Dashboard --",
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "scheme",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 3,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"max": 50,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 0
},
{
"color": "orange",
"value": 20
},
{
"color": "red",
"value": 30
}
]
},
"unit": "degree"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 14
},
"id": 6,
"maxDataPoints": 50,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"panelId": 4,
"refId": "A"
}
],
"title": "Color line by color scale",
"type": "timeseries"
},
{
"datasource": "-- Dashboard --",
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 64,
"gradientMode": "scheme",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"max": 50,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 0
},
{
"color": "orange",
"value": 20
},
{
"color": "red",
"value": 30
}
]
},
"unit": "degree"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 14
},
"id": 10,
"maxDataPoints": 45,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"panelId": 4,
"refId": "A"
}
],
"title": "Color bars by color scale",
"type": "timeseries"
},
{
"datasource": "-- Dashboard --",
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 64,
"gradientMode": "scheme",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"max": 50,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 0
},
{
"color": "orange",
"value": 20
},
{
"color": "red",
"value": 30
}
]
},
"unit": "degree"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 21
},
"id": 7,
"maxDataPoints": 50,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"panelId": 4,
"refId": "A"
}
],
"title": "Color line by color scale",
"type": "timeseries"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "points",
"fillOpacity": 10,
"gradientMode": "scheme",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 3,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"max": 50,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 0
},
{
"color": "orange",
"value": 20
},
{
"color": "red",
"value": 30
}
]
},
"unit": "degree"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 21
},
"id": 8,
"maxDataPoints": 250,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"max": 45,
"min": 20,
"noise": 0,
"refId": "A",
"scenarioId": "random_walk",
"spread": 12,
"startValue": 40
},
{
"hide": false,
"max": 20,
"min": 1,
"noise": 0,
"refId": "B",
"scenarioId": "random_walk",
"spread": 10
}
],
"title": "Color line by color scale",
"type": "timeseries"
}
],
"refresh": false,
"schemaVersion": 30,
"style": "dark",
"tags": [
"gdev",
"panel-tests"
],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Panel Tests - Graph NG - By value color schemes",
"uid": "aBXrJ0R7z",
"version": 11
}

View File

@@ -17,14 +17,11 @@
"graphTooltip": 0,
"links": [
{
"asDropdown": true,
"icon": "external link",
"tags": [
"gdev",
"graph-ng"
],
"title": "Graph Tests",
"type": "dashboards"
"tags": ["gdev", "graph-ng"],
"type": "dashboards",
"asDropdown": true,
"title": "Graph Tests"
}
],
"panels": [
@@ -38,15 +35,13 @@
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillGradient": "none",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineInterpolation": "linear",
"lineWidth": 2,
@@ -55,16 +50,10 @@
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"spanNulls": false
},
"mappings": [],
"nullValueMode": "null",
"thresholds": {
"mode": "absolute",
"steps": [
@@ -93,7 +82,6 @@
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
@@ -148,15 +136,13 @@
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillGradient": "none",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineInterpolation": "linear",
"lineWidth": 2,
@@ -165,17 +151,11 @@
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"spanNulls": false
},
"mappings": [],
"max": 120,
"nullValueMode": "null",
"thresholds": {
"mode": "absolute",
"steps": [
@@ -204,7 +184,6 @@
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
@@ -267,15 +246,13 @@
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillGradient": "none",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineInterpolation": "linear",
"lineWidth": 2,
@@ -284,17 +261,11 @@
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"spanNulls": false
},
"mappings": [],
"max": 120,
"nullValueMode": "null",
"thresholds": {
"mode": "absolute",
"steps": [
@@ -323,7 +294,6 @@
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
@@ -405,15 +375,13 @@
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillGradient": "none",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineInterpolation": "linear",
"lineWidth": 2,
@@ -422,16 +390,10 @@
"type": "linear"
},
"showPoints": "auto",
"spanNulls": true,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"spanNulls": true
},
"mappings": [],
"nullValueMode": "null",
"thresholds": {
"mode": "absolute",
"steps": [
@@ -460,7 +422,6 @@
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
@@ -515,15 +476,13 @@
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillGradient": "none",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineInterpolation": "linear",
"lineWidth": 2,
@@ -532,17 +491,11 @@
"type": "linear"
},
"showPoints": "auto",
"spanNulls": true,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"spanNulls": true
},
"mappings": [],
"max": 120,
"nullValueMode": "null",
"thresholds": {
"mode": "absolute",
"steps": [
@@ -571,7 +524,6 @@
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
@@ -634,15 +586,13 @@
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillGradient": "none",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineInterpolation": "linear",
"lineWidth": 2,
@@ -651,17 +601,11 @@
"type": "linear"
},
"showPoints": "auto",
"spanNulls": true,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"spanNulls": true
},
"mappings": [],
"max": 120,
"nullValueMode": "null",
"thresholds": {
"mode": "absolute",
"steps": [
@@ -690,7 +634,6 @@
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
@@ -770,33 +713,48 @@
"mode": "palette-classic"
},
"custom": {
"axis": {
"grid": true,
"label": "Temperature",
"side": 3,
"width": 60
},
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"bars": {
"show": false
},
"drawStyle": "line",
"fill": {
"alpha": 0
},
"fillGradient": "none",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"line": {
"color": {
"mode": "palette-classic"
},
"show": true,
"width": 1
},
"lineInterpolation": "linear",
"lineWidth": 2,
"nullValues": "null",
"pointSize": 5,
"points": {
"radius": 8,
"show": true
},
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"spanNulls": false
},
"mappings": [],
"thresholds": {
@@ -860,7 +818,6 @@
},
"legend": {
"asTable": false,
"calcs": [],
"displayMode": "list",
"isVisible": true,
"placement": "bottom"
@@ -917,33 +874,48 @@
"mode": "palette-classic"
},
"custom": {
"axis": {
"grid": true,
"label": "Temperature",
"side": 3,
"width": 60
},
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"bars": {
"show": false
},
"drawStyle": "line",
"fill": {
"alpha": 0
},
"fillGradient": "none",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"line": {
"color": {
"mode": "palette-classic"
},
"show": true,
"width": 1
},
"lineInterpolation": "linear",
"lineWidth": 2,
"nullValues": "null",
"pointSize": 5,
"points": {
"radius": 8,
"show": true
},
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"spanNulls": false
},
"mappings": [],
"thresholds": {
@@ -1007,7 +979,6 @@
},
"legend": {
"asTable": false,
"calcs": [],
"displayMode": "list",
"isVisible": true,
"placement": "bottom"
@@ -1073,8 +1044,7 @@
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
@@ -1083,14 +1053,7 @@
"type": "linear"
},
"showPoints": "never",
"spanNulls": 3600000,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"spanNulls": 3600000
},
"mappings": [],
"thresholds": {
@@ -1161,97 +1124,11 @@
"timeShift": null,
"title": "Span nulls below 1hr",
"type": "timeseries"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 7,
"x": 0,
"y": 22
},
"id": 15,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"refId": "A",
"scenarioId": "csv_metric_values",
"stringInput": "30,null,1,20,90,null,30,null,5,0,null,30"
}
],
"title": "Always show points between gaps",
"type": "timeseries"
}
],
"schemaVersion": 30,
"schemaVersion": 27,
"style": "dark",
"tags": [
"gdev",
"panel-tests",
"graph-ng"
],
"tags": ["gdev", "panel-tests", "graph-ng"],
"templating": {
"list": []
},
@@ -1263,5 +1140,5 @@
"timezone": "",
"title": "Panel Tests - Graph NG - Gaps and Connected",
"uid": "8mmCAF1Mz",
"version": 12
}
"version": 1
}

View File

@@ -14,7 +14,7 @@
},
"editable": true,
"gnetId": null,
"graphTooltip": 1,
"graphTooltip": 0,
"id": 479,
"links": [],
"panels": [

View File

@@ -1,568 +0,0 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"description": "",
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"links": [],
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "line"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"hide": false,
"max": 100,
"min": 1,
"refId": "A",
"scenarioId": "random_walk",
"startValue": 50
},
{
"alias": "",
"csvContent": "min,max,threshold1\n1000,1000,8000\n0,100,80\n\n",
"refId": "config",
"scenarioId": "csv_content"
}
],
"title": "Min, max, threshold from separate query",
"transformations": [
{
"id": "configFromData",
"options": {
"configRefId": "config",
"mappings": []
}
}
],
"type": "timeseries"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "left",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "SensorA"
},
"properties": [
{
"id": "custom.displayMode",
"value": "color-text"
}
]
}
]
},
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 0
},
"id": 5,
"options": {
"showHeader": true
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"csvContent": "Name, Value, SensorA, MyUnit, MyColor\nGoogle, 10, 50, km/h, blue\nGoogle, 100, 100,km/h, orange\n",
"hide": false,
"refId": "A",
"scenarioId": "csv_content"
}
],
"title": "Custom mappings and apply to self",
"transformations": [
{
"id": "configFromData",
"options": {
"applyTo": {
"id": "byName",
"options": "SensorA"
},
"applyToConfig": true,
"configRefId": "A",
"mappings": [
{
"configProperty": "unit",
"fieldName": "MyUnit",
"handlerKey": "unit"
},
{
"fieldName": "MyColor",
"handlerKey": "color"
}
]
}
}
],
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "center",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Value"
},
"properties": [
{
"id": "custom.displayMode",
"value": "color-background-solid"
}
]
}
]
},
"gridPos": {
"h": 5,
"w": 12,
"x": 0,
"y": 9
},
"id": 7,
"options": {
"showHeader": true
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"csvContent": "ID, DisplayText\n21412312312, Homer\n12421412413, Simpsons \n12321312313, Bart",
"hide": false,
"refId": "A",
"scenarioId": "csv_content"
}
],
"title": "Mapping data",
"transformations": [
{
"id": "configFromData",
"options": {
"applyToConfig": true,
"configRefId": "A",
"mappings": [
{
"fieldName": "Color",
"handlerKey": "mappings.color"
},
{
"fieldName": "Value",
"handlerKey": "mappings.value"
}
]
}
}
],
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "center",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Value"
},
"properties": [
{
"id": "custom.displayMode",
"value": "color-background-solid"
}
]
}
]
},
"gridPos": {
"h": 10,
"w": 12,
"x": 12,
"y": 9
},
"id": 6,
"options": {
"showHeader": true
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"csvContent": "Value, Color\nOK, blue\nPretty bad, red\nYay it's green, green\nSomething is off, orange\nNo idea, #88AA00\nAm I purple?, purple",
"hide": false,
"refId": "A",
"scenarioId": "csv_content"
}
],
"title": "Value mappings from query result applied to itself",
"transformations": [
{
"id": "configFromData",
"options": {
"applyTo": {
"id": "byName",
"options": "Value"
},
"applyToConfig": true,
"configRefId": "A",
"mappings": [
{
"fieldName": "Color",
"handlerKey": "mappings.color"
},
{
"fieldName": "Value",
"handlerKey": "mappings.value"
}
]
}
}
],
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "center",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 12,
"x": 0,
"y": 14
},
"id": 8,
"options": {
"showHeader": true
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"csvContent": "ID, Value\n21412312312, 100\n12421412413, 20\n12321312313, 10",
"hide": false,
"refId": "A",
"scenarioId": "csv_content"
}
],
"title": "Display data",
"transformations": [
{
"id": "configFromData",
"options": {
"applyToConfig": true,
"configRefId": "A",
"mappings": [
{
"fieldName": "Color",
"handlerKey": "mappings.color"
},
{
"fieldName": "Value",
"handlerKey": "mappings.value"
}
]
}
}
],
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"axisSoftMin": 0,
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineWidth": 1
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 12,
"x": 0,
"y": 19
},
"id": 9,
"options": {
"barWidth": 0.97,
"groupWidth": 0.7,
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom"
},
"orientation": "horizontal",
"showValue": "auto",
"text": {},
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"csvContent": "ID, Value\nA21412312312, 100\nA12421412413, 20\nA12321312313, 10\n",
"hide": false,
"refId": "data",
"scenarioId": "csv_content"
},
{
"csvContent": "ID, DisplayText\nA21412312312, Homer\nA12421412413, Marge \nA12321312313, Bart",
"hide": false,
"refId": "mappings",
"scenarioId": "csv_content"
}
],
"title": "Value mapping ID -> DisplayText from separate query",
"transformations": [
{
"id": "configFromData",
"options": {
"applyTo": {
"id": "byName",
"options": "ID"
},
"applyToConfig": false,
"configRefId": "mappings",
"mappings": [
{
"fieldName": "ID",
"handlerKey": "mappings.value"
},
{
"fieldName": "DisplayText",
"handlerKey": "mappings.text"
}
]
}
}
],
"type": "barchart"
}
],
"refresh": "",
"schemaVersion": 30,
"style": "dark",
"tags": [
"gdev",
"transform"
],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Transforms - Config from query",
"uid": "Juj4_7ink",
"version": 1
}

View File

@@ -1,615 +0,0 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"links": [],
"panels": [
{
"datasource": "-- Dashboard --",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "left",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 12,
"x": 0,
"y": 0
},
"id": 8,
"options": {
"showHeader": true
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"panelId": 2,
"refId": "A"
}
],
"title": "Raw data",
"type": "table"
},
{
"datasource": "-- Dashboard --",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "left",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Value"
},
"properties": [
{
"id": "custom.width",
"value": 82
}
]
},
{
"matcher": {
"id": "byName",
"options": "Unit"
},
"properties": [
{
"id": "custom.width",
"value": 108
}
]
}
]
},
"gridPos": {
"h": 5,
"w": 12,
"x": 12,
"y": 0
},
"id": 7,
"options": {
"showHeader": true,
"sortBy": []
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"panelId": 3,
"refId": "A"
}
],
"title": "Raw data",
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 5
},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"csvContent": "Name,Value,Unit,Color\nTemperature,10,degree,green\nPressure,100,bar,blue\nSpeed,30,km/h,red",
"refId": "A",
"scenarioId": "csv_content"
}
],
"title": "Unit and color from data",
"transformations": [
{
"id": "rowsToFields",
"options": {}
}
],
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 5
},
"id": 3,
"options": {
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": true,
"showThresholdMarkers": true,
"text": {}
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"csvContent": "Name,Value,Unit,min,max, threshold1\nTemperature,10,degree,0,50,30\nPressure,100,Pa,0,300,200\nSpeed,30,km/h,0,150,110",
"refId": "A",
"scenarioId": "csv_content"
}
],
"title": "Min, Max & Thresholds from data",
"transformations": [
{
"id": "rowsToFields",
"options": {}
}
],
"type": "gauge"
},
{
"datasource": "-- Dashboard --",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "left",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 12,
"x": 0,
"y": 12
},
"id": 10,
"options": {
"showHeader": true
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"panelId": 9,
"refId": "A"
}
],
"title": "Raw data",
"type": "table"
},
{
"datasource": "-- Dashboard --",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "left",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Value"
},
"properties": [
{
"id": "custom.width",
"value": 82
}
]
},
{
"matcher": {
"id": "byName",
"options": "Unit"
},
"properties": [
{
"id": "custom.width",
"value": 108
}
]
}
]
},
"gridPos": {
"h": 5,
"w": 12,
"x": 12,
"y": 12
},
"id": 12,
"options": {
"showHeader": true,
"sortBy": []
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"panelId": 11,
"refId": "A"
}
],
"title": "Raw data (Custom mapping)",
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 17
},
"id": 9,
"options": {
"displayMode": "gradient",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showUnfilled": true,
"text": {}
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"csvContent": "Name,Value,Unit,Min,Max\nTemperature,20,degree,0,50\nPressure,150,Pa,0,300\nSpeed,100,km/h,0,110",
"refId": "A",
"scenarioId": "csv_content"
}
],
"title": "Min max from data",
"transformations": [
{
"id": "rowsToFields",
"options": {}
}
],
"type": "bargauge"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 17
},
"id": 11,
"options": {
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": true,
"showThresholdMarkers": true,
"text": {}
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"csvContent": "Name,Value,Type,Quota, Warning\nTemperature,25,degree,50,30\nPressure,100,Pa,300,200\nSpeed,30,km/h,150,130",
"refId": "A",
"scenarioId": "csv_content"
}
],
"title": "Custom mapping",
"transformations": [
{
"id": "rowsToFields",
"options": {
"mappings": [
{
"configProperty": "unit",
"fieldName": "Type",
"handlerKey": "unit"
},
{
"configProperty": "max",
"fieldName": "Quota",
"handlerKey": "max"
},
{
"configProperty": "threshold1",
"fieldName": "Warning",
"handlerKey": "threshold1"
}
]
}
}
],
"type": "gauge"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 24
},
"id": 13,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.1.0-pre",
"targets": [
{
"csvContent": "Name, City, Country, Value\nSensorA, Stockholm, Sweden, 20\nSensorB, London, England, 50\nSensorC, New York, USA,100",
"refId": "A",
"scenarioId": "csv_content"
}
],
"title": "Extra string fields to labels",
"transformations": [
{
"id": "rowsToFields",
"options": {}
}
],
"type": "stat"
}
],
"refresh": "",
"schemaVersion": 30,
"style": "dark",
"tags": [
"gdev",
"transform"
],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Transforms - Rows to fields",
"uid": "PMtIInink",
"version": 1
}

View File

@@ -1,19 +1,15 @@
# You need to run 'sysctl -w vm.max_map_count=262144' on the host machine
elasticsearch-latest:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.2
command: elasticsearch
environment:
- "discovery.type=single-node"
elasticsearch:
image: elasticsearch:2.4.1
command: elasticsearch -Des.network.host=0.0.0.0
ports:
- "14200:9200"
- "14300:9300"
- "9200:9200"
- "9300:9300"
volumes:
- ./docker/blocks/elastic/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
fake-elastic-latest-data:
fake-elastic-data:
image: grafana/fake-data-gen
links:
- elasticsearch-latest
network_mode: bridge
environment:
FD_SERVER: elasticsearch-latest
FD_DATASOURCE: elasticsearch7
FD_PORT: 9200
FD_DATASOURCE: elasticsearch
FD_PORT: 9200

View File

@@ -1,3 +1,2 @@
script.inline: on
script.indexed: on
xpack.license.self_generated.type: basic

View File

@@ -1,15 +0,0 @@
elasticsearch2:
image: elasticsearch:2.4.1
command: elasticsearch -Des.network.host=0.0.0.0
ports:
- "9200:9200"
- "9300:9300"
volumes:
- ./docker/blocks/elastic2/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
fake-elastic-data:
image: grafana/fake-data-gen
network_mode: bridge
environment:
FD_DATASOURCE: elasticsearch2
FD_PORT: 9200

View File

@@ -1,2 +0,0 @@
script.inline: on
script.indexed: on

View File

@@ -1,44 +0,0 @@
# You need to run 'sysctl -w vm.max_map_count=262144' on the host machine
elasticsearch77:
image: docker.elastic.co/elasticsearch/elasticsearch:7.7.1
command: elasticsearch
environment:
- "discovery.type=single-node"
ports:
- "13200:9200"
- "13300:9300"
fake-elastic77-data:
image: grafana/fake-data-gen
links:
- elasticsearch77
environment:
FD_SERVER: elasticsearch77
FD_DATASOURCE: elasticsearch7
FD_PORT: 9200
filebeat77:
image: docker.elastic.co/beats/filebeat:7.7.1
command: filebeat -e -strict.perms=false
volumes:
- ./docker/blocks/elastic77/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
- /var/log:/var/log:ro
- ../data/log:/var/log/grafana:ro
metricbeat77:
image: docker.elastic.co/beats/metricbeat:7.7.1
command: metricbeat -e -strict.perms=false
user: root
volumes:
- ./docker/blocks/elastic77/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
kibana77:
image: docker.elastic.co/kibana/kibana:7.7.1
ports:
- "5601:5601"
links:
- elasticsearch77
environment:
ELASTICSEARCH_HOSTS: http://elasticsearch77:9200

View File

@@ -1,3 +0,0 @@
script.inline: on
script.indexed: on
xpack.license.self_generated.type: basic

File diff suppressed because it is too large Load Diff

View File

@@ -1,38 +0,0 @@
metricbeat.config:
modules:
path: ${path.config}/modules.d/*.yml
# Reload module configs as they change:
reload.enabled: false
metricbeat.autodiscover:
providers:
- type: docker
hints.enabled: true
metricbeat.modules:
- module: docker
metricsets:
- "container"
- "cpu"
- "diskio"
- "healthcheck"
- "info"
#- "image"
- "memory"
- "network"
hosts: ["unix:///var/run/docker.sock"]
period: 10s
enabled: true
processors:
- add_cloud_metadata: ~
output.elasticsearch:
hosts: ["elasticsearch77:9200"]
index: "metricbeat-%{+yyyy.MM.dd}"
setup.template.name: "metricbeat"
setup.template.pattern: "metricbeat-*"
setup.template.settings:
index.number_of_shards: 1
index.number_of_replicas: 1

View File

@@ -24,7 +24,7 @@
- influxdb
telegraf:
image: telegraf:1.19.1
image: telegraf:1.10.4
links:
- influxdb
depends_on:

View File

@@ -1,5 +1,5 @@
influxdb1:
image: influxdb:1.8.6
image: influxdb:1.8.4-alpine
container_name: influxdb1
ports:
- '2004:2004'
@@ -22,7 +22,7 @@
FD_PORT: 8086
telegraf-influxdb1:
image: telegraf:1.19.1
image: telegraf:1.10.4
links:
- influxdb1
volumes:

View File

@@ -1,7 +1,7 @@
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- "6831:6831/udp"
- "6831:6831"
- "16686:16686"
# Additional loki to generate some traces
# datasource URL: http://localhost:3100/

View File

@@ -1,2 +1,2 @@
ORIGIN_SERVER=http://host.docker.internal:9090/
ORIGIN_SERVER=http://localhost:9090/
SLEEP_DURATION=60s

View File

@@ -1,11 +1,7 @@
FROM golang:latest as builder
FROM golang:latest
ADD main.go /
WORKDIR /
RUN go mod init proxy
RUN CGO_ENABLED=0 go build -o main .
FROM scratch
WORKDIR /
RUN GO111MODULE=off go build -o main .
EXPOSE 3011
COPY --from=builder /main /main
ENTRYPOINT ["/main"]

View File

@@ -1,9 +1,8 @@
slow_proxy:
build: docker/blocks/slow_proxy
network_mode: host
ports:
- "3011:3011"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
ORIGIN_SERVER: ${ORIGIN_SERVER}
SLEEP_DURATION: ${SLEEP_DURATION}

View File

@@ -12,14 +12,12 @@ import (
func main() {
origin := os.Getenv("ORIGIN_SERVER")
if origin == "" {
// it is never not-set, the default is in the `.env` file
log.Fatalf("missing env-variable ORIGIN_SERVER")
origin = "http://localhost:9090/"
}
sleepDurationStr := os.Getenv("SLEEP_DURATION")
if sleepDurationStr == "" {
// it is never not-set, the default is in the `.env` file
log.Fatalf("missing env-variable SLEEP_DURATION")
sleepDurationStr = "60s"
}
sleep, err := time.ParseDuration(sleepDurationStr)

View File

@@ -0,0 +1,7 @@
FROM golang:latest
ADD main.go /
WORKDIR /
RUN GO111MODULE=off go build -o main .
EXPOSE 3011
ENTRYPOINT ["/main"]

View File

@@ -0,0 +1,6 @@
slow_proxy_mac:
build: docker/blocks/slow_proxy_mac
ports:
- '3011:3011'
environment:
ORIGIN_SERVER: 'http://host.docker.internal:9090/'

View File

@@ -0,0 +1,31 @@
package main
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
"net/url"
"os"
"time"
)
func main() {
origin := os.Getenv("ORIGIN_SERVER")
if origin == "" {
origin = "http://host.docker.internal:9090/"
}
sleep := time.Minute
originURL, _ := url.Parse(origin)
proxy := httputil.NewSingleHostReverseProxy(originURL)
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Printf("sleeping for %s then proxying request: %s", sleep.String(), r.RequestURI)
<-time.After(sleep)
proxy.ServeHTTP(w, r)
})
log.Fatal(http.ListenAndServe(":3011", nil))
}

View File

@@ -94,11 +94,11 @@ aliases = ["/docs/grafana/v1.1", "/docs/grafana/latest/guides/reference/admin",
<img src="/static/img/docs/logos/icon_cloudmonitoring.svg">
<h5>Google Cloud Monitoring</h5>
</a>
<a href="{{< relref "datasources/aws-cloudwatch/_index.md" >}}" class="nav-cards__item nav-cards__item--ds">
<a href="{{< relref "datasources/cloudwatch.md" >}}" class="nav-cards__item nav-cards__item--ds">
<img src="/static/img/docs/logos/icon_cloudwatch.svg">
<h5>AWS CloudWatch</h5>
</a>
<a href="{{< relref "datasources/azuremonitor/_index.md" >}}" class="nav-cards__item nav-cards__item--ds">
<a href="{{< relref "datasources/azuremonitor.md" >}}" class="nav-cards__item nav-cards__item--ds">
<img src="/static/img/docs/logos/icon_azure_monitor.jpg">
<h5>Azure Monitor</h5>
</a>

View File

@@ -10,21 +10,18 @@ weight = 400
Grafana CLI is a small executable that is bundled with Grafana server. It can be executed on the same machine Grafana server is running on. Grafana CLI has `plugins` and `admin` commands, as well as global options.
To list all commands and options:
```
grafana-cli -h
```
## Invoking Grafana CLI
To invoke Grafana CLI, add the path to the grafana binaries in your `PATH` environment variable. Alternately, if your current directory is the `bin` directory, use `./grafana-cli`. Otherwise, you can specify full path to the CLI. For example, on Linux `/usr/share/grafana/bin/grafana-cli` and on Windows `C:\Program Files\GrafanaLabs\grafana\bin\grafana-cli.exe`.
> **Note:** Some commands, such as installing or removing plugins, require `sudo` on Linux. If you are on Windows, run Windows PowerShell as Administrator.
>**Note:** Some commands, such as installing or removing plugins, require `sudo` on Linux. If you are on Windows, run Windows PowerShell as Administrator.
## Grafana CLI command syntax
The general syntax for commands in Grafana CLI is:
```bash
grafana-cli [global options] command [command options] [arguments...]
```
@@ -40,7 +37,6 @@ Each global option applies only to the command in which it is used. For example,
`--help` or `-h` displays the help, including default paths and Docker configuration information.
**Example:**
```bash
grafana-cli -h
```
@@ -50,7 +46,6 @@ grafana-cli -h
`--version` or `-v` prints the version of Grafana CLI currently running.
**Example:**
```bash
grafana-cli -v
```
@@ -60,7 +55,6 @@ grafana-cli -v
`--pluginsDir value` overrides the path to where your local Grafana instance stores plugins. Use this option if you want to install, update, or remove a plugin somewhere other than the default directory ("/var/lib/grafana/plugins") [$GF_PLUGIN_DIR].
**Example:**
```bash
grafana-cli --pluginsDir "/var/lib/grafana/devplugins" plugins install <plugin-id>
```
@@ -70,7 +64,6 @@ grafana-cli --pluginsDir "/var/lib/grafana/devplugins" plugins install <plugin-i
`--repo value` allows you to download and install or update plugins from a repository other than the default Grafana repo.
**Example:**
```bash
grafana-cli --repo "https://example.com/plugins" plugins install <plugin-id>
```
@@ -80,7 +73,6 @@ grafana-cli --repo "https://example.com/plugins" plugins install <plugin-id>
`--pluginUrl value` allows you to download a .zip file containing a plugin from a local URL instead of downloading it from the default Grafana source.
**Example:**
```bash
grafana-cli --pluginUrl https://company.com/grafana/plugins/<plugin-id>-<plugin-version>.zip plugins install <plugin-id>
```
@@ -92,7 +84,6 @@ grafana-cli --pluginUrl https://company.com/grafana/plugins/<plugin-id>-<plugin-
`--insecure` allows you to turn off Transport Layer Security (TLS) verification (insecure). You might want to do this if you are downloading a plugin from a non-default source.
**Example:**
```bash
grafana-cli --insecure --pluginUrl https://company.com/grafana/plugins/<plugin-id>-<plugin-version>.zip plugins install <plugin-id>
```
@@ -102,7 +93,6 @@ grafana-cli --insecure --pluginUrl https://company.com/grafana/plugins/<plugin-i
`--debug` or `-d` enables debug logging. Debug output is returned and shown in the terminal.
**Example:**
```bash
grafana-cli --debug plugins install <plugin-id>
```
@@ -114,7 +104,6 @@ grafana-cli --debug plugins install <plugin-id>
For example, you can use it to redirect logging to another file (maybe to log plugin installations in Grafana Cloud) or when resetting the admin password and you have non-default values for some important configuration value (like where the database is located).
**Example:**
```bash
grafana-cli --configOverrides cfg:default.paths.log=/dev/null plugins install <plugin-id>
```
@@ -124,7 +113,6 @@ grafana-cli --configOverrides cfg:default.paths.log=/dev/null plugins install <p
Sets the path for the Grafana install/home path, defaults to working directory. You do not need to use this if you are in the Grafana installation directory when using the CLI.
**Example:**
```bash
grafana-cli --homepath "/usr/share/grafana" admin reset-admin-password <new password>
```
@@ -134,7 +122,6 @@ grafana-cli --homepath "/usr/share/grafana" admin reset-admin-password <new pass
`--config value` overrides the default location where Grafana expects the configuration file. Refer to [Configuration]({{< relref "../administration/configuration.md" >}}) for more information about configuring Grafana and default configuration file locations.
**Example:**
```bash
grafana-cli --config "/etc/configuration/" admin reset-admin-password mynewpassword
```
@@ -170,7 +157,6 @@ grafana-cli plugins ls
```
### Update all installed plugins
```bash
grafana-cli plugins update-all
```
@@ -222,7 +208,6 @@ If you need to set the password in a script, then you can use the [Grafana User
`encrypt-datasource-passwords` migrates passwords from unsecured fields to secure_json_data field. Returns `ok` unless there is an error. Safe to execute multiple times.
**Example:**
```bash
grafana-cli admin data-migration encrypt-datasource-passwords
```

View File

@@ -202,13 +202,15 @@ Or redirect port 80 to the Grafana port using:
$ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000
```
Another way is to put a web server like Nginx or Apache in front of Grafana and have them proxy requests to Grafana.
Another way is put a webserver like Nginx or Apache in front of Grafana and have them proxy requests to Grafana.
### domain
This setting is only used in as a part of the `root_url` setting (see below). Important if you use GitHub or Google OAuth.
### enforce_domain
Redirect to correct domain if the host header does not match the domain. Prevents DNS rebinding attacks. Default is `false`.
Redirect to correct domain if host header does not match domain. Prevents DNS rebinding attacks. Default is `false`.
### root_url
@@ -412,19 +414,12 @@ The length of time that Grafana will wait for a successful TLS handshake with th
The length of time that Grafana will wait for a datasources first response headers after fully writing the request headers, if the request has an “Expect: 100-continue” header. A value of `0` will result in the body being sent immediately. Default is `1` second. For more details check the [Transport.ExpectContinueTimeout](https://golang.org/pkg/net/http/#Transport.ExpectContinueTimeout) documentation.
### max_conns_per_host
Optionally limits the total number of connections per host, including connections in the dialing, active, and idle states. On limit violation, dials are blocked. A value of `0` means that there are no limits. Default is `0`.
For more details check the [Transport.MaxConnsPerHost](https://golang.org/pkg/net/http/#Transport.MaxConnsPerHost) documentation.
### max_idle_connections
The maximum number of idle connections that Grafana will maintain. Default is `100`. For more details check the [Transport.MaxIdleConns](https://golang.org/pkg/net/http/#Transport.MaxIdleConns) documentation.
### max_idle_connections_per_host
[Deprecated - use max_idle_connections instead]
The maximum number of idle connections per host that Grafana will maintain. Default is `2`. For more details check the [Transport.MaxIdleConnsPerHost](https://golang.org/pkg/net/http/#Transport.MaxIdleConnsPerHost) documentation.
### idle_conn_timeout_seconds
@@ -509,7 +504,7 @@ Sets the `SameSite` cookie attribute and prevents the browser from sending this
When `false`, the HTTP header `X-Frame-Options: deny` will be set in Grafana HTTP responses which will instruct
browsers to not allow rendering Grafana in a `<frame>`, `<iframe>`, `<embed>` or `<object>`. The main goal is to
mitigate the risk of [Clickjacking](https://owasp.org/www-community/attacks/Clickjacking). Default is `false`.
mitigate the risk of [Clickjacking](https://www.owasp.org/index.php/Clickjacking). Default is `false`.
### strict_transport_security
@@ -586,9 +581,7 @@ As of Grafana v7.3, this also limits the refresh interval options in Explore.
### default_home_dashboard_path
Path to the default home dashboard. If this value is empty, then Grafana uses StaticRootPath + "dashboards/home.json".
> **Note:** On Linux, Grafana uses `/usr/share/grafana/public/dashboards/home.json` as the default home dashboard location.
Path to the default home dashboard. If this value is empty, then Grafana uses StaticRootPath + "dashboards/home.json"
<hr />
@@ -828,7 +821,7 @@ Azure cloud environment where Grafana is hosted:
| Azure Cloud | Value |
| ------------------------------------------------ | ---------------------- |
| Microsoft Azure public cloud | AzureCloud (_default_) |
| Microsoft Azure public cloud | AzureCloud (*default*) |
| Microsoft Chinese national cloud | AzureChinaCloud |
| US Government cloud | AzureUSGovernment |
| Microsoft German national cloud ("Black Forest") | AzureGermanCloud |
@@ -909,11 +902,7 @@ Default is `false`.
### templates_pattern
Enter a comma separated list of template patterns. Default is `emails/*.html, emails/*.txt`.
### content_types
Enter a comma-separated list of content types that should be included in the emails that are sent. List the content types according descending preference, e.g. `text/html, text/plain` for HTML as the most preferred. The order of the parts is significant as the mail clients will use the content type that is supported and most preferred by the sender. Supported content types are `text/html` and `text/plain`. Default is `text/html`.
Default is `emails/*.html`.
<hr>
@@ -1099,16 +1088,6 @@ Sets a global limit on number of alert rules that can be created. Default is -1
<hr>
## [unified_alerting]
For more information about the Grafana 8 alerts, refer to [Unified Alerting]({{< relref "../alerting/unified-alerting/_index.md" >}}).
### admin_config_poll_interval_seconds
Specify the frequency of polling for admin config changes. The default value is `60`.
<hr>
## [alerting]
For more information about the Alerting feature in Grafana, refer to [Alerts overview]({{< relref "../alerting/_index.md" >}}).
@@ -1403,7 +1382,7 @@ Basic auth password.
### public_url
Optional URL to send to users in notifications. If the string contains the sequence `${file}`, it is replaced with the uploaded filename. Otherwise, the file name is appended to the path part of the URL, leaving any query string unchanged.
Optional URL to send to users in notifications. If the string contains the sequence \${file}, it is replaced with the uploaded filename. Otherwise, the file name is appended to the path part of the URL, leaving any query string unchanged.
<hr>
@@ -1426,7 +1405,7 @@ Optional extra path inside bucket.
### enable_signed_urls
If set to true, Grafana creates a [signed URL](https://cloud.google.com/storage/docs/access-control/signed-urls) for
If set to true, Grafana creates a [signed URL](https://cloud.google.com/storage/docs/access-control/signed-urls] for
the image uploaded to Google Cloud Storage.
### signed_url_expiration
@@ -1490,9 +1469,7 @@ Set to `true` if you want to test alpha plugins that are not yet ready for gener
### allow_loading_unsigned_plugins
Enter a comma-separated list of plugin identifiers to identify plugins to load even if they are unsigned. Plugins with modified signatures are never loaded.
We do _not_ recommend using this option. For more information, refer to [Plugin signatures]({{< relref "../plugins/plugin-signatures.md" >}}).
Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature.
### plugin_admin_enabled
@@ -1522,47 +1499,6 @@ Refer to [Grafana Live configuration documentation]({{< relref "../live/configur
0 disables Grafana Live, -1 means unlimited connections.
### allowed_origins
> **Note**: Available in Grafana v8.0.4 and later versions.
The `allowed_origins` option is a comma-separated list of additional origins (`Origin` header of HTTP Upgrade request during WebSocket connection establishment) that will be accepted by Grafana Live.
If not set (default), then the origin is matched over [root_url]({{< relref "#root_url" >}}) which should be sufficient for most scenarios.
Origin patterns support wildcard symbol "\*".
For example:
```ini
[live]
allowed_origins = "https://*.example.com"
```
### ha_engine
> **Note**: Available in Grafana v8.1 and later versions.
**Experimental**
The high availability (HA) engine name for Grafana Live. By default, it's not set. The only possible value is "redis".
For more information, refer to [Configure Grafana Live HA setup]({{< relref "../live/live-ha-setup.md" >}}).
### ha_engine_address
> **Note**: Available in Grafana v8.1 and later versions.
**Experimental**
Address string of selected the high availability (HA) Live engine. For Redis, it's a `host:port` string. Example:
```ini
[live]
ha_engine = redis
ha_engine_address = 127.0.0.1:6379
```
<hr>
## [plugin.grafana-image-renderer]
@@ -1706,26 +1642,3 @@ Used as the default time zone for user preferences. Can be either `browser` for
### enabled
Set this to `false` to disable expressions and hide them in the Grafana UI. Default is `true`.
## [geomap]
This section controls the defaults settings for Geomap Plugin.
### default_baselayer_config
The json config used to define the default base map. Four base map options to choose from are `carto`, `esriXYZTiles`, `xyzTiles`, `standard`.
For example, to set cartoDB light as the default base layer:
```ini
default_baselayer_config = `{
"type": "xyz",
"config": {
"attribution": "Open street map",
"url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
}
}`
```
### enable_custom_baselayers
Set this to `true` to disable loading other custom base maps and hide them in the Grafana UI. Default is `false`.

View File

@@ -40,14 +40,14 @@ docker run -d --user $ID --volume "$PWD/data:/var/lib/grafana" -p 3000:3000 graf
The following settings are hard-coded when launching the Grafana Docker container and can only be overridden using environment variables, not in `conf/grafana.ini`.
| Setting | Default value |
| --------------------- | ------------------------- |
| GF_PATHS_CONFIG | /etc/grafana/grafana.ini |
| GF_PATHS_DATA | /var/lib/grafana |
| GF_PATHS_HOME | /usr/share/grafana |
| GF_PATHS_LOGS | /var/log/grafana |
| GF_PATHS_PLUGINS | /var/lib/grafana/plugins |
| GF_PATHS_PROVISIONING | /etc/grafana/provisioning |
Setting | Default value
----------------------|---------------------------
GF_PATHS_CONFIG | /etc/grafana/grafana.ini
GF_PATHS_DATA | /var/lib/grafana
GF_PATHS_HOME | /usr/share/grafana
GF_PATHS_LOGS | /var/log/grafana
GF_PATHS_PLUGINS | /var/lib/grafana/plugins
GF_PATHS_PROVISIONING | /etc/grafana/provisioning
## Logging
@@ -92,5 +92,5 @@ You may also specify multiple profiles to `GF_AWS_PROFILES` (e.g.
Supported variables:
- `GF_AWS_${profile}_ACCESS_KEY_ID`: AWS access key ID (required).
- `GF_AWS_${profile}_SECRET_ACCESS_KEY`: AWS secret access key (required).
- `GF_AWS_${profile}_SECRET_ACCESS_KEY`: AWS secret access key (required).
- `GF_AWS_${profile}_REGION`: AWS region (optional).

View File

@@ -9,7 +9,7 @@ weight = 300
Grafana supports automatic rendering of panels as PNG images. This allows Grafana to automatically generate images of your panels to include in [alert notifications]({{< relref "../alerting/old-alerting/notifications.md" >}}).
> **Note:** Image rendering of dashboards is not supported at this time.
>**Note:** Image rendering of dashboards is not supported at this time.
While an image is being rendered, the PNG image is temporarily written to the file system. When the image is rendered, the PNG image is temporarily written to the `png` folder in the Grafana `data` folder.
@@ -35,7 +35,7 @@ To install the plugin, refer to the [Grafana Image Renderer Installation instruc
## Run in custom Grafana Docker image
We recommend setting up another Docker container for rendering and using remote rendering. Refer to [Remote rendering service]({{< relref "#remote-rendering-service" >}}) for instructions.
We recommend setting up another Docker container for rendering and using remote rendering. Refer to [Remote rendering service]({{< relref "#remote-rendering-service" >}}) for instructions.
If you still want to install the plugin in the Grafana Docker image, refer to [Build with Grafana Image Renderer plugin pre-installed]({{< relref "../installation/docker/#build-with-grafana-image-renderer-plugin-pre-installed" >}}).
@@ -60,7 +60,7 @@ services:
grafana:
image: grafana/grafana:main
ports:
- '3000:3000'
- "3000:3000"
environment:
GF_RENDERING_SERVER_URL: http://renderer:8081/render
GF_RENDERING_CALLBACK_URL: http://grafana:3000/
@@ -84,24 +84,24 @@ The following example describes how to build and run the remote HTTP rendering s
1. Clone the [Grafana image renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer) Git repository.
1. Install dependencies and build:
```bash
yarn install --pure-lockfile
yarn run build
```
```bash
yarn install --pure-lockfile
yarn run build
```
1. Run the server:
```bash
node build/app.js server --port=8081
```
```bash
node build/app.js server --port=8081
```
1. Update Grafana configuration:
```
[rendering]
server_url = http://localhost:8081/render
callback_url = http://localhost:3000/
```
```
[rendering]
server_url = http://localhost:8081/render
callback_url = http://localhost:3000/
```
1. Restart Grafana.
@@ -128,7 +128,7 @@ Rendering failed: Error: Failed to launch chrome!/var/lib/grafana/plugins/grafan
error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
```
In general you can use the [`ldd`](<https://en.wikipedia.org/wiki/Ldd_(Unix)>) utility to figure out what shared libraries
In general you can use the [`ldd`](https://en.wikipedia.org/wiki/Ldd_(Unix)) utility to figure out what shared libraries
are not installed in your system:
```bash
@@ -158,13 +158,13 @@ libx11-6 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3
On Debian 9 (Stretch) the following dependencies have been confirmed as needed for the image rendering to function.
```bash
libx11 libcairo bcairo2 libcairo2 libxtst6 libxcomposite1 libx11-xcb1 libxcursor1 libxdamage1 libnss3 libcups libcups2 libXss libXss1 libxss1 libxrandr2 libasound2 libatk1.0-0 libatk-bridge2.0-0 libpangocairo-1.0-0 libgtk-3-0 libgbm1
libx11 libcairo bcairo2 libcairo2 libxtst6 libxcomposite1 libx11-xcb1 libxcursor1 libxdamage1 libnss3 libcups libcups2 libXss libXss1 libxss1 libxrandr2 libasound2 libatk1.0-0 libatk-bridge2.0-0 libpangocairo-1.0-0 libgtk-3-0
```
On Debian 10 (Buster) the following dependencies have been confirmed as needed for the image rendering to function.
```bash
libxdamage1 libxext6 libxi6 libxtst6 libnss3 libnss3 libcups2 libxss1 libxrandr2 libasound2 libatk1.0-0 libatk-bridge2.0-0 libpangocairo-1.0-0 libpango-1.0-0 libcairo2 libatspi2.0-0 libgtk3.0-cil libgdk3.0-cil libx11-xcb-dev libgbm1
libxdamage1 libxext6 libxi6 libxtst6 libnss3 libnss3 libcups2 libxss1 libxrandr2 libasound2 libatk1.0-0 libatk-bridge2.0-0 libpangocairo-1.0-0 libpango-1.0-0 libcairo2 libatspi2.0-0 libgtk3.0-cil libgdk3.0-cil libx11-xcb-dev
```
**Centos:**
@@ -208,5 +208,5 @@ instead of the pre-packaged version of Chromium.
To override the path to the Chrome/Chromium executable, set an environment variable and make sure that it's available for the Grafana process. For example:
```bash
export GF_PLUGIN_RENDERING_CHROME_BIN="/usr/bin/chromium-browser"
export GF_RENDERER_PLUGIN_CHROME_BIN="/usr/bin/chromium-browser"
```

View File

@@ -11,6 +11,6 @@ Grafana supports [Jaeger tracing](https://www.jaegertracing.io/).
Grafana can emit Jaeger traces for its HTTP API endpoints and propagate Jaeger trace information to data sources.
All HTTP endpoints are logged evenly (annotations, dashboard, tags, and so on).
When a trace ID is propagated, it is reported with operation 'HTTP /datasources/proxy/:id/\*'.
When a trace ID is propagated, it is reported with operation 'HTTP /datasources/proxy/:id/*'.
Refer to [Configuration]({{< relref "configuration.md#tracing-jaeger" >}}) for information about enabling Jaeger tracing.

View File

@@ -20,11 +20,10 @@ Follow these instructions if you are a Grafana Server Admin.
{{< docs/list >}}
{{< docs/shared "manage-users/view-server-org-list.md" >}}
1. In the organization list, click the name of the organization that you want to change.
1. In **Name**, enter the new organization name.
1. Click **Update**.
{{< /docs/list >}}
{{< /docs/list >}}
### Organization Admin change organization name
@@ -32,16 +31,14 @@ If you are an Organization Admin, follow these steps:
{{< docs/list >}}
{{< docs/shared "preferences/org-preferences-list.md" >}}
1. In **Organization name**, enter the new name.
1. Click **Update organization name**.
{{< /docs/list >}}
{{< /docs/list >}}
## Change team name or email
Organization administrators and team administrators can change team names and email addresses.
To change the team name or email, follow these steps:
1. Hover your cursor over the **Configuration** (gear) icon in the side menu.
1. Click **Teams**. Grafana displays the team list.
1. In the team list, click the name of the team that you want to change.

View File

@@ -52,10 +52,9 @@ Organization and team administrators can change the UI theme for all users in a
{{< docs/list >}}
{{< docs/shared "manage-users/view-team-list.md" >}}
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/list >}}
{{< docs/shared "preferences/select-ui-theme-list.md" >}}
{{< /docs/list >}}
## Change your personal UI theme

View File

@@ -30,10 +30,9 @@ Organization administrators and team administrators can choose a default timezon
{{< docs/list >}}
{{< docs/shared "manage-users/view-team-list.md" >}}
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/list >}}
{{< docs/shared "preferences/select-timezone-list.md" >}}
{{< /docs/list >}}
## Set your personal timezone
@@ -42,4 +41,4 @@ You can change the timezone for your user account. This setting overrides timezo
{{< docs/list >}}
{{< docs/shared "preferences/navigate-user-preferences-list.md" >}}
{{< docs/shared "preferences/select-timezone-list.md" >}}
{{< /docs/list >}}
{{< /docs/list >}}

View File

@@ -32,7 +32,7 @@ Users with the Grafana Server Admin flag on their account or access to the confi
### Use a JSON file as the home dashboard
1. Save your JSON file somewhere that Grafana can access it. For example, in the Grafana `data` folder of Grafana.
1. Update your configuration file to set the path to the JSON file. Refer to [default_home_dashboard_path]({{< relref "../configuration.md#default_home_dashboard_path">}}) for more information about modifying the Grafana configuration files.
1. Update your configuration file to set the path to the JSON file. Refer to [default_home_dashboard_path]({{< relref "../configuration.md">}}) for more information about modifying the Grafana configuration files.
```ini
[dashboards]
@@ -40,8 +40,6 @@ Users with the Grafana Server Admin flag on their account or access to the confi
default_home_dashboard_path = data/main-dashboard.json
```
> **Note:** On Linux, Grafana uses `/usr/share/grafana/public/dashboards/home.json` as the default home dashboard location.
## Set the home dashboard for your organization
Organization administrators can choose a home dashboard for their organization.
@@ -59,10 +57,9 @@ Organization administrators and Team Admins can choose a home dashboard for a te
{{< docs/list >}}
{{< docs/shared "preferences/navigate-to-the-dashboard-list.md" >}}
{{< docs/shared "manage-users/view-team-list.md" >}}
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/list >}}
{{< docs/shared "preferences/select-home-dashboard-list.md" >}}
{{< /docs/list >}}
## Set your personal home dashboard

View File

@@ -141,50 +141,49 @@ Please refer to each datasource documentation for specific provisioning examples
Since not all datasources have the same configuration settings we only have the most common ones as fields. The rest should be stored as a json blob in the `jsonData` field. Here are the most common settings that the core datasources use.
| Name | Type | Datasource | Description |
| ----------------------- | ------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| tlsAuth | boolean | _All_ | Enable TLS authentication using client cert configured in secure json data |
| tlsAuthWithCACert | boolean | _All_ | Enable TLS authentication using CA cert |
| tlsSkipVerify | boolean | _All_ | Controls whether a client verifies the server's certificate chain and host name. |
| Name | Type | Datasource | Description |
| ----------------------- | ------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| tlsAuth | boolean | _All_ | Enable TLS authentication using client cert configured in secure json data |
| tlsAuthWithCACert | boolean | _All_ | Enable TLS authentication using CA cert |
| tlsSkipVerify | boolean | _All_ | Controls whether a client verifies the server's certificate chain and host name. |
| serverName | string | _All_ | Optional. Controls the server name used for certificate common name/subject alternative name verification. Defaults to using the data source URL. |
| timeout | string | _All_ | Request timeout in seconds. Overrides dataproxy.timeout option |
| graphiteVersion | string | Graphite | Graphite version |
| timeInterval | string | Prometheus, Elasticsearch, InfluxDB, MySQL, PostgreSQL and MSSQL | Lowest interval/step value that should be used for this data source. |
| httpMode | string | Influxdb | HTTP Method. 'GET', 'POST', defaults to GET |
| maxSeries | number | Influxdb | Max number of series/tables that Grafana processes |
| httpMethod | string | Prometheus | HTTP Method. 'GET', 'POST', defaults to POST |
| customQueryParameters | string | Prometheus | Query parameters to add, as a URL-encoded string. |
| manageAlerts | boolean | Prometheus and Loki | Manage alerts via Alerting UI |
| esVersion | string | Elasticsearch | Elasticsearch version (E.g. `7.0.0`, `7.6.1`) |
| timeField | string | Elasticsearch | Which field that should be used as timestamp |
| interval | string | Elasticsearch | Index date time format. nil(No Pattern), 'Hourly', 'Daily', 'Weekly', 'Monthly' or 'Yearly' |
| logMessageField | string | Elasticsearch | Which field should be used as the log message |
| logLevelField | string | Elasticsearch | Which field should be used to indicate the priority of the log message |
| sigV4Auth | boolean | Elasticsearch and Prometheus | Enable usage of SigV4 |
| sigV4AuthType | string | Elasticsearch and Prometheus | SigV4 auth provider. default/credentials/keys |
| sigV4ExternalId | string | Elasticsearch and Prometheus | Optional SigV4 External ID |
| sigV4AssumeRoleArn | string | Elasticsearch and Prometheus | Optional SigV4 ARN role to assume |
| sigV4Region | string | Elasticsearch and Prometheus | SigV4 AWS region |
| sigV4Profile | string | Elasticsearch and Prometheus | Optional SigV4 credentials profile |
| authType | string | Cloudwatch | Auth provider. default/credentials/keys |
| externalId | string | Cloudwatch | Optional External ID |
| assumeRoleArn | string | Cloudwatch | Optional ARN role to assume |
| defaultRegion | string | Cloudwatch | Optional default AWS region |
| customMetricsNamespaces | string | Cloudwatch | Namespaces of Custom Metrics |
| profile | string | Cloudwatch | Optional credentials profile |
| tsdbVersion | string | OpenTSDB | Version |
| tsdbResolution | string | OpenTSDB | Resolution |
| sslmode | string | PostgreSQL | SSLmode. 'disable', 'require', 'verify-ca' or 'verify-full' |
| tlsConfigurationMethod | string | PostgreSQL | SSL Certificate configuration, either by 'file-path' or 'file-content' |
| sslRootCertFile | string | PostgreSQL | SSL server root certificate file, must be readable by the Grafana user |
| sslCertFile | string | PostgreSQL | SSL client certificate file, must be readable by the Grafana user |
| sslKeyFile | string | PostgreSQL | SSL client key file, must be readable by _only_ the Grafana user |
| encrypt | string | MSSQL | Connection SSL encryption handling. 'disable', 'false' or 'true' |
| postgresVersion | number | PostgreSQL | Postgres version as a number (903/904/905/906/1000) meaning v9.3, v9.4, ..., v10 |
| timescaledb | boolean | PostgreSQL | Enable usage of TimescaleDB extension |
| maxOpenConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of open connections to the database (Grafana v5.4+) |
| maxIdleConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of connections in the idle connection pool (Grafana v5.4+) |
| connMaxLifetime | number | MySQL, PostgreSQL and MSSQL | Maximum amount of time in seconds a connection may be reused (Grafana v5.4+) |
| timeout | string | _All_ | Request timeout in seconds. Overrides dataproxy.timeout option |
| graphiteVersion | string | Graphite | Graphite version |
| timeInterval | string | Prometheus, Elasticsearch, InfluxDB, MySQL, PostgreSQL and MSSQL | Lowest interval/step value that should be used for this data source. |
| httpMode | string | Influxdb | HTTP Method. 'GET', 'POST', defaults to GET |
| maxSeries | number | Influxdb | Max number of series/tables that Grafana processes |
| httpMethod | string | Prometheus | HTTP Method. 'GET', 'POST', defaults to POST |
| customQueryParameters | string | Prometheus | Query parameters to add, as a URL-encoded string. |
| esVersion | string | Elasticsearch | Elasticsearch version (E.g. `7.0.0`, `7.6.1`) |
| timeField | string | Elasticsearch | Which field that should be used as timestamp |
| interval | string | Elasticsearch | Index date time format. nil(No Pattern), 'Hourly', 'Daily', 'Weekly', 'Monthly' or 'Yearly' |
| logMessageField | string | Elasticsearch | Which field should be used as the log message |
| logLevelField | string | Elasticsearch | Which field should be used to indicate the priority of the log message |
| sigV4Auth | boolean | Elasticsearch and Prometheus | Enable usage of SigV4 |
| sigV4AuthType | string | Elasticsearch and Prometheus | SigV4 auth provider. default/credentials/keys |
| sigV4ExternalId | string | Elasticsearch and Prometheus | Optional SigV4 External ID |
| sigV4AssumeRoleArn | string | Elasticsearch and Prometheus | Optional SigV4 ARN role to assume |
| sigV4Region | string | Elasticsearch and Prometheus | SigV4 AWS region |
| sigV4Profile | string | Elasticsearch and Prometheus | Optional SigV4 credentials profile |
| authType | string | Cloudwatch | Auth provider. default/credentials/keys |
| externalId | string | Cloudwatch | Optional External ID |
| assumeRoleArn | string | Cloudwatch | Optional ARN role to assume |
| defaultRegion | string | Cloudwatch | Optional default AWS region |
| customMetricsNamespaces | string | Cloudwatch | Namespaces of Custom Metrics |
| profile | string | Cloudwatch | Optional credentials profile |
| tsdbVersion | string | OpenTSDB | Version |
| tsdbResolution | string | OpenTSDB | Resolution |
| sslmode | string | PostgreSQL | SSLmode. 'disable', 'require', 'verify-ca' or 'verify-full' |
| tlsConfigurationMethod | string | PostgreSQL | SSL Certificate configuration, either by 'file-path' or 'file-content' |
| sslRootCertFile | string | PostgreSQL | SSL server root certificate file, must be readable by the Grafana user |
| sslCertFile | string | PostgreSQL | SSL client certificate file, must be readable by the Grafana user |
| sslKeyFile | string | PostgreSQL | SSL client key file, must be readable by _only_ the Grafana user |
| encrypt | string | MSSQL | Connection SSL encryption handling. 'disable', 'false' or 'true' |
| postgresVersion | number | PostgreSQL | Postgres version as a number (903/904/905/906/1000) meaning v9.3, v9.4, ..., v10 |
| timescaledb | boolean | PostgreSQL | Enable usage of TimescaleDB extension |
| maxOpenConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of open connections to the database (Grafana v5.4+) |
| maxIdleConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of connections in the idle connection pool (Grafana v5.4+) |
| connMaxLifetime | number | MySQL, PostgreSQL and MSSQL | Maximum amount of time in seconds a connection may be reused (Grafana v5.4+) |
#### Secure Json Data
@@ -192,15 +191,15 @@ Since not all datasources have the same configuration settings we only have the
Secure json data is a map of settings that will be encrypted with [secret key]({{< relref "configuration.md#secret-key" >}}) from the Grafana config. The purpose of this is only to hide content from the users of the application. This should be used for storing TLS Cert and password that Grafana will append to the request on the server side. All of these settings are optional.
| Name | Type | Datasource | Description |
| ----------------- | ------ | ---------------------------- | -------------------------------------------------------- |
| tlsCACert | string | _All_ | CA cert for out going requests |
| tlsClientCert | string | _All_ | TLS Client cert for outgoing requests |
| tlsClientKey | string | _All_ | TLS Client key for outgoing requests |
| password | string | _All_ | password |
| basicAuthPassword | string | _All_ | password for basic authentication |
| accessKey | string | Cloudwatch | Access key for connecting to Cloudwatch |
| secretKey | string | Cloudwatch | Secret key for connecting to Cloudwatch |
| Name | Type | Datasource | Description |
| ----------------- | ------ | ---------- | --------------------------------------- |
| tlsCACert | string | _All_ | CA cert for out going requests |
| tlsClientCert | string | _All_ | TLS Client cert for outgoing requests |
| tlsClientKey | string | _All_ | TLS Client key for outgoing requests |
| password | string | _All_ | password |
| basicAuthPassword | string | _All_ | password for basic authentication |
| accessKey | string | Cloudwatch | Access key for connecting to Cloudwatch |
| secretKey | string | Cloudwatch | Secret key for connecting to Cloudwatch |
| sigV4AccessKey | string | Elasticsearch and Prometheus | SigV4 access key. Required when using keys auth provider |
| sigV4SecretKey | string | Elasticsearch and Prometheus | SigV4 secret key. Required when using keys auth provider |
@@ -320,11 +319,9 @@ By default, Grafana deletes dashboards in the database if the file is removed. Y
> or `uid` within the same installation as this will cause weird behaviors.
### Provision folders structure from filesystem to Grafana
If you already store your dashboards using folders in a git repo or on a filesystem, and also you want to have the same folder names in the Grafana menu, you can use `foldersFromFilesStructure` option.
For example, to replicate these dashboards structure from the filesystem to Grafana,
```
/etc/dashboards
├── /server
@@ -334,21 +331,18 @@ For example, to replicate these dashboards structure from the filesystem to Graf
├── /requests_dashboard.json
└── /resources_dashboard.json
```
you need to specify just this short provision configuration file.
```yaml
apiVersion: 1
providers:
- name: dashboards
type: file
updateIntervalSeconds: 30
options:
path: /etc/dashboards
foldersFromFilesStructure: true
- name: dashboards
type: file
updateIntervalSeconds: 30
options:
path: /etc/dashboards
foldersFromFilesStructure: true
```
`server` and `application` will become new folders in Grafana menu.
> **Note:** `folder` and `folderUid` options should be empty or missing to make `foldersFromFilesStructure` work.
@@ -432,7 +426,7 @@ The following sections detail the supported settings and secure settings for eac
#### Alert notification `pushover`
| Name | Secure setting |
| ---------- | -------------- |
| -------- | -------------- |
| apiToken | yes |
| userKey | yes |
| device | |
@@ -445,11 +439,11 @@ The following sections detail the supported settings and secure settings for eac
#### Alert notification `discord`
| Name | Secure setting |
| ---------- | -------------- |
| url | yes |
| avatar_url | |
| content | |
| Name | Secure setting |
| -------------- | -------------- |
| url | yes |
| avatar_url | |
| message | |
#### Alert notification `slack`
@@ -506,7 +500,7 @@ The following sections detail the supported settings and secure settings for eac
#### Alert notification `sensugo`
| Name | Secure setting |
| --------- | -------------- |
| -------- | -------------- |
| url | |
| apikey | yes |
| entity | |

View File

@@ -28,7 +28,7 @@ Require all network requests being made by Grafana to go through a proxy server.
## Limit Viewer query permissions
Users with the Viewer role can enter _any possible query_ in _any_ of the data sources available in the **organization**, not just the queries that are defined on the dashboards for which the user has Viewer permissions.
Users with the Viewer role can enter *any possible query* in *any* of the data sources available in the **organization**, not just the queries that are defined on the dashboards for which the user has Viewer permissions.
**For example:** In a Grafana instance with one data source, one dashboard, and one panel that has one query defined, you might assume that a Viewer can only see the result of the query defined in that panel. Actually, the Viewer has access to send any query to the data source. With a command-line tool like curl (there are lots of tools for this), the Viewer can make their own query to the data source and potentially access sensitive data.
@@ -41,6 +41,6 @@ To address this vulnerability, you can restrict data source query access in the
When you enable anonymous access to a dashboard, it is publicly available. This section lists the security implications of enabling Anonymous access.
- Anyone with the URL can access the dashboard.
- Anyone with the URL can access the dashboard.
- Anyone can make view calls to the API and list all folders, dashboards, and data sources.
- Anyone can make arbitrary queries to any data source that the Grafana instance is configured with.

View File

@@ -18,16 +18,12 @@ and other persistent data. So the default embedded SQLite database will not work
First, you need to set up MySQL or Postgres on another server and configure Grafana to use that database.
You can find the configuration for doing that in the [[database]]({{< relref "../administration/configuration.md#database" >}}) section in the Grafana config.
Grafana will now persist all long term data in the database. How to configure the database for high availability is out of scope for this guide. We recommend finding an expert on the database you're using.
Grafana will now persist all long term data in the database. How to configure the database for high availability is out of scope for this guide. We recommend finding an expert on for the database you're using.
## Alerting
Currently alerting supports a limited form of high availability. [Alert notifications]({{< relref "../alerting/old-alerting/notifications.md" >}}) are deduplicated when running multiple servers. This means all alerts are executed on every server but alert notifications are only sent once per alert. Grafana does not support load distribution between servers.
## Grafana Live
Grafana Live works with limitations in highly available setup. For details, refer to the [Grafana Live documentation]({{< relref "../live/live-ha-setup.md" >}}).
## User sessions
Grafana uses auth token strategy with database by default. This means that a load balancer can send a user to any Grafana server without having to log in on each server.

View File

@@ -59,7 +59,6 @@ These instructions assume you have already added Prometheus as a data source in
static_configs:
- targets: ['localhost:3000']
```
1. Restart Prometheus. Your new job should appear on the Targets tab.
1. In Grafana, hover your mouse over the **Configuration** (gear) icon on the left sidebar and then click **Data Sources**.
1. Select the **Prometheus** data source.
@@ -82,7 +81,6 @@ These instructions assume you have already added Graphite as a data source in Gr
```
1. Enable [metrics.graphite] options:
```
# Send internal metrics to Graphite
[metrics.graphite]

View File

@@ -8,8 +8,6 @@ weight = 300
# View Grafana server settings
> Refer to [Fine-grained access control]({{< relref "../../enterprise/access-control/_index.md" >}}) in Grafana Enterprise to understand how you can control access with fine-grained permissions.
If you are a Grafana server administrator, use the Settings tab to view the settings that are applied to your Grafana server via the [Configuration]({{< relref "../configuration.md#config-file-locations" >}}) file and any environmental variables.
> **Note:** Only Grafana server administrators can access the **Server Admin** menu. For more information about about administrative permissions, refer to [Grafana server admin]({{< relref "../../permissions/_index.md" >}}).

View File

@@ -7,8 +7,6 @@ weight = 400
# View Grafana server stats
> Refer to [Fine-grained access control]({{< relref "../../enterprise/access-control/_index.md" >}}) in Grafana Enterprise to understand how you can control access with fine-grained permissions.
If you are a Grafana server admin, then you can view useful statistics about your Grafana server in the Stats tab.
> **Note:** Only Grafana server administrators can access the **Server Admin** menu. For more information about about administrative permissions, refer to [Grafana server admin]({{< relref "../../permissions/_index.md" >}}).
@@ -47,5 +45,5 @@ If a user belongs to several organizations, then that user is counted once as a
For example, if Sofia is a Viewer in two organizations, an Editor in two organizations, and Admin in three organizations, then she would be reflected in the stats as:
- Total users 1
- Total admins 1
- Total users 1
- Total admins 1

View File

@@ -0,0 +1,8 @@
+++
title = "Alerts"
aliases = ["/docs/grafana/latest/alerting/rules/", "/docs/grafana/latest/alerting/metrics/"]
weight = 110
+++
# Alerts v2.0 overview

View File

@@ -1,15 +1,14 @@
+++
title = "Alerts"
aliases = ["/docs/grafana/latest/alerting/rules/", "/docs/grafana/latest/alerting/metrics/"]
weight = 110
+++
# Grafana alerts
Alerts allow you to know about problems in your systems moments after they occur. Robust and actionable alerts help you identify and resolve issues quickly, minimizing disruption to your services.
Alerts allow you to know about problems in your systems moments after they occur. Robust and actionable alerts help you identify and resolve issues quickly, minimizing disruption to your services.
Grafana 8.0 has new and improved alerts. The new alerting system is an [opt-in]({{< relref "./unified-alerting/opt-in.md" >}}) feature that centralizes alerting information for Grafana managed alerts and alerts from Prometheus-compatible data sources in one UI and API.
> **Note:** Out of the box, Grafana still supports old [legacy dashboard alerts]({{< relref "./old-alerting/_index.md" >}}). We encourage you to create issues in the Grafana GitHub repository for bugs found while testing Grafana 8 alerts.
Grafana 8.0 has new and improved alerts. The new alerting system are an [opt-in]({{< relref "./unified-alerting/opt-in.md" >}}) feature that centralizes alerting information for Grafana managed alerts and alerts from Prometheus-compatible data sources in one UI and API.
Alerts have four main components:
@@ -20,12 +19,8 @@ Alerts have four main components:
You can create and edit alerting rules for Grafana managed alerts, Cortex alerts, and Loki alerts as well as see alerting information from prometheus-compatible data sources in a single, searchable view. For more information, on how to create and edit alerts and notifications, refer to [Overview of Grafana 8.0 alerts]({{< relref "../alerting/unified-alerting/_index.md" >}}).
For handling notifications for Grafana managed alerts, we use an embedded Alertmanager. You can configure its contact points, notification policies, silences and templates from the new Grafana alerting UI by selecting `Grafana` from the Alertmanager dropdown on the top of the respective tab.
> **Note:** Currently the configuration of this embedded Alertmanager is shared across organisations. Therefore users are advised to use the new Grafana 8 Alerts only if they have one organisation otherwise all contact points, notification policies, silences and templates for Grafana managed alerts will be visible by all organizations.
As part of the new alert changes, we have introduced a new data source, Alertmanager, which includes built-in support for Prometheus Alertmanager. It is presently in alpha and it not accessible unless alpha plugins are enabled in Grafana settings. For more information, refer to [Alertmanager data source]({{< relref "../datasources/alertmanager.md" >}}). If such a data source is present, then you can view and modify its silences, contact points and notification policies from the Grafana alerting UI by selecting it from the Alertmanager dropdown on the top of respective tab.
As part of the new alert changes, we have introduced a new data source, Alertmanager, which includes built-in support for Prometheus Alertmanager. It is presently in alpha and it not accessible unless alpha plugins are enabled in Grafana settings. For more information, refer to [Alertmanager data source]({{< relref "../datasources/alertmanager.md" >}}).
> **Note:** Out of the box, Grafana still supports old Grafana alerts. They are legacy alerts at this time, and will be deprecated in a future release. For more information, refer to [Legacy Grafana alerts]({{< relref "./old-alerting/_index.md" >}}).
To learn more about the differences between new alerts and the legacy alerts, refer to [What's New with Grafana 8 Alerts]({{< relref "../alerting/difference-old-new.md" >}}).
To learn more about the differences between new alerts and the legacy alerts, refer to [What's New with Grafana 8 Alerts]({{< relref "../alerting/difference-old-new.md" >}}).

View File

@@ -0,0 +1,23 @@
+++
title = "Alert notification templating"
keywords = ["grafana", "documentation", "alerting", "alerts", "notification", "templating"]
weight = 110
+++
# Alert notification templating
You can provide detailed information to alert notification recipients by injecting alert query data into an alert notification. This topic explains how you can use alert query labels in alert notifications.
Labels that exist from the evaluation of the alert query can be used in the alert rule name and in the alert notification message fields. The alert label data is injected into the notification fields when the alert is in the alerting state. When there are multiple unique values for the same label, the values are comma-separated.
This topic explains how you can use alert query labels in alert notifications.
## Adding alert label data into your alert notification
1. Navigate to the panel you want to add or edit an alert rule for.
1. Click on the panel title, and then click **Edit**.
1. On the Alert tab, click **Create Alert**. If an alert already exists for this panel, then you can edit the alert directly.
1. Refer to the alert query labels in the alert rule name and/or alert notification message field by using the `${Label}` syntax.
1. Click **Save** in the upper right corner to save the alert rule and the dashboard.
![Alerting notification template](/static/img/docs/alerting/alert-notification-template-7-4.png)

View File

@@ -0,0 +1,126 @@
+++
title = "Create alerts"
description = "Configure alert rules"
keywords = ["grafana", "alerting", "guide", "rules"]
weight = 200
+++
# Create alerts
Grafana alerting allows you to attach rules to your dashboard panels. When you save the dashboard, Grafana extracts the alert rules into a separate alert rule storage and schedules them for evaluation.
![Alerting overview](/static/img/docs/alerting/drag_handles_gif.gif)
In the Alert tab of the graph panel you can configure how often the alert rule should be evaluated and the conditions that need to be met for the alert to change state and trigger its [notifications]({{< relref "notifications.md" >}}).
Currently only the graph panel supports alert rules.
## Add or edit an alert rule
1. Navigate to the panel you want to add or edit an alert rule for, click the title, and then click **Edit**.
1. On the Alert tab, click **Create Alert**. If an alert already exists for this panel, then you can just edit the fields on the Alert tab.
1. Fill out the fields. Descriptions are listed below in [Alert rule fields](#alert-rule-fields).
1. When you have finished writing your rule, click **Save** in the upper right corner to save alert rule and the dashboard.
1. (Optional but recommended) Click **Test rule** to make sure the rule returns the results you expect.
## Delete an alert
To delete an alert, scroll to the bottom of the alert and then click **Delete**.
## Alert rule fields
This section describes the fields you fill out to create an alert.
### Rule
- **Name -** Enter a descriptive name. The name will be displayed in the Alert Rules list. This field supports [templating]({{< relref "./add-notification-template.md" >}}).
- **Evaluate every -** Specify how often the scheduler should evaluate the alert rule. This is referred to as the _evaluation interval_.
- **For -** Specify how long the query needs to violate the configured thresholds before the alert notification triggers.
You can set a minimum evaluation interval in the `alerting.min_interval_seconds` configuration field, to set a minimum time between evaluations. Refer to [Configuration]({{< relref "../administration/configuration.md" >}}#min-interval-seconds) for more information.
> **Caution:** Do not use `For` with the `If no data or all values are null` setting set to `No Data`. The triggering of `No Data` will trigger instantly and not take `For` into consideration. This may also result in that an OK notification not being sent if alert transitions from `No Data -> Pending -> OK`.
If an alert rule has a configured `For` and the query violates the configured threshold, then it will first go from `OK` to `Pending`. Going from `OK` to `Pending` Grafana will not send any notifications. Once the alert rule has been firing for more than `For` duration, it will change to `Alerting` and send alert notifications.
Typically, it's always a good idea to use this setting since it's often worse to get false positive than wait a few minutes before the alert notification triggers. Looking at the `Alert list` or `Alert list panels` you will be able to see alerts in pending state.
Below you can see an example timeline of an alert using the `For` setting. At ~16:04 the alert state changes to `Pending` and after 4 minutes it changes to `Alerting` which is when alert notifications are sent. Once the series falls back to normal the alert rule goes back to `OK`.
{{< figure class="float-right" src="/static/img/docs/v54/alerting-for-dark-theme.png" caption="Alerting For" >}}
{{< figure class="float-right" max-width="40%" src="/static/img/docs/v4/alerting_conditions.png" caption="Alerting Conditions" >}}
### Conditions
Currently the only condition type that exists is a `Query` condition that allows you to
specify a query letter, time range and an aggregation function.
#### Query condition example
```sql
avg() OF query(A, 15m, now) IS BELOW 14
```
- `avg()` Controls how the values for **each** series should be reduced to a value that can be compared against the threshold. Click on the function to change it to another aggregation function.
- `query(A, 15m, now)` The letter defines what query to execute from the **Metrics** tab. The second two parameters define the time range, `15m, now` means 15 minutes ago to now. You can also do `10m, now-2m` to define a time range that will be 10 minutes ago to 2 minutes ago. This is useful if you want to ignore the last 2 minutes of data.
- `IS BELOW 14` Defines the type of threshold and the threshold value. You can click on `IS BELOW` to change the type of threshold.
The query used in an alert rule cannot contain any template variables. Currently we only support `AND` and `OR` operators between conditions and they are executed serially.
For example, we have 3 conditions in the following order:
_condition:A(evaluates to: TRUE) OR condition:B(evaluates to: FALSE) AND condition:C(evaluates to: TRUE)_
so the result will be calculated as ((TRUE OR FALSE) AND TRUE) = TRUE.
We plan to add other condition types in the future, like `Other Alert`, where you can include the state of another alert in your conditions, and `Time Of Day`.
#### Multiple Series
If a query returns multiple series, then the aggregation function and threshold check will be evaluated for each series. What Grafana does not do currently is track alert rule state **per series**. This has implications that are detailed in the scenario below.
- Alert condition with query that returns 2 series: **server1** and **server2**
- **server1** series causes the alert rule to fire and switch to state `Alerting`
- Notifications are sent out with message: _load peaking (server1)_
- In a subsequent evaluation of the same alert rule, the **server2** series also causes the alert rule to fire
- No new notifications are sent as the alert rule is already in state `Alerting`.
So, as you can see from the above scenario Grafana will not send out notifications when other series cause the alert to fire if the rule already is in state `Alerting`. To improve support for queries that return multiple series we plan to track state **per series** in a future release.
> Starting with Grafana v5.3 you can configure reminders to be sent for triggered alerts. This will send additional notifications
> when an alert continues to fire. If other series (like server2 in the example above) also cause the alert rule to fire they will be included in the reminder notification. Depending on what notification channel you're using you may be able to take advantage of this feature for identifying new/existing series causing alert to fire.
### No Data & Error Handling
Below are conditions you can configure how the rule evaluation engine should handle queries that return no data or only null values.
| No Data Option | Description |
| --------------- | ------------------------------------------------------------------------------------------ |
| No Data | Set alert rule state to `NoData` |
| Alerting | Set alert rule state to `Alerting` |
| Keep Last State | Keep the current alert rule state, whatever it is. |
| Ok | Not sure why you would want to send yourself an alert when things are okay, but you could. |
### Execution errors or timeouts
Tell Grafana how to handle execution or timeout errors.
| Error or timeout option | Description |
| ----------------------- | --------------------------------------------------- |
| Alerting | Set alert rule state to `Alerting` |
| Keep Last State | Keep the current alert rule state, whatever it is. |
If you have an unreliable time series store from which queries sometime timeout or fail randomly you can set this option to `Keep Last State` in order to basically ignore them.
## Notifications
In alert tab you can also specify alert rule notifications along with a detailed message about the alert rule. The message can contain anything, information about how you might solve the issue, link to runbook, and so on.
The actual notifications are configured and shared between multiple alerts. Read
[Alert notifications]({{< relref "notifications.md" >}}) for information on how to configure and set up notifications.
- **Send to -** Select an alert notification channel if you have one set up.
- **Message -** Enter a text message to be sent on the notification channel. Some alert notifiers support transforming the text to HTML or other rich formats. This field supports [templating]({{< relref "./add-notification-template.md" >}}).
- **Tags -** Specify a list of tags (key/value) to be included in the notification. It is only supported by [some notifiers]({{< relref "notifications/#all-supported-notifiers" >}}).
## Alert state history and annotations
Alert state changes are recorded in the internal annotation table in Grafana's database. The state changes are visualized as annotations in the alert rule's graph panel. You can also go into the `State history` submenu in the alert tab to view and clear state history.

View File

@@ -6,21 +6,16 @@ weight = 112
+++
# What's New with Grafana 8 Alerts
The Alerts released with Grafana 8.0 are an opt-in feature that centralizes alerting information for Grafana managed alerts and alerts from Prometheus-compatible datasources in one UI and API. You are able to create and edit alerting rules for Grafana managed alerts, Cortex alerts, and Loki alerts as well as see alerting information from prometheus-compatible datasources in a single, searchable view.
## Multi-dimensional alerting
Create alerts that will give you system-wide visibility with a single alerting rule. With Grafana 8 alerts, you are able to generate multiple alert instances from a single rule eg. creating a rule to monitor disk usage for multiple mount points on a single host. The evaluation engine is able to return multiple time series from a single query. Each time series is identified by its label set.
Create alerts that will give you system-wide visibility with a single alerting rule. With Grafana 8 alerts, you are able to generate multiple alert instances from a single rule eg. creating a rule to monitor disk usage for multiple mount points on a single host. The evaluation engine is able to return multiple time series from a single query. Each time series is identified by its label set.
## Create alerts outside of Dashboards
Grafana legacy alerts were tied to a dashboard. Grafana 8 Alerts allow you to create queries and expressions that can combine data from multiple sources, in unique ways. You are still able to link dashboards and panels to alerting rules, allowing you to quickly troubleshoot the system under observation, by linking a dashboard and/or panel ID to the alerting rule.
Grafana legacy alerts were tied to a dashboard. Grafana 8 Alerts allow you to create queries and expressions that can combine data from multiple sources, in unique ways. You are still able to link dashboards and panels to alerting rules, allowing you to quickly troubleshoot the system under observation, by linking a dashboard and/or panel ID to the alerting rule.
## Create Loki and Cortex alerting rules
With Grafana 8 Alerts you are able to manage your Loki and Cortex alerting rules using the same UI and API as your Grafana managed alerts.
With Grafana 8 Alerts you are able to manage your Loki and Cortex alerting rules using the same UI and API as your Grafana managed alerts.
## View and search for alerts from Prometheus
You can now display all of your alerting information in one, searchable UI. Alerts for Prometheus compatible datasources are listed below Grafana managed alerts. Search for labels across multiple datasources to quickly find all of the relevant alerts.

View File

@@ -0,0 +1,283 @@
+++
title = "Alert notifications"
description = "Alerting notifications guide"
keywords = ["Grafana", "alerting", "guide", "notifications"]
weight = 100
+++
# Alert notifications
When an alert changes state, it sends out notifications. Each alert rule can have
multiple notifications. In order to add a notification to an alert rule you first need
to add and configure a `notification` channel (can be email, PagerDuty, or other integration).
This is done from the Notification channels page.
> **Note:** Alerting is only available in Grafana v4.0 and above.
## Add a notification channel
1. In the Grafana side bar, hover your cursor over the **Alerting** (bell) icon and then click **Notification channels**.
1. Click **Add channel**.
1. Fill out the fields or select options described below.
## New notification channel fields
### Default (send on all alerts)
- **Name -** Enter a name for this channel. It will be displayed when users add notifications to alert rules.
- **Type -** Select the channel type. Refer to the [List of supported notifiers](#list-of-supported-notifiers) for details.
- **Default (send on all alerts) -** When selected, this option sends a notification on this channel for all alert rules.
- **Include Image -** See [Enable images in notifications](#enable-images-in-notifications-external-image-store) for details.
- **Disable Resolve Message -** When selected, this option disables the resolve message [OK] that is sent when the alerting state returns to false.
- **Send reminders -** When this option is checked additional notifications (reminders) will be sent for triggered alerts. You can specify how often reminders should be sent using number of seconds (s), minutes (m) or hours (h), for example `30s`, `3m`, `5m` or `1h`.
**Important:** Alert reminders are sent after rules are evaluated. Therefore a reminder can never be sent more frequently than a configured alert rule evaluation interval.
These examples show how often and when reminders are sent for a triggered alert.
Alert rule evaluation interval | Send reminders every | Reminder sent every (after last alert notification)
---------- | ----------- | -----------
`30s` | `15s` | ~30 seconds
`1m` | `5m` | ~5 minutes
`5m` | `15m` | ~15 minutes
`6m` | `20m` | ~24 minutes
`1h` | `15m` | ~1 hour
`1h` | `2h` | ~2 hours
<div class="clearfix"></div>
## List of supported notifiers
Name | Type | Supports images | Support alert rule tags
-----|------|---------------- | -----------------------
[DingDing](#dingdingdingtalk) | `dingding` | yes, external only | no
[Discord](#discord) | `discord` | yes | no
[Email](#email) | `email` | yes | no
[Google Hangouts Chat](#google-hangouts-chat) | `googlechat` | yes, external only | no
Hipchat | `hipchat` | yes, external only | no
[Kafka](#kafka) | `kafka` | yes, external only | no
Line | `line` | yes, external only | no
Microsoft Teams | `teams` | yes, external only | no
[Opsgenie](#opsgenie) | `opsgenie` | yes, external only | yes
[Pagerduty](#pagerduty) | `pagerduty` | yes, external only | yes
Prometheus Alertmanager | `prometheus-alertmanager` | yes, external only | yes
[Pushover](#pushover) | `pushover` | yes | no
Sensu | `sensu` | yes, external only | no
[Sensu Go](#sensu-go) | `sensugo` | yes, external only | no
[Slack](#slack) | `slack` | yes | no
Telegram | `telegram` | yes | no
Threema | `threema` | yes, external only | no
VictorOps | `victorops` | yes, external only | yes
[Webhook](#webhook) | `webhook` | yes, external only | yes
[Zenduty](#zenduty) | `webhook` | yes, external only | yes
### Email
To enable email notifications you have to set up [SMTP settings]({{< relref "../administration/configuration/#smtp" >}})
in the Grafana config. Email notifications will upload an image of the alert graph to an
external image destination if available or fallback to attaching the image to the email.
Be aware that if you use the `local` image storage email servers and clients might not be
able to access the image.
> **Note:** Template variables are not supported in email alerts.
Setting | Description
---------- | -----------
Single email | Send a single email to all recipients. Disabled per default.
Addresses | Email addresses to recipients. You can enter multiple email addresses using a ";" separator.
### Slack
{{< figure class="float-right" max-width="40%" src="/static/img/docs/v4/slack_notification.png" caption="Alerting Slack Notification" >}}
To set up Slack, you need to configure an incoming Slack webhook URL. You can follow
[Sending messages using Incoming Webhooks](https://api.slack.com/incoming-webhooks) on how to do that. If you want to include screenshots of the
firing alerts in the Slack messages you have to configure either the [external image destination](#external-image-store)
in Grafana or a bot integration via Slack Apps. [Follow Slack's guide to set up a bot integration](https://api.slack.com/bot-users) and use the token
provided, which starts with "xoxb".
Setting | Description
---------- | -----------
Url | Slack incoming webhook URL, or eventually the [chat.postMessage](https://api.slack.com/methods/chat.postMessage) Slack API endpoint.
Username | Set the username for the bot's message.
Recipient | Allows you to override the Slack recipient. You must either provide a channel Slack ID, a user Slack ID, a username reference (@&lt;user&gt;, all lowercase, no whitespace), or a channel reference (#&lt;channel&gt;, all lowercase, no whitespace). If you use the `chat.postMessage` Slack API endpoint, this is required.
Icon emoji | Provide an emoji to use as the icon for the bot's message. Ex :smile:
Icon URL | Provide a URL to an image to use as the icon for the bot's message.
Mention Users | Optionally mention one or more users in the Slack notification sent by Grafana. You have to refer to users, comma-separated, via their corresponding Slack IDs (which you can find by clicking the overflow button on each user's Slack profile).
Mention Groups | Optionally mention one or more groups in the Slack notification sent by Grafana. You have to refer to groups, comma-separated, via their corresponding Slack IDs (which you can get from each group's Slack profile URL).
Mention Channel | Optionally mention either all channel members or just active ones.
Token | If provided, Grafana will upload the generated image via Slack's file.upload API method, not the external image destination. If you use the `chat.postMessage` Slack API endpoint, this is required.
If you are using the token for a slack bot, then you have to invite the bot to the channel you want to send notifications and add the channel to the recipient field.
### Opsgenie
To setup Opsgenie you will need an API Key and the Alert API Url. These can be obtained by configuring a new [Grafana Integration](https://docs.opsgenie.com/docs/grafana-integration).
Setting | Description
--------|------------
Alert API URL | The API URL for your Opsgenie instance. This will normally be either `https://api.opsgenie.com` or, for EU customers, `https://api.eu.opsgenie.com`.
API Key | The API Key as provided by Opsgenie for your configured Grafana integration.
Override priority | Configures the alert priority using the `og_priority` tag. The `og_priority` tag must have one of the following values: `P1`, `P2`, `P3`, `P4`, or `P5`. Default is `False`.
Send notification tags as | Specify how you would like [Notification Tags]({{< relref "create-alerts.md/#notifications" >}}) delivered to Opsgenie. They can be delivered as `Tags`, `Extra Properties` or both. Default is Tags. See note below for more information.
> **Note:** When notification tags are sent as `Tags` they are concatenated into a string with a `key:value` format. If you prefer to receive the notifications tags as key/values under Extra Properties in Opsgenie then change the `Send notification tags as` to either `Extra Properties` or `Tags & Extra Properties`.
### PagerDuty
To set up PagerDuty, all you have to do is to provide an integration key.
Setting | Description
---------- | -----------
Integration Key | Integration key for PagerDuty.
Severity | Level for dynamic notifications, default is `critical` (1)
Auto resolve incidents | Resolve incidents in PagerDuty once the alert goes back to ok
Message in details | Removes the Alert message from the PD summary field and puts it into custom details instead (2)
>**Note:** The tags `Severity`, `Class`, `Group`, `dedup_key`, and `Component` have special meaning in the [Pagerduty Common Event Format - PD-CEF](https://support.pagerduty.com/docs/pd-cef). If an alert panel defines these tag keys, then they are transposed to the root of the event sent to Pagerduty. This means they will be available within the Pagerduty UI and Filtering tools. A Severity tag set on an alert overrides the global Severity set on the notification channel if it's a valid level.
>Using Message In Details will change the structure of the `custom_details` field in the PagerDuty Event.
This might break custom event rules in your PagerDuty rules if you rely on the fields in `payload.custom_details`.
Move any existing rules using `custom_details.myMetric` to `custom_details.queries.myMetric`.
This behavior will become the default in a future version of Grafana.
> **Note:** The `dedup_key` tag overrides the Grafana-generated `dedup_key` with a custom key.
> **Note:** The `state` tag overrides the current alert state inside the `custom_details` payload.
### VictorOps
To configure VictorOps, provide the URL from the Grafana Integration and substitute `$routing_key` with a valid key.
> **Note:** The tag `Severity` has special meaning in the [VictorOps Incident Fields](https://help.victorops.com/knowledge-base/incident-fields-glossary/). If an alert panel defines this key, then it replaces the `message_type` in the root of the event sent to VictorOps.
### Pushover
To set up Pushover, you must provide a user key and an API token. Refer to [What is Pushover and how do I use it](https://support.pushover.net/i7-what-is-pushover-and-how-do-i-use-it) for instructions on how to generate them.
Setting | Description
---------- | -----------
API Token | Application token
User key(s) | A comma-separated list of user keys
Device(s) | A comma-separated list of devices
Priority | The priority alerting nottifications are sent
OK priority | The priority OK notifications are sent; if not set, then OK notifications are sent with the priority set for alerting notifications
Retry | How often (in seconds) the Pushover servers send the same notification to the user. (minimum 30 seconds)
Expire | How many seconds your notification will continue to be retried for (maximum 86400 seconds)
Alerting sound | The sound for alerting notifications
OK sound | The sound for OK notifications
### Webhook
The webhook notification is a simple way to send information about a state change over HTTP to a custom endpoint.
Using this notification you could integrate Grafana into a system of your choosing.
Example json body:
```json
{
"dashboardId":1,
"evalMatches":[
{
"value":1,
"metric":"Count",
"tags":{}
}
],
"imageUrl":"https://grafana.com/assets/img/blog/mixed_styles.png",
"message":"Notification Message",
"orgId":1,
"panelId":2,
"ruleId":1,
"ruleName":"Panel Title alert",
"ruleUrl":"http://localhost:3000/d/hZ7BuVbWz/test-dashboard?fullscreen\u0026edit\u0026tab=alert\u0026panelId=2\u0026orgId=1",
"state":"alerting",
"tags":{
"tag name":"tag value"
},
"title":"[Alerting] Panel Title alert"
}
```
- **state** - The possible values for alert state are: `ok`, `paused`, `alerting`, `pending`, `no_data`.
### DingDing/DingTalk
DingTalk supports the following "message type": `text`, `link` and `markdown`. Only the `link` message type is supported. Refer to the [configuration instructions](https://developers.dingtalk.com/document/app/custom-robot-access) in Chinese language.
In DingTalk PC Client:
1. Click "more" icon on upper right of the panel.
2. Click "Robot Manage" item in the pop menu, there will be a new panel call "Robot Manage".
3. In the "Robot Manage" panel, select "customized: customized robot with Webhook".
4. In the next new panel named "robot detail", click "Add" button.
5. In "Add Robot" panel, input a nickname for the robot and select a "message group" which the robot will join in. click "next".
6. There will be a Webhook URL in the panel, looks like this: https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxx. Copy this URL to the Grafana DingTalk setting page and then click "finish".
### Discord
To set up Discord, you must create a Discord channel webhook. For instructions on how to create the channel, refer to
[Intro to Webhooks](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) f.
Setting | Description
---------- | -----------
Webhook URL | Discord webhook URL.
Message Content | Mention a group using @ or a user using <@ID> when notifying in a channel.
Avatar URL | Optionally, provide a URL to an image to use as the avatar for the bot's message.
Alternately, use the [Slack](#slack) notifier by appending `/slack` to a Discord webhook URL.
### Kafka
Notifications can be sent to a Kafka topic from Grafana using the [Kafka REST Proxy](https://docs.confluent.io/1.0/kafka-rest/docs/index.html).
There are a couple of configuration options which need to be set up in Grafana UI under Kafka Settings:
1. Kafka REST Proxy endpoint.
1. Kafka Topic.
Once these two properties are set, you can send the alerts to Kafka for further processing or throttling.
### Google Hangouts Chat
Notifications can be sent by setting up an incoming webhook in Google Hangouts chat. For more information about configuring a webhook, refer to [webhooks](https://developers.google.com/hangouts/chat/how-tos/webhooks).
### Prometheus Alertmanager
Alertmanager handles alerts sent by client applications such as Prometheus server or Grafana. It takes care of deduplicating, grouping, and routing them to the correct receiver. Grafana notifications can be sent to Alertmanager via a simple incoming webhook. Refer to the official [Prometheus Alertmanager documentation](https://prometheus.io/docs/alerting/alertmanager) for configuration information.
> **Caution:** In case of a high-availability setup, do not load balance traffic between Grafana and Alertmanagers to keep coherence between all your Alertmanager instances. Instead, point Grafana to a list of all Alertmanagers, by listing their URLs comma-separated in the notification channel configuration.
### Zenduty
[Zenduty](https://www.zenduty.com) is an incident alerting and response orchestration platform that not alerts the right teams via SMS, Phone(Voice), Email, Slack, Microsoft Teams and Push notifications(Android/iOS) whenever a Grafana alert is triggered, but also helps you rapidly triage and remediate critical, user impacting incidents. Grafana alert are sent to Zenduty through Grafana's native webhook dispatcher. Refer the Zenduty-Grafana [integration documentation](https://docs.zenduty.com/docs/grafana) for configuring the integration.
### Sensu Go
[Sensu](https://sensu.io) is a complete solution for monitoring and observability at scale. Sensu Go is designed to give you visibility into everything you care about: traditional server closets, containers, applications, the cloud, and more. Grafana notifications can be sent to Sensu Go as events via the API. This operation requires an API Key. Refer to the [Sensu Go documentation](https://docs.sensu.io/sensu-go/latest/operations/control-access/use-apikeys/#api-key-authentication) for information on creating this key.
## Enable images in notifications {#external-image-store}
Grafana can render the panel associated with the alert rule as a PNG image and include that in the notification. Read more about the requirements and how to configure
[image rendering]({{< relref "../administration/image_rendering/" >}}).
You must configure an [external image storage provider]({{< relref "../administration/configuration/#external-image-storage" >}}) in order to receive images in alert notifications. If your notification channel requires that the image be publicly accessible (e.g. Slack, PagerDuty), configure a provider which uploads the image to a remote image store like Amazon S3, Webdav, Google Cloud Storage, or Azure Blob Storage. Otherwise, the local provider can be used to serve the image directly from Grafana.
Notification services which need public image access are marked as 'external only'.
## Configure the link back to Grafana from alert notifications
All alert notifications contain a link back to the triggered alert in the Grafana instance.
This URL is based on the [domain]({{< relref "../administration/configuration/#domain" >}}) setting in Grafana.
## Notification templating
> **Note:** Alert notification templating is only available in Grafana v7.4 and above.
The alert notification template feature allows you to take the [label]({{< relref "../basics/timeseries-dimensions.md#labels" >}}) value from an alert query and [inject that into alert notifications]({{< relref "./add-notification-template.md" >}}).

View File

@@ -1,23 +1,22 @@
+++
title = "Legacy Grafana Alerts"
aliases = ["/docs/grafana/latest/alerting/rules/", "/docs/grafana/latest/alerting/metrics/"]
weight = 114
+++
# Legacy Grafana alerts
Grafana 8.0 has [new and improved alerts]({{< relref "../unified-alerting/_index.md" >}}). The new alerting system are an opt-in feature that centralizes alerting information for Grafana managed alerts and alerts from Prometheus-compatible data sources in one UI and API.
Out of the box, Grafana still supports legacy dashboard alerts. Legacy Grafana alerts consists of two parts:
Legacy Grafana alerts consists of two parts:
Alert rules - When the alert is triggered. Alert rules are defined by one or more conditions that are regularly evaluated by Grafana.
Notification channel - How the alert is delivered. When the conditions of an alert rule are met, the Grafana notifies the channels configured for that alert.
Currently only the graph panel visualization supports alerts.
Legacy alerts have two main components:
Legacy aerts have two main components:
- Alert rule - When the alert is triggered. Alert rules are defined by one or more conditions that are regularly evaluated by Grafana.
- Notification channel - How the alert is delivered. When the conditions of an alert rule are met, the Grafana notifies the channels configured for that alert.
- Notification channel - How the alert is delivered. When the conditions of an alert rule are met, the Grafana notifies the channels configured for that alert.
## Alert tasks
@@ -37,21 +36,20 @@ Currently alerting supports a limited form of high availability. Since v4.2.0 of
Grafana managed alerts are evaluated by the Grafana backend. Rule evaluations are scheduled, according to the alert rule configuration, and queries are evaluated by an engine that is part of core Grafana.
Alert rules can only query backend data sources with alerting enabled:
- builtin or developed and maintained by grafana: `Graphite`, `Prometheus`, `Loki`, `InfluxDB`, `Elasticsearch`,
`Google Cloud Monitoring`, `Cloudwatch`, `Azure Monitor`, `MySQL`, `PostgreSQL`, `MSSQL`, `OpenTSDB`, `Oracle`, and `Azure Data Explorer`
`Google Cloud Monitoring`, `Cloudwatch`, `Azure Monitor`, `MySQL`, `PostgreSQL`, `MSSQL`, `OpenTSDB`, `Oracle`, and `Azure Data Explorer`
- any community backend data sources with alerting enabled (`backend` and `alerting` properties are set in the [plugin.json]({{< relref "../../developers/plugins/metadata.md" >}}))
## Metrics from the alert engine
The alert engine publishes some internal metrics about itself. You can read more about how Grafana publishes [internal metrics]({{< relref "../../administration/view-server/internal-metrics.md" >}}).
| Metric Name | Type | Description |
| ------------------------------------------- | --------- | ---------------------------------------------------------------------------------------- |
| `alerting.alerts` | gauge | How many alerts by state |
| `alerting.request_duration_seconds` | histogram | Histogram of requests to the Alerting API |
| `alerting.active_configurations` | gauge | The number of active, non default alertmanager configurations for grafana managed alerts |
| `alerting.rule_evaluations_total` | counter | The total number of rule evaluations |
| `alerting.rule_evaluation_failures_total` | counter | The total number of rule evaluation failures |
| `alerting.rule_evaluation_duration_seconds` | summary | The duration for a rule to execute |
| `alerting.rule_group_rules` | gauge | The number of rules |
Metric Name | Type | Description
---------- | ----------- | ----------
`alerting.alerts` | gauge | How many alerts by state
`alerting.request_duration_seconds` | histogram | Histogram of requests to the Alerting API
`alerting.active_configurations` | gauge | The number of active, non default alertmanager configurations for grafana managed alerts
`alerting.rule_evaluations_total` | counter | The total number of rule evaluations
`alerting.rule_evaluation_failures_total` | counter | The total number of rule evaluation failures
`alerting.rule_evaluation_duration_seconds` | summary | The duration for a rule to execute
`alerting.rule_group_rules` | gauge | The number of rules

View File

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

View File

@@ -3,7 +3,6 @@ title = "Create alerts"
description = "Configure alert rules"
keywords = ["grafana", "alerting", "guide", "rules"]
weight = 200
aliases = ["/docs/grafana/latest/alerting/create-alerts/"]
+++
# Create alerts
@@ -96,16 +95,16 @@ Below are conditions you can configure how the rule evaluation engine should han
| --------------- | ------------------------------------------------------------------------------------------ |
| No Data | Set alert rule state to `NoData` |
| Alerting | Set alert rule state to `Alerting` |
| Keep Last State | Keep the current alert rule state, whatever it is. |
| Keep Last State | Keep the current alert rule state, whatever it is. |
| Ok | Not sure why you would want to send yourself an alert when things are okay, but you could. |
### Execution errors or timeouts
Tell Grafana how to handle execution or timeout errors.
| Error or timeout option | Description |
| ----------------------- | -------------------------------------------------- |
| Alerting | Set alert rule state to `Alerting` |
| Error or timeout option | Description |
| ----------------------- | --------------------------------------------------- |
| Alerting | Set alert rule state to `Alerting` |
| Keep Last State | Keep the current alert rule state, whatever it is. |
If you have an unreliable time series store from which queries sometime timeout or fail randomly you can set this option to `Keep Last State` in order to basically ignore them.
@@ -124,3 +123,4 @@ The actual notifications are configured and shared between multiple alerts. Read
## Alert state history and annotations
Alert state changes are recorded in the internal annotation table in Grafana's database. The state changes are visualized as annotations in the alert rule's graph panel. You can also go into the `State history` submenu in the alert tab to view and clear state history.

View File

@@ -3,7 +3,6 @@ title = "Alert notifications"
description = "Alerting notifications guide"
keywords = ["Grafana", "alerting", "guide", "notifications"]
weight = 100
aliases = ["/docs/grafana/latest/alerting/notifications/"]
+++
# Alert notifications
@@ -37,40 +36,41 @@ This is done from the Notification channels page.
These examples show how often and when reminders are sent for a triggered alert.
| Alert rule evaluation interval | Send reminders every | Reminder sent every (after last alert notification) |
| ------------------------------ | -------------------- | --------------------------------------------------- |
| `30s` | `15s` | ~30 seconds |
| `1m` | `5m` | ~5 minutes |
| `5m` | `15m` | ~15 minutes |
| `6m` | `20m` | ~24 minutes |
| `1h` | `15m` | ~1 hour |
| `1h` | `2h` | ~2 hours |
Alert rule evaluation interval | Send reminders every | Reminder sent every (after last alert notification)
---------- | ----------- | -----------
`30s` | `15s` | ~30 seconds
`1m` | `5m` | ~5 minutes
`5m` | `15m` | ~15 minutes
`6m` | `20m` | ~24 minutes
`1h` | `15m` | ~1 hour
`1h` | `2h` | ~2 hours
<div class="clearfix"></div>
## List of supported notifiers
| Name | Type | Supports images | Support alert rule tags |
| --------------------------------------------- | ------------------------- | ------------------ | ----------------------- |
| [DingDing](#dingdingdingtalk) | `dingding` | yes, external only | no |
| [Discord](#discord) | `discord` | yes | no |
| [Email](#email) | `email` | yes | no |
| [Google Hangouts Chat](#google-hangouts-chat) | `googlechat` | yes, external only | no |
| Hipchat | `hipchat` | yes, external only | no |
| [Kafka](#kafka) | `kafka` | yes, external only | no |
| Line | `line` | yes, external only | no |
| Microsoft Teams | `teams` | yes, external only | no |
| [Opsgenie](#opsgenie) | `opsgenie` | yes, external only | yes |
| [Pagerduty](#pagerduty) | `pagerduty` | yes, external only | yes |
| Prometheus Alertmanager | `prometheus-alertmanager` | yes, external only | yes |
| [Pushover](#pushover) | `pushover` | yes | no |
| Sensu | `sensu` | yes, external only | no |
| [Sensu Go](#sensu-go) | `sensugo` | yes, external only | no |
| [Slack](#slack) | `slack` | yes | no |
| Telegram | `telegram` | yes | no |
| Threema | `threema` | yes, external only | no |
| VictorOps | `victorops` | yes, external only | yes |
| [Webhook](#webhook) | `webhook` | yes, external only | yes | |
Name | Type | Supports images | Support alert rule tags
-----|------|---------------- | -----------------------
[DingDing](#dingdingdingtalk) | `dingding` | yes, external only | no
[Discord](#discord) | `discord` | yes | no
[Email](#email) | `email` | yes | no
[Google Hangouts Chat](#google-hangouts-chat) | `googlechat` | yes, external only | no
Hipchat | `hipchat` | yes, external only | no
[Kafka](#kafka) | `kafka` | yes, external only | no
Line | `line` | yes, external only | no
Microsoft Teams | `teams` | yes, external only | no
[Opsgenie](#opsgenie) | `opsgenie` | yes, external only | yes
[Pagerduty](#pagerduty) | `pagerduty` | yes, external only | yes
Prometheus Alertmanager | `prometheus-alertmanager` | yes, external only | yes
[Pushover](#pushover) | `pushover` | yes | no
Sensu | `sensu` | yes, external only | no
[Sensu Go](#sensu-go) | `sensugo` | yes, external only | no
[Slack](#slack) | `slack` | yes | no
Telegram | `telegram` | yes | no
Threema | `threema` | yes, external only | no
VictorOps | `victorops` | yes, external only | yes
[Webhook](#webhook) | `webhook` | yes, external only | yes
[Zenduty](#zenduty) | `webhook` | yes, external only | yes
### Email
@@ -82,10 +82,10 @@ able to access the image.
> **Note:** Template variables are not supported in email alerts.
| Setting | Description |
| ------------ | -------------------------------------------------------------------------------------------- |
| Single email | Send a single email to all recipients. Disabled per default. |
| Addresses | Email addresses to recipients. You can enter multiple email addresses using a ";" separator. |
Setting | Description
---------- | -----------
Single email | Send a single email to all recipients. Disabled per default.
Addresses | Email addresses to recipients. You can enter multiple email addresses using a ";" separator.
### Slack
@@ -97,17 +97,17 @@ firing alerts in the Slack messages you have to configure either the [external i
in Grafana or a bot integration via Slack Apps. [Follow Slack's guide to set up a bot integration](https://api.slack.com/bot-users) and use the token
provided, which starts with "xoxb".
| Setting | Description |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Url | Slack incoming webhook URL, or eventually the [chat.postMessage](https://api.slack.com/methods/chat.postMessage) Slack API endpoint. |
| Username | Set the username for the bot's message. |
| Recipient | Allows you to override the Slack recipient. You must either provide a channel Slack ID, a user Slack ID, a username reference (@&lt;user&gt;, all lowercase, no whitespace), or a channel reference (#&lt;channel&gt;, all lowercase, no whitespace). If you use the `chat.postMessage` Slack API endpoint, this is required. |
| Icon emoji | Provide an emoji to use as the icon for the bot's message. Ex :smile: |
| Icon URL | Provide a URL to an image to use as the icon for the bot's message. |
| Mention Users | Optionally mention one or more users in the Slack notification sent by Grafana. You have to refer to users, comma-separated, via their corresponding Slack IDs (which you can find by clicking the overflow button on each user's Slack profile). |
| Mention Groups | Optionally mention one or more groups in the Slack notification sent by Grafana. You have to refer to groups, comma-separated, via their corresponding Slack IDs (which you can get from each group's Slack profile URL). |
| Mention Channel | Optionally mention either all channel members or just active ones. |
| Token | If provided, Grafana will upload the generated image via Slack's file.upload API method, not the external image destination. If you use the `chat.postMessage` Slack API endpoint, this is required. |
Setting | Description
---------- | -----------
Url | Slack incoming webhook URL, or eventually the [chat.postMessage](https://api.slack.com/methods/chat.postMessage) Slack API endpoint.
Username | Set the username for the bot's message.
Recipient | Allows you to override the Slack recipient. You must either provide a channel Slack ID, a user Slack ID, a username reference (@&lt;user&gt;, all lowercase, no whitespace), or a channel reference (#&lt;channel&gt;, all lowercase, no whitespace). If you use the `chat.postMessage` Slack API endpoint, this is required.
Icon emoji | Provide an emoji to use as the icon for the bot's message. Ex :smile:
Icon URL | Provide a URL to an image to use as the icon for the bot's message.
Mention Users | Optionally mention one or more users in the Slack notification sent by Grafana. You have to refer to users, comma-separated, via their corresponding Slack IDs (which you can find by clicking the overflow button on each user's Slack profile).
Mention Groups | Optionally mention one or more groups in the Slack notification sent by Grafana. You have to refer to groups, comma-separated, via their corresponding Slack IDs (which you can get from each group's Slack profile URL).
Mention Channel | Optionally mention either all channel members or just active ones.
Token | If provided, Grafana will upload the generated image via Slack's file.upload API method, not the external image destination. If you use the `chat.postMessage` Slack API endpoint, this is required.
If you are using the token for a slack bot, then you have to invite the bot to the channel you want to send notifications and add the channel to the recipient field.
@@ -115,12 +115,12 @@ If you are using the token for a slack bot, then you have to invite the bot to t
To setup Opsgenie you will need an API Key and the Alert API Url. These can be obtained by configuring a new [Grafana Integration](https://docs.opsgenie.com/docs/grafana-integration).
| Setting | Description |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Alert API URL | The API URL for your Opsgenie instance. This will normally be either `https://api.opsgenie.com` or, for EU customers, `https://api.eu.opsgenie.com`. |
| API Key | The API Key as provided by Opsgenie for your configured Grafana integration. |
| Override priority | Configures the alert priority using the `og_priority` tag. The `og_priority` tag must have one of the following values: `P1`, `P2`, `P3`, `P4`, or `P5`. Default is `False`. |
| Send notification tags as | Specify how you would like [Notification Tags]({{< relref "create-alerts.md/#notifications" >}}) delivered to Opsgenie. They can be delivered as `Tags`, `Extra Properties` or both. Default is Tags. See note below for more information. |
Setting | Description
--------|------------
Alert API URL | The API URL for your Opsgenie instance. This will normally be either `https://api.opsgenie.com` or, for EU customers, `https://api.eu.opsgenie.com`.
API Key | The API Key as provided by Opsgenie for your configured Grafana integration.
Override priority | Configures the alert priority using the `og_priority` tag. The `og_priority` tag must have one of the following values: `P1`, `P2`, `P3`, `P4`, or `P5`. Default is `False`.
Send notification tags as | Specify how you would like [Notification Tags]({{< relref "create-alerts.md/#notifications" >}}) delivered to Opsgenie. They can be delivered as `Tags`, `Extra Properties` or both. Default is Tags. See note below for more information.
> **Note:** When notification tags are sent as `Tags` they are concatenated into a string with a `key:value` format. If you prefer to receive the notifications tags as key/values under Extra Properties in Opsgenie then change the `Send notification tags as` to either `Extra Properties` or `Tags & Extra Properties`.
@@ -128,47 +128,45 @@ To setup Opsgenie you will need an API Key and the Alert API Url. These can be o
To set up PagerDuty, all you have to do is to provide an integration key.
| Setting | Description |
| ---------------------- | ----------------------------------------------------------------------------------------------- |
| Integration Key | Integration key for PagerDuty. |
| Severity | Level for dynamic notifications, default is `critical` (1) |
| Auto resolve incidents | Resolve incidents in PagerDuty once the alert goes back to ok |
| Message in details | Removes the Alert message from the PD summary field and puts it into custom details instead (2) |
Setting | Description
---------- | -----------
Integration Key | Integration key for PagerDuty.
Severity | Level for dynamic notifications, default is `critical` (1)
Auto resolve incidents | Resolve incidents in PagerDuty once the alert goes back to ok
Message in details | Removes the Alert message from the PD summary field and puts it into custom details instead (2)
> **Note:** The tags `Severity`, `Class`, `Group`, `dedup_key`, and `Component` have special meaning in the [Pagerduty Common Event Format - PD-CEF](https://support.pagerduty.com/docs/pd-cef). If an alert panel defines these tag keys, then they are transposed to the root of the event sent to Pagerduty. This means they will be available within the Pagerduty UI and Filtering tools. A Severity tag set on an alert overrides the global Severity set on the notification channel if it's a valid level.
>**Note:** The tags `Severity`, `Class`, `Group`, `dedup_key`, and `Component` have special meaning in the [Pagerduty Common Event Format - PD-CEF](https://support.pagerduty.com/docs/pd-cef). If an alert panel defines these tag keys, then they are transposed to the root of the event sent to Pagerduty. This means they will be available within the Pagerduty UI and Filtering tools. A Severity tag set on an alert overrides the global Severity set on the notification channel if it's a valid level.
> Using Message In Details will change the structure of the `custom_details` field in the PagerDuty Event.
> This might break custom event rules in your PagerDuty rules if you rely on the fields in `payload.custom_details`.
> Move any existing rules using `custom_details.myMetric` to `custom_details.queries.myMetric`.
> This behavior will become the default in a future version of Grafana.
>Using Message In Details will change the structure of the `custom_details` field in the PagerDuty Event.
This might break custom event rules in your PagerDuty rules if you rely on the fields in `payload.custom_details`.
Move any existing rules using `custom_details.myMetric` to `custom_details.queries.myMetric`.
This behavior will become the default in a future version of Grafana.
> **Note:** The `dedup_key` tag overrides the Grafana-generated `dedup_key` with a custom key.
> **Note:** The `state` tag overrides the current alert state inside the `custom_details` payload.
> **Note:** Grafana uses the `Events API V2` integration. This can be configured for each service.
### VictorOps
To configure VictorOps, provide the URL from the Grafana Integration and substitute `$routing_key` with a valid key.
> **Note:** The tag `Severity` has special meaning in the [VictorOps Incident Fields](https://help.victorops.com/knowledge-base/incident-fields-glossary/). If an alert panel defines this key, then it replaces the `message_type` in the root of the event sent to VictorOps.
### Pushover
To set up Pushover, you must provide a user key and an API token. Refer to [What is Pushover and how do I use it](https://support.pushover.net/i7-what-is-pushover-and-how-do-i-use-it) for instructions on how to generate them.
| Setting | Description |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| API Token | Application token |
| User key(s) | A comma-separated list of user keys |
| Device(s) | A comma-separated list of devices |
| Priority | The priority alerting nottifications are sent |
| OK priority | The priority OK notifications are sent; if not set, then OK notifications are sent with the priority set for alerting notifications |
| Retry | How often (in seconds) the Pushover servers send the same notification to the user. (minimum 30 seconds) |
| Expire | How many seconds your notification will continue to be retried for (maximum 86400 seconds) |
| Alerting sound | The sound for alerting notifications |
| OK sound | The sound for OK notifications |
Setting | Description
---------- | -----------
API Token | Application token
User key(s) | A comma-separated list of user keys
Device(s) | A comma-separated list of devices
Priority | The priority alerting nottifications are sent
OK priority | The priority OK notifications are sent; if not set, then OK notifications are sent with the priority set for alerting notifications
Retry | How often (in seconds) the Pushover servers send the same notification to the user. (minimum 30 seconds)
Expire | How many seconds your notification will continue to be retried for (maximum 86400 seconds)
Alerting sound | The sound for alerting notifications
OK sound | The sound for OK notifications
### Webhook
@@ -179,26 +177,26 @@ Example json body:
```json
{
"dashboardId": 1,
"evalMatches": [
"dashboardId":1,
"evalMatches":[
{
"value": 1,
"metric": "Count",
"tags": {}
"value":1,
"metric":"Count",
"tags":{}
}
],
"imageUrl": "https://grafana.com/assets/img/blog/mixed_styles.png",
"message": "Notification Message",
"orgId": 1,
"panelId": 2,
"ruleId": 1,
"ruleName": "Panel Title alert",
"ruleUrl": "http://localhost:3000/d/hZ7BuVbWz/test-dashboard?fullscreen\u0026edit\u0026tab=alert\u0026panelId=2\u0026orgId=1",
"state": "alerting",
"tags": {
"tag name": "tag value"
"imageUrl":"https://grafana.com/assets/img/blog/mixed_styles.png",
"message":"Notification Message",
"orgId":1,
"panelId":2,
"ruleId":1,
"ruleName":"Panel Title alert",
"ruleUrl":"http://localhost:3000/d/hZ7BuVbWz/test-dashboard?fullscreen\u0026edit\u0026tab=alert\u0026panelId=2\u0026orgId=1",
"state":"alerting",
"tags":{
"tag name":"tag value"
},
"title": "[Alerting] Panel Title alert"
"title":"[Alerting] Panel Title alert"
}
```
@@ -214,7 +212,7 @@ In DingTalk PC Client:
2. Click "Robot Manage" item in the pop menu, there will be a new panel call "Robot Manage".
3. In the "Robot Manage" panel, select "customized: customized robot with Webhook".
3. In the "Robot Manage" panel, select "customized: customized robot with Webhook".
4. In the next new panel named "robot detail", click "Add" button.
@@ -224,14 +222,14 @@ In DingTalk PC Client:
### Discord
To set up Discord, you must create a Discord channel webhook. For instructions on how to create the channel, refer to
[Intro to Webhooks](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks).
To set up Discord, you must create a Discord channel webhook. For instructions on how to create the channel, refer to
[Intro to Webhooks](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) f.
| Setting | Description |
| --------------- | --------------------------------------------------------------------------------- |
| Webhook URL | Discord webhook URL. |
| Message Content | Mention a group using @ or a user using <@ID> when notifying in a channel. |
| Avatar URL | Optionally, provide a URL to an image to use as the avatar for the bot's message. |
Setting | Description
---------- | -----------
Webhook URL | Discord webhook URL.
Message Content | Mention a group using @ or a user using <@ID> when notifying in a channel.
Avatar URL | Optionally, provide a URL to an image to use as the avatar for the bot's message.
Alternately, use the [Slack](#slack) notifier by appending `/slack` to a Discord webhook URL.
@@ -256,9 +254,13 @@ Alertmanager handles alerts sent by client applications such as Prometheus serve
> **Caution:** In case of a high-availability setup, do not load balance traffic between Grafana and Alertmanagers to keep coherence between all your Alertmanager instances. Instead, point Grafana to a list of all Alertmanagers, by listing their URLs comma-separated in the notification channel configuration.
### Zenduty
[Zenduty](https://www.zenduty.com) is an incident alerting and response orchestration platform that not alerts the right teams via SMS, Phone(Voice), Email, Slack, Microsoft Teams and Push notifications(Android/iOS) whenever a Grafana alert is triggered, but also helps you rapidly triage and remediate critical, user impacting incidents. Grafana alert are sent to Zenduty through Grafana's native webhook dispatcher. Refer the Zenduty-Grafana [integration documentation](https://docs.zenduty.com/docs/grafana) for configuring the integration.
### Sensu Go
Grafana alert notifications can be sent to [Sensu]((https://sensu.io)) Go as events via the API. This operation requires an API key. For information on creating this key, refer to [Sensu Go documentation](https://docs.sensu.io/sensu-go/latest/operations/control-access/use-apikeys/#api-key-authentication).
[Sensu](https://sensu.io) is a complete solution for monitoring and observability at scale. Sensu Go is designed to give you visibility into everything you care about: traditional server closets, containers, applications, the cloud, and more. Grafana notifications can be sent to Sensu Go as events via the API. This operation requires an API Key. Refer to the [Sensu Go documentation](https://docs.sensu.io/sensu-go/latest/operations/control-access/use-apikeys/#api-key-authentication) for information on creating this key.
## Enable images in notifications {#external-image-store}

View File

@@ -3,7 +3,6 @@ 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/"]
+++
# Pause an alert rule
@@ -12,4 +11,4 @@ Pausing the evaluation of an alert rule can sometimes be useful. For example, du
1. In the Grafana side bar, hover your cursor over the Alerting (bell) icon and then click **Alert Rules**. All configured alert rules are listed, along with their current state.
1. Find your alert in the list, and click the **Pause** icon on the right. The **Pause** icon turns into a **Play** icon.
1. Click the **Play** icon to resume evaluation of your alert.
1. Click the **Play** icon to resume evaluation of your alert.

View File

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

View File

@@ -3,7 +3,6 @@ title = "View alerts"
description = "View existing alert rules"
keywords = ["grafana", "alerting", "guide", "rules", "view"]
weight = 400
aliases = ["/docs/grafana/latest/alerting/view-alerts/"]
+++
# View existing alert rules
@@ -17,4 +16,4 @@ You can do several things while viewing alerts.
- **Filter alerts by name -** Type an alert name in the **Search alerts** field.
- **Filter alerts by state -** In **States**, select which alert states you want to see. All others will be hidden.
- **Pause or resume an alert -** Click the **Pause** or **Play** icon next to the alert to pause or resume evaluation. See [Pause an alert rule]({{< relref "pause-an-alert-rule.md" >}}) for more information.
- **Access alert rule settings -** Click the alert name or the **Edit alert rule** (gear) icon. Grafana opens the Alert tab of the panel where the alert rule is defined. This is helpful when an alert is firing but you don't know which panel it is defined in.
- **Access alert rule settings -** Click the alert name or the **Edit alert rule** (gear) icon. Grafana opens the Alert tab of the panel where the alert rule is defined. This is helpful when an alert is firing but you don't know which panel it is defined in.

View File

@@ -0,0 +1,14 @@
+++
title = "Pause alert rule"
description = "Pause an existing alert rule"
keywords = ["grafana", "alerting", "guide", "rules", "view"]
weight = 400
+++
# Pause an alert rule
Pausing the evaluation of an alert rule can sometimes be useful. For example, during a maintenance window, pausing alert rules can avoid triggering a flood of alerts.
1. In the Grafana side bar, hover your cursor over the Alerting (bell) icon and then click **Alert Rules**. All configured alert rules are listed, along with their current state.
1. Find your alert in the list, and click the **Pause** icon on the right. The **Pause** icon turns into a **Play** icon.
1. Click the **Play** icon to resume evaluation of your alert.

View File

@@ -0,0 +1,41 @@
+++
title = "Troubleshoot alerts"
description = "Troubleshoot alert rules"
keywords = ["grafana", "alerting", "guide", "rules", "troubleshoot"]
weight = 500
+++
# Troubleshoot alerts
If alerts are not behaving as you expect, here are some steps you can take to troubleshoot and figure out what is going wrong.
![Test Rule](/static/img/docs/v4/alert_test_rule.png)
The first level of troubleshooting you can do is click **Test Rule**. You will get result back that you can expand to the point where you can see the raw data that was returned from your query.
Further troubleshooting can also be done by inspecting the grafana-server log. If it's not an error or for some reason the log does not say anything you can enable debug logging for some relevant components. This is done in Grafana's ini config file.
Example showing loggers that could be relevant when troubleshooting alerting.
```ini
[log]
filters = alerting.scheduler:debug \
alerting.engine:debug \
alerting.resultHandler:debug \
alerting.evalHandler:debug \
alerting.evalContext:debug \
alerting.extractor:debug \
alerting.notifier:debug \
alerting.notifier.slack:debug \
alerting.notifier.pagerduty:debug \
alerting.notifier.email:debug \
alerting.notifier.webhook:debug \
tsdb.graphite:debug \
tsdb.prometheus:debug \
tsdb.opentsdb:debug \
tsdb.influxdb:debug \
tsdb.elasticsearch:debug \
tsdb.elasticsearch.client:debug \
```
If you want to log raw query sent to your TSDB and raw response in log you also have to set grafana.ini option `app_mode` to `development`.

View File

@@ -5,12 +5,11 @@ weight = 113
+++
# Overview of Grafana 8 alerts
Alerts allow you to know about problems in your systems moments after they occur. Robust and actionable alerts help you identify and resolve issues quickly, minimizing disruption to your services.
> **Note:** Grafana 8 alerts (beta) is an [opt-in]({{< relref"./opt-in.md" >}}) feature. Out of the box, Grafana still supports old [legacy dashboard alerts]({{< relref "../old-alerting/_index.md" >}}). We encourage you to create issues in the Grafana GitHub repository for bugs found while testing this new feature.
>**Note:** This information is for the new, Grafana 8 Alerts. This is an [opt-in]({{< relref"./opt-in.md" >}}) feature released in Grafana 8.0. Grafana still supports [dashboard alerts]({{< relref "../old-alerting/_index.md" >}}) out of the box
Grafana 8 alerts have four main components:
Alerts have four main components:
- Alerting rule - One or more query and/or expression, a condition, the frequency of evaluation, and the (optional) duration that a condition must be met before creating an alert.
- Contact point - A channel for sending notifications when the conditions of an alerting rule are met.
@@ -21,24 +20,24 @@ Grafana 8 alerts have four main components:
You can perform the following tasks for alerts:
- [Create a Grafana managed alert rule]({{< relref "alerting-rules/create-grafana-managed-rule.md" >}})
- [Create a Cortex or Loki managed alert rule]({{< relref "alerting-rules/create-cortex-loki-managed-rule.md" >}})
- [View existing alert rules and their current state]({{< relref "alerting-rules/rule-list.md" >}})
- [View state and health of alerting rules]({{< relref "alerting-rules/state-and-health.md" >}})
- [Test alert rules and troubleshoot]({{< relref "./troubleshoot-alerts.md" >}})
- [Add or edit an alert contact point]({{< relref "./contact-points.md" >}})
- [Add or edit notification policies]({{< relref "./notification-policies.md" >}})
- [Create and edit silences]({{< relref "./silences.md" >}})
## Clustering
The current alerting system doesn't support high availability. Alert notifications are not deduplicated and load balancing is not supported between instances e.g. silences from one instance will not appear in the other. The Grafana team aims to have this feature by Grafana version 8.1+.
Currently alerting supports a limited form of high availability. Alert notifications are deduped when running multiple servers. This means all alerts are executed on every server but no duplicate alert notifications are sent due to the deduping logic. Proper load balancing of alerts will be introduced in the future.
## Alert evaluation
Grafana managed alerts are evaluated by the Grafana backend. Rule evaluations are scheduled, according to the alert rule configuration, and queries are evaluated by an engine that is part of core Grafana.
Alerting rules can only query backend data sources with alerting enabled:
- builtin or developed and maintained by grafana: `Graphite`, `Prometheus`, `Loki`, `InfluxDB`, `Elasticsearch`,
`Google Cloud Monitoring`, `Cloudwatch`, `Azure Monitor`, `MySQL`, `PostgreSQL`, `MSSQL`, `OpenTSDB`, `Oracle`, and `Azure Data Explorer`
- any community backend data sources with alerting enabled (`backend` and `alerting` properties are set in the [plugin.json]({{< relref "../../developers/plugins/metadata.md" >}}))
@@ -47,14 +46,15 @@ Alerting rules can only query backend data sources with alerting enabled:
The alerting engine publishes some internal metrics about itself. You can read more about how Grafana publishes [internal metrics]({{< relref "../../administration/view-server/internal-metrics.md" >}}).
| Metric Name | Type | Description |
| ------------------------------------------- | --------- | ---------------------------------------------------------------------------------------- |
| `alerting.alerts` | gauge | How many alerts by state |
| `alerting.request_duration_seconds` | histogram | Histogram of requests to the Alerting API |
| `alerting.active_configurations` | gauge | The number of active, non default Alertmanager configurations for grafana managed alerts |
| `alerting.rule_evaluations_total` | counter | The total number of rule evaluations |
| `alerting.rule_evaluation_failures_total` | counter | The total number of rule evaluation failures |
| `alerting.rule_evaluation_duration_seconds` | summary | The duration for a rule to execute |
| `alerting.rule_group_rules` | gauge | The number of rules |
Metric Name | Type | Description
---------- | ----------- | ----------
`alerting.alerts` | gauge | How many alerts by state
`alerting.request_duration_seconds` | histogram | Histogram of requests to the Alerting API
`alerting.active_configurations` | gauge | The number of active, non default Alertmanager configurations for grafana managed alerts
`alerting.rule_evaluations_total` | counter | The total number of rule evaluations
`alerting.rule_evaluation_failures_total` | counter | The total number of rule evaluation failures
`alerting.rule_evaluation_duration_seconds` | summary | The duration for a rule to execute
`alerting.rule_group_rules` | gauge | The number of rules
- [View alert rules and their current state]({{< relref "alerting-rules/rule-list.md" >}})

View File

@@ -5,12 +5,9 @@ weight = 130
+++
# Create and manage alerting Rules
One or more queries and/or expressions, a condition, the frequency of evaluation, and the (optional) duration that a condition must be met before creating an alert. Alerting rules are how you express the criteria for creating an alert. Queries and expressions select and can operate on the data you wish to alert on. A condition sets the threshold that an alert must meet or exceed to create an alert. The interval specifies how frequently the rule should be evaluated. The duration, when configured, sets a period that a condition must be met or exceeded before an alert is created. Alerting rules also can contain settings for what to do when your query does not return any data, or there is an error attempting to execute the query.
One or more queries and/or expressions, a condition, the frequency of evaluation, and the (optional) duration that a condition must be met before creating an alert. Alerting rules are how you express the criteria for creating an alert. Queries and expressions select and can operate on the data you wish to alert on. A condition sets the threshold that an alert must meet or exceed to create an alert. The interval specifies how frequently the rule should be evaluated. The duration, when configured, sets a period that a condition must be met or exceeded before an alert is created. Alerting rules also can contain settings for what to do when your query does not return any data, or there is an error attempting to execute the query.
- [Create Cortex or Loki managed alert rule]({{< relref "./create-cortex-loki-managed-rule.md" >}})
- [Create Cortex or Loki managed recording rule]({{< relref "./create-cortex-loki-managed-recording-rule.md" >}})
- [Edit Cortex or Loki rule groups and namespaces]({{< relref "./edit-cortex-loki-namespace-group.md" >}})
- [Create Grafana managed alert rule]({{< relref "./create-grafana-managed-rule.md" >}})
- [State and Health of alerting rules]({{< relref "./state-and-health.md" >}})
- [View existing alert rules and their current state]({{< relref "./rule-list.md" >}})

View File

@@ -1,56 +0,0 @@
+++
title = "Create Cortex or Loki managed recording rule"
description = "Create Cortex or Loki managed recording rule"
keywords = ["grafana", "alerting", "guide", "rules", "recording rules", "create"]
weight = 400
+++
# Create a Cortex or Loki managed recording rule
You can create and manage recording rules for an external Cortex or Loki instance. Recording rules calculate frequently needed expressions or computationally expensive expressions in advance and save the result as a new set of time series. Querying this new time series is faster, especially for dashboards since they query the same expression every time the dashboards refresh.
For both Cortex and Loki data sources to work with Grafana 8.0 alerting, enable the ruler API by configuring their respective services. The `local` rule storage type (default for Loki data source), only supports viewing of rules. If you want to edit rules, then configure one of the other rule storage types.
When configuring a Grafana Prometheus data source to point to Cortex, use the legacy /api/prom prefix, not /prometheus. Only single-binary mode is currently supported, provide a separate URL for the ruler API.
## Add a Cortex or Loki managed recording rule
1. Hover your cursor over the Alerting (bell) icon.
1. Click **New alert rule**.
1. Click on the **Alert type** drop down and select **Cortex / Loki managed recording rule**.
1. Enter the recording rule details using instructions in the [Recording rule fields](#recording-rule-fields) section.
1. Click **Save** in the upper right corner to save the rule.
## Edit a Cortex or Loki managed recording rule
1. Hover your cursor over the Alerting (bell) icon in the side menu.
1. Expand an existing recording rule in the **Cortex / Loki** section and click **Edit**.
1. Update the recording rule details using instructions in the [Recording rule fields](#recording-rule-fields) section.
1. Click **Save and exit** to save and exit rule editing.
## Recording rule fields
This section describes the fields you fill out to create a recording rule.
### Rule type
- **Rule name -** Enter a descriptive name. The name will get displayed in the alert rule list. It will also get added as an `alertname` label to every alert instance that is created from this rule. Recording rules names must be valid [metric names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels).
- **Rule type -** Select **Cortex / Loki managed recording rule**.
- **Data source -** Select a Prometheus or Loki data source. Only data sources that support Cortex ruler API are available.
- **Namespace -** Select an existing rule namespace or click **Add new** and enter a name to create a new one. Namespaces can contain one or more rule groups and have only organizational purpose.
- **Group -** Select an existing group within the selected namespace or click **Add new** to create a new group. Newly created rules are added to the end of this group. Rules within a group are run sequentially at a regular interval, with the same evaluation time.
![Rule type section screenshot](/static/img/docs/alerting/unified/rule-edit-cortex-recording-rule-8-2.png 'Rule type section screenshot')
### Query
Enter a PromQL or LogQL expression. The result of this expression will get recorded as the value for the new metric.
![Query section](/static/img/docs/alerting/unified/rule-edit-cortex-recording-rule-query-8-2.png 'Query section screenshot')
### Details
You can optionally define labels in the details section.
![Details section](/static/img/docs/alerting/unified/rule-recording-rule-labels-8-2.png 'Details section screenshot')

View File

@@ -7,43 +7,41 @@ weight = 400
# Create a Cortex or Loki managed alerting rule
Grafana allows you manage alerting rules for an external Cortex or Loki instance.
In order for both Cortex and Loki data sources to work with Grafana 8.0 alerting, enable the ruler API by configuring their respective services. The`local` rule storage type, default for Loki, only supports viewing of rules. If you want to edit rules, then configure one of the other rule storage types. When configuring a Grafana Prometheus data source to point to Cortex, use the legacy `/api/prom` prefix, not `/prometheus`. Only single-binary mode is currently supported, and it is not possible to provide a separate URL for the ruler API.
Grafana allows you manage alerting rules for an external Cortex or Loki instance.
## Add or edit a Cortex or Loki managed alerting rule
1. In the Grafana menu hover your cursor over the Alerting (bell) icon.
1. To create a new alert rule, click **New alert rule**. To edit an existing rule, expand one of the rules in the **Cortex / Loki** section and click **Edit**.
1. Click on the **Rule type** drop down and select **Cortex / Loki managed alert**.
1. Click on the **Alert type** drop down and select **Cortex / Loki managed alert**.
1. Fill out the rest of the fields. Descriptions are listed below in [Alert rule fields](#alert-rule-fields).
1. When you have finished writing your rule, click **Save** in the upper right corner to save the rule, or **Save and exit** to save and exit rule editing.
1. When you have finished writing your rule, click **Save** in the upper right corner to save the rule,, or **Save and exit** to save and exit rule editing.
## Alert rule fields
This section describes the fields you fill out to create an alert.
### Rule type
### Alert type
- **Rule name -** Enter a descriptive name. The name will be displayed in the alert rule list, as well as added as `alertname` label to every alert instance that is created from this rule.
- **Rule type -** Select **Cortex / Loki managed alert**.
- **Data source -** Select a Prometheus or Loki data source. Only Prometheus data sources that support Cortex ruler API will be available.
- **Namespace -** Select an existing rule namespace or click **Add new** and enter a name to create a new one. Namespaces can contain one or more rule groups and have only organizational purpose.
- **Group -** Select an existing group within the selected namespace or click **Add new** and enter a name to create a new one. Newly created rules will be added to the end of the rule group. Rules within a group are run sequentially at a regular interval, with the same evaluation time.
- **Alert name -** Enter a descriptive name. The name will be displayed in the alert rule list, as well as added as `alertname` label to every alert instance that is created from this rule.
- **Alert type -** Select **Cortex / Loki managed alert**.
- **Data source -** Select a Prometheus or Loki data source. Only Prometheus data sources that support Cortex ruler API will be available.
- **Namespace -** Select an existing rule namespace or click **Add new** to create a new one.
- **Group -** Select an existing group within the selected namespace or click **Add new** to create a new one. Newly created rules will be added to the end of the rule group.
![Alert type section screenshot](/static/img/docs/alerting/unified/rule-edit-cortex-alert-type-8-0.png 'Alert type section screenshot')
![Alert type section screenshot](/img/docs/alerting/unified/rule-edit-cortex-alert-type-8-0.png 'Alert type section screenshot')
### Query
Enter a PromQL or LogQL expression. Rule will fire if evaluation result has at least one series with value > 0. An alert will be created per each such series.
![Query section](/static/img/docs/alerting/unified/rule-edit-cortex-query-8-0.png 'Query section screenshot')
![Query section](/img/docs/alerting/unified/rule-edit-cortex-query-8-0.png 'Query section screenshot')
### Conditions
- **For -** For how long the selected condition should violated before an alert enters `Firing` state. When condition threshold is violated for the first time, an alert becomes `Pending`. If the **for** time elapses and the condition is still violated, it becomes `Firing`. Else it reverts back to `Normal`.
- **For -** For how long the selected condition should violated before an alert enters `Firing` state. When condition threshold is violated for the first time, an alert becomes `Pending`. If the **for** time elapses and the condition is still violated, it becomes `Firing`. Else it reverts back to `Normal`.
![Conditions section](/static/img/docs/alerting/unified/rule-edit-cortex-conditions-8-0.png 'Conditions section screenshot')
![Conditions section](/img/docs/alerting/unified/rule-edit-cortex-conditions-8-0.png 'Conditions section screenshot')
### Details
@@ -51,18 +49,14 @@ Annotations and labels can be optionally added in the details section.
#### Annotations
Annotations are key and value pairs that provide additional meta information about the alert, for example description, summary, runbook URL. They 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 and value pairs that provide additional meta information about the alert, for example description, summary, runbook URL. They 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.
#### 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, it is common to add a `severity` label and then configure a separate notification policy for each severity. Or one could add a `team` label and configure team specific notification policies, or silence all alerts for a particular team.
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, it is common to add a `severity` label and then configure a separate notification policy for each severity. Or one could add a `team` label and configure team specific notification policies, or silence all alerts for a particular team.
![Details section](/static/img/docs/alerting/unified/rule-edit-details-8-0.png 'Details section screenshot')
![Details section](/img/docs/alerting/unified/rule-edit-details-8-0.png 'Details section screenshot')
## Preview alerts
To evaluate the rule and see what alerts it would produce, click **Preview alerts**. It will display a list of alerts with state and value of for each one.
## Opt-out a Loki or Prometheus data source
If you do not want to allow creating rules for a particular Loki or Prometheus data source, go to its settings page and clear the **Manage alerts via Alerting UI** checkbox.
To evaluate the rule and see what alerts it would produce, click **Preview alerts**. It will display a list of alerts with state and value of for each one.

View File

@@ -7,7 +7,7 @@ weight = 400
# Create a Grafana managed alerting rule
Grafana allows you to create alerting rules that query one or more data sources, reduce or transform the results and compare them to each other or to fix thresholds. These rules will be executed and notifications sent by Grafana itself.
Grafana allows you to create alerting rules that query one or more data sources, reduce or transform the results and compare them to each other or to fix thresholds. These rules will be executed and notifications sent by Grafana itself.
## Add or edit a Grafana managed alerting rule
@@ -23,15 +23,15 @@ This section describes the fields you fill out to create an alert.
### Alert type
- **Alert name -** Enter a descriptive name. The name will be displayed in the alert rule list, as well as added as `alertname` label to every alert instance that is created from this rule.
- **Alert type -** Select **Grafana managed alert**.
- **Folder -** Select a folder this alert rule will belong to. To create a new folder, click on the drop down and type in a new folder name.
- **Alert name -** Enter a descriptive name. The name will be displayed in the alert rule list, as well as added as `alertname` label to every alert instance that is created from this rule.
- **Alert type -** Select **Grafana managed alert**.
- **Folder -** Select a folder this alert rule will belong to. To create a new folder, click on the drop down and type in a new folder name.
![Alert type section screenshot](/static/img/docs/alerting/unified/rule-edit-grafana-alert-type-8-0.png 'Alert type section screenshot')
![Alert type section screenshot](/img/docs/alerting/unified/rule-edit-grafana-alert-type-8-0.png 'Alert type section screenshot')
### Query
Add one or more [queries]({{< relref "../../../panels/queries.md" >}}) or [expressions]({{< relref "../../../panels/expressions.md" >}}). You can use classic condition expression to create a rule that will trigger a single alert if it's threshold is met, or use reduce and math expressions to create a multi dimensional alert rule that can trigger multiple alerts, one per matching series in the query result.
Add one or more [queries]({{< relref "../../../panels/queries.md" >}}) or [expressions]({{< relref "../../../panels/expressions.md" >}}). You can use classic condition expression to create a rule that will trigger a single alert if it's threshold is met, or use reduce and math expressions to create a multi dimensional alert rule that can trigger multiple alerts, one per matching series in the query result.
#### Rule with classic condition
@@ -41,7 +41,7 @@ You can use classic condition expression to create a rule that will trigger a si
1. Add an expression. Click on **Operation** dropdown and select **Classic condition**.
1. Add one or more conditions. For each condition you can specify operator (`AND` / `OR`), aggregation function, query letter and threshold value.
If a query returns multiple series, then the aggregation function and threshold check will be evaluated for each series.It will not track alert state **per series**. This has implications that are detailed in the scenario below.
If a query returns multiple series, then the aggregation function and threshold check will be evaluated for each series.It will not track alert state **per series**. This has implications that are detailed in the scenario below.
- Alert condition with query that returns 2 series: **server1** and **server2**
- **server1** series causes the alert rule to fire and switch to state `Firing`
@@ -51,7 +51,7 @@ If a query returns multiple series, then the aggregation function and threshold
So, as you can see from the above scenario Grafana will not send out notifications when other series cause the alert to fire if the rule already is in state `Firing`. If you want to have alert per series, create a multi dimensional alert rule as described in the section below.
![Query section classic condition](/static/img/docs/alerting/unified/rule-edit-classic-8-0.png 'Query section classic condition screenshot')
![Query section classic condition](/img/docs/alerting/unified/rule-edit-classic-8-0.png 'Query section classic condition screenshot')
#### Multi dimensional rule
@@ -63,30 +63,31 @@ You can use reduce and math expressions to create a rule that will create an ale
See or [expressions documentation]({{< relref "../../../panels/expressions.md" >}}) for in depth explanation of `math` and `reduce` expressions.
![Query section multi dimensional](/static/img/docs/alerting/unified/rule-edit-multi-8-0.png 'Query section multi dimensional screenshot')
![Query section multi dimensional](/img/docs/alerting/unified/rule-edit-multi-8-0.png 'Query section multi dimensional screenshot')
### Conditions
- **Condition -** Select the letter of the query or expression whose result will trigger the alert rule. You will likely want to select either a `classic condition` or a `math` expression.
- **Evaluate every -** How often the rule should be evaluated, executing the defined queries and expressions. Must be no less than 10 seconds and a multiple of 10 seconds. Examples: `1m`, `30s`
- **Evaluate for -** For how long the selected condition should violated before an alert enters `Alerting` state. When condition threshold is violated for the first time, an alert becomes `Pending`. If the **for** time elapses and the condition is still violated, it becomes `Alerting`. Else it reverts back to `Normal`.
- **Condition -** Select the letter of the query or expression whose result will trigger the alert rule. You will likely want to select either a `classic condition` or a `math` expression.
- **Evaluate every -** How often the rule should be evaluated, executing the defined queries and expressions. Must be no less than 10 seconds and a multiple of 10 seconds. Examples: `1m`, `30s`
- **Evaluate for -** For how long the selected condition should violated before an alert enters `Alerting` state. When condition threshold is violated for the first time, an alert becomes `Pending`. If the **for** time elapses and the condition is still violated, it becomes `Alerting`. Else it reverts back to `Normal`.
#### No Data & Error handling
Toggle **Configure no data and error handling** switch to configure how the rule should handle cases where evaluation results in error or returns no data.
Toggle **Configure no data and error handling** switch to configure how the rule should handle cases where evaluation results in error or returns no data.
| No Data Option | Description |
| --------------- | ------------------------------------------------------------------------------------------ |
| No Data | Set alert state to `NoData` and rule state to `Normal` |
| Alerting | Set alert rule state to `Alerting` |
| Ok | Set alert rule state to `Normal` |
| No Data Option | Description |
| -------------- | ----------------------------------------------------------------------------------------------------------- |
| No Data | Set alert state to `NoData` and rule state to `Normal` (notifications are not sent on NoData states). |
| Alerting | Set alert rule state to `Alerting`. |
| Ok | Set alert rule state to `Normal`. |
| Error or timeout option | Description |
| ----------------------- | ---------------------------------- |
| Alerting | Set alert rule state to `Alerting` |
| OK | Set alert rule state to `Normal` |
| Error or timeout option | Description |
| ----------------------- | --------------------------------------------------- |
| Alerting | Set alert rule state to `Alerting` |
| OK | Set alert rule state to `Normal` |
![Conditions section](/static/img/docs/alerting/unified/rule-edit-grafana-conditions-8-0.png 'Conditions section screenshot')
![Conditions section](/img/docs/alerting/unified/rule-edit-grafana-conditions-8-0.png 'Conditions section screenshot')
### Details
@@ -94,23 +95,13 @@ Annotations and labels can be optionally added in the details section.
#### Annotations
Annotations are key and value pairs that provide additional meta information about the alert, for example description, summary, runbook URL. They 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 and value pairs that provide additional meta information about the alert, for example description, summary, runbook URL. They 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.
#### 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, it is common to add a `severity` label and then configure a separate notification policy for each severity. Or one could add a `team` label and configure team specific notification policies, 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 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, it is common to add a `severity` label and then configure a separate notification policy for each severity. Or one could add a `team` label and configure team specific notification policies, 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.
![Details section](/static/img/docs/alerting/unified/rule-edit-details-8-0.png 'Details section screenshot')
#### Template variables
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. |
| $value | The value string of the alert instance. For example, `[ var='A' labels={instance=foo} value=10 ]`. |
![Details section](/img/docs/alerting/unified/rule-edit-details-8-0.png 'Details section screenshot')
## Preview alerts

View File

@@ -1,34 +0,0 @@
+++
title = "Edit Cortex or Loki rule groups and namespaces"
description = "Edit Cortex or Loki rule groups and namespaces"
keywords = ["grafana", "alerting", "guide", "group", "namespace", "cortex", "loki"]
weight = 400
+++
# Edit Cortex or Loki rule groups and namespaces
You can rename Cortex or Loki rule namespaces and groups and edit group evaluation intervals.
## Rename a namespace
A namespace contains one or more groups. To rename a namespace, find a group that belongs to the namespace, then update the namespace.
1. Hover your cursor over the Alerting (bell) icon in the side menu.
1. Locate a group that belongs to the namespace you want to edit and click the edit (pen) icon.
1. Enter a new name in the **Namespace** field, then click **Save changes**.
A new namespace is created and all groups are copied into this namespace from the old one. The old namespace is deleted.
## Rename rule group or change rule group evaluation interval
The rules within a group are run sequentially at a regular interval, the default interval is one (1) minute. You can modify this interval using the following instructions.
1. Hover your cursor over the Alerting (bell) icon in the side menu.
1. Find the group you want to edit and click the edit (pen) icon.
1. Modify the **Rule group** and **Rule group evaluation interval** information as necessary.
1. Click **Save changes**.
If you remaned the group, a new group is created that has all the rules from the old group, and the old group deleted.
![Group list](/static/img/docs/alerting/unified/rule-list-edit-cortex-loki-icon-8-2.png 'Rule group list screenshot')
![Group edit modal](/static/img/docs/alerting/unified/rule-list-cortex-loki-edit-ns-group-8-2.png 'Rule group edit modal screenshot')

View File

@@ -7,29 +7,27 @@ weight = 400
# View alert rules
To view alerts:
To view alters:
1. In the Grafana menu hover your cursor over the Alerting (bell) icon.
1. Click **Alert Rules**. You can see all configured Grafana alert rules as well as any rules from Loki or Prometheus data sources.
By default, the group view is shown. You can toggle between group or state views by clicking the relevant **View as** buttons in the options area at the top of the page.
1. Click **Alert Rules**. You can see all configured Grafana alert rules as well as any rules from Loki or Prometheus data sources.
By default, the group view is shown. You can toggle between group or state views by clicking the relevant **View as** buttons in the options area at the top of the page.
### Group view
Group view shows Grafana alert rules grouped by folder and Loki or Prometheus alert rules grouped by `namespace` + `group`. This is the default rule list view, intended for managing rules. You can expand each group to view a list of rules in this group. Each rule can be further expanded to view its details. Action buttons and any alerts spawned by this rule, and each alert can be further expanded to view its details.
![Grouped alert rule view](/static/img/docs/alerting/unified/rule-list-group-view-8-0.png 'Screenshot of grouped alert rule view')
![Grouped alert rule view](/img/docs/alerting/unified/rule-list-group-view-8-0.png 'Screenshot of grouped alert rule view')
### State view
State view shows alert rules grouped by state. Use this view to get an overview of which rules are in what state. Each rule can be expanded to view its details. Action buttons and any alerts spawned by this rule, and each alert can be further expanded to view its details.
![Alert rule state view](/static/img/docs/alerting/unified/rule-list-state-view-8-0.png 'Screenshot of alert rule state view')
![Alert rule state view](/img/docs/alerting/unified/rule-list-state-view-8-0.png 'Screenshot of alert rule state view')
## Filter alert rules
You can use the following filters to view only alert rules that match specific criteria:
- **Filter alerts by label -** Search by alert labels using label selectors in the **Search** input. eg: `environment=production,region=~US|EU,severity!=warning`
- **Filter alerts by name or label -** Type an alert name, label name or value in the **Search** input.
- **Filter alerts by state -** In **States** Select which alert states you want to see. All others are hidden.
- **Filter alerts by data source -** Click the **Select data source** and select an alerting data source. Only alert rules that query selected data source will be visible.
@@ -37,18 +35,14 @@ You can use the following filters to view only alert rules that match specific c
A rule row shows the rule state, health, and summary annotation if the rule has one. You can expand the rule row to display rule labels, all annotations, data sources this rule queries, and a list of alert instances spawned from this rule.
![Alert rule details](/static/img/docs/alerting/unified/rule-details-8-0.png 'Screenshot of alert rule details')
![Alert rule details](/img/docs/alerting/unified/rule-details-8-0.png 'Screenshot of alert rule details')
### Edit or delete rule
Grafana rules can only be edited or deleted by users with Edit permissions for the folder which contains the rule. Prometheus or Loki rules can be edited or deleted by users with Editor or Admin roles.
Grafana rules can only be edited or deleted by users with Edit permissions for the folder which contains the rule. Prometheus or Loki rules can be edited or deleted by users with Editor or Admin roles.
To edit or delete a rule:
1. Expand this rule to reveal rule controls.
1. Expand this rule to reveal rule controls.
1. Click **Edit** to go to the rule editing form. Make changes following [instructions listed here]({{< relref "./create-grafana-managed-rule.md" >}}).
1. Click **Delete"** to delete a rule.
## Opt-out a Loki or Prometheus data source
If you do not want rules to be loaded from a Prometheus or Loki data source, go to its settings page and clear the **Manage alerts via Alerting UI** checkbox.
1. Click **Delete"** to delete a rule.

View File

@@ -4,22 +4,16 @@ description = "State and Health of alerting rules"
keywords = ["grafana", "alerting", "guide", "state"]
+++
# State and Health of alerting rule
The concepts of state and health for alerting rules help you understand, at a glance, several key status indicators about your alerts. Alert state, alerting rule state, and alerting rule health are related, but they each convey subtly different information.
## Alerting rule state
Indicates whether any of the timeseries resulting from evaluation of the alerting rule are in an alerting state. Alerting rule state only requires a single alerting instance to be in a pending or firing state for the alerting rule state to not be normal.
- Normal: none of the timeseries returned are in an alerting state.
- Pending: at least one of the timeseries returned are in a pending state.
- Firing: at least one of the timeseries returned are in an alerting state.
## Alert state
Alert state is an indication of the output of the alerting evaluation engine.
- Normal: the condition for the alerting rule has evaluated to **false** for every timeseries returned by the evaluation engine.
- Alerting: the condition for the alerting rule has evaluated to **true** for at least one timeseries returned by the evaluation engine and the duration, if set, **has** been met or exceeded.
- Pending: the condition for the alerting rule has evaluated to **true** for at least one timeseries returned by the evaluation engine and the duration, if set, **has not** been met or exceeded.
@@ -27,9 +21,7 @@ Alert state is an indication of the output of the alerting evaluation engine.
- Error: There was an error encountered when attempting to evaluate the alerting rule.
## Alerting rule health
Indicates the status of alerting rule evaluation.
- Ok: the rule is being evaluated, data is being returned, and no errors have been encountered.
- Error: an error was encountered when evaluating the alerting rule.
- NoData: at least one of the timeseries returned during evaluation is in a NoData state.

View File

@@ -9,27 +9,21 @@ weight = 400
Contact points define where to send notifications about alerts that match a particular [notification policy]({{< relref "./notification-policies.md" >}}). A contact point can contain one or more contact point types, eg email, slack, webhook and so on. A notification will dispatched to all contact point types defined on a contact point. [Templating]({{< relref "./message-templating/_index.md" >}}) can be used to customize contact point type message with alert data. Grafana alerting UI can be used to configure both Grafana managed contact points and contact points for an [external Alertmanager if one is configured]({{< relref "../../datasources/alertmanager.md" >}}).
Grafana alerting UI allows you to configure contact points for the Grafana managed alerts (handled by the embedded Alertmanager) as well as contact points for an [external Alertmanager if one is configured]({{< relref "../../datasources/alertmanager.md" >}}), using the Alertmanager dropdown.
> **Note:** Currently the configuration of the embedded Alertmanager is shared across organisations. Therefore users are advised to use the new Grafana 8 Alerts only if they have one organisation otherwise contact points for the Grafana managed alerts will be visible by all organizations.
## Add a contact point
1. In the Grafana side bar, hover your cursor over the **Alerting** (bell) icon and then click **Contact points**.
1. Click **Add contact point**.
1. Enter a **Name** for the contact point
1. Enter a **Name** for the contact point
1. Select contact point type and fill out mandatory fields. **Optional settings** can be expanded for more options.
1. If you'd like this contact point to notify via multiple channels, for example both email and slack, click **New contact point type** and fill out additional contact point type details.
1. Click **Save contact point** button at the bottom of the page.
## Editing a contact point
1. In the Grafana side bar, hover your cursor over the **Alerting** (bell) icon and then click **Contact points**.
1. Find the contact point you want to edit in the contact points table and click the **pen icon** on the right side.
1. Make any changes and click **Save contact point** button at the bottom of the page.
## Deleting a contact point
## Deleting a contact point
1. In the Grafana side bar, hover your cursor over the **Alerting** (bell) icon and then click **Contact points**.
1. Find the contact point you want to edit in the contact points table and click the **trash can icon** on the right side.
1. A confirmation dialog will open. Click **Yes, delete**.
@@ -38,31 +32,31 @@ Grafana alerting UI allows you to configure contact points for the Grafana manag
## List of notifiers supported by Grafana
| Name | Type |
| --------------------------------------------- | ------------------------- |
| [DingDing](#dingdingdingtalk) | `dingding` |
| [Discord](#discord) | `discord` |
| [Email](#email) | `email` |
| [Google Hangouts Chat](#google-hangouts-chat) | `googlechat` |
| [Kafka](#kafka) | `kafka` |
| Line | `line` |
| Microsoft Teams | `teams` |
| [Opsgenie](#opsgenie) | `opsgenie` |
| [Pagerduty](#pagerduty) | `pagerduty` |
| Prometheus Alertmanager | `prometheus-alertmanager` |
| [Pushover](#pushover) | `pushover` |
| Sensu | `sensu` |
| [Sensu Go](#sensu-go) | `sensugo` |
| [Slack](#slack) | `slack` |
| Telegram | `telegram` |
| Threema | `threema` |
| VictorOps | `victorops` |
| [Webhook](#webhook) | `webhook` |
| [Zenduty](#zenduty) | `webhook` |
Name | Type
-----|-----
[DingDing](#dingdingdingtalk) | `dingding`
[Discord](#discord) | `discord`
[Email](#email) | `email`
[Google Hangouts Chat](#google-hangouts-chat) | `googlechat`
[Kafka](#kafka) | `kafka`
Line | `line`
Microsoft Teams | `teams`
[Opsgenie](#opsgenie) | `opsgenie`
[Pagerduty](#pagerduty) | `pagerduty`
Prometheus Alertmanager | `prometheus-alertmanager`
[Pushover](#pushover) | `pushover`
Sensu | `sensu`
[Sensu Go](#sensu-go) | `sensugo`
[Slack](#slack) | `slack`
Telegram | `telegram`
Threema | `threema`
VictorOps | `victorops`
[Webhook](#webhook) | `webhook`
[Zenduty](#zenduty) | `webhook`
## Manage contact points for an external Alertmanager
Grafana alerting UI supports managing external Alertmanager configuration. Once you add an [Alertmanager data source]({{< relref "../../datasources/alertmanager.md" >}}), a dropdown displays at the top of the page where you can select either `Grafana` or an external Alertmanager as your data source.
Grafana alerting UI supports managing external Alertmanager configuration. Once you add an [Alertmanager data source]({{< relref "../../datasources/alertmanager.md" >}}), a dropdown displays at the top of the page where you can select either `Grafana` or an external Alertmanager as your data source.
{{< figure max-width="40%" src="/static/img/docs/alerting/unified/contact-points-select-am-8-0.gif" caption="Select Alertmanager" >}}
@@ -70,6 +64,7 @@ Grafana alerting UI supports managing external Alertmanager configuration. Once
To edit global configuration options for an alertmanager, like SMTP server that is used by default for all email contact types:
1. In the Grafana side bar, hover your cursor over the **Alerting** (bell) icon and then click **Contact points**.
1. In the dropdown at the top of the page, select an Alertmanager data source.
1. Click **Edit global config** button at the bottom of the page.

View File

@@ -28,40 +28,40 @@ If there are string columns then those columns become labels. The name of column
For a MySQL table called "DiskSpace":
| Time | Host | Disk | PercentFree |
| ----------- | ---- | ---- | ----------- |
| 2021-June-7 | web1 | /etc | 3 |
| 2021-June-7 | web2 | /var | 4 |
| 2021-June-7 | web3 | /var | 8 |
| ... | ... | ... | ... |
| Time | Host | Disk | PercentFree
| ----------- | --- | -----| --------
| 2021-June-7 | web1 | /etc | 3
| 2021-June-7 | web2 | /var | 4
| 2021-June-7 | web3 | /var | 8
| ... | ... | ... | ...
You can query the data filtering on time, but without returning the time series to Grafana. For example, an alert that would trigger per Host, Disk when there is less than 5% free space:
```sql
SELECT Host, Disk, CASE WHEN PercentFree < 5.0 THEN PercentFree ELSE 0 END FROM (
SELECT
Host,
Disk,
Avg(PercentFree)
SELECT
Host,
Disk,
Avg(PercentFree)
FROM DiskSpace
Group By
Host,
Group By
Host,
Disk
Where __timeFilter(Time)
```
This query returns the following Table response to Grafana:
| Host | Disk | PercentFree |
| ---- | ---- | ----------- |
| web1 | /etc | 3 |
| web2 | /var | 4 |
| web3 | /var | 0 |
| Host | Disk | PercentFree
| --- | -----| --------
| web1 | /etc | 3
| web2 | /var | 4
| web3 | /var | 0
When this query is used as the **condition** in an alert rule, then the non-zero will be alerting. As a result, three alert instances are produced:
| Labels | Status |
| --------------------- | -------- |
| {Host=web1,disk=/etc} | Alerting |
| {Host=web2,disk=/var} | Alerting |
| {Host=web3,disk=/var} | Normal |
| Labels | Status
| ----------------------| ------
| {Host=web1,disk=/etc} | Alerting
| {Host=web2,disk=/var} | Alerting
| {Host=web3,disk=/var} | Normal

View File

@@ -8,7 +8,8 @@ weight = 400
# Message templating
Notifications sent via [contact points]({{< relref "../contact-points.md" >}}) are built using templates. Grafana comes with default templates which you can customize. Grafana's notification templates are based on the [Go templating system](https://golang.org/pkg/text/template) where some fields are evaluated as text, while others are evaluated as HTML which can affect escaping. Since most of the contact point fields can be templated, you can create reusable templates and them in multiple contact points. See [template data reference]({{< relref "./template-data.md" >}}) to check what variables are available in the templates. The default template is defined in [default_template.go](https://github.com/grafana/grafana/blob/main/pkg/services/ngalert/notifier/channels/default_template.go) which can serve as a useful reference or starting point for custom templates.
Notifications sent via [contact points]({{< relref "../contact-points.md" >}}) are built using templates. Grafana comes with default templates which you can customize. Grafana's notification templates are based on the [Go templating system](https://golang.org/pkg/text/template) where some fields are evaluated as text, while others are evaluated as HTML which can affect escaping. Since most of the contact point fields can be templated, you can create reusable templates and them in multiple contact points. See [template data reference]({{< relref "./template-data.md" >}}) to check what variables are available in the templates.
## Using templating in contact point fields
@@ -20,12 +21,7 @@ This section shows an example of using templating to render a number of firing o
You can create named templates and then reuse them in contact point fields or other templates.
Grafana alerting UI allows you to configure templates for the Grafana managed alerts (handled by the embedded Alertmanager) as well as templates for an [external Alertmanager if one is configured]({{< relref "../../../datasources/alertmanager.md" >}}), using the Alertmanager dropdown.
> **Note:** Currently the configuration of the embedded Alertmanager is shared across organisations. Therefore users are advised to use the new Grafana 8 Alerts only if they have one organisation otherwise templates for the Grafana managed alerts will be visible by all organizations
### Create a template
1. In the Grafana side bar, hover your cursor over the **Alerting** (bell) icon and then click **Contact points**.
1. Click **Add template**.
1. Fill in **Name** and **Content** fields.
@@ -33,19 +29,18 @@ Grafana alerting UI allows you to configure templates for the Grafana managed al
**Note** The template name used to reference this template in templating is not the value of the **Name** field, but the parameter to `define` tag in the content. When creating a template you can omit `define` entirely and it will be added automatically with same value as **Name** field. It's recommended to use the same name for `define` and **Name** field to avoid confusion.
<img src="/static/img/docs/alerting/unified/templates-create-8-0.png" width="600px">
### Edit a template
1. In the Grafana side bar, hover your cursor over the **Alerting** (bell) icon and then click **Contact points**.
1. Find the template you want to edit in the templates table and click the **pen icon** on the right side.
1. Make any changes and click **Save template** button at the bottom of the page.
### Delete a template
1. In the Grafana side bar, hover your cursor over the **Alerting** (bell) icon and then click **Contact points**.
1. Find the template you want to edit in the templates table and click the **trash can icon** on the right side.
1. A confirmation dialog will open. Click **Yes, delete**.
1. A confirmation dialog will open. Click **Yes, delete**.
**Note** You are not prevented from deleting templates that are in use somewhere in contact points or other templates. Be careful!
@@ -53,23 +48,23 @@ Grafana alerting UI allows you to configure templates for the Grafana managed al
To use a template:
Enter `{{ template "templatename" . }}` into a contact point field, where `templatename` is the `define` parameter of a template.
Enter `{{ template "templatename" . }}` into a contact point field, where `templatename` is the `define` parameter of a template.
<img src="/static/img/docs/alerting/unified/contact-points-use-template-8-0.png" width="600px">
### Template examples
Here is an example of a template to render a single alert:
```
{{ define "alert" }}
[{{.Status}}] {{ .Labels.alertname }}
Labels:
{{ range .Labels.SortedPairs }}
{{ .Name }}: {{ .Value }}
{{ end }}
{{ if gt (len .Annotations) 0 }}
Annotations:
{{ range .Annotations.SortedPairs }}
@@ -81,13 +76,12 @@ Here is an example of a template to render a single alert:
Silence alert: {{ .SilenceURL }}
{{ end }}
{{ if gt (len .DashboardURL ) 0 }}
Go to dashboard: {{ .DashboardURL }}
Go to dashboard: {{ .Dashboard URL }}
{{ end }}
{{ end }}
```
Template to render entire notification message:
```
{{ define "message" }}
{{ if gt (len .Alerts.Firing) 0 }}
@@ -103,6 +97,6 @@ Template to render entire notification message:
## Manage templates for an external Alertmanager
Grafana alerting UI supports managing external Alertmanager configuration. Once you add an [Alertmanager data source]({{< relref "../../../datasources/alertmanager.md" >}}), a dropdown displays at the top of the page, allowing you to select either `Grafana` or an external Alertmanager data source.
Grafana alerting UI supports managing external Alertmanager configuration. Once you add an [Alertmanager data source]({{< relref "../../../datasources/alertmanager.md" >}}), a dropdown displays at the top of the page, allowing you to select either `Grafana` or an external Alertmanager data source.
{{< figure max-width="40%" src="/static/img/docs/alerting/unified/contact-points-select-am-8-0.gif" caption="Select Alertmanager" >}}

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