Compare commits

...

818 Commits

Author SHA1 Message Date
Grot (@grafanabot)
d7f71e9eae "Release: Updated versions in package to 8.2.0" (#40134) 2021-10-07 12:23:10 +02:00
Grot (@grafanabot)
1be90124f0 Aws: Update AWS authentication documentation (#39236) (#39861)
* wip: adding workspace iam role

* add intro

* minor adjustment

* Update docs/sources/datasources/aws-cloudwatch/aws-authentication.md

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

* Update docs/sources/datasources/aws-cloudwatch/aws-authentication.md

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

* Update docs/sources/datasources/aws-cloudwatch/aws-authentication.md

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

* Update docs/sources/datasources/aws-cloudwatch/aws-authentication.md

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

* Update docs/sources/datasources/aws-cloudwatch/aws-authentication.md

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

* Update docs/sources/datasources/aws-cloudwatch/aws-authentication.md

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

* Update docs/sources/datasources/aws-cloudwatch/aws-authentication.md

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

* Update docs/sources/datasources/aws-cloudwatch/aws-authentication.md

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

* revert to on behalf of

* remove permissions

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

Co-authored-by: Erik Sundell <erik.sundell@grafana.com>
2021-10-07 11:49:56 +02:00
Grot (@grafanabot)
2d9aabfcac Search: Fix local storage key (#40127) (#40130)
* Default to 'General' if no folder title is present

* Add bottom padding

(cherry picked from commit 5c7e874008)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-10-07 11:18:47 +02:00
Grot (@grafanabot)
235351ae69 Stat: recompute shared y range during streaming updates (#39485) (#40132)
(cherry picked from commit d3815a851c)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-10-07 11:16:30 +02:00
Grot (@grafanabot)
f6199596df Annotations: Improve rendering performance of event markers (#39984) (#39999)
(cherry picked from commit ead8429210)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-10-07 10:50:19 +02:00
Grot (@grafanabot)
f15be05dec Fix: prevent queryDisplyText in QueryRowHeader from overflowing (#40094) (#40128)
* Revert "Fix Query Editor Row horizontal overflow (#39419)"

This reverts commit 42b1fa0f62.

* fix: prevent queryDisplyText in QueryRowHeader from overflowing

(cherry picked from commit 95d9722afa)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-10-07 10:45:45 +02:00
Grot (@grafanabot)
81fcc3a007 CodeEditor: making sure we trigger the latest onSave callback provided to the component (#39835) (#40120)
(cherry picked from commit d9ca3c5c5d)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-10-07 09:18:47 +02:00
Grot (@grafanabot)
764ec0bd98 TimePicker: fix console error on time picker open (#40067) (#40072)
* TimePicker: fix console error on time picker open

(cherry picked from commit ba31e4ee4d)

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-10-07 07:22:46 +01:00
Grot (@grafanabot)
250381f581 Docs: Add documentation for library elements API (#39829) (#40117)
* LibraryElements: Adds api documentation

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Update docs/sources/http_api/library_element.md

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

* Refactor: changes after PR comments

* Apply suggestions from code review

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

* Chore: updates after review

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

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-10-07 08:03:07 +02:00
Grot (@grafanabot)
cac6effebd Explore: Add opt-in config for Node Graph in Jaeger, Zipkin, and Tempo (#39958) (#40105)
(cherry picked from commit 3a8d04603f)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2021-10-06 14:42:07 -06:00
Grot (@grafanabot)
9212b34d46 Doc: Organized the Getting Started section (#39813) (#40039)
* First commit with reorganized and updated content.

* Updated Getting started topic.

* Changed some wording.

* Removed extra word "setting".

* Update docs/sources/getting-started/getting-started-prometheus.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/getting-started/getting-started-prometheus.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Updated doc based on review.

* Fix linting errors

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
(cherry picked from commit cfc31ce523)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-10-06 13:30:46 -04:00
Grot (@grafanabot)
6db0af2223 A11y: Fix fastpass issues for dashboard management pages (#39940) (#40065)
* A11y: Fix fastpass issues for dashboard pages
See #39429

(cherry picked from commit 1ce750471f)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2021-10-06 18:02:54 +01:00
Grot (@grafanabot)
6730d5b657 Tempo: Decrease the default Tempo search limit to 20 (#40030) (#40088)
(cherry picked from commit 3e33330e27)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2021-10-06 09:30:48 -06:00
Dimitris Sotirakis
dc5ed14290 Remove unnecessary Dockerize steps (#40087) 2021-10-06 18:21:59 +03:00
Grot (@grafanabot)
8b396d5421 Fix typo in "filter by value" example (#40070) (#40086)
(cherry picked from commit 98a9b4adc5)

Co-authored-by: ian moone <lrobin@xee.com>
2021-10-06 11:19:05 -04:00
George Robinson
29638a485b Panel ID annotation cannot be set without Dashboard UID (#40019) (#40063)
(cherry picked from commit 935bd34a30)
2021-10-06 12:17:29 +01:00
Grot (@grafanabot)
7cd58dd7d0 MySql: Fix reset button on config page (#39988) (#40064)
* MySql: Fix reset button on config page

* Use button instead of anchor

* Add aria labels

(cherry picked from commit 7fd7c98540)

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-10-06 13:08:02 +02:00
George Robinson
265714866b You can now get alert rules for a dashboard or a panel using /api/v1/rules endpoints. (#39476) (#40008)
Get alert rules for a dashboard and panel in /api/v1/rules

(cherry picked from commit 2a4c1b1aa6)
2021-10-06 11:38:26 +01:00
Grot (@grafanabot)
cb6d6e0497 Docs: update alerting (#39899) (#40058)
* Docs: update alerting

* Apply suggestions from code review

Co-authored-by: Armand Grillet <2117580+armandgrillet@users.noreply.github.com>
(cherry picked from commit 4f2a3f92e4)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-10-06 12:22:06 +02:00
achatterjee-grafana
a6ef2cda29 Doc: Fix escalation issue 903 (#40034) (#40036)
* First set of reorg of Playlist topic. Also fixed a broken bookmark in Azure authentication topic.

* More re-org.

* Added note requested in issue 903.

* Updated a note added dashboard HTTP API endpoint.

* Update docs/sources/dashboards/playlist.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/dashboards/playlist.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/dashboards/playlist.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/dashboards/playlist.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/dashboards/playlist.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/dashboards/playlist.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Updated image position and name.

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>
2021-10-05 20:41:20 -04:00
Grot (@grafanabot)
73e89da81c Fix static path matching issue in macaron (#40023) (#40027)
Co-authored-by: Malcolm Holmes <mdh@odoko.co.uk>
(cherry picked from commit 329f96db1a)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-10-05 20:04:26 +02:00
Grot (@grafanabot)
218dc8104e AccessControl: rename data source id read action (#39966) (#40009)
(cherry picked from commit 4160429b71)

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2021-10-05 16:09:32 +02:00
Grot (@grafanabot)
c26dc6487e AccessControl: Document new permissions restricting data source access. (#39091) (#40004)
* Add data sources roles and permissions to docs

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
(cherry picked from commit 6aa006b699)

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2021-10-05 15:25:21 +02:00
Domas
b5521a9eaf Alerting: Alertmanager datasource support for upstream Prometheus AM implementation (#39775) (#39989)
(cherry picked from commit a1d4be0700)
2021-10-05 12:13:11 +03:00
Grot (@grafanabot)
32481e75c5 Alerting: make /api/prometheus/grafana/api/v1/rules faster (#39660) (#39986)
(cherry picked from commit e343b62665)

Co-authored-by: Domas <domas.lapinskas@grafana.com>
2021-10-05 11:11:15 +03:00
Grot (@grafanabot)
3e6bb78e3d TimePicker: Close timepicker with esc (#39962) (#39969)
(cherry picked from commit 3cd7b11eb4)

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-10-04 22:52:26 +02:00
Grot (@grafanabot)
d4bec0b178 Docs: Add API endpoints used for templating in Prometheus (#39639) (#39974)
(cherry picked from commit 3e01db9a1e)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-10-04 22:28:06 +02:00
Grot (@grafanabot)
815adae389 Some documentation fixes (#39951) (#39973)
* Some documentation fixes

* Address review comments

* Fixed lint issues using prettifier.

Co-authored-by: achatterjee-grafana <aparajita.chatterjee@grafana.com>
(cherry picked from commit ccd7f8a5ba)

Co-authored-by: Michael D <michael@drueing.de>
2021-10-04 15:54:44 -04:00
Kyle Brandt
4be5dd6391 Alerting: Allow more characters in label names so notifications are sent (#38629) (#39965)
Remove validation for labels to be accepted in the Alertmanager, This helps with datasources that produce non-compatible labels.

Adds an "object_matchers" to alert manager routers so we can support labels names with extended characters beyond prometheus/openmetrics. It only does this for the internal Grafana managed Alert Manager.

This requires a change to alert manager, so for now we use grafana/alertmanager which is a slight fork, with the intention of going back to upstream.

The frontend handles the migration of "matchers" -> "object_matchers" when the route is edited and saved. Once this is done, downgrades will not work old versions will not recognize the "object_matchers".

Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Nathan Rodman <nathanrodman@gmail.com>
(cherry picked from commit 6572017ec7)

cleanup

Co-authored-by: gotjosh <josue@grafana.com>
2021-10-04 09:07:04 -07:00
Grot (@grafanabot)
b4016187ff Doc: Updated Azure AD OAuth2 authentication topic. (#39609) (#39964)
* Updated topic.

* Added bookmarks.

* Update docs/sources/auth/azuread.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/auth/azuread.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Update docs/sources/auth/azuread.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Fixed bulleted list.

* Updated list again.

* Format change.

* Removed spaces.

* Run prettifier to fix whitespace issues.

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>
(cherry picked from commit 991b5fee3d)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-10-04 11:50:19 -04:00
Grot (@grafanabot)
045146184a CloudWatch Logs: Skip caching for Log queries (#39860) (#39893)
* Add x-skip-cache header to queries

* Specify caching works for CW metrics

(cherry picked from commit 3e47fb1432)

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2021-10-04 12:34:36 +02:00
Grot (@grafanabot)
2ecde07356 [v8.2.x] CloudWatch Logs: Docs for X-Ray links (#39894)
* CloudWatch Logs: Docs for X-Ray links  (#39725)

(cherry picked from commit 0b89bdd47d)

* Docs: Lint CloudWatch index page

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-10-04 12:03:36 +02:00
Grot (@grafanabot)
8dd5e88f92 Docs: Move image renderer doc to its own section and add configuration doc (#38759) (#39896)
* Move image renderer doc to its own section and add configuration doc

* revert unwanted changes

* remove unwanted formatting

* revert change

* Improve configuration section

* update default flags for 3.1.0 update

* Clean up and add some links

* fix broken links

* clean up notes & links and small updates

* fix after merge

* fix broken link

* fix typo

* Apply suggestions from code review

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

* Apply PR feedback

* Update monitoring.md

* Apply suggestions from code review

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

* Update troubleshooting.md

* add alias for old image rendering doc page

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
(cherry picked from commit b7eac0f655)

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
Co-authored-by: Agnès Toulet <agnes.toulet@gmail.com>
2021-10-04 09:23:10 +02:00
Grot (@grafanabot)
439b1b7310 A11y: Fix fastpass issues for /org/ pages (#39902) (#39916)
* A11y: Fix fastpass issues for /org/ pages
See #39429

(cherry picked from commit 816d70a7e5)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2021-10-04 10:01:01 +03:00
Grot (@grafanabot)
76ecd3759b Fix folder icons for alert rules (#39873) (#39891)
(cherry picked from commit 0f42b37e21)

Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
2021-10-01 21:30:21 +02:00
Grot (@grafanabot)
ab53001fd2 Plugins Catalog: fix overflowing text in plugin cards (#39862) (#39866)
* refactor(Plugins/Admin): add a "badge" for displaying available updates

* refactor(Plugins/Admin): rename component

* refactor(Plugins/Admin): use the PluginListItemBadges component

(cherry picked from commit 3ad5ee87a3)

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2021-10-01 17:37:20 +02:00
Grot (@grafanabot)
ea030e8bbd Prometheus: metrics browser: handle label values with special characters (#39713) (#39858)
* prometheus: handle label-values with special characters

* added comment

(cherry picked from commit d363c36853)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-10-01 16:11:03 +02:00
Grot (@grafanabot)
5d2fb57dd8 Plugins: Mock Icon component to prevent console errors (#39901) (#39909)
* feat(grafana-ui): externalise react-inlinesvg for mocking

* feat(grafana-toolkit): mock react-inlinesvg to prevent svg fetch errors in tests

* test(toolkit): remove assertion on array length of moduleNameMapper overrides

* feat(toolkit): set testId to match the Icon name prop in react-inlinesvg mock

(cherry picked from commit cc7f7e30e9)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-10-01 15:54:19 +02:00
Grot (@grafanabot)
5166c3c8bb A11y: Fix fastpass issues for /org/teams pages (#39848) (#39864)
* A11y: Fix fastpass issues for /org/teams pages
See #39429

(cherry picked from commit 451d023c79)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2021-10-01 14:32:51 +01:00
Grot (@grafanabot)
05c0e83802 DashboardList/AlertList: Fix for missing All folder value (#39772) (#39886)
* DashboardList/AlertList: Fix for missing All folder value

* Refactor: Fixes case where folder does not exist in results

(cherry picked from commit 7c7b21b39e)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-10-01 13:38:38 +02:00
Grot (@grafanabot)
c61395d7dc ReleaseNotes: Updated changelog and release notes for 8.2.0-beta2 (#39832) (#39851)
* ReleaseNotes: Updated changelog and release notes for 8.2.0-beta2

* Update _index.md

* Fix linting errors

* Update CHANGELOG.md

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

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Ivana <ivana.huckova@gmail.com>
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
(cherry picked from commit 58aa595527)
2021-09-30 15:02:14 +02:00
Grot (@grafanabot)
a2306d2765 "Release: Updated versions in package to 8.2.0-beta.2" (#39831) 2021-09-30 10:49:00 +02:00
Grot (@grafanabot)
229c45ccda Add fiscal years and search to time picker (#39073) (#39828)
* Add search to time picker

* implement fiscal datemath

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

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-09-30 10:07:24 +02:00
Grot (@grafanabot)
1126ea6539 Graphite: Ensure only valid queries are used for interpolation (#39761) (#39827)
* Graphite: Ensure only valid queries are used for interpolation

* Add a unit test

(cherry picked from commit 787e5e78dd)

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-09-30 10:00:06 +02:00
Grot (@grafanabot)
06015fbdaf Explore: Fix displaying rich history saving error message (#39766) (#39826)
* Explore: Fix displaying rich history saving error message

* Keep generic error message

* remove testing snippet

(cherry picked from commit f8ebcaa0d9)

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-09-30 09:52:18 +02:00
Grot (@grafanabot)
dc363a05ac A11y: Fixes some fastpass errors for /datasources/* routes (#39577) (#39797)
* A11y: Fixes some fastpass errors for /datasources/* routes
See #39429

(cherry picked from commit 75a55379f1)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2021-09-30 09:24:26 +02:00
Grot (@grafanabot)
70a4fd8a21 Plugins Catalog: Make the catalog the default way to interact with plugins (#39779) (#39822)
* chore(Plugins/Admin): make the Plugins Catalog the default way to interact with plugins

* chore(defaults.ini): change the default value for `plugin_admin_enabled`

* test(Plugins): make the tests pass

(cherry picked from commit c2754eb9cc)

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2021-09-30 09:05:55 +02:00
Torkel Ödegaard
91db8910a7 Chore: Tidy up emotion css with better theme breakpoint (#39340) (#39811)
(cherry picked from commit f3475b864c)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-09-29 20:41:02 +02:00
Grot (@grafanabot)
e69544b6ea Scatter: support bubble and line charts with out-of-order data (alpha) (#39377) (#39809)
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
(cherry picked from commit 4c8c2f6c96)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-09-29 19:42:50 +02:00
Grot (@grafanabot)
c6fb06721f DashboardRow: Prevent unintended editing of DashboardRow with keyboard shortcut 'e' (#39792) (#39803)
(cherry picked from commit ff009bee9f)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-09-29 18:11:20 +02:00
Grot (@grafanabot)
900c94fd8a Admin: Show licensed roles and unit membership in UI (#39773) (#39802)
* Extend User type

* Render licensed roles and org units

* Combine admin icon with units

* Extract search users to a new service

* Fix wire provider

* remove mock data

* Fix icon margin

* Fix common_test and remove RouteRegister

* Remove old endpoints

* Fix test

* Add indexes to dashboards and orgs tables

* Fix lint

* Revert docs changes

* undo docs formatting

* Change order of input and filters

* Abstract aria-label into a function

* Add accessible info about user's membership

* UI tweaks

Co-authored-by: spinillos <selenepinillos@gmail.com>
(cherry picked from commit 62dc10829a)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-09-29 18:00:15 +02:00
Grot (@grafanabot)
d6b00710cb PluginsCatalog: Add support for viewing the plugins list as both table and list (#39466) (#39798)
* working version but with duplications.

* refactor(Plugins/Admin): use "fr" instead of "repeat" for grid columns

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>

* fix(Plugins/Admin): use PluginIconName instead of IconName

* refactor(Plugins/Admin): store the display-mode on the state

* refactor(Plugins/Admin): use && for conditional rendering

* refactor(Plugins/Admin): rename variable

* refactor(Plugins/Admin): share code between card and row components

* test(PluginListItemRow): add tests

* test(Plugins/Admin): add a simple test for the display-mode switching

* fix(Plugins/Admin): compose styles with css``

* refactor(Plugins/Admin): rename "table" to "grid" for display modes

* test(Plugins/Browse): follow up on renaming "table" to "grid"

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
(cherry picked from commit 2dedbcd3c3)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-09-29 17:56:43 +02:00
Grot (@grafanabot)
4fe38b169c Docs: Add docs for Redis cluster caching backend configuration (#39687) (#39800)
* caching: add docs for redis cluster config

* address PR comments

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 9f1de095b7)

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2021-09-29 17:56:19 +02:00
Grot (@grafanabot)
bd12923c59 E2E: improvements to the importDashboard flow (#39693) (#39790)
* E2E: improvements to the importDashboard flow

(cherry picked from commit aeeaa67b0a)

Co-authored-by: Sarah Zinger <sarahzinger@users.noreply.github.com>
2021-09-29 11:53:32 -04:00
Grot (@grafanabot)
9570495af5 A11y: Fix fastpass issues for /explore page (#39507) (#39796)
* Fix(A11y): add label to explore short url button

* Grafana-UI(A11y): Set Selects images alt attribute to their option label

* Update packages/grafana-ui/src/components/Select/SingleValue.tsx

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
(cherry picked from commit f61c8d3eed)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-09-29 17:46:03 +02:00
Sofia Papagiannaki
368742ab04 Alerting: Remove ngalert feature toggle and introduce two new settings for enabling Grafana 8 alerts and disabling them for specific organisations (#38746) (#39793)
* Remove `ngalert` feature toggle

* Update frontend

Remove all references of ngalert feature toggle

* Update docs

* Disable unified alerting for specific orgs

* Add backend tests

* Apply suggestions from code review

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

* Disabled unified alerting by default

* Ensure backward compatibility with old ngalert feature toggle

* Apply suggestions from code review

Co-authored-by: gotjosh <josue@grafana.com>
(cherry picked from commit 012d4f0905)
2021-09-29 11:21:25 -04:00
Selene
d07ed05918 Extract search users functions into a service (#39002) (#39770)
* Extract search users to a new service

* Fix wire provider

* Fix common_test and remove RouteRegister

* Remove old endpoints

* Fix test

* Add indexes to dashboards and orgs tables

* Fix lint

(cherry picked from commit 02702eb82d)
2021-09-29 17:02:58 +02:00
Grot (@grafanabot)
4699620e23 Plugin Catalog: support Grafana instances that cannot communicate with gcom (#39638) (#39787)
* added possibility to track if remote plugins could be fetched.

* adding hook to detect if remote plugins are available.

* feat(catalog): disable installed/all filter if remote plugins are unavailable

* feat(Plugins/Admin): hide the install controls if GCOM is not available

* refactor(Plugins/Admin): group `@grafana` dependencies

* fix(Plugins/Admin): don't show an error alert if a remote plugin is not available

* feat(Plugins/Admin): prefer to use the local version of the readme

* chore(Plugins/Admin): type the mocked state properly

* test(Plugins/Admin): add tests for the Plugin Details when GCOM is not available

* test(Plugins/Admin): add tests for the Browse when GCOM is not available

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
(cherry picked from commit fffcee7c1f)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-09-29 16:44:57 +02:00
Grot (@grafanabot)
09461d03ea Update migration to not delete existing Grafana alerts (#39541) (#39736)
* keep existing unified alert rules untouched
* move silences and other alertmanager files to the organization directory (only if it is a single organization deployment)
* assign the existing notification settings and routes to the first organization
* create default notification settings for each organization in the case of multi org deployment

(cherry picked from commit 5d0d7dcb3a)

Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
2021-09-29 09:27:44 -04:00
Grot (@grafanabot)
c7e9b1685c OrgPage: Minor typo fix (#39764) (#39777)
(cherry picked from commit 630a120a15)

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-09-29 14:37:20 +02:00
Grot (@grafanabot)
20212aaf97 BarGauge: Improve behaviour when working with streaming data (#39737) (#39765)
* BarGauge: Improve behaviour when working with streaming data

* BarGauge: Refactor default min/max into grafana/data

(cherry picked from commit 2058193e98)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-09-29 11:39:55 +02:00
Grot (@grafanabot)
832321b405 add support for interaction events (#39752) (#39762)
(cherry picked from commit db8c9122aa)

Co-authored-by: Erik Sundell <erik.sundell@grafana.com>
2021-09-29 11:28:15 +02:00
Grot (@grafanabot)
f4bd6d4f84 Docs: alerting fixes (#39717) (#39730)
* Docs: alerting fixes

(cherry picked from commit eead8cd8e1)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-09-29 12:22:06 +03:00
Grot (@grafanabot)
805cbba81d TimeSeries: Fix shared cursor (#39738) (#39760)
(cherry picked from commit 4682cf5b7c)

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-09-29 10:58:14 +02:00
Grot (@grafanabot)
f793c0d2fc Table panel: Make filter case insensitive (#39746) (#39757)
* Expose FilterInput from grafana/ui

* Make table filter case insensitive

* Update packages/grafana-ui/src/components/Table/FilterList.tsx

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
(cherry picked from commit f887576a27)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-09-29 10:05:50 +02:00
Grot (@grafanabot)
b82bc90180 Hooks: Adding possibility to display banner on the top of the page (#39099) (#39755)
* adding working version of notificaion banner trigger.

* Move it to enterprise

* Fixing csss, none of the pages showed our CustomScrollbar or had double scrollbars

* fixing explore

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
(cherry picked from commit b626ba223f)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-09-29 08:29:45 +02:00
Grot (@grafanabot)
b37d4152d8 AzureMonitor: move metric deep link code to backend (#39524) (#39727)
(cherry picked from commit bf9be975ac)

Co-authored-by: Isabella Siu <sakurablossom@blueblueworld.com>
2021-09-28 14:31:47 -04:00
Grot (@grafanabot)
2cd112b9da Alerting: Add filtering for Silences (#39109) (#39452)
* Add filtering for Silences page

* Add tests Silences and SilenceEditor

* pr feedback: add field validation and test refactor

* Add test for checking content

* fix overflow for validation error message

* increase login threshold for pa11y

* Make silence filter state its own type and function

(cherry picked from commit d03f75726b)

Co-authored-by: Nathan Rodman <nathanrodman@gmail.com>
2021-09-28 10:35:27 -07:00
Grot (@grafanabot)
e426039d6c Tempo: Improve search form defaults and validation (#39534) (#39749)
* Tempo: add default limit, option to hide Loki search, and run query on hotkey in dropdowns

(cherry picked from commit 06592410b2)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2021-09-28 11:20:49 -06:00
Grot (@grafanabot)
f28d869db2 Tempo: Show warning if search is not available. Add opt-out config (#39489) (#39747)
* Tempo: Show warning if search is not available. Add opt-out config

(cherry picked from commit 24479ff6b0)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2021-09-28 10:52:14 -06:00
Grot (@grafanabot)
618a590a05 Tempo: Improve how Tempo Search fetches autocomplete values (#39371) (#39745)
* Improve how tempo search fetches autocomplete values

* Refetch autocomplete options on menu load

(cherry picked from commit 1865689411)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2021-09-28 10:20:43 -06:00
Grot (@grafanabot)
ce5fe730b8 Tempo: Format tempo search query history text (#39250) (#39743)
* Format tempo search query history text

(cherry picked from commit c57ff8beed)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2021-09-28 10:13:15 -06:00
Grot (@grafanabot)
6648f8c5a1 Tempo: Run search query with keyboard shortcut from input fields (#39247) (#39741)
* Tempo: Run query with keyboard shortcut from duration fields

(cherry picked from commit 9c4e7eb659)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2021-09-28 09:50:05 -06:00
Grot (@grafanabot)
d38782bc94 grafana-ui: Improve PartialHighlighter error handling (#39685) (#39739)
* Improve PartialHighlighter error handling

(cherry picked from commit 05bb451a1d)

Co-authored-by: Connor Lindsey <cblindsey3@gmail.com>
2021-09-28 09:45:15 -06:00
Grot (@grafanabot)
2e86425ed9 Alerting: Move alertmanager default config to UnifiedAlertingSettings (#39597) (#39714)
(cherry picked from commit 05eb30e323)

Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
2021-09-28 11:01:18 -04:00
Grot (@grafanabot)
5aaef25a33 Alerting: Optimization of fetching data in multiorg alertmanager (#39237) (#39720)
* Add method GetAllLatestAlertmanagerConfiguration to DBStore
* add method ApplyConfig to AlertManager
* update multiorg alert manager to load all alertmanager configs at once

(cherry picked from commit 1910d85ae0)

Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
2021-09-28 09:05:22 -04:00
Grot (@grafanabot)
35dad9c267 Provide reader to alertmanager silence instead of file path (#39305) (#39721)
(cherry picked from commit e1aae0549e)

Co-authored-by: Yuriy Tseretyan <tceretian@gmail.com>
2021-09-28 09:04:22 -04:00
Grot (@grafanabot)
c2d95d4d01 Alerting: Prevent preview if no condition is set (#39659) (#39706)
* prevent preview if no condition is set

* fixes after pr feedback

* watch on type and condition

(cherry picked from commit cc94c55e48)

Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
2021-09-28 14:24:19 +02:00
Sofia Papagiannaki
c89e1236fe Alerting: tune rule evaluation via configuration (#35623) (#39712)
* Alerting: Configure max evaluation retries

* Alerting: Enforce minimum rule evaluation interval

* Alerting: Disable rule evaluation from configuration

* Update docs

* Alerting: Configure rule evaluation timeout

* Move options on unified_alerting config section

* Apply suggestions from code review

Co-authored-by: gotjosh <josue@grafana.com>
(cherry picked from commit f6f3a54742)
2021-09-28 14:58:31 +03:00
Grot (@grafanabot)
3d76c772be Plugin Catalog: Use routing for PluginDetails Tabs (#39555) (#39680)
* feat(catalog): introduce id and href to PluginDetailsTabs

* feat(catalog): add hrefs and ids to PluginDetails tabs. Pass queryParams to PluginDetailsBody

* feat(catalog): pass queryParams to PluginsDetailsBody and add page param to PluginListCard

* fix(catalog): prevent flicker of content by waiting for fetch details to finish loading

* feat(catalog): add tab icons to PluginDetails page

* feat(catalog): make breadcrumbs in PluginDetailsHeader aware of page queryparam

* fix(catalog): fix deeplinking to PluginDetails by comparing tabs length

* test(catalog): update tests with correct props and wrap in router

(cherry picked from commit 4dc556445c)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-09-28 12:00:49 +02:00
Grot (@grafanabot)
1feb7ce022 Plugins Catalog: Remove notice asking user to refresh browser (#39592) (#39681)
(cherry picked from commit 6eceb69d43)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-09-28 12:00:00 +02:00
Grot (@grafanabot)
2089b58def Loki: Fix creating coontext query for logs with parsed labels (#39648) (#39705)
(cherry picked from commit 79c797c232)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-09-28 11:14:49 +02:00
Grot (@grafanabot)
f3479aad2b Add orientation prop to Gauge panel (#39682) (#39698)
(cherry picked from commit 0bb426ec33)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-09-28 09:51:14 +02:00
Grot (@grafanabot)
6c92beb7fe Variables: Prevents enter key from refreshing page or changing focus (#39666) (#39697)
(cherry picked from commit 9a178e7ba9)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-09-28 06:41:28 +02:00
Grot (@grafanabot)
06cb288848 Alerting: Move spammy log line to debug in the state manager (#39410) (#39434)
(cherry picked from commit fcbcfd232b)

Co-authored-by: gotjosh <josue@grafana.com>
2021-09-27 15:36:52 +01:00
Grot (@grafanabot)
cac03cc7fe Elasticsearch/Prometheus: Set correct service namespace for SigV4 (#39439) (#39652)
Makes sure to set the SigV4 service namespace for Elasticsearch and Prometheus.

Fixes #38440

(cherry picked from commit 45a844e77e)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-09-27 15:18:35 +02:00
Grot (@grafanabot)
ea57ae7470 Update lockfile to correct output after running yarn install (#39646) (#39651)
* Update lockfile to correct output after running `yarn install`

* Chore: Remove caniuse-db since nothing is using it anymore

(cherry picked from commit bbf64722e4)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-09-27 15:13:41 +02:00
Grot (@grafanabot)
bbfb211408 Plugins Catalog: update the available panels on install/uninstall (#39293) (#39405)
* feat(Plugins/Admin): add a function to update panels

* fix(Plugins/Admin): update the available panels on plugin install / uninstall

(cherry picked from commit c8e94a2443)

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2021-09-27 13:50:56 +02:00
Grot (@grafanabot)
07de5e5a5d Bump tmpl from 1.0.4 to 1.0.5 (#39475) (#39644)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 057c9a4fe1)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-27 13:10:02 +02:00
Grot (@grafanabot)
7d9308113a Bump prismjs from 1.24.0 to 1.25.0 (#39450) (#39645)
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.24.0 to 1.25.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.24.0...v1.25.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
(cherry picked from commit 0e60abfe00)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-27 13:09:31 +02:00
Grot (@grafanabot)
5ce3c48c8c InfluxDB: Flux: make $__interval and $__interval_ms work in alerting (#38889) (#39642)
* influxdb: flux: handle $__interval and $__interval_ms in alert-queries

* influxdb: flux: do not handle interval-variable in the frontend

* $__interval should be rounded

* added comment

(cherry picked from commit 9f027e32b7)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-09-27 12:32:54 +02:00
Grot (@grafanabot)
e90558d3b3 Fix: State timeline panel tooltip error when data is not in sync (#39438) (#39634)
* Fix: State timeline panel tooltip error when data is not in sync

* Move check from tooltip to panel

(cherry picked from commit 24475cfdda)

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-09-27 10:15:27 +02:00
Grot (@grafanabot)
e7ca31214b Live: disable centrifuge-js debug mode (#39625) (#39626)
(cherry picked from commit 1d1da09568)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-09-26 20:48:56 -07:00
Grot (@grafanabot)
fee11227da PanelOptions: fix array with siblings (#39620) (#39623)
(cherry picked from commit c9ae46a9ad)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-09-25 17:58:09 +02:00
Grot (@grafanabot)
258f3eae32 Options: support array value paths for panel options (#39499) (#39596)
(cherry picked from commit 01deae2105)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-09-23 10:58:14 -07:00
Grot (@grafanabot)
ac1ca2e4b5 Update PageToolbar.tsx (#39572) (#39585)
(cherry picked from commit 0229146c3b)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-09-23 16:02:47 +02:00
Grot (@grafanabot)
1fc22f6e4d BarGauge: Set cell color to off if numeric value is NaN (#39574) (#39580)
* BarGauge: Set cell color to off if numeric value is NaN

* BarGauge: Pull getCellColor out into a pure function and add unit tests

(cherry picked from commit 6948dbe550)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-09-23 14:59:52 +02:00
Oscar Kilhed
fa6c44b12a Remove ? as header for piechart table legend (#39521) (#39571)
(cherry picked from commit 71122930b9)
2021-09-23 14:21:31 +02:00
Grot (@grafanabot)
53a11de774 Cleanup kv_store alertmanager namespace when disabling unified alerting (#39554) (#39576)
(cherry picked from commit ba4242bdb9)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-09-23 13:53:51 +02:00
Grot (@grafanabot)
4ffa29d959 Fix alerts with evaluation interval more than 30 seconds resolving in Alertmanager (#39513) (#39523)
(cherry picked from commit 27609dc2c5)

Co-authored-by: George Robinson <george.robinson@grafana.com>
2021-09-23 13:06:27 +02:00
Grot (@grafanabot)
22563454b7 Variables: Prevents panel from crashing when using adhoc variable in data links (#39546) (#39568)
* Variables: Prevents panel from crashing when using adhoc variable in data links

* Refactor: uses isAdhoc instead

* Chore: updates after PR feedback

(cherry picked from commit af5296bee7)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-09-23 12:24:24 +02:00
Grot (@grafanabot)
345fb89699 Dashboard: Short url generation works for variables values with spaces (#39552) (#39567)
(cherry picked from commit 65d79d9a30)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-09-23 12:20:47 +02:00
Grot (@grafanabot)
5bf35bd49e influxdb: flux: use more precise start and end timestamps (#39415) (#39520)
* influxdb: flux: use more precise start and end timestamps

* added unit test

(cherry picked from commit bf0dc3ef62)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-09-23 12:13:55 +02:00
Grot (@grafanabot)
aa2dbd63f3 PieChart: Filter NaN values from total calculation (#39503) (#39509)
* Filter NaN values from total calculation

* remove duplicated code, use missing value string for NaN and hidden series

(cherry picked from commit a1d8d6e95e)

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-09-23 12:00:36 +02:00
Grot (@grafanabot)
4d1969c9c4 Alerting: fix the migrated silence file content (#39557) (#39564)
(cherry picked from commit 81e82ebbbd)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-09-23 11:49:22 +02:00
Grot (@grafanabot)
5003b911e2 VersionHistory: Remove global scss causing conflicts elsewhere (#39437) (#39560)
(cherry picked from commit 4aed940738)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-09-23 11:24:55 +02:00
Grot (@grafanabot)
ef7a2bda39 PieChart: Fix sorting for null values in piechart (#39516) (#39556)
* Fix sorting for null values in piechart

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
(cherry picked from commit 4a6e354497)

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-09-23 11:10:24 +02:00
Grot (@grafanabot)
1b8255e317 A11y: Fix fastpass issues for /admin/* pages (#39435) (#39535)
* A11y: Fix fastpass issues for /admin/* pages
See #39429

(cherry picked from commit 00dad0f4e8)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2021-09-22 23:35:05 +01:00
Grot (@grafanabot)
d343d2242d CloudMonitoring: Fix INT64 label unmarshal error (#39441) (#39528)
(cherry picked from commit f76a11c955)

Co-authored-by: Benedikt Spellmeyer <b.spellmeyer@googlemail.com>
2021-09-22 17:42:15 +02:00
Ashley Harrison
a0fe59adef Chore(Navigation): Rename SideMenu -> NavBar (#39483) (#39525)
(cherry picked from commit a4d41d35d0)
2021-09-22 15:38:20 +01:00
Grot (@grafanabot)
04900c63f0 Plugins Catalog: add a few more tests (#39433) (#39470)
* refactor(Plugins/Admin): add an extra line-break between tests

* test(Plugins/Admin): add a couple of more tests for Plugin Details

* fix(Plugins/Admin): fix accidental linting issue

(cherry picked from commit 660afc6279)

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2021-09-22 13:46:22 +02:00
Grot (@grafanabot)
e4862a64f7 Explore: prevent eplore from hiding errors containing refId (#39504) (#39508)
* Explore: prevent eplore from hiding errors containing refId

* Update public/app/features/explore/ResponseErrorContainer.tsx

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
(cherry picked from commit 5f48d0641b)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-09-22 11:59:38 +02:00
Grot (@grafanabot)
036db0f9d0 Plugins Catalog: add unit tests for data-munging (#39338) (#39432)
* test(Plugins/Admin): add tests for the helper functions

* chore(Plugins/Admin): add `error` field to the CatalogPlugin mock

* test(Plugins/Admin): add new properties `error` & `isDisabled` to test expectations

* refactor(Plugins/Admin): make the `errors` param optional everywhere

* fix(Plugins/Admin): fix a rebase bug

(cherry picked from commit fef8e646ea)

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2021-09-22 11:06:07 +02:00
Grot (@grafanabot)
9b9b7e5a45 CloudWatch: Add AWS Gateway ELB metrics and dimensions (#39490) (#39502)
(cherry picked from commit dfb8a4cd13)

Co-authored-by: Ilya Stoliar <52413756+ilyastoli@users.noreply.github.com>
2021-09-22 10:41:48 +02:00
Grot (@grafanabot)
793cd39af3 [v8.2.x] docs: removed nonsense line from standard-options.md (#39383)
* docs: removed nonsense line from standard-options.md (#39381)

(cherry picked from commit 85391c59d0)

* Added extra space.

* Removed space.

Co-authored-by: Nick Reilingh <nreiling@bard.edu>
Co-authored-by: achatterjee-grafana <aparajita.chatterjee@grafana.com>
2021-09-21 10:17:34 -04:00
Grot (@grafanabot)
f5be918e49 Use sdk pkg for gtime (#39354) (#39468)
(cherry picked from commit 64c8d32fe7)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2021-09-21 13:41:31 +02:00
Grot (@grafanabot)
698c13482a Fix Query Editor Row horizontal overflow (#39419) (#39460)
(cherry picked from commit 42b1fa0f62)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-09-21 12:18:24 +01:00
Grot (@grafanabot)
88ea42ab9c Chore: Add go-redis v8 dependency (#39442) (#39448)
* adds redis v8 client dependency

* remove go-redis v5 dependency

(cherry picked from commit 1781c8ec7d)

Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
2021-09-20 22:52:18 +02:00
Grot (@grafanabot)
9ae43a7aaa Schema: unify bar/point/etc visibility modes (#39378) (#39446)
(cherry picked from commit ad3c7529b0)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-09-20 21:52:52 +02:00
Grot (@grafanabot)
ee7c12592d Live: show popup if local changes exist (#36093) (#39440)
* change tracker

* not needed

(cherry picked from commit a6fbb8d724)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-09-20 18:54:51 +02:00
Grot (@grafanabot)
17a5142901 Plugins Catalog: Fix a11y issues (#39407) (#39416)
* refactor(catalog): fix a11y issues in Browse and PluginListCard

* test(catalog): fix failing PluginListCard tests

(cherry picked from commit 4a11d0dab9)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-09-20 15:48:28 +02:00
Grot (@grafanabot)
9e825719f6 prometheus: monaco: do not recalculate not-changing function-list (#39406) (#39413)
(cherry picked from commit dc61edc8ac)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-09-20 14:03:28 +02:00
Grot (@grafanabot)
10c44b4f8d Alerting: Move the unified alerting settings to its own struct (#39350) (#39400)
(cherry picked from commit 2ad82b9354)

Co-authored-by: gotjosh <josue@grafana.com>
2021-09-20 11:02:07 +01:00
Grot (@grafanabot)
395730e2f7 Publishing packages: Add grafana/schema (#39317) (#39325)
(cherry picked from commit 5eb46281a4)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-09-20 11:11:53 +02:00
Grot (@grafanabot)
c418e75fcf A11y/Menu: Add keyboard support to Menu component (#38974) (#39403)
(cherry picked from commit d5b885f958)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2021-09-20 09:37:22 +01:00
Grot (@grafanabot)
56db5cc071 Plugins Catalog: show a confirmation modal when uninstalling a plugin (#39244) (#39402)
* feat(Plugins/Admin): show a confirmation modal when uninstalling a plugin

* refactor(Plugins/Admin): use a helper function for showing/hiding the modal

* test(Plugins/Admin): test if the modal disappears after an uninstall

(cherry picked from commit 02f9564607)

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2021-09-20 10:14:11 +02:00
Grot (@grafanabot)
e272e239d0 Explore: Fixed default data source loading (#37059) (#39379)
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
(cherry picked from commit 64f898c5f6)

Co-authored-by: Assaf Dayan <asfdyn@gmail.com>
2021-09-20 10:11:51 +02:00
Grot (@grafanabot)
972ec9cf85 Variables: Prevents unnecessary duplicate requests (#39394) (#39401)
(cherry picked from commit e696a9ab42)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-09-20 09:55:25 +02:00
Grot (@grafanabot)
635e489a59 ConfirmModal: Fix confirm button focus on modal open (#39328) (#39397)
(cherry picked from commit 06012a8da0)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-09-20 09:45:43 +02:00
Grot (@grafanabot)
333c1da5c7 PluginsCatalog: adding error information about disabled plugins. (#39171) (#39399)
* added errors in plugin list.

* added error to details page.

* adding badge on details page.

* added some more tests.

* Renamed to disabled and will handle the scenario in the plugin catalog.

* Update public/app/features/plugins/admin/components/PluginDetailsDisabledError.tsx

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* fixing some nits

* added missing isDisabeld to the mock.

* adding tests to verify scenarios when plugin is disabled.

* fixed issue with formatting after file changed on GH.

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
(cherry picked from commit f3002931f4)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-09-20 09:43:24 +02:00
Grot (@grafanabot)
cea17c7e49 ValueMappings: Value mapping and specifying only color should not affect value formatting (decimals, unit, etc) (#39315) (#39398)
(cherry picked from commit a899e9be10)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-09-20 09:40:42 +02:00
Grot (@grafanabot)
704ba385aa Make "dist" version of dashboard scuemata directly importable in CUE (#39251) (#39372)
* Update embeds with new paths, remove deprefixing

* Add dist dashboard scuemata, in CUE

Also add tests that ensure all panel plugins with models.cue are
imported by this file, so that we can't go out of sync.

* Remove comment detritus

* Check error return

* Remove hardcoded path prefix from cli validator

(cherry picked from commit 39f2ee7692)

Co-authored-by: sam boyer <sam.boyer@grafana.com>
2021-09-17 17:14:36 -04:00
Grot (@grafanabot)
b21ba77c4f GraphNG: uPlot 1.6.16 (#39260) (#39367)
(cherry picked from commit 474461ba15)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-09-17 15:16:36 -05:00
Grot (@grafanabot)
3a002da406 Pipeline: Make Pa11y ci not mandatory on PR stage (#39285) (#39368)
(cherry picked from commit ef36bbbfbd)

Co-authored-by: Maria Alexandra <239999+axelavargas@users.noreply.github.com>
2021-09-17 13:59:10 -05:00
Grot (@grafanabot)
6f52226c66 Alerting: Metrics should have the label org instead of user (#39353) (#39365)
An user within Grafana has a completely different meaning. Multi-tenancy is done via Organizations as a top-level concept.

(cherry picked from commit 35e5bfce40)

Co-authored-by: gotjosh <josue@grafana.com>
2021-09-17 18:52:54 +02:00
Grot (@grafanabot)
ab5ec6e838 namespace should be AWS/Rekognition (#39094) (#39360)
(cherry picked from commit 7d873fa795)

Co-authored-by: Sumit Bopche <sumitbopche01@gmail.com>
2021-09-17 17:52:49 +02:00
Grot (@grafanabot)
71b0ae9094 BarChart: Fix field enumeration for bar value display and legend items (#39308) (#39357)
(cherry picked from commit 29e8728ef0)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-09-17 17:23:38 +02:00
Grot (@grafanabot)
3b1abd4bd3 prometheus: monaco-query-field: fix metrics-list (#39347) (#39349)
(cherry picked from commit 73873f99cd)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-09-17 15:28:35 +02:00
Andres Martinez Gotor
13b8b7721b backport #39322 (#39344) 2021-09-17 15:22:48 +02:00
Grot (@grafanabot)
8a369feb63 Alerting: Support Unified Alerting with Grafana HA (#37920) (#39342)
* Alerting: Support Unified Alerting in Grafana's HA mode.

(cherry picked from commit 7db97097c9)

Co-authored-by: gotjosh <josue@grafana.com>
2021-09-17 13:23:51 +01:00
Grot (@grafanabot)
499b1f4ff2 influxdb: influxql: more robust resultformat-handling (#39330) (#39339)
(cherry picked from commit d116b2d71b)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-09-17 13:06:44 +02:00
Andres Martinez Gotor
8fcfc4d87e merge main (#39318)
Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com>
2021-09-17 11:23:50 +02:00
Grot (@grafanabot)
c05f195de5 prometheus: monaco: handle multiple query fields at the same time (#39286) (#39320)
(cherry picked from commit 8489575c84)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-09-17 10:24:18 +02:00
Grot (@grafanabot)
49bec6ce4f prometheus: query-editor: better duration-completions (#39284) (#39314)
(cherry picked from commit f8de33da8d)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-09-17 09:41:16 +02:00
Grot (@grafanabot)
d8b03490c3 "Release: Updated versions in package to 8.2.0-beta.1" (#39281) 2021-09-16 11:32:27 +02:00
Andres Martinez Gotor
fc632276f1 Update release notes and what’s new links (#39277) 2021-09-16 10:32:40 +02:00
Torkel Ödegaard
95fd659bfc SideMenu: Remove live section from main side menu (#39278) 2021-09-16 10:12:54 +02:00
Peter Holmberg
4f7e1db57c Graphs: Fix threshold handle being visible in dashboards (#39270) 2021-09-16 08:59:36 +02:00
rodrigosilva-ciandt
b5ed47c95c Docs: Update azuread docs to mention about env variables (#39203)
* Update azuread docs to mention about env variables

Add a note about the name of the environment variables to be used for configuring client_id and client_secret

* Update docs/sources/auth/azuread.md

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

* Update docs/sources/auth/azuread.md

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

* fix typo

* Revert "fix typo"

This reverts commit ff84f70773.

* Fixed typo again, trying to kick start license check.

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <aparajita.chatterjee@grafana.com>
2021-09-15 21:47:03 -04:00
Santiago
c3cf95f383 Revert "Alerting: add template funcs (#38404)" (#39258)
This reverts commit d6fb0181fb.
2021-09-15 19:47:22 -03:00
Santiago
0d2e68537c Alerting: Cleanup template, silence and notification files created du… (#39007)
* Alerting: Cleanup template, silence and notification files created during tests

* Create tempdir for testing, delete afterwards and check for errors

* Refactoring error checks

* Update docs/sources/enterprise/access-control/fine-grained-access-control-references.md

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

* Update docs/sources/administration/configuration.md

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

* Update docs/sources/enterprise/access-control/fine-grained-access-control-references.md

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

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-15 18:48:52 -03:00
Santiago
d6fb0181fb Alerting: add template funcs (#38404)
* Alerting: (wip) add template funcs

* Alerting: (wip) numeric template functions

* Alerting: (wip) template functions

* Test for the "args" function

* Alerting: (wip) Documentation for template functions

* Alerting: template functions - refactor

* code review changes

* disable linter error

* Use Prometheus implementation of TemplateExpander

* Update docs/sources/alerting/unified-alerting/alerting-rules/create-grafana-managed-rule.md

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

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-15 18:48:29 -03:00
Ryan McKinley
cde133fe05 Canvas: use grafana datasource to list resource files (#39204) 2021-09-15 14:48:11 -07:00
Marcus Efraimsson
e31b8f4d33 Chore: Remove SQL engine cache (#39254)
Fix bug with engine cache not updating after data source updated, introduced in #36635.
Removes the SQL engine cache because since #36635 we already have instance caching in place using the SDK instance manager.
This also adds support for disposing cached SQL/xorm engines before a query happens to a data source that has been updated. Done by letting the SQL engine implementing the InstanceDisposer interface.

Fixes #37299
2021-09-15 23:03:25 +02:00
Atif Shoukat Ali
64ff15c157 Live: default to constant label value for pipeline (#39211) 2021-09-15 13:10:52 -07:00
Maarten De Wispelaere
3d0fa70b3b Docs: Added "manageAlerts" provisioning option. (#38836)
* add "manageAlerts" option to prov. docs

* Update docs/sources/administration/provisioning.md

Takes into account suggestion from @domasx2

Co-authored-by: Domas <domasx2@gmail.com>

* Revert "Update docs/sources/administration/provisioning.md
"

This reverts commit d7085355a6.

* Adding content back.

Co-authored-by: Domas <domasx2@gmail.com>
Co-authored-by: achatterjee-grafana <aparajita.chatterjee@grafana.com>
2021-09-15 14:32:30 -04:00
Leon Sorokin
fb091de2c7 BarChart: Fix legend and tooltip colors off by 1 after data refresh (#39234) 2021-09-15 13:10:26 -05:00
sam boyer
2a4b08eab9 Apply cuetsy attrs to PanelSchema (#39112) 2021-09-15 12:27:47 -04:00
Vardan Torosyan
8537b36be2 Access control: Document new permissions restricting access for reloading provisioning configuration (#38906)
* Access control: Document new permissions restricting access for reloading provisioning configuration

* Apply suggestions from code review

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

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-09-15 17:58:20 +02:00
Dan Cech
f8ae71af5b Usage Stats Updates (#39235)
* add randomly-generated anonymous id to usage reports
* include uptime in stats
* add last_sent tracking, remove metricsLogger
2021-09-15 11:47:44 -04:00
Peter Holmberg
74beb9a64c Alerting: Edit thresholds by handle in timeseries panel (#38881)
* POC/Thresholds: Allow thresholds modification directly from the time series panel

* Snapshot updates

* Optimize styles memoization

* change threshold from graph

* renames and logging

* using useeffect to update graph

* Fix react worning about setting state on unmounted component

* revert panelrenderer

* using onFieldConfig change

* use a useeffect

* simplied fieldConfig state

* Do not use plot context in ThresholdControlsPlugin

* Do not throw setState warnings when drag handle is dropped

* Update thresholds position on the graph when updating threshold drag handle

* fix issues with rerenders

* prevent thresholds on conditions with range

* only edit the first threshold

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-09-15 17:35:12 +02:00
Josh Hunt
b3196621f1 AzureMonitor: Fix template variables being cleared out (#39173)
* AzureMonitor: Fix template variables being cleared out

* fix metric namespace from resetting

* tests :)
2021-09-15 16:31:37 +01:00
Giordano Ricci
f79173c99d Explore: Reuse Dashboard's QueryRows component (#38942)
* WIP

* Functional without custom wrapper component, needs highlight

* Remove latency from explore

* Sync eventbus

* Some cleanup & removal of unused code

* Avoid clearing queries when running all empty queries

* Run remaining queries when removing one

* Update snapshots

* fix failing tests

* type cleanup

* Refactor QueryRows

* update snapshot

* Remove highlighter expressions

* minor fixes in queryrows

* remove unwanted change

* fix failing e2e test

* Persist refId in explore url state

* make traces test slightly more robust

* add test for query duplication
2021-09-15 16:26:23 +01:00
Domas
e251863085 Alerting: validate recording rule name (#39136) 2021-09-15 18:24:26 +03:00
Marcus Andersson
aba8af1d59 Docs: plugin migration guide 7.0.0 to 8.0.0 (#38911)
* restructuring to new storybook inspired structure.

* added instructions on how to handle breaking changes in the legend.

* start adding migration steps for 7 -> 8

* added information about the data frame format changes.

* added plugin.json changes.

* added emotion 11 imports.

* added information about theme v1 being deprecated.

* added steps for backend plugin migration.

* added reference to the migrate hooks v6 -> v7.

* docs(pluginmigration): introduce getColorForTheme changes

* Update docs/sources/developers/plugins/migration-guide.md

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* Update docs/sources/developers/plugins/migration-guide.md

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>

* Update docs/sources/developers/plugins/migration-guide.md

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* Update docs/sources/developers/plugins/migration-guide.md

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* Update docs/sources/developers/plugins/migration-guide.md

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* docs(migration-guide): introduce useStyles to v8 deprecation notes

* Apply suggestions from code review

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

* Update docs/sources/developers/plugins/migration-guide.md

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

* Update docs/sources/developers/plugins/migration-guide.md

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

* Update docs/sources/developers/plugins/migration-guide.md

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

* Update docs/sources/developers/plugins/migration-guide.md

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

* suggestion from review.

* Update docs/sources/developers/plugins/migration-guide.md

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

* docs(Migration Guide): update the example for `grafanaDependency`

* docs(Migration Guide): remove the time-series migration part for now

* Update docs/sources/developers/plugins/migration-guide.md

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>

* Update docs/sources/developers/plugins/migration-guide.md

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

* docs(Migration Guide): update wording about plugin signing

* Update docs/sources/developers/plugins/migration-guide.md

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

* Update docs/sources/developers/plugins/migration-guide.md

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

* Update docs/sources/developers/plugins/migration-guide.md

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

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-09-15 17:23:10 +02:00
Andrew Burian
e4c80d1269 Update silences.md (#38834)
* Update silences.md

minor correction in not equals regex

* Update docs/sources/alerting/unified-alerting/silences.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-15 10:59:18 -04:00
Andrej Ocenas
515d6afec3 CloudWatch Logs: Disable query path using websockets (Live) feature (#39231)
* Use only non live branch for querying logs.

* Update tests

* fix lint
2021-09-15 16:28:34 +02:00
Domas
264946f37f Graph: make old graph panel thresholds work even if ngalert is enabled (#38918) 2021-09-15 16:15:50 +03:00
Alexander Kubyshkin
32946ec9b1 Table panel: Fix table column resize handle incorrect z-index (#36934) (#39157) 2021-09-15 13:26:11 +02:00
Erik Sundell
9d3f4f5983 Analytics: Instrument Azure Application Insights (#38553)
* add backend

* read config and pass to backend

* update config docs

* change var name

* use connection string instead of instrumentation key

* add config for endpoint url. update docs

* update default ini

* add spaces

* remove space

* Update docs/sources/administration/configuration.md

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

* Update conf/defaults.ini

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

* Update conf/defaults.ini

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

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-15 13:00:38 +02:00
Serge Zaitsev
6005e6572d Chore: fix param names in ctx.ParamsInt64 (#39223) 2021-09-15 12:14:15 +02:00
Dimitris Sotirakis
fdc681788b InfluxDB: Fix regex to identify / as separator (#39185)
* Fix regex to identify / as separator

* Update regex
2021-09-15 09:37:33 +01:00
Erik Sundell
c621131fff remove code that was duplicated by accident (#39212) 2021-09-15 10:32:01 +02:00
Jim McDonald
1aaa00a1e4 Value mappings: add regex value mapping. (#38931) 2021-09-14 17:15:14 -07:00
Alexander Emelin
15e278e9e1 Live: search for pipeline files in data folder (#39198)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-09-14 22:27:51 +02:00
Alexander Emelin
548b4daa49 Live: up centrifuge to v0.18.4 (#39139) 2021-09-14 11:31:04 -07:00
Leon Sorokin
df6b6e7a98 BarChart: fix stale bar values and x axis labels (#39188) 2021-09-14 12:16:43 -05:00
Serge Zaitsev
063160aae2 Chore: pass url parameters through context.Context (#38826)
* pass url parameters through context.Context

* fix url param names without colon prefix

* change context params to vars

* replace url vars in tests using new api

* rename vars to params

* add some comments

* rename seturlvars to seturlparams
2021-09-14 18:34:56 +02:00
Andrej Ocenas
fb1c31e1b6 CloudWatch Logs: Add link to Xray data source for trace IDs in logs (#39135)
* Refactor log query handling

* Add link to config page

* Change message about missing xray to alert

* Add xrayTraceLinks

* Fix typo in field name

* Fix tests and lint

* Move test

* Add test for trace id link

* lint
2021-09-14 17:02:41 +02:00
Levente Balogh
3c433dc36d Plugins Catalog: refactor the mocking for our tests (#39165)
* refactor(Plugins/Admin): add a type for version coming back from the API

* refactor(Plugins/Admin): only add necessary version information to the state

* test(Plugins/Admin): add a mock for a CatalogPlugin

* test(Plugins/ADmin): add a mock for a LocalPlugin

* test(Plugins/Admin): add a test for a RemotePlugin

* test(Plugins/Admin): add helpers for mocking plugin states

* refactor(Plugins/Admin): mock the Redux state instead of the API responses

This makes it simpler to add new test cases and also makes
the tests easier to reason about.

* refactor(Plugins/Admin): mock the Redux state instead of the API responses
2021-09-14 16:44:13 +02:00
Gábor Farkas
bff3d91b0d prometheus: monaco: better popup-font-size (#39181) 2021-09-14 16:40:44 +02:00
Dimitris Sotirakis
ed810da1f6 Update to grabpl 2.4.6 (#39177) 2021-09-14 16:21:04 +02:00
Marcus Efraimsson
fa9857499b Chore: GetDashboardQuery should be dispatched using DispatchCtx (#36877)
* Chore: GetDashboardQuery should be dispatched using DispatchCtx

* Fix after merge

* Changes after review

* Various fixes

* Use GetDashboardCtx function instead of GetDashboard
2021-09-14 16:08:04 +02:00
gotjosh
2b1d3d27e4 Alerting: Fix bug not creating filepath for silences/nflog if it does not exist (#39174)
We created this filepath just as we're about persist the templates - with the latest change, we now need to create it sooner.
2021-09-14 14:40:59 +01:00
Todd Treece
9b20a24989 Handle enterprise data source tab refreshes (#37567) 2021-09-14 09:24:18 -04:00
Dimitris Sotirakis
f5ecf5c2d9 Cast fields to int64 (#39179) 2021-09-14 14:57:12 +02:00
gotjosh
a2f4344bf2 Alerting: Refactor & fix unified alerting metrics structure (#39151)
* Alerting: Refactor & fix unified alerting metrics structure

Fixes and refactors the metrics structure we have for the ngalert service. Now, each component has its own metric struct that includes the JUST the metrics it uses. Additionally, I have fixed the configuration metrics and added new metrics to determine if we have discovered and started all the necessary configurations of an instance.

This allows us to alert on `grafana_alerting_discovered_configurations - grafana_alerting_active_configurations != 0` to know whether an alertmanager instance did not start successfully.
2021-09-14 12:55:01 +01:00
Maria Alexandra
1edd415ddf Accessibility checks: Phase 2 - Adding Pa11y CI PR stage (#38556)
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-09-14 13:23:17 +02:00
Gábor Farkas
27e3fda7ce influxdb: influxql query editor: fix escaping problematic characters (#39170) 2021-09-14 12:55:43 +02:00
Emil Tullstedt
ad971cc9be LDAP: Search all DNs for users (#38891) 2021-09-14 10:49:37 +02:00
Ryan McKinley
98cca6317d Options: expose a dashboard picker element (#38955) 2021-09-13 23:30:46 -07:00
An
45e67630e8 Live: admin config UI (#39103)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Atif Ali <atifshoukatali@yahoo.com>
2021-09-13 21:09:55 -07:00
achatterjee-grafana
d3a7e0228c Doc: Created a separate topic for AWS authentication (#39012)
* Created new topic for AWS authentication and fixed broken relrefs.

* Applied suggestion from review.

* Update docs/sources/datasources/aws-cloudwatch/aws-authentication.md

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* Applied some suggestions from doc review.

* Applied all doc review.

* Last of the edits, went through and addressed all comments.

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>
2021-09-14 01:30:43 +02:00
Piotr Jamróz
26bb08e1e6 Graphite: Fix drag and drop queries (#39130)
* Do not use "select metric" segment when rendering target

* Use better names for tests
2021-09-13 20:10:35 +02:00
Marcus Efraimsson
2cc0788187 Chore: Disable backend test for now since it adds 10 minutes extra in CI (#39150)
Ref #38586
2021-09-13 19:37:26 +02:00
Peter Leitzen
4f70113ea0 OAuth: Support role mapping for GitLab OAuth (#30025)
* Support `role_attribute_path` for GitLab OAuth

Allow role mapping for GitLab accounts.

Example:

  [auth.gitlab]
  role_attribute_path = is_admin && 'Admin' || 'Viewer'

* Support `role_attribute_path` for GitLab OAuth

Allow role mapping for GitLab accounts.

Example:

  [auth.gitlab]
  role_attribute_path = is_admin && 'Admin' || 'Viewer'

* docs: add docs for role_attribute_path

* Apply suggestions from code review

Co-authored-by: Peter Leitzen <splattael@users.noreply.github.com>

* docs: update example

example should suggest a full configuration

* Apply suggestions from code review

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

* Apply suggestions from code review

Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>

* docs: add suggestions from tech writers

Co-authored-by: Henry Sachs <Henry.Sachs@deutschebahn.com>
Co-authored-by: Henry Sachs <henrysachs@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Fiona Artiaga <89225282+GrafanaWriter@users.noreply.github.com>
2021-09-13 12:44:37 -04:00
David Lamb
89878dae1b OAuth: clarify role & group paths prefer id_token over userinfo api (#39066)
* OAuth: clarify role & group paths prefer id_token over userinfo api (#39066)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
2021-09-13 18:15:15 +02:00
Jorge Luis Betancourt
ae4900e76f Docs: Fix broken link to signed GCS URLs docs (#39144)
The current version of the docs contains a broken link to the GCS docs about signed URLs. The link (since it contains an additional `]`) generates a 404 and also slightly breaks the rendering of the link.
2021-09-13 18:06:42 +02:00
Piotr Jamróz
0026162845 Add handlers to handle time range changes to Explore graphs (#39142) 2021-09-13 18:04:46 +02:00
Ashley Harrison
ca53f5c8da Navigation: Implement active state for items in the Sidemenu (#39030)
* Navigation: Implement active state for items in the Sidemenu

* Navigation: Improve logic for when link is active and extract isSearchActive into a util function

* Navigation: Implement custom rule for dashboards under /d/ and fix minor bugs

* Navigation: only show first matching active state + strip query params from link urls
2021-09-13 16:49:27 +01:00
Will Browne
1a71f0fe13 Chore: Add WARN log if grafana server process is running with elevated privileges (#35205)
* warn on linux

* add warning for grpc plugins

* add windows support

* update go.mod

* reorganize imports

* update naming

* remove Windows logic

* simplify and add check for when UID and EUID don't match

* fix build

* tidy go.mod

* feedback

* cleanup + migrate
2021-09-13 17:46:47 +02:00
Will Browne
40267f5ea0 Plugins: Fix "too many open files" error when verifying signature of plugin with many files (#39100)
* close file at loop end

* less tired approach
2021-09-13 17:46:26 +02:00
Maria Alexandra
04e7736cba Variables: Fix not updating inside a Panel when the preceding Row uses "Repeat For" (#38935)
Added a condition to the `repeatRow` function to only update GridPos if we actually rendered more than 1 repeated row.
2021-09-13 16:47:01 +02:00
Dan Cech
9dfd469afc add daily active counts to stats (#38842)
* add daily active counts to stats

* standardize on int64, update tests
2021-09-13 10:29:35 -04:00
Michael Kopinsky
baff8fe39d Add link to default template (#39106)
This would have been useful to me. Perhaps it would be useful to others?
2021-09-13 10:29:23 -04:00
Alexander Kubyshkin
82f5fb7d6d QueryEditor: Fix copy-paste with unicode special symbol (#39117) 2021-09-13 15:46:43 +02:00
Serge Zaitsev
e1e385b318 Chore: Remove untyped data map from macaron context (#39077) 2021-09-13 15:41:03 +02:00
Marcus Efraimsson
1c892a2fc4 Postgres/MySQL/MSSQL: Add setting to limit maximum amount of rows processed (#38986)
Adds a new setting dataproxy.row_limit that allows an operator to limit the 
amount of rows being processed/accepted in response to database queries 
originating from SQL data sources.

Closes #38975
Ref #39095

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-13 15:27:51 +02:00
Yuriy Tseretyan
5b7dc16c06 Alerting: Clarify group by label in documentation of notification policies (#39105)
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-13 09:03:06 -04:00
Domas
f38c8a2b2b Chore: infer combined reducer state types (#39118) 2021-09-13 16:00:41 +03:00
Ivana Huckova
f172701043 IntervalV2: Use maxDataPoints to calculate correct interval (#39036)
* Use max data points to calculate interval

* Fix mockCalculator to mach Calculator

* Fix incorrect merge, replace queryModel with query
2021-09-13 14:58:32 +02:00
Dominik Prokop
b97e2da2bf Table panel: Make sure width of the tooltip is correct (#39086) 2021-09-13 14:03:32 +02:00
Serge Zaitsev
abfdfcf405 Plugins: Support multiple HTTP methods in plugin.json routes (#39069)
* Fix: support comma-separated methods in plugin.json

* update docs about multiple methods per route
2021-09-13 13:32:11 +02:00
Gábor Farkas
e055ba3525 prometheus: monaco: improved suggestion-displaying (icons, help-text) (#38977)
* prometheus: monaco: better icons in popup

* prometheus: monaco: add help-text to functions

* prometheus: monaco: add help-text to metrics

* better help-text
2021-09-13 12:36:18 +02:00
Piotr Jamróz
88ad9aad42 Explore: Ensure logs volume bar colors match legend colors (#39072)
* Ensure logs volume bar colors match legend colors

* Fix tests
2021-09-13 11:11:49 +02:00
Piotr Jamróz
15b8b738f3 Graphite: Fix Graphite Editor not loading (#39116) 2021-09-13 10:04:52 +02:00
shuotli
b49045794c remove untitled file (#39060) 2021-09-13 09:39:06 +02:00
Alexander Kubyshkin
3cf3e02596 Thresholds: Fix undefined color in "Add threshold" #39113 2021-09-13 07:11:13 +02:00
sam boyer
f8d79d301c Rename Family to Panel in models.cue (#39111) 2021-09-12 14:34:33 -04:00
Ivana Huckova
4952f6fc58 Prometheus: Add interpolation for built-in-time variables to backend (#39051)
* Add grafana variable interpolation to backend

* Remove newlines
2021-09-10 22:56:15 +02:00
Emruz Hossain
a30f560b35 Doc: Fix table not rendering properly in datasources/prometheus.md (#39084)
Signed-off-by: Emruz Hossain <emruz@appscode.com>
2021-09-10 15:39:40 -04:00
Zoltán Bedi
94f1173824 Explore: Refactor graph component to use PanelRenderer (#38914)
* Move SplitOpenFn type to grafana-data

* Use panel renderer instead of Timeseries panel for graph in Explore

* rename splitopen props on panel context
2021-09-10 18:18:22 +02:00
Ryan McKinley
ddd110d0b2 Geomap: include sample geojson files (#39057) 2021-09-10 09:05:03 -07:00
Marcus Efraimsson
0bb7d50ad6 Docs: Improve v8 upgrade notes for SQL data sources (#38792)
Improves SQL data sources documentation in regards to Grafana 8 changes 
and adds some additional upgrade notes in regards to this.

Ref #35390
Ref #38666

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-10 17:38:09 +02:00
Jack Westbrook
c9620b2202 Catalog: Add update text to PluginListCard (#39087)
* feat(catalog): add update info to PluginListCard

* refactor(catalog): use IconName enum and minor styling changes to PluginHeaderDependencies

* fix(catalog): add a semver range to grafanaVersion for dependency checks in InstallControls
2021-09-10 17:17:57 +02:00
Carl Bergquist
cbf16bebc6 CDN: always look for files in the root folder (#39092)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-09-10 16:48:13 +02:00
Ryan McKinley
6bda64cb19 Grafana: include a built-in backend datasource (#38571) 2021-09-10 07:44:47 -07:00
Alexander Emelin
f74421b892 update centrifuge to v0.18.3 (#39085) 2021-09-10 17:20:05 +03:00
Alexander Emelin
2a6871d64e Chore: build on armv6 to catch 32-bit CPU problems (#39078) 2021-09-10 17:10:47 +03:00
Connor Lindsey
b89f8fdfcb Explore: Trace view now shows trace start time in selected timezone (#39054) 2021-09-10 07:52:59 -06:00
Dimitris Sotirakis
ba9d5540b8 Datasources: Introduce response_limit for datasource responses (#38962)
* Introduce response_limit for datasource responses

* Fix lint

* Fix tests

* Add case where limit <= 0 - added parametrized tests

* Add max_bytes_reader.go

* Use new httpclient.MaxBytesReader instead of net/http one

* Fixes according to reviewer's comments

* Add tests for max_bytes_reader

* Add small piece in configuration.md

* Further fixes according to reviewer's comments

* Fix linting - fix test
2021-09-10 16:51:06 +03:00
Alexander Emelin
5fcc9fe193 temporary switch to alternative jsonpath implementation (#39090)
to work with go1.16 and avoid replace in go.mod
2021-09-10 16:24:31 +03:00
Dominik Prokop
e68bf87de1 GraphNG: Remove plot context (#38928)
* Remove plot ctx usage: Tooltip plugin

* Remove plot ctx usage: Context menu plugin

* Remove plot ctx usage: Annotations plugin

* Remove plot ctx usage: Exemplars plugin

* Remove plot ctx usage: EventsCanvas plugin

* Remove plot ctx usage: EventsCanvas/XYCanvas plugin

* Remove plot ctx usage: AnnotationEditor plugin

* Remove plot ctx usage: AnnotationMarker

* Remove plot context

* Do not throw react warnings from uPlot performed hooks
2021-09-10 13:50:21 +02:00
Carl Bergquist
c979b5d868 Upgrade the build pipeline to 2.4.5 (#39080)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-09-10 13:21:44 +02:00
Dominik Prokop
92d736665a TimeSrv: Do not update URL multiple times for same, consecutive range updates (#39083) 2021-09-10 13:05:34 +02:00
Alexander Emelin
e78d880db3 tmp replace of ojg lib to fix builds on 32-bit CPU (#39074) 2021-09-10 13:14:16 +03:00
Sofia Papagiannaki
7af329f385 Alerting: Fix API specification (#38753)
* Alerting: Fix API spec

* Add missing status codes
2021-09-10 12:46:02 +03:00
Levente Balogh
9173898fd6 Plugins Catalog: show Grafana and plugin dependencies (#39062)
* fix(@grafana/data): add a missing optional field to the plugin types

* refactor(Plugins/ADmin): use the type from @grafana/data for plugin dependencies

* fix(Datasources/Graphite): add missing `state` to useEffect dependencies

* refactor(Plugins/Admin): remove unnecessary comment

* feat(Plugins/Admin): add plugin and grafana dependencies to the CatalogPluginDetails

* feat(Plugins/ADmin): show Grafana dependency under plugin details

* feat(Plugins/Admin): show grafana and plugin dependencies for a plugin

* test(Plugins/Admin): add a smoke test for plugin dependencies

* refactor(Plugins/Admin): remove unused style from the header
2021-09-10 11:32:21 +02:00
Hugo Häggmark
fc73bc1161 LibraryElements: Enables creating library elements with specific UID (#39019)
* LibraryPanels: Enables create/update library panels with specific UID

* Chore: added check for uid length after PR comments

* Refactor: creates IsShortUIDTooLong function

* Refactor: adds UID to PATCH endpoint

* Refactor: clarifies the patch code

* Refactor: changes  after PR comments
2021-09-10 11:22:13 +02:00
Gábor Farkas
580b03c952 grafana-ui: monaco dependencies updated (#39027) 2021-09-10 10:36:43 +02:00
Ryan McKinley
be2e9d3501 Live: remove the 'canPublish' check from the UI (#39016) 2021-09-09 09:52:01 -07:00
Sergey Kostrukov
06a616e630 Update Azure SDK with bug fixes (#38952) 2021-09-09 17:32:36 +01:00
gotjosh
39a3bb8a1c Alerting: Persist notification log and silences to the database (#39005)
* Alerting: Persist notification log and silences to the database

This removes the dependency of having persistent disk to run grafana alerting. Instead of regularly flushing the notification log and silences to disk we now flush the binary content of those files to the database encoded as a base64 string.
2021-09-09 17:25:22 +01:00
Alexander Emelin
3ee861f57e Live: declarative processing pipeline, input -> frames -> output, toggle protected POC (#37644) 2021-09-09 19:19:29 +03:00
Carl Bergquist
d19f33b52f Annotations: don't log context.Cancelled as an error when cleaning up (#39024)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-09-09 18:13:14 +02:00
Sofia Papagiannaki
b56bf83c19 Alerting: Fix notification channel migration (#38983) 2021-09-09 18:53:06 +03:00
Connor Lindsey
5511383070 Explore: Add more error handling to Tempo trace download (#39045) 2021-09-09 09:49:45 -06:00
Alexander Emelin
84e821bdef Chore: update plugin sdk to v0.113.0 (#39040) 2021-09-09 08:18:07 -07:00
jcolladokuri
aa45eebf3d Azure Monitor: changed ARG API version to 2021-06-01-preview (#38951)
* changed ARG API version to 2021-06-01-preview

* Fixing lint error
2021-09-09 17:00:16 +02:00
Dominik Prokop
1a566bef47 Alerting/Annotations: Bring back metrics and alert state to annotations tooltip (#39035)
* Normalize alert state name for UI descriptor retrieval

* Bring back alert state and metric values to annotation tooltip

* Make sure alert state is only shown when present

* Update test

* Handle Error alerting satte
2021-09-09 16:58:27 +02:00
dependabot[bot]
f7d105174b Bump axios from 0.21.1 to 0.21.2 (#39020)
Bumps [axios](https://github.com/axios/axios) from 0.21.1 to 0.21.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.21.1...v0.21.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-09 16:50:50 +02:00
Kyle Brandt
fb14769383 Macaron: Continue on invalid slice type to avoid panic (#39004)
Makes the panic go away.
Otherwise I get a reflect: call of reflect.Value.Interface on zero Value
2021-09-09 10:32:18 -04:00
Todd Treece
6e667cacee Alerting: Skip query cache for alert queries (#39010) 2021-09-09 16:16:05 +02:00
Yuriy Tseretyan
6c2884ac37 Alerting: Fix notifier tests to close the temp file (#38992) 2021-09-09 09:56:42 -04:00
Serge Zaitsev
4c921cf120 remove default return handler from macaron (#38887) 2021-09-09 15:41:34 +02:00
Kevin Minehart
792fa63725 set opts.version after getting version from package.json (#39038) 2021-09-09 15:40:08 +02:00
Connor Lindsey
e3c11d2682 Explore: Add filter by trace and span ID to trace to logs feature (#38943)
* Add filter by trace and span ID to trace to logs feature

* Update settings screenshot
2021-09-09 07:24:08 -06:00
Giordano Ricci
dc36f15fbb Prometheus: Revert stepMode functionality (#38982)
* Revert "Prometheus: add functionality to specify desired step interval in dashboards panels (#36422)"

This reverts commit ddf5b65c51.
Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>

* Revert "Explore: add functionality for supporting different step modes in prometheus (#37829)"

This reverts commit f433cfd8d9.
Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>

* Revert stepMode BE implementation from #36796
Co-authored-by: "Ivana Huckova" <ivana.huckova@gmail.com>
2021-09-09 14:05:08 +02:00
Hugo Häggmark
419ead99aa Annotations: Fixes blank panels for queries with unknown data sources (#39017)
* Annotations: Fixes blank panels for queries with unknown data sources

* Chore: fixes strict typescript error
2021-09-09 13:43:05 +02:00
Levente Balogh
1133e56006 Plugins Catalog: migrate state handling to Redux (#38876)
* feat(Plugins/Catalog): start adding necessary apis

* feat(PLugins/Catalog): add extra helpers for merging local & remote plugins

* feat(Plugins/Catalog): add plugin details as an optional field of CatalogPlugin

* feat(PLugins/Catalog): add scaffolding for the new redux model

* feat(PLugins/Catalog): export reducers based on a feature-flag

* refactor(Plugins/Admin): rename api methods

* feat(Plugin/Catalog): add an api method for fetching a single plugin

* feat(Plugins/Admin): try cleaning stuff around plugin fetching

* ffeat(Plugins/Catalog): return the catalog reducer when the feature flag is set

* refactor(Plugins/Admin): fix typings

* feat(Plugins/Admin): use the new reducer for the browse page

* feat(catalog): introduce selectors to search and filter plugins list

* refactor(Plugins/Details): rename page prop type

* refactor(Plugins/Admin): add a const for a state prefix

* refactor(Plugins/Admin): use the state prefix in the actions

* feat(Plugins/Admin): add types for the requests

* refactor(Plugins/Admin): add request info to the reducer

* refactor(Plugins/Admin): add request handling to the hooks & selectors

* refactor(Plugins/Details): start using the data stored in Redux

* refactor(Plugins/Admin): rename selector to start with "select"

* fix(Plugins/Admin): only fetch plugins once

* refactor(Plugins/Admin): make the tab selection work in details

* refactor(catalog): put back loading and error states in plugin list

* refactor(Plugins/Admin): use CatalogPlugin for <PluginDetailsSignature />

* feat(Plugins/Admin): add an api method for fetching plugin details

* refactor(Plugins/Admin): add action for updating the details

* irefactor(Plugins/Admin): show basic plugin details info

* refactor(Plugin Details): migrate the plugin details header

* refactor(Plugins/Admin): make the config and dashboards tabs work

* refactor(Plugins/Admin): add old reducer state to the new one

* feat(catalog): introduce actions, reducers and hooks for install & uninstall

* refactor(catalog): wire up InstallControls component to redux

* refactor(catalog): move parentUrl inside PluginDetailsHeader and uncomment InstallControls

* feat(catalog): introduce code for plugin updates to install action

* refactor(Plugins/Admin): add backward compatible actions

* test(catalog): update PluginDetails and Browse tests to work with catalog store

* refactor(Plugins/Admin): make the dashboards and panels work again

* refactor(Plugins/Admin): fix linter and typescript errors

* fix(Plugins/Admin): put the local-only plugins to the beginning of the list

* fix(Plugins/Admin): fix the mocks in the tests for PluginDetails

* refactor(Plugins/Admin): remove unecessary hook usePluginsByFilter()

* refactor(Plugins/Admin): extract the useTabs() hook to its own file

* refactor(Plugins/Admin): remove unused helpers and types

* fix(Plugins/Admin): show the first tab when uninstalling an app plugin

This can cause the user to find themselves on a dissappeared tab, as the
config and dashboards tabs are removed.

* fix(catalog): correct logic for checking if activeTabIndex is greater than total tabs

* fix(Plugins/Admin): fix race-condition between fetching plugin details and all plugins

* fix(Plugins): fix strict type errors

* chore(catalog): remove todos

* feat(catalog): render an alert in PluginDetails when a plugin cannot be found

* feat(catalog): use the proper store state

* refactor(Plugins/Admin): fetch local and remote plugins in parallell

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>

* style(catalog): fix prettier error in api

* fix(catalog): prevent throwing error if InstallControlsButton is unmounted during install

* refactor(Plugins/Admin): add a separate hook for filtering & sorting plugins

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-09-09 12:20:35 +02:00
Ashley Harrison
e4ca6f2445 Sidemenu: Refactor Sidemenu to use emotion (#38995)
* Chore(Sidemenu): Refactor Sidemenu scss into emotion

* Fix unit test

* Sidemenu: use cx instead of template strings
2021-09-09 09:56:08 +01:00
Dimitris Sotirakis
78b3847014 Copy cue.mod and packages/grafana-schema to container workdir (#38998) 2021-09-09 08:54:36 +03:00
Erik Sundell
cf83d55db9 bump latest (#38991) 2021-09-09 07:28:35 +02:00
Hugo Häggmark
bfb34b9c1a LibraryPanels: Prevents changing the folder when saving an existing library panel (#38978) 2021-09-09 06:21:31 +02:00
Ryan McKinley
a960aae4e7 Timeseries: add wide-to-long, and fix the multi-frame output (#38670)
Co-authored-by: Douglas Thrift <dthrift@flexera.com>
2021-09-08 23:44:51 +02:00
leplan73
258e2cd91e #31983 Changed regexp (#38642) 2021-09-08 11:20:13 -04:00
Andrej Ocenas
91a67ab0fb CloudWatch/Logs: Don't group dataframes for non time series queries for non live path (#38915)
* Use the same grouping function in legacy code

* Add error propagation

* Fix tests

* Fix tests
2021-09-08 16:30:55 +02:00
Erik Sundell
5e38b02f94 Cloudwatch: Migrate queries that use multiple stats to one query per stat (#36925)
* migrate queries that use multiple stats - squash commits

* fix typo
2021-09-08 16:06:43 +02:00
Santiago
ae9343f8ae Clear ngalert configuration table (#38940) 2021-09-08 10:48:50 -03:00
Ashley Harrison
e639b220ce Sidemenu: Use <a> instead of <Link> when target is present (#38987) 2021-09-08 14:39:49 +01:00
Connor Lindsey
6a39ac7407 Explore: Download traces as JSON in Explore Inspector (#38614)
* Transform dataframe to jaeger format

* Transform dataframe to Zipkin format

* Add endpoint type and shared to Zipkin

* Transform dataframe to OTLP format

* Add data tab tests and note in inspector docs

* Remove comments and logs

* Resolve typescript strict errors

* Update docs/sources/explore/explore-inspector.md

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

* Update docs

* Improve OTLP conversion to include service info and additional tags

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-08 07:04:27 -06:00
Marcus Andersson
3bb2ee9de6 Plugins: added the possibility to manage field config state outside of the panel renderer. (#38944) 2021-09-08 15:02:44 +02:00
Grot (@grafanabot)
7f49ad4152 ReleaseNotes: Updated changelog and release notes for 8.1.3 (#38972)
* ReleaseNotes: Updated changelog and release notes for 8.1.3

* ReleaseNotes: Updated changelog and release notes for 8.1.3

Co-authored-by: Erik Sundell <erik.sundell@grafana.com>
2021-09-08 13:33:42 +02:00
Gabriel MABILLE
8585273c29 AccessControl: Restrict more the access to the data sources configuration tab (#38966)
Co-authored-by: Emil Tullstedt <sakjur@users.noreply.github.com>
2021-09-08 13:15:21 +02:00
George Robinson
5caf6cb369 Change templateCaptureValue to support using template functions (#38766)
* Change templateCaptureValue to support using template functions

This commit changes templateCaptureValue to use float64 for the value
instead of *float64. This change means that annotations and labels can
use the float64 value with functions such as printf and avoid having to
check for nil. It also means that absent values are now printed as 0.

* Use math.NaN() instead of 0 for absent value
2021-09-08 10:46:15 +01:00
Hugo Häggmark
17f9bc138e LibraryPanels: Fixes update issues related to library panels in rows (#38963) 2021-09-08 10:53:55 +02:00
Ashley Harrison
b82fe083d7 Sidemenu: Refactor SignIn to use SideMenuItem (#38882) 2021-09-08 09:48:30 +01:00
Gábor Farkas
cbdba57924 Prometheus: fix popup positioning in monaco-based query-field (#38964)
* prometheus: monaco: fix popup positioning

* added explanation comment
2021-09-08 10:23:59 +02:00
Gabriel MABILLE
e9631fdf7c AccessControl: "Add data source" button needs create and write rights to be enabled (#38934) 2021-09-08 09:47:55 +02:00
Ryan McKinley
10ffc9a754 Tables: optionally show field type icon in tables (#38855) 2021-09-08 00:44:41 -07:00
Oscar Kilhed
ecf40f0331 PieChart: Display "No data" when there is no data (#38808)
PieChart: Display "No data" when there is no data
2021-09-08 09:07:09 +02:00
Will Browne
40643ee023 track signature files + add warn log (#38938) 2021-09-08 08:49:05 +02:00
Djairho Geuens
0383becc46 OAuth: Make generic teams URL and JMES path configurable (#37233)
OAuth: Make generic teams URL and JMES path configurable
2021-09-07 19:57:20 -05:00
Marcus Efraimsson
fbdaf56a84 Postgres/MySQL/MSSQL: Fix region annotations not displayed correctly (#38936)
Fix region annotations not displayed correctly when returning timeend column 
as epoch timestamp and by that making sure that the returned data frame field 
named timeend is treated as time type.

Fixes #38533
2021-09-08 01:54:48 +02:00
Ryan McKinley
9aa03acfa6 Chore: remove sql testdata (#38945) 2021-09-07 16:35:52 -07:00
Alexander Emelin
342b1426e5 live: update centrifuge to v0.18.2 (#38925) 2021-09-07 21:05:24 +03:00
An
b14b267bed Canvas Panel: icon/image select modal (#38844)
* feature: add icon modal

* fix: make apply send on change

* move to resource folder

* allow empty

* type

* icon modal

* fix: edit styles

* fix: edit styles

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-09-07 19:46:20 +02:00
Torkel Ödegaard
51776e6bd3 UsageStats: Add connected users and client (#38811) 2021-09-07 18:50:28 +02:00
Ashley Harrison
b24a4630a6 Chore(Navigation): Add feature toggle for new navigation work (#38929) 2021-09-07 17:24:44 +01:00
Gabriel MABILLE
a811d7d76f Access control: Add a scope to Data Sources GET endpoint (#38933) 2021-09-07 17:13:11 +02:00
Andreas Gerstmayr
4e22823a49 uPlot: Fix default value for plot legend visibility (#36660)
Fixed the condition, as the last part of `!seriesConfig.show ?? false`
will never be evaluated because `!seriesConfig.show` always yields a
boolean.
2021-09-07 16:20:29 +02:00
Ivana Huckova
19d4213df6 Prometheus: Fix validate selector in metrics browser (#38921)
* Fix match[] param in loki and prometheus

* Update loki series match param
2021-09-07 15:44:45 +02:00
Ashley Harrison
9ce5edfa6b Docs: Update 'Whitelisted' to 'Allowed' per style guide (#38897)
* Docs: Updated 'Whitelisted' to 'Accepted' to match what's shown in the frontend now.

* Apply suggestions from code review

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

* Docs: Update frontend to match docs

* kick drone

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-09-07 13:30:26 +01:00
Hugo Häggmark
8826540c09 Dashboard: Forces panel re-render when exiting panel edit (#38913) 2021-09-07 12:46:21 +02:00
Torkel Ödegaard
a7c367968c Docs: Clarify delta value (#38824) 2021-09-07 12:10:13 +02:00
Dimitris Sotirakis
5f10843203 Chore: Rename scripts/star dir to scripts/drone (#38910)
* Rename scripts/star dir to scripts/drone

* Update CODEOWNERS after paths change
2021-09-07 12:15:04 +03:00
Hugo Häggmark
058ac6becf Chore: Bumps Immer, Redux Toolkit, Redux and React Redux (#38872)
* Chore: Bumps immer and redux/toolkit

* WIP: transpile errors

* Chore: bumps redux and react redux

* Chore: removes unused dispatch

* make alerting compile with updated redux toolkit

* Test: Fixes broken test

* Chore: fixes strict errors

Co-authored-by: Domas <domasx2@gmail.com>
2021-09-07 10:44:47 +02:00
Gábor Farkas
3f0f448201 influxdb: influxql: explicit min-interval check (#38873)
* influxdb: influxql: explicit min-interval check

* added test
2021-09-07 09:49:34 +02:00
Alex Khomenko
9f833681b1 Docs: Fix typos in merge pull request guide (#38904)
* Fix typos

* Update contribute/merge-pull-request.md

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

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-09-07 09:46:10 +02:00
ying-jeanne
c989f0fbbe SQL: Migrate to use SDK contracts (#36635)
* convert SQLs to use sdk contracts

* make draft

* postgres

* intermedia

* get datasourceinfo filled at the beginning of the service

* move the interval into package because of cyclict  import and fix all postgres tests

* fix mysql test

* fix mssql

* fix the test for pr https://github.com/grafana/grafana/issues/35839

* fix some issue about intervalv2 package

* update sql test

* wire migration for SQLs

* add sqls to the background process

* make it register instead of register and start

* revert formatting

* fix tests

* fix linter

* remove integration test

* Postgres test fix

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-09-07 09:35:37 +02:00
Serge Zaitsev
51aeb717a4 inject modified request into context (#38807) 2021-09-07 09:23:16 +02:00
Dimitris Sotirakis
2316c3942b Chore: Tidy up starlark files into folders (#38874)
* Tidy up starlark files into folders

* Rename steps

* Make sure lib.star only contain steps - added services.star and utils.star
2021-09-07 10:21:49 +03:00
sam boyer
269c01ea5c Chore: fix function name spelling (#38901)
Should be appendTransformerAfter().
2021-09-06 21:15:39 -07:00
sam boyer
96473004db Refactor dashboard scuemata to introduce composition slots, allow unspecified panels to validate, and re-enable devenv validation (#38727)
* Re-enable devenv dashboard validation

* Open up dashboard schema composition points

* Introduce composition space at front of scuemata

* Refactor go code to use new composition structure

* Bunch of small cleanups in dashboard.cue

* Enable both base and dist tests of devenv

* Get rid of obsolete CUE loading hacks

* Skip weird failures on these tests

Really don't seem to be testing for what we intend them to be testing
for.
2021-09-06 18:53:42 -04:00
Marcus Efraimsson
0ecc24d1c0 Docs: Contribution guideline for merging pull requests (#38800)
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-09-06 17:13:13 +02:00
Marcus Andersson
49f7278063 OAuth: add docs for disableAutoLogin param (#38752)
* OAuth: add docs for disableAutoLogin param

* Apply suggestions from code review

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

* OAuth: add availability note for disableAutoLogin

* Update docs/sources/auth/overview.md

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

* Update docs/sources/auth/overview.md

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

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-09-06 16:55:30 +02:00
Maria Alexandra
98dc925175 Dashboard: Fix UIDs are not preserved when importing/creating dashboards thru importing .json file (#38659)
* Dashboard: Fix UID not preserved on import

* Import Dashboard: add e2e test to verify uid is preserved when importing dashboard

* E2e: Use dynamic uid

* Tests: fixes e2e test

* Chore: adds back waits

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2021-09-06 15:50:28 +01:00
Myrle Krantz
dc381dbf8e Improving "Accepted Cookies" terminology (#38886)
Updating text to be more descriptive and inline with our values.
2021-09-06 15:28:31 +01:00
Gabriel MABILLE
cf7034ee50 AccessControl: add permission to datasource permissions navigation selection (#38758) 2021-09-06 16:18:18 +02:00
Ivana Huckova
d5956ce4b7 Loki: Fix error handling, remove legacy condition (#38633)
* Fix error handling, remove legacy condition

* Fix strict errors in Loki and lower error count

* Update
2021-09-06 15:28:54 +02:00
shuotli
d2f3bb6491 Azure Monitor: Add Azure resource overview dashboard (#38801)
* Add azure resource overview dashboard

* fix width
2021-09-06 09:44:45 +02:00
Gábor Farkas
6cab44d73a InfluxDB: InfluxQL: handle new-alerting better (#37588)
* influxdb: influxql: alert: use already-computed interval-value when available

* reverted by-mistake changed import

* simplify code

now we can rely on DataQuery.Interval always being good

* removed unnecessary test

* fix lint-error
2021-09-06 09:33:07 +02:00
Gábor Farkas
01f1c550bf old-alert: interval calculation: apply default-min-interval of 1ms (#38835) 2021-09-06 09:24:32 +02:00
Uchechukwu Obasi
774f0a0d01 e2e guide: improves data-testid code snippet to be clear and understandable (#38791) 2021-09-06 07:03:02 +01:00
Hugo Häggmark
3b0910e470 LibraryPanels: Prevents duplicate repeated panels from being created (#38804)
* LibraryPanels: Prevents duplicate repeated panels from being created

* Tests: adds tests

* Chore: updates after PR feedback
2021-09-06 05:57:01 +02:00
Kevin Minehart
d913e46e37 Chore: move build command to importable package (#38726)
* move build command to importable package & clean up
2021-09-03 11:24:21 -05:00
MichaIng
68c7d054bf Update PID file location form /var/run to /run (#35739)
Signed-off-by: MichaIng <micha@dietpi.com>
2021-09-03 10:50:13 -05:00
nikki-kiga
2a2f10da7e Transformations: Use fieldMatchers for convertFieldType and add doc (#38769) 2021-09-03 04:18:06 +02:00
Will
caef39b6a4 Chore: fix typo (#38838) 2021-09-02 19:14:17 -07:00
nikki-kiga
9e7ad70e5d FieldNamePicker: Add preview details for field type and values (#38768)
* add field type and values preview to picker

* add more details to description

* add icon to Select and specify icons for FieldType

* remove description
2021-09-02 17:04:02 -07:00
achatterjee-grafana
27e1c49534 Fixed a couple of broken relrefs. (#38833) 2021-09-02 20:11:25 +02:00
Ryan McKinley
9a0040c0ae Canvas: add alpha canvas panel and initial interfaces (#37279) 2021-09-02 10:01:08 -07:00
Sofia Papagiannaki
c19d65b1ad Alerting: some fixes for updating rules via the API (#38764)
* Alerting: Allow updating rules if quota are exceeded

* Check for rule UID uniqueness in POST request
2021-09-02 19:38:42 +03:00
Dimitris Sotirakis
e5cdf9e4d1 Add type/ci as label on CI related file changes (#38831) 2021-09-02 18:22:51 +02:00
gotjosh
dd502f22eb Alerting: Fix alert flapping in the internal alertmanager (#38648)
* Alerting: Fix alert flapping in the alertmanager

fixes a bug that caused Alerts that are evaluated at low intervals (sub 1 minute), to flap in the Alertmanager.
Mostly due to a combination of `EndsAt` and resend delay.

The Alertmanager uses `EndsAt` as a heuristic to know whenever it should resolve a firing alert, in the case that it hasn't heard
back from the alert generation system.

Because grafana sent the alert with an `EndsAt` which is equal to the `For` of the alert itself,
and we had a hard-coded 1 minute re-send delay (only applicable to firing alerts) this meant that a firing alert would resolve in the Alertmanager before we re-notify that it still firing.

This commit, increases the `EndsAt` by 3x the the resend delay or alert interval (depending on which one is higher). The resendDelay has been decreased to 30 seconds.
2021-09-02 16:22:59 +01:00
Giordano Ricci
7f1327d1ed Elasticsearch: Prevent pipeline aggregations to show up in terms order by options (#38448)
* Elasticsearch: Prevent pipeline aggregations to show up in terms order by options

* fix optional props

* Refactor & add tests

* Fix & lower strict ts count

* Update public/app/plugins/datasource/elasticsearch/components/QueryEditor/BucketAggregationsEditor/SettingsEditor/TermsSettingsEditor.test.tsx

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

* Update public/app/plugins/datasource/elasticsearch/components/QueryEditor/BucketAggregationsEditor/SettingsEditor/TermsSettingsEditor.test.tsx

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

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-09-02 16:00:40 +02:00
Connor Lindsey
fb17f053d3 Explore: Standardize trace query field styling (#38796) 2021-09-02 07:30:11 -06:00
Ashley Harrison
ea65e11c44 Sidemenu: Various accessibility improvements (#38823) 2021-09-02 14:17:57 +01:00
erdnaxe
5f521bd9ae packaging: systemd unit hardening (#38109) 2021-09-02 07:36:35 -05:00
Zoltán Bedi
7e6cf14c84 Fix: Include Buffer in webpack build (#38819) 2021-09-02 14:18:07 +02:00
malcolmholmes
b22c2543d0 Build: Upgrade grabpl to 2.4.2 (#38820) 2021-09-02 13:03:32 +01:00
Friedrich Mäckle
8c8ccc8b91 Check navigator property exists before accessing it (#38745)
* Check navigator property exists before acecssing it

* fix: pass undefined to Intl.DateTimeFormat if no locale can be determined

* Update packages/grafana-data/src/datetime/formats.ts

replacing ternary by or

Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>

Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
2021-09-02 11:47:25 +01:00
Dimitris Sotirakis
a5ce61b539 Chore: Update to alpine:3.14.2 (#38813)
* Update apline to 3.14.2

* Remove libcrypto1.1 libssl1.1 version dependencies

* Update grabpl version
2021-09-02 12:57:11 +03:00
blackmetal23
fe65021c14 Update Dockerfile (#38785)
Update alpine 3.14.1 to 3.14.2
CVE : https://github.com/alpinelinux/docker-alpine/issues/199
2021-09-02 11:45:33 +03:00
Kyle Brandt
f524cdb5ee devenv: update prom random_data for go1.17 (use go install) (#38763)
* devenv: update prom random_data for go1.17 (use go install)
* restore env vars and tags to install cmd
2021-09-02 10:32:09 +02:00
Piotr Jamróz
bd95856ff9 Graphite: Migrate to React (part 6: Remove AngularJS Query Editor) (#37919)
* Add UMLs

* Add rendered diagrams

* Move QueryCtrl to flux

* Remove redundant param in the reducer

* Use named imports for lodash and fix typing for GraphiteTagOperator

* Add missing async/await

* Extract providers to a separate file

* Clean up async await

* Rename controller functions back to main

* Simplify creating actions

* Re-order controller functions

* Separate helpers from actions

* Rename vars

* Simplify helpers

* Move controller methods to state reducers

* Remove docs (they are added in design doc)

* Move actions.ts to state folder

* Add docs

* Add old methods stubs for easier review

* Check how state dependencies will be mapped

* Rename state to store

* Rename state to store

* Rewrite spec tests for Graphite Query Controller

* Update docs

* Update docs

* Add GraphiteTextEditor

* Add play button

* Add AddGraphiteFunction

* Use Segment to simplify AddGraphiteFunction

* Memoize function defs

* Fix useCallback deps

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Add more type definitions

* Remove submitOnClickAwayOption

This behavior is actually needed to remove parameters in functions

* Load function definitions before parsing the target on initial load

* Add button padding

* Fix loading function definitions

* Change targetChanged to updateQuery to avoid mutating state directly

It's also needed for extra refresh/runQuery execution as handleTargetChanged doesn't handle changing the raw query

* Fix updating query after adding a function

* Simplify updating function params

* Migrate function editor to react

* Simplify setting Segment Select min width

* Remove unnecessary changes to SegmentInput

* Extract view logic to a helper and update types definitions

* Clean up types

* Update FuncDef types and add tests

* Show red border for unknown functions

* Autofocus on new params

* Extract params mapping to a helper

* Split code between params and function editor

* Focus on the first param when a function is added even if it's an optional argument

* Add function editor tests

* Remove todo marker

* Fix adding new functions

* Allow empty value in selects for removing function params

* Add placeholders and fix styling

* Add more docs

* Create basic implementation for metrics and tags

* Post merge fixes

These files are not .ts

* Remove mapping to Angular dropdowns

* Simplify mapping tag names, values and operators

* Simplify mapping metrics

* Fix removing tags and autocomplete

* Simplify debouncing providers

* Ensure options are loaded twice and segment is opened

* Remove focusing new segments logic (not supported by React's segment)

* Clean up

* Move debouncing to components

* Simplify mapping to selectable options

* Add docs

* Group all components

* Remove unused controller methods

* Create Dispatch context

* Group Series and Tags Sections

* Create Functions section

* Create Section component

* use getStyles

* remove redundant async/await

* Remove

* remove redundant async/await

* Remove console.log and silent test console output

* Do not display the name of the selected dropdown option

* Move Section to grafana-ui

* Update storybook

* Simplify SectionLabel

* Fix Influx tests

* Fix API Extractor warnings

* Fix API Extractor warnings

* Do not show hidden functions

* Use block docs for better doc generation

* Handle undefined values provided for autocomplete

* Basic integration

* Move creating state to context.tsx

* Update tests

* Rename test

* Clean up dependencies

panel.targets is not needed for interpolation - it happens in the data source itself. It was used only to show query ref in the the dropdown for the segment.

* Update time range when it changes

* Change action name

* Simplify segments cloning

* Remove redundant variable

* Use styles instead of direct css

* Update docs

* Remove angular wrappers

* Remove redundant tests

* Section -> SegmentSection

* Simplify section styling

* Remove redundant div

* Fix unit tests

* Simplify SegmentSection component

* Use theme.spacing

* Use empty label instead of a single space label

* Remove targetFull

It was used in the past two store the query interpolated with sub-queries inside the model and send both to the backed (interpolated and not interpolated). This has been changed though - the logic has been moved away from model to the data source where interpolation happens and now only interpolated query is passed meaning targetFull is not needed anymore.

* Revert "Remove targetFull"

This reverts commit 499f8b33

* Bring back calculating targetFull

* Clean up

* Add missing dep

* Add missing dep in tests

* Fix time range synchronization

* Fix warning message

* Remove unused type

* Synchronize changes to the query

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-09-02 10:18:14 +02:00
Piotr Jamróz
f941390631 Deprecate browser access mode for the Graphite data source. (#38783)
* Deprecate browser access mode for Graphite

* Update docs

* Update copy
2021-09-02 10:16:17 +02:00
Ryan McKinley
ae702caec6 Transformer: labels to fields should not also merge frames (#38671) 2021-09-01 20:18:50 +02:00
Ashley Harrison
205c672417 Sidemenu: Refactor TopSectionItem and BottomNavLinks into SideMenuItem (#38755)
* Sidemenu: Refactor TopSectionItem and BottomNavLinks into SideMenuItem

* Update failing snapshot

* BottomSection: Convert tests to RTL + add some extra unit tests
2021-09-01 17:16:50 +01:00
Ole Kristian (Zee)
92934af741 Monaco: Add javascript and typescript support (#38703) 2021-09-01 08:55:01 -07:00
Ryan McKinley
e461c722bf Live: prepend orgId when publishing from HTTP (#38775) 2021-09-01 17:54:34 +02:00
Ryan McKinley
e980f8531a StateTimeline: merge threshold values (#35073) 2021-09-01 17:43:57 +02:00
Domas
7fe3599ab1 Docs: document editing cortex/loki recording rules, namespaces and groups (#38547)
* document recording rule creation

* namespace/group editing docs

* explain namespaces & groups

* Jita's suggestions
2021-09-01 11:35:33 -04:00
Ryan McKinley
7af2d1a629 Dashboards: support merging in new panels and options (#37905) 2021-09-01 08:03:56 -07:00
Serge Zaitsev
643c7fa0cb Chore: update all +build statements (#38782) 2021-09-01 17:38:56 +03:00
Alex Khomenko
ea8d9d77f4 Admin: User list tweaks (#38750)
* Setup filter

* Enable filtering users by active in last 30 days

* Add loading state

* Update last active age strings

* Tweak user list

* Use theme spacing

* Improve table's accessibility

* Add more aria-labels
2021-09-01 16:53:58 +03:00
Will Browne
e39410c094 Cloud-Monitoring: Ensure service gets dependencies (#38788)
* ensure cloud-monitoring gets service dependencies

* all one line
2021-09-01 15:29:21 +02:00
Gabriel MABILLE
9f29241a0c AccessControl: add one-dimensional permissions to datasources (#38070)
* AccessControl: add one-dimensional permissions to datasources in the backend

* AccessControl: add one-dimensional permissions to datasources in the frontend (#38080)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-09-01 15:18:17 +02:00
Uchechukwu Obasi
4e8ab0512c PlayList: add delete functionality to remove playlist (#38120)
* WIP: add delete functionality to playlist

* fixes deleted item to be removed instantly without manual refresh

* update confirmModal to reference playlist name

* refactor confirmModal message to be clear enough

* WIP: some unit tests for the playlistPage

* added more tests and did some cleanup

* some code refactoring

* adds ability for user roles to control playlist delete

* some abstraction to cleanup code

* modified alert message for delete button to correspond with action

* tried a better approach to modify the alert message

* fixes playlist lookup on each render

* update handlers to not use anonymous function

* exposed getBackendSrv().get api to fetch all playlist

* used better naming convention

* removes unecessary async/await construct

* some code refactoring

* used the correct param structure
2021-09-01 13:23:57 +01:00
Dominik Prokop
326455a9b8 Annotation tooltip: Bring back links styles (#38780) 2021-09-01 13:30:30 +02:00
Hugo Häggmark
55e20bbf04 LibraryPanels: Separates name from panel title (#38707)
* LibraryPanels: Separates name from panel title

* WIP

* Chore: fixes update for duplicate lib panels

* Chore: reverts implementation

* Chore: show library options only for library panels

* Chore: ui fixes after PR comments

* Chore: fixes issue when creating library panels
2021-09-01 13:27:43 +02:00
Joan López de la Franca Beltran
6cfb640a0b Chore: Refactor securedata to remove global encryption calls from dashboard snapshots (#38714)
* Add encryption service

* Add tests for encryption service

* Inject encryption service into http server

* Replace encryption global function usage in login tests

* Migrate to Wire

* Move Encryption bindings to OSS Wire set

* Chore: Refactor securedata to remove global encryption calls from dashboard snapshots

* Fix dashboard snapshot tests

* Remove no longer user test

* Add dashboard snapshots service tests

* Refactor service initialization

* Set up dashboard snapshots service as a background service

Co-authored-by: Tania B <yalyna.ts@gmail.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-09-01 13:05:15 +02:00
Jack Westbrook
a4e253bcf9 Fix: Prevent yarn start exiting early on TS errors (#38777) 2021-09-01 12:31:50 +02:00
Serge Zaitsev
c3ab2fdeb7 Macaron: remove custom Request type (#37874)
* remove macaron.Request, use http.Request instead

* remove com dependency from bindings module

* fix another c.Req.Request
2021-09-01 11:18:30 +02:00
Jack Westbrook
56f61001a8 Chore: Bump Lerna to v4 (#38751) 2021-09-01 11:00:09 +02:00
Dimitris Sotirakis
89716f2806 Remove ci-build-windows folder (#38778) 2021-09-01 10:44:08 +02:00
SaintMalik
316d78f5c3 Fix typos in CHANGELOG.md (#38741) 2021-09-01 11:29:37 +03:00
Alex Khomenko
7f27a2e1af Add licensing card background images (#38774) 2021-09-01 10:46:03 +03:00
Kai Hayashi
6e0f18b13a CloudWatch: Update Period auto to take retention into account (#37424)
* now to get it to build

* modified names, added the 455 day case, and added a comment

* removed wireguard override i used for my local

* updated the docs
2021-09-01 09:44:47 +02:00
shuotli
f2c4346cc4 Azure Monitor: Add support for numeric fields in ARG (#38728)
* Fix todouble/toreal not working

* fix test
2021-09-01 09:02:08 +02:00
Hugo Häggmark
38ca27428d LibraryPanels: Removes library panel icon from the panel header (#38749) 2021-09-01 06:14:21 +02:00
Nathan Rodman
ad610a1916 Alerting: Fix bug for default value in silence matcher (#38735) 2021-08-31 20:51:36 -07:00
Scott Lepper
4f479de88e Grafana UI: Table - add sticky table footer (#38094)
* table footer to allow showing summary data from the table panel
2021-08-31 12:37:10 -04:00
Dan Cech
681de1ea89 add key/value store service (#36868)
* add key/value store service

* don't export kvStoreSQL, consumers should interact with KVStore & NamespacedKVStore

* add del method, avoid ErrNotFound (#38627)

* switch value column to medium text

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-08-31 11:05:45 -04:00
achatterjee-grafana
dd24995852 Doc: Add granularity to files and folder permissions. (#38732)
* Added note as suggested by Simon. Also, adjusted content and resized image.

* Minor wording change.
2021-08-31 10:43:13 -04:00
Tania B
6b7b9f5158 Chore: Remove global encryption calls from sqlstore (#38588)
* Add encryption service

* Add tests for encryption service

* Inject encryption service into http server

* Replace encryption global function usage in login tests

* Refactor UpdatePluginSetting

* Refactor EncryptSecureSettings

* Fix wire.go

* Refactor service initialization

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-08-31 15:01:23 +02:00
Gábor Farkas
aa7a6633b8 old-alert: set interval and max-data-points (#38434)
* alerting: old-alerting: handle interval + maxdatapoints better

* fixed failing test

* refactor: use interval instead of tsdb

* fix typo

* added unit-test

* added comment

* refactor
2021-08-31 14:49:30 +02:00
Jack Westbrook
fec50115b0 Chore: Bump dangerously-set-html-content to 1.0.9 (#38622) 2021-08-31 14:10:56 +02:00
Tania B
bfde29d107 Chore: Remove global encryption calls from authinfoservice (#38591)
* Add encryption service

* Add tests for encryption service

* Inject encryption service into http server

* Replace encryption global function usage in login tests

* Migrate to Wire

* Refactor authinfoservice to use encryption service

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-08-31 14:00:13 +02:00
Gábor Farkas
a5d11a3bef Prometheus: monaco-based query-editor-field, first step (#37251)
* prometheus: add monaco-based query-field

for now it is behind a feature-flag

* added new trigger character

* better separate grafana-specifc and prom-specific code

* better styling

* more styling

* more styling

* simpler monaco-import

* better imports

* simplified code

* simplified type imports

* refactor: group completion-provider files together

* renamed type

* simplify type-import

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

* handle no-metric-name autocompletes

* updated comment

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-08-31 13:46:13 +02:00
Jack Westbrook
8d3b31ff23 Build: Upgrade Webpack 5 (#36444)
* build(webpack): bump to v5 and successful yarn start compilation

* build(webpack): update postcss dependencies

* build(webpack): silence warnings about hash renamed to fullhash

* build(webpack): enable persistent cache to store generated webpack modules / chunks

* build(webpack): prefer eslintWebpackPlugin over tschecker so eslint doesn't block typechecking

* chore(yarn): run yarn-deduplicate to clean up dependencies

* chore(yarn): refresh lock file after clean install

* build(webpack): prefer output.clean over CleanWebpackPlugin

* build(webpack): prefer esbuild over babel-loader for dev config

* build(babel): turn off cache compression to improve build performance

* build(webpack): get production builds working

* build(webpack): remove phantomJS (removed from grafana in v7) specific loader

* build(webpack): put back babel for dev builds no performance gain in using esbuild in webpack

* build(webpack): prefer terser and optimise css plugins for prod. slower but smaller bundles

* build(webpack): clean up redundant code. inform postcss about node_modules

* build(webpack): remove deprecation warnings flag

* build(webpack): bump packages, dev performance optimisations, attempt to get hot working

* chore(storybook): use webpack 5 for dev and production builds

* build(storybook): speed up dev build

* chore(yarn): refresh lock file

* chore(webpack): bump webpack and related deps to latest

* refactor(webpack): put back inline-source-map, move start scripts out of grafana toolkit

* feat(webpack): prefer react-refresh over react-hot-loader

* build(webpack): update webpack.hot to use react-refresh

* chore: remove react-hot-loader from codebase

* refactor(queryeditorrow): fix circular dependency causing react-fast-refresh errors

* revert(webpack): remove stats.errorDetails from common config

* build(webpack): bump to v5 and successful yarn start compilation

* build(webpack): update postcss dependencies

* build(webpack): silence warnings about hash renamed to fullhash

* build(webpack): enable persistent cache to store generated webpack modules / chunks

* build(webpack): prefer eslintWebpackPlugin over tschecker so eslint doesn't block typechecking

* chore(yarn): run yarn-deduplicate to clean up dependencies

* chore(yarn): refresh lock file after clean install

* build(webpack): prefer output.clean over CleanWebpackPlugin

* build(webpack): prefer esbuild over babel-loader for dev config

* build(babel): turn off cache compression to improve build performance

* build(webpack): get production builds working

* build(webpack): remove phantomJS (removed from grafana in v7) specific loader

* build(webpack): put back babel for dev builds no performance gain in using esbuild in webpack

* build(webpack): prefer terser and optimise css plugins for prod. slower but smaller bundles

* build(webpack): clean up redundant code. inform postcss about node_modules

* build(webpack): remove deprecation warnings flag

* build(webpack): bump packages, dev performance optimisations, attempt to get hot working

* chore(storybook): use webpack 5 for dev and production builds

* build(storybook): speed up dev build

* chore(yarn): refresh lock file

* chore(webpack): bump webpack and related deps to latest

* refactor(webpack): put back inline-source-map, move start scripts out of grafana toolkit

* feat(webpack): prefer react-refresh over react-hot-loader

* build(webpack): update webpack.hot to use react-refresh

* chore: remove react-hot-loader from codebase

* refactor(queryeditorrow): fix circular dependency causing react-fast-refresh errors

* revert(webpack): remove stats.errorDetails from common config

* revert(webpack): remove include from babel-loader so symlinks (enterprise) work as before

* refactor(webpack): fix deprecation warnings in prod builds

* fix(storybook): fix failing builds due to replacing css-optimise webpack plugin

* fix(storybook): use raw-loader for svg icons

* build(webpack): fix dev script colors error

* chore(webpack): bump css-loader and react-refresh-webpack-plugin to latest versions

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-08-31 12:55:05 +02:00
Ashley Harrison
b40d48258d Sidemenu: Fix logout button (#38747) 2021-08-31 11:33:38 +01:00
Dimitris Sotirakis
3fb5afb9e3 Update Dockerfile (#38744) 2021-08-31 12:53:17 +03:00
Ashley Harrison
7a242afcd6 Sidemenu: Refactor BottomNavLinks to use SideMenuDropDown (#38598)
* Sidemenu: Attempt to refactor BottomNavLinks to use SideMenuDropDown

* BottomNavLinks: Rewrite existing enzyme tests in RTL

* BottomNavLinks: Use object spreading instead of slicing
2021-08-31 10:37:51 +01:00
Selene
e47a60f511 Add filter to search users by active (#38637)
* Add filter to search users by active

* Fix query
2021-08-31 11:35:16 +02:00
shuotli
f1529b83a2 [Azure monitor] Support variables for Azure Resource Group subscription picker (#38620) 2021-08-31 09:15:35 +02:00
Ryan McKinley
f567bef0bf Geomap: hide legend for markers with single threshold (#38734) 2021-08-30 23:22:19 -07:00
Dimitris Sotirakis
8e2ee0a1c8 Chore: Update to Golang 1.17 (#38608)
* Update to golang 1.17

* Further updates

* Run go mod tidy on go 1.17

* Apply suggestions from code review

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

* Use build-container:1.4.2

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-08-31 09:19:26 +03:00
Leon Sorokin
05e5b67a99 Colors: rename getThresholdRange() -> getGradientRange() (#38688)
* Colors: use visible y scale range for non-threshold gradients schemes

* rename instead
2021-08-30 15:04:02 -05:00
Tania B
a0108a1e5b Encryption: Extract encryption into service (#38442)
* Add encryption service

* Add tests for encryption service

* Inject encryption service into http server

* Replace encryption global function usage in login tests

* Apply suggestions from code review

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Migrate to Wire

* Undo non-desired changes

* Move Encryption bindings to OSS Wire set

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-08-30 19:39:55 +02:00
Kyle Brandt
79e79fe244 Alerting/Docs: Clarify NoData option (#38451)
* Alerting/Docs: Clarify NoData option
for #37665

* Update docs/sources/alerting/unified-alerting/alerting-rules/create-grafana-managed-rule.md

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

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-30 09:13:04 -04:00
Zoltán Bedi
dbc7464e78 Toolkit: fix matchmedia missing (#38694) 2021-08-30 14:36:15 +02:00
Levente Balogh
82c038bd06 Plugins Catalog: add signature information to details (#38558)
* refaactor: extract the tab labels into a const

* feat: list - show signature badge for enterprise plugins as well

* feat(plugins): add a component for showing plugin signature details

* feat: add a component for showing signature info under details

* feat: add a component for displaying signature info in details header

* feat: extract the plugin details header into a separate component

* feat: show signature information on the plugins details page

* refactor(Plugins): use an enum instead of an object

* refactor(Plugins): use more strict typing for tabs

* refactor(Plugins): use function declaration instead of fat-arrow for components

* fix(Plugins): fix typo

* fix: make installed plugin config an optional param again

* refactor: cache plugin meta requests

* refactor: move PLUGIN_TAB_LABELS to the types module
2021-08-30 14:00:11 +02:00
Serge Zaitsev
d15cbe4b4e Macaron cleanup (#37795)
* simplify some dependency injection in macaron
* remove unused internal server error handler from macaron
* remove internal server error handler from the router
* remove unused combo router api
* remove unused parts of the macaron router
2021-08-30 11:48:34 +02:00
Peter Holmberg
74afe809af Alerting: Add DateTimePicker on view rule page (#38592)
* export datetimepicker

* minor fixes to the datetime picker

* correct datetime to picker

* move datetime calc to function

* set maxDate

* set maxDate

* wrap in useCallback
2021-08-30 11:42:37 +02:00
Zoltán Bedi
38b398feb4 Fix: panel crash after esc (#38646) 2021-08-30 09:57:07 +02:00
Alex Khomenko
d90c822e69 Fix key prop when rendering options (#38595) 2021-08-30 06:59:51 +02:00
Oscar Kilhed
b248c119ef TimeSeries: Use graph min/max for percentage threshold (#38528)
* TimeSeries: Use graph min/max as baseis for percentage threshold calculation.

* respect hard and soft axis limits for % threshold steps

* revert state-timeline changes

* enable by-threshold coloring in histogram and barchart

* revert yMin

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-08-29 15:46:17 -05:00
sam boyer
96557ecadc Change cuetsy annotation "targetType" to "kind" (#38564)
Mirrors change made upstream in cuetsy
2021-08-29 14:29:06 -04:00
knuzhdin
3df001db93 ImageRendering: fix leakage of the rendering inflight counter (#34607) 2021-08-28 09:05:03 +02:00
Christoph Deil
06c9f7e13b Fix typo in whats-new-in-v8-1.md (#38660)
* Fix typo in whats-new-in-v8-1.md

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

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

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-28 00:28:56 +02:00
nikki-kiga
a54a139176 Transformations: Convert field types to time string number or boolean (#38517)
* outline string to time

add stringToTime transformer

start to add format

add type and dateformat

rename stringToTime to fieldConversion

add more type support and use FieldNamePicker

add field conversion transformation

* adjust for performance feedback

rename and adjust labels and widths

shorten labels and null values

rename to convertFieldType

update test

* make updates
2021-08-27 13:49:31 -07:00
Leon Sorokin
3c72f1678f Colors: fix by-value/hex3 & Single color schemes in Gradient mode (#38656) 2021-08-27 15:06:28 -05:00
Leon Sorokin
4e2516d12a GraphNG: fix crash when trying to diff missing timeRange prop (#38654) 2021-08-27 12:40:33 -05:00
Dominik Prokop
1be53b4f3b TimeSeries: Add per-axis grid visibility toggle (#38502)
* Allow grid lines visibility control to XYChart and TimeSeries

* Move grid lines config to field config (axis)

* Fix merge

* Auto grid mode

* Fix ts

* Align naming

* Update packages/grafana-ui/src/components/uPlot/config/UPlotConfigBuilder.test.ts

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* Update packages/grafana-ui/src/components/uPlot/config/UPlotConfigBuilder.test.ts

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* remove 'grid' from props diff array since field.config.custom.* is handled by structureRev diffing

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-08-27 12:30:42 -05:00
Giordano Ricci
b5e4a0a39a Elasticsearch: Only show numbers in histogram field autocomplete (#38631) 2021-08-27 17:19:44 +01:00
Jack Westbrook
5898824a48 Chore: Fix version format (#38649) 2021-08-27 18:12:37 +02:00
Petros Kolyvas
4a73e0f9a8 Docs: Remove an unnecessary legacy alerts notification webhook listing and reduce promotional content (#38644)
* Removed an unecessary webhook listing and modified some text to reduce promotion for specific tooling.

* Updated doc content with Eve and Ursula's review.

* Removed "the".

Co-authored-by: achatterjee-grafana <aparajita.chatterjee@grafana.com>
2021-08-27 11:17:58 -04:00
Olof Bourghardt
8da634f780 Loki: add tests for addAdHocFilters (#38594)
* Loki: add tests for addAdHocFilters

* Change description of test

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Replace ADD_FILTER with "=" operator in test description

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Loki: refafctor test for addAdHocFilter

* Loki: refactor tests for better readability

* Remove comments

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

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-08-27 17:06:22 +02:00
Jack Westbrook
beeb8330c4 Chore: Update packages version to 8.2.0-pre (#38635)
* chore(packages): run packages:prepare script

* chore: update package.json version

* chore: put back semver compliant version
2021-08-27 17:01:19 +02:00
Giordano Ricci
eaca54a9f2 Elasticsearch: change terms default min_doc_count to 1 (#38632) 2021-08-27 14:22:12 +01:00
Armand Grillet
72d296843d Docs: clarify state of Unified Alerting (#38603)
* Docs: clarify state of Unified Alerting

* Update docs/sources/alerting/unified-alerting/_index.md

Co-authored-by: Kyle Brandt <kyle@grafana.com>

* Adjusted note to move below the introduction.

* Fixed a typo and added beta notes.

* Minor typo fix.

* Docs: remove innacurate beta label for Grafana 8.0

Grafana 8.0 is not in beta, only unified alerting.

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: achatterjee-grafana <aparajita.chatterjee@grafana.com>
2021-08-27 15:09:28 +02:00
Ikko Ashimine
202f295e51 Chore: Fix typo in nodes.go (#38636)
commmon -> common
2021-08-27 14:57:41 +02:00
Marcus Efraimsson
e872032a2b Docs: Add v8.1 upgrade note regarding unencrypted data source passwords (#38449)
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-27 13:23:56 +02:00
Alexander Emelin
a95a40d87d Live: allow connections with request host matching origin host (#38538) 2021-08-27 13:26:28 +03:00
Andres Martinez Gotor
b25eb0aa74 AzureMonitor: Fix wrong merge (#38623) 2021-08-27 11:31:17 +02:00
Torkel Ödegaard
bbaf6a23bb Docs: Add info and links about our hosted services to our grafana install docs (#38544)
* Add info and links about our hosted services to our grafana install docs

* review updates

* Update docs/sources/installation/debian.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>
2021-08-27 10:46:45 +02:00
Marcus Efraimsson
0ef5831332 v8.2.0-pre.0 2021-08-27 10:39:53 +02:00
Olof Bourghardt
458bced826 Jaeger: fix bug where query is executed twice (#38550)
* Jaeger: add empty callback to QueryField onBlur to stop query from being run twice

* Jaeger: add wait call on 500ms to accomodate for debouncing by the QueryField component
2021-08-27 10:36:18 +02:00
Alex Khomenko
a15e33e693 Admin: remove Redux from ServerStats (#38581)
* Admin: remove Redux from ServerStats

* Admin: Fix import
2021-08-27 11:09:17 +03:00
Alex Khomenko
c08d5eeda0 Update the location of the server stats tab (#38548) 2021-08-27 10:04:57 +03:00
Gábor Farkas
8e88600c04 style-guide: frontend: describe directory naming style (#38607)
* style-guide: frontend: describe directory naming style

* apply recommended changes

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

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-08-27 08:27:56 +02:00
Dimitris Sotirakis
d7daaa19df Add CODEOWNERS for CI related code (#38606) 2021-08-27 09:06:15 +03:00
Jack Westbrook
2cb141d4ec Plugins: Refactor installation buttons component (#37642)
* refactor(catalog): split out installcontrols into multiple components

* test(catalog): update tests for plugindetails page

* refactor(catalog): rename installcontrols -> index

* refactor(catalog): remove redundant curlies

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* tests(plugindetails): fix assertions and naming of tests

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* refactor(installcontrols): prefer enum over duplicate union type, rename disabled prop

* refactor(installcontrols): use PluginStatus enum for installcontrols pluginStatus

* refactor(installcontrols): remove redundant curlies

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2021-08-26 17:15:43 +02:00
idafurjes
568549e810 Bug: Return empty plugins.DataTimeSeriesSlice when the frame field vector is epmty (#38587)
* Add check if the vector is empty

* Use Rows() instead of Len() on field

* Remove redundant condition
2021-08-26 16:39:50 +02:00
Jack Westbrook
5339275793 Grafana UI: Fix TS error property css is missing in type (#38078) 2021-08-26 16:00:52 +02:00
Stephanie Hingtgen
785072086c Add event after datasource create (#38467)
* Add event after datasource create
2021-08-26 08:50:05 -05:00
Kevin Minehart
1ced2bc6df move main.go logic out of commands (#38555)
* move main.go logic out of commands
2021-08-26 15:42:22 +02:00
Domas
2847f25781 Alerting: UI to edit cortex/loki namespace & group names, group eval interval (#38543) 2021-08-26 16:40:27 +03:00
Dimitris Sotirakis
00886afaf1 Force use versions of libcrypto1.1 and libssl1.1 (#38585) 2021-08-26 15:22:53 +02:00
Ashley Harrison
a583f7e160 Sidemenu: Refactor SideMenuDropDown (#38554)
* SideMenuDropDown: Refactor to be more component-ey + rewrite tests in RTL

* SideMenuDropDown: Rename childLinks -> items

* Rename mockChildLinks -> mockItems as well
2021-08-26 14:08:27 +01:00
Marcus Efraimsson
b231afd50f Docs: Fix error in provisioning docs for discord notifier (#38579)
Fixes an error in provisioning docs for discord notifier referencing the wrong 
name of the "message content" setting.

Fixes #38494
2021-08-26 12:29:29 +02:00
Marcus Efraimsson
2f07af1b54 Chore: Skip test TestDevenvDashboardValidity for now (#38577)
Skipping TestDevenvDashboardValidity test for now to resolve broken 
test-backend step in main/branches. Did also run scripts/stripnulls.sh 
hence the devenv dashboard changes.
2021-08-26 11:45:57 +02:00
Marcus Efraimsson
ec88295a0b Testdata: Fix proper initialization (#38576)
Fixes #38566
2021-08-26 11:39:04 +02:00
Torkel Ödegaard
d5ed4e9c8c Geomap: Minor style fixes (#38532)
* Fixed hover font-weight, option casing, and added simple test dashboard with 3 panels

* Update theme colors

* Style tweaks to legend

* Updated

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-26 10:17:03 +02:00
Dimitris Sotirakis
12320dda3c Elasticsearch: Fix metric names for alert queries (#38546)
* Export fieldName to var

* Add empty string as frame name
2021-08-26 09:20:38 +02:00
Dimitris Sotirakis
8a04af412e Build pipeline: Cleanup build-main pipeline steps (#38484)
* Refactor dependencies

* Regenerate drone.yml

* Reorder steps in starlark files

* Make build depend on test

* Make test steps depend on lint

* Make gen-version step depend on build steps

* Refactor step dependencies

* Move e2e-tests step before upload_cdn

* Sync with main
2021-08-26 10:11:22 +03:00
idafurjes
7faea40674 API: Add short url validation (#38436)
* Add short url validation
Path should not contain string ../

* Update pkg/api/short_url.go

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

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-08-26 09:07:27 +02:00
dependabot[bot]
0b945f3db4 Bump actions/cache from 2.1.5 to 2.1.6 (#34867)
Bumps [actions/cache](https://github.com/actions/cache) from 2.1.5 to 2.1.6.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.5...v2.1.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-26 08:27:37 +02:00
achatterjee-grafana
e32e135c73 Docs move "visualizations" folder up one level in TOC (#38523)
* Moved Visualizations folder one level up. Fixed a bunch of broken relrefs.

* More broken relrefs.

* Fixed the last of the broken relrefs

* Adjusted weight and added alias.

* Added aliases to a bunch of visualization topics.

* More topics with aliases.

* More aliases, adjusted some weight and other metadata information.
2021-08-25 14:14:00 -04:00
Ryan McKinley
9267014a45 Schema: export existing types in @grafana/data|ui (#38518) 2021-08-25 09:59:03 -07:00
Connor Lindsey
76ade24f2f Add catch around JSON trace upload for more error handling (#38520) 2021-08-25 10:08:46 -06:00
Ivana Huckova
d1b6132302 Loki: Fix ad-hoc filter when used with parser (#38542)
* Fix ad hoc filter when used with parser

* Update
2021-08-25 16:08:41 +02:00
Patrick O'Carroll
2e772d41a7 Themes: align hover and focus opacity (#38498)
* new warning and success color in light theme, slight tweak to primary text

* changed hover opacity to the same as focues opacity

* Updated generated files

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-08-25 15:34:19 +02:00
Ashley Harrison
b30882bd2b Sidemenu: Refactor DropDownChild (#38509)
* DropDownChild: Refactor DropDownChild to be more component-like

* Rewrite tests in RTL

* Let's not do this just yet...
2021-08-25 14:27:04 +01:00
Arve Knudsen
78596a6756 Migrate to Wire for dependency injection (#32289)
Fixes #30144

Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
2021-08-25 15:11:22 +02:00
sam boyer
e61bc33163 Move dashboard scuemata to grafana-schema (#38470)
* Relocate dashboard scuemata to grafana-schema

* Update assorted tests, vars with dashboard path

* Remove crufty commented var

* Not sure...why that failed

* Remove prefix from base dashboard path var

* Move cue/ui remnants into grafana-schema

* Update import paths in plugin models

* Remove mudball, add package statements

* Remove cuegen.sh

Wooooo we ain't got no codegen

* Revert "Remove mudball, add package statements"

This reverts commit 9bed3098f1.

* Tidy up all the cue files

* Move dashboard scuemata into scuemata/ subdir

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-25 06:55:04 -04:00
Olof Bourghardt
a19ad25eaa Jaeger: support running queries with keyboard shortcut (#37958)
* Jaeger: add QueryField component

* Remove unused imports

* Fix e2e test so that it checks for QueryField component

* Remove comments

* Fix failing e2e test
2021-08-25 11:30:32 +02:00
Ashley Harrison
7c97b9d03f QueryEditor: Don't use _.defaults as it mutates the query prop directly (#37965)
* QueryEditor: Don't use _.defaults as it mutates the query prop directly

* QueryEditor: Update the query type on mount if none exists

* QueryEditor: Mutate in the constructor instead of render

* Apply defaults immutably in render
2021-08-25 10:19:02 +01:00
Witek Bedyk
65501cbad3 Licensing: Provide correct URL for AGPL license (#36917)
* Provide correct link for AGPL license

* Change LicenseURL to point go Grafana OSS page

* Keep utm_source query parameter

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

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-08-25 10:43:43 +02:00
dependabot[bot]
f8a0c38763 Bump path-parse from 1.0.6 to 1.0.7 (#37789)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-25 10:17:34 +02:00
dependabot[bot]
c5df1c6430 Bump tar from 4.4.13 to 4.4.15 (#37536)
Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.15.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.13...v4.4.15)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-25 10:13:08 +02:00
Will Browne
1618d5ad6f use most appropriate func for registering core plugins (#38497) 2021-08-25 10:08:48 +02:00
Patrick O'Carroll
84de946daa changed opacity on disabled, secondary and secondary shade in both themes (#38453) 2021-08-25 09:47:46 +02:00
Domas
2e8a7c1161 set basic auth for prometheus backend ds requests (#38496) 2021-08-25 10:05:17 +03:00
dependabot[bot]
7751c0a706 Bump ws from 6.2.1 to 6.2.2 (#35085)
Bumps [ws](https://github.com/websockets/ws) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/commits)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-25 08:51:05 +02:00
Dimitris Sotirakis
29d0a1536c Chore: Update grabpl version to 2.3.3 (#38516)
* Update grabpl version to 2.3.1

* Update grabpl version to 2.3.2

* Update grabpl version
2021-08-25 08:50:41 +03:00
Gabriel MABILLE
f9273d0d37 AccessControl: Add a mock (#38515) 2021-08-24 20:12:48 +02:00
gotjosh
14a0519338 Alerting: Remove Multiorg alertmangaer from the top-level services (#38506)
Removes the registration of the multi-org alertmanager, it is started as a subservice of ngalerting.
2021-08-24 19:11:28 +02:00
gotjosh
2f27a5240b Alerting: Fix flake on test receiver tests (#38511)
* Alerting: Fix flake on test receiver tests

* Make the actual result from the API be sorted

* Use the correct letters
2021-08-24 17:22:11 +01:00
Alex Khomenko
6e639f3c72 Admin: Update stats page UI (#38014)
* Add StatCard

* Style cards

* Update types

* Add tests

* Move stats tab into licencing

* Prevent UI jumps when loading stats

* Fix merge conflicts

* Revert docs format
2021-08-24 19:13:48 +03:00
Ryan McKinley
fcceb5716d Schema: move existing grafana/ui models into schema (#38469) 2021-08-24 08:22:34 -07:00
Dimitris Sotirakis
e8faa2c900 Build pipeline: Cleanup PR pipeline steps (#38447)
* Refactor dependencies

* Regenerate drone.yml

* Reorder steps in starlark files

* Make build depend on test

* Make test steps depend on lint

* Make gen-version step depend on build steps
2021-08-24 17:07:06 +02:00
Stephanie Closson
8bb9600cc6 Chore: Updated plugin schema docs ref PR@38463 (#38501)
* updated plugin schema docs ref PR@38463

* Documentation updates as per review
2021-08-24 11:45:41 -03:00
dependabot[bot]
d1ed0cb275 Bump dns-packet from 1.3.1 to 1.3.4 (#34861)
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v1.3.1...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-24 16:34:51 +02:00
Dimitris Sotirakis
da72dc55cb Update to golang:1.16.1-alpine3.14 (#38508) 2021-08-24 16:13:12 +02:00
Maria Alexandra
856cb1d80f Pipeline: Fix pa11y ci when server is not available and fix publish frontend metrics step (#38485) 2021-08-24 13:44:52 +02:00
Patrick O'Carroll
8fb4882a01 Light theme palette update (#38487)
* new warning and success color in light theme, slight tweak to primary text

* Update generated light theme scss

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-08-24 13:23:01 +02:00
David Parrott
7fbeefc090 Alerting: create wrapper for Alertmanager to enable org level isolation (#37320)
Introduces org-level isolation for the Alertmanager and its components.

Silences, Alerts and Contact points are not separated by org and are not shared between them.

Co-authored with @davidmparrott and @papagian
2021-08-24 11:28:09 +01:00
Karl Persson
7ebf4027a7 Access Control: refactor permission evaluator to be more flexible (#35996)
* add a more flexible way to create permissions

* update interface for accesscontrol to use new eval interface

* use new eval interface

* update middleware to use new eval interface

* remove evaluator function and move metrics to service

* add tests for accesscontrol middleware

* Remove failed function from interface and update inejct to create a new
evaluator

* Change name

* Support Several sopes for a permission


* use evaluator and update fakeAccessControl

* Implement String that will return string representation of permissions
for an evaluator

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-08-24 11:36:28 +02:00
Domas
9d8f61c738 Alerting: allow creating/editing recording rules for Loki and Cortex (#38064) 2021-08-24 10:31:56 +02:00
Dimitris Sotirakis
309d263531 Chore: Add public/lib to .prettierignore (#38479)
* Add public/lib to .prettierignore

* Fixes according to reviewer's comments
2021-08-24 10:11:44 +02:00
Vicky Lee
c5f384c654 docs: update cloud data sources README links (#37820)
* docs: update cloud data sources README links

* Update public/app/plugins/datasource/cloudwatch/README.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 public/app/plugins/datasource/grafana-azure-monitor-datasource/README.md

* Update public/app/plugins/datasource/cloud-monitoring/README.md

Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-24 10:11:07 +02:00
Olof Bourghardt
05b0df2254 Zipkin: support running queries with keyboard shortcut (#37960)
* Zipkin: replace input field with QueryField component

* Fix failing tests

* Remove console.log

* Partially migrate test to react

* Zipkin: finish migration from enzyme to react

* Remove comments
2021-08-24 09:52:34 +02:00
idafurjes
ccab9611cb API: Add theme validation (#38432)
* Add theme validation

* Fix lint for const
2021-08-24 08:41:15 +02:00
Leon Sorokin
403bbd0144 GraphNG: optimize measureText(), drop estimation for y-axis auto-sizing (#38475) 2021-08-24 00:11:19 -05:00
Villena Guillaume
4cb87b6b60 Annotations Panel: Show annotations end time if present (#38425)
* Annotation Panel: Show annotation end time if present

* Added hyphen between dates
2021-08-23 20:57:44 -07:00
Travis Patterson
6548cd89af Add honeycomb plugin logo (#38461) 2021-08-23 14:33:55 -06:00
Ryan McKinley
425ec7ca9e Schema: create a new schema package for basic models (#38409) 2021-08-23 13:03:41 -07:00
Stephanie Closson
8d126de305 Added enterprise features to the schema (#38463) 2021-08-23 16:39:26 -03:00
Tharun Rajendran
2156980edb Datasource: add button to navigate to explore from settings (#36119)
Fixes #13737
2021-08-23 09:23:49 -06:00
Maria Alexandra
ef8e95ac7f Pipeline: Revert a11y changes to fix publish frontend metrics step (#38452) 2021-08-23 16:45:59 +02:00
Karl Persson
864c526d9a Access Control: Update docs with the correct scope name (#38444)
* Update docs with the correct scope name

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-08-23 16:39:40 +02:00
Connor Lindsey
a2525005e5 Manually set query type in Tempo explore on component mount (#38408)
* Manually set query type in Tempo explore on component mount
2021-08-23 07:51:45 -06:00
Ivana Huckova
74fef637af Prometheus: Use default POST method if no httpMethod provided (#38446)
* Prometheus: If no httpMethod, use default POST method

* Use http.MethodPost
2021-08-23 15:25:40 +02:00
Alex Khomenko
49fdab7e43 grafana/ui: Clarify InlineField docs (#38100)
* grafana/ui: clarify InlineField docs

* grafana/ui: revert formatting

* grafana/ui: revert formatting[2]

* grafana/ui: do not format code samples

* grafana/ui: disable mdx formatting
2021-08-23 16:25:09 +03:00
Peter Holmberg
eba21f3145 Alerting: Append appSubUrl to links if present (#38069)
* append appSubUrl if present

* remove null check
2021-08-23 14:57:30 +02:00
idafurjes
769b7a5865 Bug: Register OpenTSDB with correct service name (#37581)
* Bug: Register OpenTSDB with correct service name

* USe Register instead of RegisterAndStart
2021-08-23 14:56:53 +02:00
Maria Alexandra
6396f05320 Pa11y: add logs to a11y step in terminal to provide more info of status (#38445) 2021-08-23 14:54:33 +02:00
Jeremy Price
9a71cec1f0 Access Control: Make the evaluator prefix match only (#38025)
* Make the evaluator prefix match only

* Handle empty scopes

* Bump version of settings read role

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2021-08-23 14:03:20 +02:00
Villena Guillaume
1b3eecddcd Annotation Panel: Fix annotation with end time not being centered (#38423)
* Annotation Panel: Fix annotation with end time not being centered

* Update public/app/plugins/panel/annolist/AnnoListPanel.tsx

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-23 12:03:27 +01:00
Dimitris Sotirakis
64cb000d37 Chore: Add e2e-tests-server as dependencies on steps that publish packages (#38059)
* Add e2e-tests-server as dependencies on steps that publish packages

* Sign drone yaml
2021-08-23 13:39:16 +03:00
Jeremy Price
e124167d05 access control: 1527/Correct grammar in usage-scenarios (#35142)
* First revision

* Update docs/sources/enterprise/access-control/usage-scenarios.md

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

* Update docs/sources/enterprise/access-control/usage-scenarios.md

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

* Note about creating roles

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
2021-08-23 11:37:19 +02:00
Uchechukwu Obasi
ab74bb78b2 A11y metrics: fixes frontend script that pushes to CI Stat dashboard (#38435) 2021-08-23 11:36:39 +02:00
Maria Alexandra
b579a707e3 A11y - Add Pa11y CI in main pipeline to collect a11y issues (#37741)
Co-authored-by: 
Hugo Häggmark <hugo.haggmark@gmail.com>
thisisobate <obasiuche62@gmail.com>
2021-08-23 10:08:01 +02:00
Gábor Farkas
9e8035ef30 devenv: influxdb: update telegraf config (#37835) 2021-08-23 09:38:47 +02:00
Jack Westbrook
bafe16368a Chore: Migrate CustomScrollbar to react-custom-scrollbars-2 (#38013) 2021-08-23 09:28:58 +02:00
idafurjes
b9a538aff0 Bug: Add check before delete org (#38056)
* Add check before delete org

* Fix comment

* Simpify check if signed in user belongs to the org

* Add check on login if user has and existing org
change error code to 400, when org can not be deleted

* Roll back last commit, regarding an different issue
2021-08-23 08:58:35 +02:00
Ryan McKinley
8c4c05493b Dashboard: keep live timeseries moving left (v2) (#37769) 2021-08-20 14:48:55 -07:00
Travis Patterson
32e11434da Fire event after datasource delete (#38090) 2021-08-20 14:51:31 -06:00
Ryan McKinley
b88f8bacf3 DataFrame: add frame type key to DataFrame structure (#38092) 2021-08-20 09:26:40 -07:00
achatterjee-grafana
d38ce58045 replace "blah" with "example". (#38114) 2021-08-20 10:09:21 -04:00
Will Browne
ae17cce316 Plugins: Add Hide OAuth Forward config option (#36306)
* add prop

* add angular conf

* invert naming

* undo md changes

* fix wording

* y u fail 4 me

* refactor(datasourcesettings): rename hideForwardOAuthIdentityOption prop

* refactor(datasourcesettings): rename scope.hideForwardOAuthIdentityOption

* Update contribute/style-guides/e2e.md

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

* feat(datasourcehttpsettings): add showForwardOAuthIdentityOption to angular wrappers & template

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-20 15:53:54 +02:00
Olof Bourghardt
5231660627 Explore: use GrafanaTheme2 (LiveLogs component) (#37452)
* Explore: use GrafanaTheme2

* Explore: add correct style values. Add theme.v1 to the styles that were uncertain

* Logs: add use of GrafanaTheme2 in varioius log components

* Styles: add some of the correct values recieved via feedback

* Add correct style values

* Update public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>

* Update public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>

* Update public/app/plugins/panel/dashlist/styles.ts

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>

* Explore: fix failing tests

* Explore: add styling values from v2

* Fix small type error

* Replace v1 styles with v2 styles

* Remove forgotten v1 values

* Remove more v1 style values

* Apply correct style value to LogRowMessage

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

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-08-20 14:53:03 +02:00
Kevin Minehart
b3c4b20953 Docker: Update base alpine version (fix CVE-2021-36159) (#38088)
* update base alpine version and update apk packages in Dockerfile

* update base alpine version

* don't need to apk update

* remove space

* Update to alpine 3.14.1

Co-authored-by: Malcolm Holmes <mdh@odoko.co.uk>
2021-08-20 12:54:03 +01:00
Jack Westbrook
d9a2dd8a4b Chore: Align enzyme dependencies in root and jaeger workspace (#38006)
* chore: align enzyme dependencies in root and jaeger workspace

* chore(yarn): refresh lock file
2021-08-20 12:54:29 +02:00
Hugo Häggmark
a0773b290b Dashboard: Prevents folder change when navigating to general settings (#38103)
* Dashboard: Prevents folder change when navigating to general settings

* Tests: fixes broken tests

* Chore: changes from PR feedback
2021-08-20 11:53:48 +02:00
Jack Westbrook
5ff3b7bf3f Chore: Bump storybook to 6.3.7 (#38008) 2021-08-20 11:40:20 +02:00
Dimitris Sotirakis
16c518582f Chore: Prevent branches beginning with "v*" from being considered as versioned branches (#38016)
* Add v8* and v9* "regex" to only build versioned branches

* Add glob pattern matching

* Sign drone yaml
2021-08-20 09:22:53 +03:00
Jason Stangroome
28784935b8 Sort notification channels alphabetically (#37426)
Even without the ability to control the sort order or to filter, this notably improves usability for long lists of notification channels.

Partially fixes #20067.
2021-08-19 22:49:14 +02:00
Grot (@grafanabot)
170d1bf954 ReleaseNotes: Updated changelog and release notes for 8.1.2 (#38086) 2021-08-19 23:15:30 +03:00
Douglas Thrift
d18205ff20 Matchers: handle undefined with Is/Is not null (#38036) 2021-08-19 11:24:01 -07:00
Mitch Seaman
5edba603a8 Add metadata (#30138)
* Sentence case

* Fix typo

* steps not paragraph

* prepare for merge conflict

* another merge conflict fix

* Update docs/sources/enterprise/license/activate-license.md

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

* add suggested changes from docs team manually

Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-08-19 19:26:26 +02:00
Leon Sorokin
7cc15c848f Chore: sync yarn.lock (#38077) 2021-08-19 11:24:38 -05:00
Nathan Rodman
df791ae2af Alerting: Add custom grouping for alert groups (#37378)
* Group alertmangaer alerts by custom grouping

* Filter am groups

* Style filter components

* Style filter bar and add clear functionality

* rename components to alert group

* use query params for group filters

* filter style improvements

* add tests for group by

* Add grouping banner to better highlight groupings

* clean up hook logic
2021-08-19 09:22:52 -07:00
Connor Lindsey
6ed60c0bec Tempo: Use echo endpoint when testing Tempo datasource (#38018)
* Use echo endpoint when testing Tempo datasource

* Remove unreachable error message

* Null check response
2021-08-19 09:56:03 -06:00
Piotr Jamróz
f7501ff77f Graphite: Convert tag values returned as numbers to strings (#37882)
* Convert tag values returned as numbers to string

This is a bug in Graphite <= 1.1.7. Since 1.1.8 all values are converted to strings.

* Simplify type conversions

* Fix linting errors
2021-08-19 08:40:13 -07:00
Connor Lindsey
76b891b001 Tempo: Add Tempo search behind feature flag (#37765)
* Add Tempo search behind feature flag

* Add query fields for Tempo search

* Only show loki search if a logs-to-traces datasource is set up

* Refactor tempo search to use separate fields for service name, span name, and tags

* Add tests to buildSearchQuery

* Move search to separate component and rename type to native search

* Improve Tempo tokenizer syntax
2021-08-19 09:15:46 -06:00
Josh Hunt
17306217aa AzureMonitor: Support PostgreSQL and MySQL Flexible Servers (#38075) 2021-08-19 16:56:58 +02:00
Tobias Skarhed
1f091c448f Template variables: Keyboard navigation improvements (#38001)
* Fix variable labels

* Add proper labeling for input

* Add ids to PickerRenderer

* Fix tests

* Update PR feedback

* OptionsPicker: Change to id

* Inherit aria attributes

* Add checkbox role

* Fix typo

* Add proper label reference

* Update role and label

* Prevent spreadng non-DOM attributes

* Move form layout to other component

* Remove haspopup

* Add testid to selector

* Add HTMLProps extension

* Use list

* Move styles outside of class

* Add cx
2021-08-19 16:28:25 +02:00
Olof Bourghardt
28cf93e42c Explore: use GrafanaTheme2 (LiveTailButton component) (#37516)
* Explore: use GrafanaTheme2 in LiveTailsButton

* Remove unused theme
2021-08-19 16:17:28 +02:00
Kyle Brandt
d43d9207ee Alerting/Docs: $labels and $values not available with classic condition (#38011)
fixes #37836
2021-08-19 09:02:41 -04:00
Jack Westbrook
e988d9b56d Piechart: Update @visx dependencies to 2.1.0 and move to root package.json (#38000)
* chore: move visx dependencies to root package.json

* chore(piechart): bump visx dependencies to 2.1.0

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-08-19 14:49:09 +02:00
Ivana Huckova
7f8576ee37 Postgres: For template queries return [] and not error (#38060)
* Postgres: For template queries return [] and not error

* remove the console error

* update mssql and mysql

Co-authored-by: Ying WANG <ying.wang@grafana.com>
2021-08-19 13:43:41 +02:00
Leon Sorokin
ecfa32c8cb AnnotationEditor: simplify plugin (#37463) 2021-08-19 06:40:40 -05:00
Raymond Chen
befdfedfb6 Add documentation for setting up debugging in VSCode (#29987) 2021-08-19 12:08:43 +02:00
billabongrob
2fe62af685 Admin: Obfuscate azure_blob Account Key
Obfuscate azure_blob Account Key #37970
2021-08-19 11:41:26 +02:00
Hugo Häggmark
4ba2636aba Dashboard: Fix so panels are rendered correctly on SoloPanelPage (#38050)
* Dashboard: Fix so panels are rendered correctly on SoloPanelPage

* Refactor: narrows down the path
2021-08-19 08:47:37 +02:00
Hugo Häggmark
dba15190af Chore: Upgrades rxjs to 7.3.0 (#37913)
* Chore: upgrades rxjs to 7.3.0

* Chore: replaces toPromise with lastValueFrom

* Chore: removes unused mock that caused test error

* Chore: fixes build error in PieChartPanel

* Chore: fixed build error in requestAllIndices

* Chore: fixes comment

* Chore: trying to reduce docs errors

* Chore: searches for explicit api extractor warnings

* Chore: updates rxjs-spy to 8.0.0

* Chore: reverts to main

* Chore: upgrade rxjs and rxjs-spy
2021-08-19 06:38:31 +02:00
Villena Guillaume
646d95b8fb TimeSeries: Support Ctrl key for marking annotations (#38034) 2021-08-18 16:38:02 -05:00
w-endre
c5f8d98709 <Explore>: Minor documentation update" (#36338)
* Clarification added for using the Explore tool.

* Update docs/sources/explore/_index.md

Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
2021-08-18 21:59:57 +02:00
An
7b813c81ac revert: change to events canvas (#38023) 2021-08-18 15:47:25 -04:00
Leon Sorokin
49b129b110 GraphNG: fix mem leaks & avoid plot re-inits (#38017)
* State timeline: fix mem leak caused by excessive plot re-init

* Update PlotTooltipInterpolator type

* Do not reference config object in the setCursor hook

* fix excessive BarChart re-init caused by shallow diff of text config

* one less error

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-18 13:43:53 -05:00
MDS
63a85a4ac0 Fix typo in set-up-for-high-availability.md (#36316)
* Update set-up-for-high-availability.md

fixed a minor typo

* Update docs/sources/administration/set-up-for-high-availability.md

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

Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-18 20:08:48 +02:00
Chip Wolf ‮
fe09879ff5 Alerting: correct property names for Slack bot icons (#33376) 2021-08-18 21:06:05 +03:00
Robby Milo
552eed75e2 docs - update publishing details, add menuTitle instructions (#37441)
* docs - update publishing details, add menuTitle instructions.

* Update docs/README.md

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

* Update docs/README.md

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

* Apply suggestions from code review

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

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
2021-08-18 19:59:04 +02:00
Ole Ernst
c0d6fc0255 avoid duplicate log in development environment (#36609)
avoid logging performance metrics in production environment
2021-08-18 19:45:54 +02:00
Alexandre de Verteuil
0bf9b6a931 Typo fix in saml.md (#31451) 2021-08-18 16:49:10 +02:00
Oscar Kilhed
21f45d4927 Postgres UUID group issue (#37999)
* Add UUID to types that can be grouped by

* Remove noop switch
2021-08-18 16:17:30 +02:00
Petros Kolyvas
861fe60d01 Updating CONTRIBUTING.md to redirect to GitHub Discussions for Enhancements (#37039) 2021-08-18 16:16:28 +02:00
wengelbrecht-grafana
3843eda130 Update auditing.md (#37312)
Fixed small spelling mistake
2021-08-18 16:12:38 +02:00
Jon Gyllenswärd
b01c0eb571 Docs update for request security (#33974)
* added link to request security feature

* Update docs/sources/administration/security.md

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

* Update docs/sources/administration/security.md

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

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-18 16:11:53 +02:00
Andrej Ocenas
60a0c5da05 CloudWatch/Logs: Don't group dataframes for non time series queries (#37998)
* Don't split response when there is no time field

* Refactor grouping to separate function

* Add test
2021-08-18 15:05:06 +02:00
Peter Holmberg
a7b22a73b6 Alerting: Add Copy link to Alert on View rule page (#37967)
* add button to page

* add url to getText

* reorder imports

* build url function

* remove log

* encode
2021-08-18 14:25:56 +02:00
Victor Cinaglia
0819d15942 profiling: Support binding pprof server to custom network interfaces (#36580)
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-18 13:28:39 +02:00
Jack Westbrook
552ecfeda3 Chore: Update NPM packages with react peer deps (#36598)
* chore: bump npm packages with react peer deps

* chore: bump rc-cascader to 1.4.3

* chore: bump react-table to 7.7.0

* chore: bump types packages

* refactor(buttoncascader): use CascaderValueType (fixes typescript errors)

* refactor(cascader): use CascaderValueType (fixes typescript errors)

* chore: bump rc-drawer to 4.4.0

* refactor(drawer): update component to match rc-drawer 4.4.0 api changes

* refactor(cascader): provide backwards compatibility for component apis

* chore(react-test-renderer): bump to match react 17.0.1

* fix(drawer): defer opening RcDrawer so animations play correctly

* chore: bump rc-cascader to 1.5.0
2021-08-18 11:23:34 +02:00
Simon Podlipsky
9900f2ed48 Fix url util converting false into true (#37402)
A value of key-value pair is stripped for boolean values. While this is ok for `true`, it kind of inverts `false`
2021-08-18 10:10:29 +02:00
Sergey Kostrukov
c6356c5bba Fix scopes mutation by cloning original array (#37981) 2021-08-18 10:05:14 +02:00
Dimitris Sotirakis
050dc7bc8f Cloudwatch: Unwrap errors - throw error from upstream (#36334)
* Unwrap errors - throw error from upstream

* Fixes according to reviewer's comments

* Fix linting

* Remove unused code
2021-08-18 10:37:13 +03:00
Domas
cb9912ec0a Alerting: button to test contact point (#37475) 2021-08-18 10:16:35 +03:00
Hugo Häggmark
a160930e24 Chore: skip e2e test for examplars (#37991) 2021-08-18 08:29:03 +02:00
An
b028dbc537 EventsCanvas: Clean up action to avoid memory leak (#37592) 2021-08-17 17:29:24 -07:00
Ryan McKinley
16b1922cdc Devenv: remove unused options from timeseries panel (#37980) 2021-08-17 16:29:15 -07:00
Nathan Rodman
b153bb6101 Alerting: Add alertmanager notifications panel (#37078)
* Add filter parsing to rule list filters

* Add unit tests for label parsing

* Make label operators an enum

* add example for parsing function

* Update labels operator regex

* Use tooltip for query syntax example

* refactor to use Matchers for filtering

* wip: initial alertmanager notifications panel

* Panel for alertmanager notificaitons

* add filtering for notifications list

* remove icon

* rename am notifications to alert groups

* naming fixes

* Feature toggle

* Add toggle for expand all

* add pluralize

* add action buttons

* test work in progress

* Tests for alert groups panel

* Add useEffect for expandAll prop change

* Set panel to alpha state

* Fix colors

* fix polling interval callback

Co-authored-by: Domas <domas.lapinskas@grafana.com>

Co-authored-by: Domas <domas.lapinskas@grafana.com>
2021-08-17 15:02:03 -07:00
Nathan Rodman
6579872122 Alerting: update matchers field operators to Select (#37809)
* Alerting: update matchers field operators to Select

* Add matcher field to routes

* fix default values

* min-width for matcher operator

* dry up matcher field options

* change MatcherField name to MatcherValue
2021-08-17 14:48:39 -07:00
Petros Kolyvas
9008ebd27a Relative reference error for influxdb gettting started guide (#37979) 2021-08-17 17:09:36 -04:00
Ryan McKinley
2ff4b028c8 Core: move dimensions out of geomap into app/features (#37946) 2021-08-17 13:43:54 -07:00
Piotr Jamróz
d93d989a5a Graphite: Migrate to React (part 4 & 5: group all components) (#37590)
* Add UMLs

* Add rendered diagrams

* Move QueryCtrl to flux

* Remove redundant param in the reducer

* Use named imports for lodash and fix typing for GraphiteTagOperator

* Add missing async/await

* Extract providers to a separate file

* Clean up async await

* Rename controller functions back to main

* Simplify creating actions

* Re-order controller functions

* Separate helpers from actions

* Rename vars

* Simplify helpers

* Move controller methods to state reducers

* Remove docs (they are added in design doc)

* Move actions.ts to state folder

* Add docs

* Add old methods stubs for easier review

* Check how state dependencies will be mapped

* Rename state to store

* Rename state to store

* Rewrite spec tests for Graphite Query Controller

* Update docs

* Update docs

* Add GraphiteTextEditor

* Add play button

* Add AddGraphiteFunction

* Use Segment to simplify AddGraphiteFunction

* Memoize function defs

* Fix useCallback deps

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Add more type definitions

* Remove submitOnClickAwayOption

This behavior is actually needed to remove parameters in functions

* Load function definitions before parsing the target on initial load

* Add button padding

* Fix loading function definitions

* Change targetChanged to updateQuery to avoid mutating state directly

It's also needed for extra refresh/runQuery execution as handleTargetChanged doesn't handle changing the raw query

* Fix updating query after adding a function

* Simplify updating function params

* Migrate function editor to react

* Simplify setting Segment Select min width

* Remove unnecessary changes to SegmentInput

* Extract view logic to a helper and update types definitions

* Clean up types

* Update FuncDef types and add tests

* Show red border for unknown functions

* Autofocus on new params

* Extract params mapping to a helper

* Split code between params and function editor

* Focus on the first param when a function is added even if it's an optional argument

* Add function editor tests

* Remove todo marker

* Fix adding new functions

* Allow empty value in selects for removing function params

* Add placeholders and fix styling

* Add more docs

* Create basic implementation for metrics and tags

* Post merge fixes

These files are not .ts

* Remove mapping to Angular dropdowns

* Simplify mapping tag names, values and operators

* Simplify mapping metrics

* Fix removing tags and autocomplete

* Simplify debouncing providers

* Ensure options are loaded twice and segment is opened

* Remove focusing new segments logic (not supported by React's segment)

* Clean up

* Move debouncing to components

* Simplify mapping to selectable options

* Add docs

* Group all components

* Remove unused controller methods

* Create Dispatch context

* Group Series and Tags Sections

* Create Functions section

* Create Section component

* use getStyles

* remove redundant async/await

* Remove

* remove redundant async/await

* Remove console.log and silent test console output

* Do not display the name of the selected dropdown option

* Move Section to grafana-ui

* Update storybook

* Simplify SectionLabel

* Fix Influx tests

* Fix API Extractor warnings

* Fix API Extractor warnings

* Do not show hidden functions

* Use block docs for better doc generation

* Handle undefined values provided for autocomplete

* Section -> SegmentSection

* Simplify section styling

* Remove redundant div

* Simplify SegmentSection component

* Use theme.spacing

* Use empty label instead of a single space label

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-08-17 18:50:31 +02:00
Ashley Harrison
f8d7726187 DashboardGrid: compare window width against theme breakpoints (#37868) 2021-08-17 16:53:25 +01:00
Josh Hunt
1e221b6452 AzureMonitor: Show error message when subscriptions request fails in ConfigEditor (#37837)
* Fix jsdoc description for datasourceRequest

* Align default subscription width with other fields

* AzureMonitor: Show error message when requesting default subscriptions in ConfigEditor

* update snapshots:
2021-08-17 16:46:15 +01:00
Andrej Ocenas
11c848f00d Tempo: Service map (#37661)
* Add prometheus queries

* Add stats

* Refactor transform

* Fix stat format

* Refactor transform

* Hide behind feature flag

* Better linking error messages

* Add test

* Add test for datasource

* Fix lint

* Make optionality checking more explicit
2021-08-17 15:48:29 +02:00
cyhone
6aa2a0dc8a refactor: simplify serverlock code (#37451) 2021-08-17 15:34:03 +02:00
Hugo Häggmark
0d2aaed3e8 Annotations: Fixes so alert annotations are visible in the correct Panel (#37959) 2021-08-17 15:14:11 +02:00
George Robinson
3ca00f90b5 Contact point testing (#37308)
This commit adds contact point testing to ngalerts via a new API
endpoint. This endpoint accepts JSON containing a list of
receiver configurations which are validated and then tested
with a notification for a test alert. The endpoint returns JSON
for each receiver with a status and error message. It accepts
a configurable timeout via the Request-Timeout header (in seconds)
up to a maximum of 30 seconds.
2021-08-17 13:49:05 +01:00
Josh Hunt
afabc617ed AzureMonitor: Apply query migrations in QueryEditor (#37704)
* move query migrations out of the angular controller

* Migrate queries in QueryEditor

* finish up migrations

* update deprecated comment

* remove comment
2021-08-17 14:03:18 +02:00
sam boyer
6aba592741 Schema: get all devenv dashboards passing validation (#37857)
* Strip nulls (again)

* Add stripnulls script

* Add transformations field

* Close FieldConfig struct; proper plugin validating

* s/graph/viz/ field in histogram dashboard

* Use ui.GraphFieldConfig in histogram model

* Add models for stat, gauge, barguage panel plugins

Also toss necessary shared types into cue/ui/gen.cue, with TODOs to move
them appropriately later.

* Add required license headers

* Heap of updates to cue UI components

* Fix barchart types and one old devenv input

* Use the GraphFieldConfig directly for timeseries

* Add models.cue for a few panel plugins

Barchart, state-timeline, and status-history

* Enable the test validating all devenv dashboards!!

* Fix effects of not checking after making comments

* Update packages/grafana-ui/src/options/models.gen.ts

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Realign and unalign cue with ts types

* Update devenv test to sniff for null errors

Best option we have right now for helping people to know they need to
strip nulls from devenv dashboards.

* Add speculative default for barchart stacking

* Fixup some dated devenv dashboards

timeline-modes needed to be regenerated with the appropriate tooltip
values included, per typing requirements, and timeline-demo needed to
have the `mode` field removed, as it is not intended to be persisted.

* Add necessary missing options for various panels

* Regenerate devenv dashboards

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-17 07:11:57 -04:00
Josh Hunt
368da73ac4 AzureMonitor: Fix crash from infinite render loop (#37924) 2021-08-17 11:50:37 +01:00
Will Browne
697ac937c6 fix with global config state (#37293) 2021-08-17 12:16:34 +02:00
Will Browne
8a2f63ee06 Update Makefile (#37926) 2021-08-17 12:06:33 +02:00
Jack Westbrook
483c597740 Storybook: Fix Graph with Tooltip story (#37937) 2021-08-17 10:14:57 +02:00
Olof Bourghardt
f433cfd8d9 Explore: add functionality for supporting different step modes in prometheus (#37829) 2021-08-17 07:48:45 +02:00
Atif Shoukat Ali
f6c9c196ba Live: No connection warning for user with no org (#37943) 2021-08-16 22:11:39 -07:00
Evan Sosenko
5d74c47cf8 Add missing AWS/Cognito metrics (#37768)
* Add missing AWS/Cognito metrics

https://docs.aws.amazon.com/cognito/latest/developerguide/metrics-for-cognito-user-pools.html

* Add missing Cognito dimensions

* Remove Cognito usage metrics
2021-08-16 20:44:32 +02:00
Ashley Harrison
344c43f2e8 PanelEdit: Fix 'Actual' size by passing the correct panel size to DashboardPanel (#37885) 2021-08-16 16:01:54 +01:00
Tobias Skarhed
89572926c3 Search: Make search icon keyboard navigable (#37865)
* Make search icon keyboard navigable

* Update text

* Update test

* Remove unused line

* Add global focus-visible styles for button
2021-08-16 15:51:44 +02:00
Maria Alexandra
1735f9a56b Navigation: Add aria-label to top section links to improve a11y for screen readers (#36953) 2021-08-16 15:10:57 +02:00
Dimitris Sotirakis
37b0c20984 Chore: Update channel to where failed Docker nightly builds are posted (#37927)
* Update channel

* Sign drone.yml
2021-08-16 14:54:52 +02:00
Olof Bourghardt
d26f3cdd03 Loki: add support for resolution (#36710)
* Add input to specify min step

* Add stepInterval to as input to component

* Add onBlur to Input component

* Loki: add functionality for min step

* Loki: change name on props to step to make it more clear

* Loki: add resolution as a query option

* Loki: Add min,max,exact as step options

* Loki: add functionality for different step modes

* Loki: fix bug where step function isn't working

* Loki: fix bug where exact step isn't working

* Loki: change width of step input field

* Loki: add tests for adjustInterval function

* Loki: add check for max step oprio to make sure it's not below the safe interval

* Loki: fix bug with some tests

* Loki: fix bug with tests

* Explore: add tooltip to loki step function

* Loki: remove resolution as a logs option

* Loki: update snapshots

* Fix failing tests

* Loki: add select component for choosing resolution

* Loki: add functionality for calculating correct interval with resolution applied

* Loki: remove functionality for step mode

* Loki: remove tests for step mode

* Loki: add tooltip to line limit and resolution

* Loki: add backend support for resolution

* Loki: fixed backend bug where resolution was undefined

* Loki: add check for resolution
2021-08-16 14:02:13 +02:00
Dimitris Sotirakis
1aeafa34d1 Elasticsearch: Fix metric names for alert queries (#37871)
* Use props names as metrics names

* Make aliases work
2021-08-16 14:45:20 +03:00
Sherwin Daganato
118c811c61 CloudWatch: Add AWS/EC2 MetadataNoToken metric (#37427) 2021-08-16 10:04:21 +02:00
Gábor Farkas
668f397a8e Prometheus/Alerting: handle datasource.timeRange is nil case (#37888) 2021-08-16 09:20:58 +02:00
Domas
5ab8d6a3b9 remove guideliens form rule list state table (#37839) 2021-08-16 10:12:07 +03:00
Stephanie Hingtgen
db2e0d46b7 Update http error code when datasource health check fails (#37895)
Since the datasource settings are configured by the user, the health check error could be a client error. A 506 error may be sufficient as well.
2021-08-16 09:49:34 +03:00
Ivana Huckova
15edaa5837 Add pattern parser to syntax (#37824) 2021-08-15 21:20:37 +02:00
Ikko Ashimine
1a5529d244 Annotations: Fix typo in types.ts (#37910) 2021-08-15 09:22:38 -07:00
Sergey Kostrukov
10cc9bda74 Toolkit: return original stack trace for webpack errors (#37814) 2021-08-14 13:49:56 -07:00
Teppo Kurki
5c69f899b5 doc: add missing LoadingState.Streaming (#37903)
The final query is missing this and does not work without it.
2021-08-14 09:35:33 -04:00
sam boyer
6d08be157f Don't reuse plugin action for cue subcommands (#37858) 2021-08-13 17:01:12 -04:00
Leon Sorokin
0e3fb55caa Tooltip: bring back optimized hoverpoint code (#37901) 2021-08-13 15:35:41 -05:00
Ryan McKinley
f5b8e8b48a Devenv: remove unused stacking setting (#37898) 2021-08-13 21:09:57 +02:00
Travis Patterson
00709ec1db Add prometheus remote client (#37755) 2021-08-13 10:44:56 -06:00
Dominik Eckelmann
e49aa48dbb Added note on pagerduty alert notification (#37759) 2021-08-13 12:32:42 -04:00
shuotli
6ecf401cd1 AzureMonitor: Add data links to deep link to Azure Portal Azure Resource Graph (#35591)
* Add deep link in ARG

* add soverigh clouds

* add query to Azure portal link

* move deep link to backend

* cloud specific to ARG

* Add unit test

* fix lint

* fix escape issue

* use constant & fix test

* fix constant & use pathEscape

* use cmp.Equal for test
2021-08-13 16:21:24 +01:00
Leon Sorokin
6a77cd43ae GraphNG: refactor by-value color schemes (#37670)
* GraphNG: account for top canvas padding in gradient gen for color scheme/thresholds-by-value

* Updated test dashboard

* Added fix for issue when scaleMin was same as threshold

* fixed firefox issue

* revert docs changes

* update gdev dash for easier comparisons & regression spotting

* refactor

* optimize gradient re-gen/re-use and color more tinycolor.setAlpha() -> alpha(). update uPlot to dev build.

* fix percentage steps

* implement % threshold region rendering

* crisp threshold line rendering

* simplify

* WIP: hoverpoint dynamic color interpolation

* fix hover point color interp

* re-use gradient gen to draw threshold areas

* re-implement by-value color scales

* tweak comment

* mimic tinycolor behavior in colorManipulator.alpha() for empty colors

* explicitly disable hover points for BarChart and Histogram

* reduce test failures and required changes to tests

* fix barchart tests

* uPlot 1.6.15

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-13 09:38:04 -05:00
Sergey Kostrukov
dd0a906fb7 Fix alternative Azure cloud names (#37133) 2021-08-13 14:58:05 +01:00
Uchechukwu Obasi
4e98ade2af Annotations: fixes variable values not displaying in annotations. (#37883)
* Fixes wrong annotation when opening dashboard with URL encoded variable
Co-authored-by: Ashley Harrison, Hugo Haggmark, and Tobias Skarhed.

* added a more descriptive comment
2021-08-13 14:38:57 +01:00
Sofia Papagiannaki
7a01fb369d Alerting: Fix API spec generation (#37852)
* Alerting: Fix API spec generation

* Apply suggestion from code review

Co-authored-by: gotjosh <josue@grafana.com>
2021-08-13 16:15:53 +03:00
gotjosh
f3f3fcc727 Alerting: Introduces /api/v1/ngalert/alertmanagers to expose discovered and dropped Alertmanager(s) (#37632)
* Alerting: Expose discovered and dropped Alertmanagers

Exposes the API for discovered and dropped Alertmanagers.

* make admin config poll interval configurable

* update after rebase

* wordsmith

* More wordsmithing

* change name of the config

* settings package too
2021-08-13 13:14:36 +01:00
Dimitris Sotirakis
db91a55d49 Remove duplicated title from slack notification (#37834) 2021-08-13 15:13:02 +03:00
Ursula Kallio
e8696f978f Fix #747; remove 'other variables'. (#37866) 2021-08-13 08:02:04 -04:00
Matt Abrams
f76248cdbf [docs] : fix broken link (#37860)
found a broken link. This PR points the hyperlink at the new URL 👍
2021-08-13 07:45:38 -04:00
Josh Hunt
81cfc2c347 AzureMonitor: Use React QueryEditor for annotations editor (#37633) 2021-08-13 11:05:57 +01:00
Ashley Harrison
d4098cf098 Select: Add menuShouldPortal to a couple that got missed (#37847) 2021-08-13 08:35:24 +01:00
Hugo Häggmark
5449f1c1e6 Variables: Fix issue with empty dropdowns on navigation (#37776) 2021-08-13 09:10:37 +02:00
Olof Bourghardt
13a91f791d Explore: use GrafanaTheme2 (Explore component) (#37445)
* Explore: use GrafanaTheme2

* Explore: change width and paneel padding

* Explore: remove the use of stylyesFactory

* Explore: fix failing tests

* Simpify calculation of width for ExploreGraphNGPanel

* Update public/app/features/explore/Explore.tsx

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Update public/app/features/explore/Explore.tsx

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Prettified code

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-08-13 08:02:49 +02:00
Kyle Brandt
aef67994a1 Annotations: Fix alerting annotation coloring (#37412)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-12 09:37:54 -07:00
ying-jeanne
d18bd03a82 Scuemeta: Fix cue schemas for panels (#37788)
* complete the data model of graph panel

* fix histogram graph

* fix timeseries panel type

* Update cue/ui/gen.cue

Co-authored-by: sam boyer <sam.boyer@grafana.com>

* fix graph/viz and gradientMode enum

* add the changes into cue component and remove fields for graph panel

Co-authored-by: sam boyer <sam.boyer@grafana.com>
2021-08-12 09:52:03 -04:00
sam boyer
a17339cb9a One-off schema support for old graph and row plugins (#37810)
* Add special types for graph and row panels

* Update old keys on dashboard json
2021-08-12 09:50:10 -04:00
Sofia Papagiannaki
04d5dcb7c8 Alerting: modify DB table, accessors and migration to restrict org access (#37414)
* Alerting: modify table and accessors to limit org access appropriately

* Update migration to create multiple Alertmanager configs

* Apply suggestions from code review

Co-authored-by: gotjosh <josue@grafana.com>

* replace mg.ClearMigrationEntry()

mg.ClearMigrationEntry() would create a new session.
This commit introduces a new migration for clearing an entry from migration log for replacing  mg.ClearMigrationEntry() so that all dashboard alert migration operations will run inside the same transaction.
It adds also `SkipMigrationLog()` in Migrator interface for skipping adding an entry in the migration_log.

Co-authored-by: gotjosh <josue@grafana.com>
2021-08-12 16:04:09 +03:00
Connor Lindsey
4a9fdb8b76 Add span duration to left panel in trace viewer (#37806) 2021-08-12 06:54:55 -06:00
Ashley Harrison
8ffce22e7c Chore: Update optimize-css-assets-webpack-plugin to 5.0.5 (#37746)
* Chore: Update optimize-css-assets-webpack-plugin to 5.0.5

* kick github
2021-08-12 11:40:26 +01:00
Tobias Skarhed
b6ede8d96d Chore: Low hanging a11y fruits (#37783)
* aria-label disallowed on header element

* A11y issues for Getting Started and panel header

* Add unique identifier to search navigation

* Add dashboard header markup

* Fix news panel low hanging fruits
2021-08-12 11:13:03 +02:00
Alex Khomenko
059ef4ee9a PasswordField: Fix button role (#37816)
* Fix button role

* Fix tests
2021-08-12 10:46:33 +02:00
Dimitris Sotirakis
e4779cfb4f Remove pkg-archive from Makefile (#37821) 2021-08-12 11:39:09 +03:00
Andrej Ocenas
b5f7df3e62 CloudWatch/Logs: Fix crash when time column has nil values (#37708) 2021-08-12 10:36:06 +02:00
Domas
e76848acee Alerting: improve rule list error message (#37734) 2021-08-12 09:57:52 +02:00
Gábor Farkas
28229fc344 devenv: influxdb: simplified versioning for old-version influxdb (#37726) 2021-08-12 08:36:50 +02:00
Gábor Farkas
4afa74232f prometheus: alerting: respect datasource.scrapeInterval (#37799) 2021-08-11 20:34:51 +02:00
Will Browne
45754edfbc bump plugin-sdk-go to fix tls verify field issue (#37797) 2021-08-11 16:23:07 +02:00
Serge Zaitsev
e2227c38a3 Remove debug log from gzipper (#37790) 2021-08-11 14:04:08 +02:00
Ursula Kallio
a058a09b9b Include voice and tone summary (#37742)
Fix https://github.com/grafana/technical-documentation/issues/35.
2021-08-11 11:30:40 +02:00
dependabot[bot]
94b58b87ea Bump prismjs from 1.23.0 to 1.24.0 (#36236)
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.23.0 to 1.24.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.23.0...v1.24.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-11 09:56:20 +01:00
Ryan McKinley
3205450210 Transformations: support a synchronous transformation pattern (#37780) 2021-08-11 01:25:33 -07:00
Ashley Harrison
181d6a78ed Chore: Fix some more typescript strict errors (#37750) 2021-08-11 09:10:41 +01:00
Ivana Huckova
4cf097c4e5 Small UX updates (#37694) 2021-08-11 09:56:23 +02:00
Ryan McKinley
36c798eb2f Chore: define base panel type in @grafana/data (#37766) 2021-08-11 00:23:41 -07:00
Ryan McKinley
7a8e861c1f Timeseries: migrate log scale (#37771) 2021-08-11 00:23:12 -07:00
Piotr Jamróz
31bb3522c8 Graphite: Migrate to React (part 3: migrate segments) (#37309)
* Add UMLs

* Add rendered diagrams

* Move QueryCtrl to flux

* Remove redundant param in the reducer

* Use named imports for lodash and fix typing for GraphiteTagOperator

* Add missing async/await

* Extract providers to a separate file

* Clean up async await

* Rename controller functions back to main

* Simplify creating actions

* Re-order controller functions

* Separate helpers from actions

* Rename vars

* Simplify helpers

* Move controller methods to state reducers

* Remove docs (they are added in design doc)

* Move actions.ts to state folder

* Add docs

* Add old methods stubs for easier review

* Check how state dependencies will be mapped

* Rename state to store

* Rename state to store

* Rewrite spec tests for Graphite Query Controller

* Update docs

* Update docs

* Add GraphiteTextEditor

* Add play button

* Add AddGraphiteFunction

* Use Segment to simplify AddGraphiteFunction

* Memoize function defs

* Fix useCallback deps

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Add more type definitions

* Remove submitOnClickAwayOption

This behavior is actually needed to remove parameters in functions

* Load function definitions before parsing the target on initial load

* Add button padding

* Fix loading function definitions

* Change targetChanged to updateQuery to avoid mutating state directly

It's also needed for extra refresh/runQuery execution as handleTargetChanged doesn't handle changing the raw query

* Fix updating query after adding a function

* Simplify updating function params

* Migrate function editor to react

* Simplify setting Segment Select min width

* Remove unnecessary changes to SegmentInput

* Extract view logic to a helper and update types definitions

* Clean up types

* Update FuncDef types and add tests

* Show red border for unknown functions

* Autofocus on new params

* Extract params mapping to a helper

* Split code between params and function editor

* Focus on the first param when a function is added even if it's an optional argument

* Add function editor tests

* Remove todo marker

* Fix adding new functions

* Allow empty value in selects for removing function params

* Add placeholders and fix styling

* Add more docs

* Create basic implementation for metrics and tags

* Post merge fixes

These files are not .ts

* Remove mapping to Angular dropdowns

* Simplify mapping tag names, values and operators

* Simplify mapping metrics

* Fix removing tags and autocomplete

* Simplify debouncing providers

* Ensure options are loaded twice and segment is opened

* Remove focusing new segments logic (not supported by React's segment)

* Clean up

* Move debouncing to components

* Simplify mapping to selectable options

* Add docs

* use getStyles

* remove redundant async/await

* Remove

* remove redundant async/await

* Remove console.log and silent test console output

* Do not display the name of the selected dropdown option

* Use block docs for better doc generation

* Handle undefined values provided for autocomplete

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-08-11 09:13:55 +02:00
Olof Bourghardt
2a1363f175 Explore: use GrafanaTheme2 (MetaInfoText component) (#37539)
* Explore: use GrafanaTheme2 in MetaInfoText component

* Explore: change font-size to h6 size

* Explore: add correct font weight

* Use correct style value for font-size

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Use error color style

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Use bodySmall font-size instead of h6 font-size

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-08-11 08:25:54 +02:00
nikki-kiga
87b8a74576 Tooltip: display ms within minute time range (#37569)
* Tooltip: add hasMs flag for system dateTime format

* Tooltip: display ms in sub minute time range

* Tooltip: add field check, increase range on tests

* Add diffrentiating test

* minimize parsing to string values

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-08-10 13:54:44 -07:00
SLAMA
5986d99f51 Alerting frontend : fix line notifier (#37744)
- Fixes #37425
- change `line` type string to uppercase
2021-08-10 18:59:53 +01:00
achatterjee-grafana
1da779103e Added missing period. (#37737) 2021-08-10 17:06:14 +02:00
Tobias Skarhed
fa731f16bf DashboardLinks: Screen reader accessibility #37682 2021-08-10 16:55:25 +02:00
Gábor Farkas
476a227505 influxdb: check for invalid program-flow (#37474) 2021-08-10 14:18:29 +02:00
Serge Zaitsev
707d3536f0 Macaron: Strip down renderer middleware (#37627)
* strip down macaron renderer

* inline renderHTML

* remove IndentJSON parameter

* replace renderer with a html/template set

* fix failing test

* fix renderer paths in tests

* make template reloading even simpler

* unify ignored gzip path lookup

* fix csp middleware usage
2021-08-10 13:29:46 +02:00
Tobias Skarhed
5b575ae91f TimeRangeOption: Make entire list item clickable #37730 2021-08-10 12:43:50 +02:00
Jeremy Price
06368abf44 Accesscontrol fix permission name (#37717)
* Fixes permission name for services:accesscontrol
2021-08-10 11:11:13 +02:00
Zoltán Bedi
ad6a4edfeb UI: FileDropzone component to handle file list overwrite (#37685)
* UI: FileDropzone component to handle file list overwrite

* FileListItem: use type=button everywhere

* Update packages/grafana-ui/src/components/FileDropzone/FileDropzone.story.tsx

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

* FileListItem: add aria-hidden and change cancel text

* Update packages/grafana-ui/src/components/FileDropzone/FileListItem.test.tsx

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-08-10 10:23:49 +02:00
Domas
3e124c854e Alerting: interpolate variables when creating alert rule from dashboard panel (#37201) 2021-08-10 10:59:48 +03:00
Gábor Farkas
488930dbe3 influxdb: influxql: update provisioning example (#37701) 2021-08-10 09:07:23 +02:00
Serge Zaitsev
0dfac9c3aa Macaron: convert CSP middleware (#37672) 2021-08-10 09:03:22 +02:00
Serge Zaitsev
377b323faf truncate float64 values to a lower precision to look the same on all platforms (#37677) 2021-08-10 09:03:01 +02:00
Ivana Huckova
a02f9be0c6 Explore: Fix showing of full log context (#37442)
* Fix log context

* Update to auto values insted of unset

* Update comment

* Fix redundant left margin for non-wrapped logs

* Remove unused css styling

* Adjust width and height
2021-08-10 09:01:57 +02:00
Julien Duchesne
7e63118ea9 Run builds on single-build agents (#37702)
This is an effort to reduce cache errors when multiple agents try to build the yarn cache at the same time
https://github.com/grafana/deployment_tools/issues/13329
2021-08-10 09:16:09 +03:00
Zoltán Bedi
33aeee60ff Toolkit: Fix matchMedia not found error (#37643) 2021-08-10 07:34:35 +02:00
Leonard Gram
7d503d4331 Update latest to v8.1.1 (#37715) 2021-08-09 21:01:38 +02:00
achatterjee-grafana
b556bafc4d Updated note as requested. Also adjusted the weight of some of the topics to list data sources alphabetically in TOC. (#37713) 2021-08-09 20:37:21 +02:00
Grot (@grafanabot)
72b1b0e90e ReleaseNotes: Updated changelog and release notes for 8.1.1 (#37692)
* ReleaseNotes: Updated changelog and release notes for 8.1.1

* Update _index.md

* Update CHANGELOG.md

Co-authored-by: Leonard Gram <leo@xlson.com>
2021-08-09 19:53:44 +02:00
achatterjee-grafana
2bc2315e99 Updated note by adding the word "longer". (#37707) 2021-08-09 19:37:11 +02:00
sam boyer
6ae5db5608 Adapt dashboard schema to validate on some devenv dashboards (#37594)
* Remove null values from JSON

* Specify the color field

* Add note about openness of custom field's struct

* Update schemaVersion

* Specify thresholds

* Add panel id

* Add maxDataPoints and interval

* Add mappings, albeit very under-specified

* Allow empty string for timezone field

This is probably not a good idea - same as allowing nulls.

* Allow false for refresh - otherwise, string

* Make threshold value optional

* Make interval optional

* Fix broken and changed decls in ui models

* Add models.cue for timeseries panel

* Fixups for home dashboard

* Add timeShift, timeFrom

* Abstract out #Target, rejigger comments
2021-08-10 00:49:58 +08:00
sam boyer
e1637f70bd Strip nulls from all latest devenv dashboards (#37602)
Everything schemaVersion >= 30
2021-08-10 00:42:41 +08:00
Josh Hunt
88487806e3 Docs: Clarify how to enable "Forward OAuth Identity" for data sources (#37696)
* Docs: Clarify how to enable "Forward OAuth Identity" for data sources

* Update docs/sources/developers/plugins/add-authentication-for-data-source-plugins.md

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

* Update add-authentication-for-data-source-plugins.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-09 17:22:40 +01:00
achatterjee-grafana
acc77d5cef Fix typo. (#37697) 2021-08-09 17:18:30 +02:00
Will Browne
e0315dabe8 Plugins: Use file extension allowlist when serving plugin assets instead of checking for UNIX executable (#37688)
* explicitly check for plugin binary

* remove check completely

* resolve conflicts

* allow module + logos

* add tests

* simplify

* rework to allowlist

* add case

* remove old stuff

* simplify

* add case insensitive test
2021-08-09 16:07:54 +02:00
Jeremy Price
fe500315f0 Accesscontrol update api examples (#37654)
* Fix status, add global flags

* Check examples are working, correct where they aren't
2021-08-09 15:26:27 +02:00
Ivana Huckova
c5eea16cfe Logs panel: Set default scrolling for ascending order to bottom (#37634)
* LogsPanel: When ascending order, scroll to bottom

* Add tests

* Refactor style

* Update scroll position when logs change
2021-08-09 15:19:46 +02:00
Alex Khomenko
a6a09add7a DateTimePicker: Use TZ independent formatter (#37676) 2021-08-09 12:37:53 +03:00
Dimitris Sotirakis
27c71a1f09 Prometheus: Migrate to use SDK contracts (#37358)
* Use SDK contracts (test needs fixing)

* Fix tests

* Add customQueryParametersMiddleware

* Fix merge conflicts
2021-08-09 11:11:19 +02:00
Tobias Skarhed
2d33ddf37f Dashboard: Accessible text for search links #37593 2021-08-09 09:59:29 +02:00
Olof Bourghardt
e300696792 Epxplore: use GrafanaTheme (SecondaryActions component) (#37543) 2021-08-09 08:47:47 +02:00
Alexander Emelin
ff1837a768 live: add ha with redis to what's new (#37652) 2021-08-06 20:51:46 +03:00
Connor Lindsey
b78a67cec7 PackageJson: Prettify markdown/mdx on commit with lint-staged (#37616)
* Format md,mdx files with prettier on lint-staged

* Manually run prettier on docs/sources
2021-08-06 07:52:36 -06:00
Andrej Ocenas
e9c032f10f CloudWatch Logs: Fix crash when no region is configured (#37639) 2021-08-06 15:47:27 +02:00
gotjosh
f83cd401e5 Alerting: Send alerts to external Alertmanager(s) (#37298)
* Alerting: Send alerts to external Alertmanager(s)

Within this PR we're adding support for registering or unregistering
sending to a set of external alertmanagers. A few of the things that are
going are:

- Introduce a new table to hold "admin" (either org or global)
  configuration we can change at runtime.
- A new periodic check that polls for this configuration and adjusts the
  "senders" accordingly.
- Introduces a new concept of "senders" that are responsible for
  shipping the alerts to the external Alertmanager(s). In a nutshell,
this is the Prometheus notifier (the one in charge of sending the alert)
mapped to a multi-tenant map.

There are a few code movements here and there but those are minor, I
tried to keep things intact as much as possible so that we could have an
easier diff.
2021-08-06 13:06:56 +01:00
Zoltán Bedi
7e42bb5df0 Toolkit: rename deprecated tsConfig to tsconfig (#37630) 2021-08-06 14:04:42 +02:00
Jack Westbrook
e0ca9585fe Build: bump fork-ts-checker-webpack-plugin to 6.3.1 (#37472) 2021-08-06 10:34:49 +02:00
Jack Westbrook
6ff599e25a Plugins: Fix plugin signature status (#37583) 2021-08-06 09:49:29 +02:00
Ivana Huckova
ba76877d28 Datasource: Pass access type to data source instance settings (#37577)
* Pass Access info to datasourceInstance

* Update packages/grafana-data/src/types/datasource.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Type access as direct | proxy

* Fix tests where mocking datasourceInstance, include access

* Pass access to data source instance mocks

* Update comment

* Pass access to data source instance mocks

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-08-06 09:24:35 +02:00
Ivana Huckova
8e7c4af366 Prometheus: Add browser access mode deprecation warning (#37578)
* Add browser deprecation info

* Update copy

* Add info to documentation

* Update copy
2021-08-06 09:22:39 +02:00
Leon Sorokin
cf1c2c374f Tooltip: fix time label mismatched with cursor & hover points (#37615) 2021-08-05 22:33:26 -05:00
achatterjee-grafana
ef19e2edce Removed section. (#37601) 2021-08-05 18:51:08 +02:00
Will Browne
74f89cfd3a update latest.json for 8.1.0 stable (#37599) 2021-08-05 18:05:40 +02:00
Grot (@grafanabot)
2418a99f09 ReleaseNotes: Updated changelog and release notes for 8.1.0 (#37589) 2021-08-05 17:22:12 +02:00
Giordano Ricci
2f21bf5cfd Chore: Reduce Elasticsearch data source plugin strict errors (#37399) 2021-08-05 16:03:38 +01:00
Zoltán Bedi
e0010860bd Tempo: add ability to upload trace json (#37407)
* Tempo: upload json

* Add test for upload

* Minor changes

* Add docs

* Update docs/sources/datasources/tempo.md

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

* Add graphframes as well to upload

* Add comments to code

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-05 15:13:44 +02:00
Will Browne
5a54deb38b Add 8.1.0 release notes link (#37591) 2021-08-05 15:04:05 +02:00
Gábor Farkas
9417e86316 Updated "react-use" package to newest version (#37579)
* package.json: updated react-use to newest version

* fixes (typescript and other)
2021-08-05 14:32:51 +02:00
Olof Bourghardt
8073be2e4e Explore: use GrafanaTheme2 in LogsNavigation component (#37518) 2021-08-05 13:31:39 +02:00
Olof Bourghardt
ba2dfe5ec4 Explore: use GrafanaTheme (LogsNavigationPages component) (#37523)
* Explore: use GrafanaTheme in LogsNavigationPages

* Explore: remove comment
2021-08-05 13:31:21 +02:00
Olof Bourghardt
0bbfe3f7b4 Explore: use GrafanaTheme2 (NoDataSourceCallToAction component) (#37542)
* Explore: use GrafanaTheme2 in NoDataSourceCallToAction component

* Explore: add px to the end of styling
2021-08-05 13:30:31 +02:00
idafurjes
7ff16c47e1 Chore: Refactor tempo using SDK contracts (#37440)
* Refactor tempo using SDK contracts

* Remove commented code

* Removing simplejson use

* Unmarshal JSON
2021-08-05 11:14:17 +02:00
Josh Hunt
f41f45f6bf AzureMonitor: Remove Angular query editor (#37532)
* Remove angular query editor

* call debounced onRunQuery, and set some default query values
2021-08-05 10:12:25 +01:00
Zoltán Bedi
44c7e65fac Zipkin: add ability to upload trace json (#37483)
* Zipkin: upload json

* Change back mock json
2021-08-05 10:55:15 +02:00
idafurjes
0563bc68fc Chore: Refactor loki to use SDK contracts (#37400)
* Refactor loki to use SDK contracts

* Register with service name

* Initialize interval calculator

* Return always created result

* Use go library instead of simplejson

* Update pkg/tsdb/loki/loki.go

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Remove newline

* Merge with main

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-08-05 10:25:31 +02:00
Ivana Huckova
1083bef030 Prometheus: Implement stepMode for alerting queries (#36796)
* Add select component for choosing step option

* Add onStepChange

* Add functionality for max step

* Rename minInterval to stepInterval to describe min, max and exact step interval

* Change select option from standard to exact

* Add new type StepType for better type safety

* Add tests for adjustInterval

* Add functionality and tests for exact step option

* Prometheus: Spell out min and max in select component

* Prometheus: Change width of step select component and add placeholder

* Prometheus: Adjust for the factor in exact step

* Prometheus: Update tooltip of step lable to include max and exact options and add padding to select component to give it some breathing room from other components

* Update snapshot for step tooltip

* Prometheus: make tooltip more informative

* Prometheus: add tooltip to interval input element

* Prometheus: extract default step option

* Prometheus: update snapshot for PromQueryEditor

* Prometheus: change step labels to uppercase

* Prometheus: define a default step option

* Prometheus: use default step option in both ui component and logic

* Prometheus: update snapshot for PromQueryEditor

* Prometheus: refactor datasource.ts for better readability

* Prometheus: change tool tip for step

* Prometheus: update snapshots

* Prometheus: add correct styling

* Prometheus: update snapshots

* Prometheus change variable name to something less superfluous

* Prometheus: refactor

* Prometheus: add new test for adjustInterval

* Docs: Update docummentation on the step parameter for prometheus

* Prometheus: make step input field smaller and change placeholder text to 15s

* Prometheus: update snapshots

* Prometheus: Make stepMode uniform in all places in the code

* Adjust step based on stepMode

* Adjust comment

* Check if we have queryInterval

* Refactor, add safe interval

* Fix merge resolutions

* Fix tests and add tests

* Update snapshot

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Update docs/sources/datasources/prometheus.md

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

* Implement calculation with intervalMode in calculator.go

* Update tests, add calculate safe interval method

* Replace panic with error

* Update pkg/tsdb/interval/interval_test.go

Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>

* Update pkg/tsdb/calculator_test.go

Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>

* Impotrt require

* Remove lint errors

Co-authored-by: Olof Bourghardt <ob655088@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>
2021-08-05 09:09:49 +02:00
Leon Sorokin
d49ce5ad47 GraphNG: optimize cursor (#37460) 2021-08-04 16:13:11 -05:00
Leon Sorokin
27b94139ed XYCanvas: useMemo() for className gen (#37513) 2021-08-04 13:47:43 -05:00
Leon Sorokin
1fe3452886 Field: use 0-based field.state.seriesIndex (#37563) 2021-08-04 13:02:27 -05:00
Will Browne
e403d54ba4 Plugins: Update plugin catalog docs (#37557)
* docs(catalog): update documentation for 8.1 changes

* docs(catalog): update the image and video links

* Apply suggestions from code review

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

* make catalog refs consistent

* Update docs/sources/plugins/catalog.md

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

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-04 18:35:15 +02:00
An
968817b151 Geomap: Use set to order labels in reducer (#37509)
* shared location config

* shared locaiton config

* shared locaiton config

* remove file

* add alpha annotations

* chore: set is already ordered

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-04 12:07:59 -04:00
achatterjee-grafana
7323ba5ec1 Added new section "Support for AES-GCM encryption algorithm". (#37556) 2021-08-04 12:01:39 -04:00
Jack Westbrook
e21ecf237b Catalog: Update enterprise license messaging in PluginDetails (#37547)
* feat(catalog): change messaging if enterprise license is missing and add link

* test(catalog): fix failing PluginDetails test
2021-08-04 17:55:03 +02:00
ying-jeanne
fcd0dac814 Dependency: update collector to v.31.0 (#37546)
* update collector to v.31.0

* Change protobuf unmarshal function after upgrade

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-08-04 17:41:07 +02:00
Sriram
800967a413 Docs: Added missing enterprise plugins (#36786)
* Added missing enterprise plugins

* Update tests
2021-08-04 16:08:43 +01:00
Alex Khomenko
1a46123dbf TimeRangePicker: fix DOM nesting (#37550) 2021-08-04 17:04:31 +02:00
Mitch Seaman
978384b27e small typo fix (#37527) 2021-08-04 10:48:40 -04:00
Ashley Harrison
8aa3845f70 Select: Make portalling the menu opt-in, but opt-in *everywhere* (#37501)
* Select: Don't portal by default

* Select: Portal all the Selects

* Fix indendentation in this comment

* Select: Remove @example docs until formatting is correct

* Docs: Add some documentation for the Select changes

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

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

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

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

* Update packages/grafana-ui/src/components/Select/types.ts

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

* Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx

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

* Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx

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

* Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx

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

* Update public/app/core/components/TransformersUI/prepareTimeSeries/PrepareTimeSeriesEditor.tsx

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

* Docs: Variants instead of varients

* Update public/app/core/components/TransformersUI/configFromQuery/ConfigFromQueryTransformerEditor.tsx

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

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-08-04 15:47:53 +01:00
Ivana Huckova
a0f94866b4 Update dashboard loki query editor (#37541) 2021-08-04 16:23:16 +02:00
Jack Westbrook
cc7c54be0e Plugins: Update Catalog Card UI (#37350)
* feat(catalog): lazy load and add alt text to plugin logos

* refactor(catalog): use plugin types, make sure data is available for new ui

* test(catalog): fix up tests after types refactor

* feat(catalog): introduce Tile and PluginBadge components for ui updates

* refactor(catalog): update PluginList to use new components, lazy load images, add creditcard icon

* test(catalog): update Browse.test types

* fix(catalog): if local and remote make sure to get the correct local plugin from array

* refactor(catalog): prefer grafana/ui components over custom Tile component

* chore(catalog): delete redundant components

* feat(catalog): introduce ascending descending name sort for Browse

* refactor(catalog): prefer theme spacing over hardcoded values

* refactor(catalog): update Local and Remote plugin types to match api responses

* fix(catalog): prefer local.hasUpdate and local.signature so updateable plugin signature is valid

* test(catalog): update test plugin mocks

* test(catalog): add tests for sorting and categorise

* test(catalog): add tests for plugin cards, remove grid component

* test(catalog): add tests for PluginBadges component

* refactor(catalog): change enterprise learn more link to open plugin page on website
2021-08-04 15:09:57 +02:00
Jeremy Price
e8e1a0b50b Revert "Revert "AccessControl: Implement a way to register fixed roles (#35641)" (#37397)" (#37535)
This reverts commit 55efeb0c02.
2021-08-04 14:44:37 +02:00
Ivana Huckova
7fd94e69c3 Loki: Update labels in log browser when time range changes (#37520)
* Refresh label when time range changes

* Refactor solution

* Add tests

* Update tests comments

* Update test

* Update public/app/plugins/datasource/loki/components/LokiQueryField.tsx

* Update public/app/plugins/datasource/loki/components/LokiQueryField.tsx
2021-08-04 14:37:19 +02:00
Jack Westbrook
224b062cac Catalog: Fix InstallControls for externally managed users (#37531) 2021-08-04 13:52:01 +02:00
Maria Alexandra
d48febee75 Fix: Wrong annotations show on a given dashboard. Correct annotations show on page refresh. #37160 (#37496) 2021-08-04 11:57:27 +02:00
Jack Westbrook
cdcccfcc53 Plugins: Fix catalog permissions for org and server admins (#37504)
* simplify toggle + add link to server admin

* feat(catalog): org admins can configure plugin apps, cannot install/uninstall plugins

* fix(catalog): dont show buttons if user doesn't have install permissions

* feat(catalog): cater for accessing catalog via /plugins and /admin/plugins

* feat(catalog): use location for list links and match.url to define breadcrumb links

* test(catalog): mock isGrafanaAdmin for PluginDetails tests

* test(catalog): preserve default bootdata in PluginDetails mock

* refactor(catalog): move orgAdmin check out of state and make easier to reason with

Co-authored-by: Will Browne <will.browne@grafana.com>
2021-08-04 11:49:05 +02:00
Ashley Harrison
81cf09af9e DashboardPrompt: Implement beforeunload handler (#37490) 2021-08-04 10:08:13 +01:00
Gábor Farkas
4da398014f influxdb: more robust query-has-variables check (#37493)
* influxdb: moved queryUtils file to better place

* influxdb: more robust query-has-variables check
2021-08-04 10:45:37 +02:00
Tobias Skarhed
aba7013ce5 TimeRangePicker: Accessiblity improvements (#36912)
* Add low hanging aria markup

* Add a list of radio buttons

* Add ref to put focus

* Add landmark markup

* Add labels to icon buttons

* Add radio button groupings

* Add keyboard focus styles

* Improve markup

* Update test selector

* Remove testid in favor of text

* Fiddle around with test labels

* Get correct testid selector

* Add aria-expanded to button

* Change order of quick select for keyboard nav

* Create headings for easier heading navigation

* Add another h3

* Add testid

* Use selectors in e2e test

* Add dataid selector for narrow absolute button

* Update e2e test with proper selectors

* Add more verbose aria-label

* Change editor to picker
2021-08-04 09:53:52 +02:00
Selene
0fc7dffee8 Remove _url from loading logo (#37480) 2021-08-04 09:36:42 +02:00
Olof Bourghardt
0b376522ac Explore: use GrafanaTheme2 (AdHocFilter component) (#37434)
* Explore: use GrafanaTheme2 and useStyles2 instead of the old ones

* Explore: delete files and components that were'nt being used
2021-08-04 09:24:25 +02:00
Oscar Kilhed
e3fe4a2d11 GraphNG: make sure we update when children changes (#37333) 2021-08-04 09:07:00 +02:00
Olof Bourghardt
2e476167eb Explore: use GrafanaTheme2 (ExploreGraphNGPanel component) (#37450)
* Explore: use GrafanaTheme2

* Explore: add correct style values

* Update public/app/features/explore/ExploreGraphNGPanel.tsx

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

* Explore: change margin-right to xs

* Explore: change margin-right to new theme xs

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-08-04 08:47:37 +02:00
Leon Sorokin
0b7253406b Portal: optimizations (#37459)
Co-authored-by: An Le <an.le@grafana.com>
2021-08-03 16:27:27 -05:00
Maria Alexandra
d48e65bf74 Annotations: Fix Datasource as template variable not available for annotations (#37506) 2021-08-03 19:54:49 +02:00
Tania B
bfc8a5cf49 Docs: Update docs for enterprise reporting (#37314)
* Docs: Update docs for enterprise reporting

* Apply feedback

* Remove old scheduler section and add screenshots

* Update images links

* Update reporting scheduler intro

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

* Update Send now

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

* Update Send later

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

* Apply more feedback

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

* Apply review feedback

* Apply review feedback

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

* Apply review feedback

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

* Apply more feedback

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

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-08-03 18:09:26 +03:00
Stephanie Hingtgen
a05ae6768c Docs: Documents caching encryption in enterprise config (#36766)
* Enterprise: adding documentation of two new configuration flags

* Update docs/sources/enterprise/enterprise-configuration.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 enterprise-configuration.md

* Fix grammar

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-08-03 10:20:05 -04:00
Leon Sorokin
0d2cd90150 GraphNG: fix y axis autosizing (#37464) 2021-08-03 08:18:05 -05:00
Park Beomsu
75c8bd26fc Docs: fix wrong formula (#37432) 2021-08-03 08:56:38 -04:00
Gábor Farkas
bc0ab3cc7a influxdb: better query-has-variable check (#37453) 2021-08-03 14:32:48 +02:00
Torkel Ödegaard
0965132bff Azure: Fixes annotations query editor not working properly (#37476) 2021-08-03 12:43:25 +02:00
MicahChiu
c2247f51e6 Style: Fix for Flex compatibility in lower versions of browsers (#36913) 2021-08-03 11:32:53 +01:00
Ashley Harrison
9934c883cc Select: Expose menuPortalTarget on SelectBase (#37456)
* Select: Expose Select props for greater flexibility

* Select: only expose menuPortalTarget

* Select: Add deprecation notice for menuPortalTarget prop

* Select: Add deprecation warning to component
2021-08-03 11:55:09 +02:00
Josh Hunt
e530d66275 AzureMonitor: Refactor query state and fetching data for Metrics (#37067)
* Split query modifications into seperate file

* seperate setQueryValue for Logs

* wip for centralising api requests

* more wip

* moved data hooks out into seperate module, added post-request cleanup

* metric metadata

* ,

* more cleanup

* update tests, fix hasOption to work with grouped variables

* update ARG subscriptiopns field

* last select stuff

* remove todo comment

* pr feedback

* more pr feedback :) :)

* updated comment
2021-08-03 10:04:04 +01:00
Maria Alexandra
f10c5020f1 Annotation: Fix "Enabled" button disappear after Grafana v8.0.6 upgrade (#37454) 2021-08-03 09:42:13 +02:00
Will Browne
312e78ff0b fix typo (#37457) 2021-08-03 09:41:31 +02:00
nikki-kiga
9fa8f5cc95 TooltipPlugin: add crosshair exception (#37285)
* TooltipPlugin: add crosshair exception

* TooltipPlugin: set active plot and add class

* Plot: hide cursor pts when not active in crosshair mode

* TooltipPlugin: clean up adding class

* TooltipPlugin: rename crosshair class

* rename class, move up to chart root element

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-08-02 11:25:51 -07:00
Connor Lindsey
6906a74179 Jaeger: Sync getTraceName improvements from upstream (#37408)
* Improve trace name resolution

* Use getTraceName in transformTraceData

* Improve getTraceName performance

* Change trace-viewer extension back to ts
2021-08-02 08:23:43 -06:00
Connor Lindsey
0699a04dcd Refactor UNSAFE_component... from SpanGraph and VirtualizedTraceView (#37418) 2021-08-02 08:03:08 -06:00
Olof Bourghardt
bc6e7d32e2 Explore: use GrafanaTheme2 (#37305)
* Explore: refactor to use GrafanaTheme2

* Explore: change style values

* Explore: change styles

* Explore: change last style values to the correct ones

* Explore: remove stylesFactory

* Update public/app/features/explore/Logs.tsx

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* Update public/app/features/explore/Logs.tsx

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

* Update public/app/features/explore/Logs.tsx

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-08-02 15:47:41 +02:00
Julien Duchesne
e5f52a05f2 Put back signature in drone.yml (#37447)
Repository protection will be enabled for grafana/grafana today
2021-08-02 15:35:49 +02:00
Connor Lindsey
e4f0d269f4 Connor/jaeger misc sync (#37420)
* Avoid resize on mouse hover (KeyValueTable)

* Add null check for span.logs in filter-spans

* Display references unless it's a single CHILD_OF

* Identify uninstrumented services

* Improve span duration formatting
2021-08-02 06:28:20 -06:00
Ashley Harrison
e7d4b175b7 Update ci-check-strict.sh (#37449) 2021-08-02 13:38:36 +02:00
Tobias Skarhed
b0dcbd568a PasswordField: Don't show password on enter #37444 2021-08-02 12:58:00 +02:00
Domas
73d36d5521 put alerting admin page under ngalert flag (#37437) 2021-08-02 10:12:01 +02:00
Alexander Emelin
31903778ae Live: display stream rate, fix duplicate channels in list response (#37365) 2021-07-30 21:05:39 +03:00
achatterjee-grafana
012b9c41a5 Doc issue 37280 (#37416)
* Additional fix: Resized two images in 8.1 what's new to make them smaller

* Fixed some broken links and deleted another empty Grafana 8 alert topic.

* Replaced reference to troubleshooting with state and health check.
2021-07-30 12:21:51 -04:00
Torkel Ödegaard
185894b756 Docs: Fix image in what's new article (#37411) 2021-07-30 17:50:49 +02:00
Agnès Toulet
0757ba1c64 Renderer: delete debug.log file when Grafana is stopped (#37367) 2021-07-30 17:29:02 +02:00
idafurjes
9d496d6f48 SDK: update plugin-sdk to v0.111.0 (#37405) 2021-07-30 16:54:52 +02:00
achatterjee-grafana
e8e45f30c0 Doc update 8.1 what's new, draft 3 (#37406)
* Updated image paths, also updated prettified JSON section.

* Rearranged content.

* Added 2 new image links for prettified JSON section.
2021-07-30 10:44:09 -04:00
Joan López de la Franca Beltran
8433def04f Encryption: Convert functions into global variables (#37240) 2021-07-30 15:48:27 +02:00
achatterjee-grafana
132e9c74c0 Topics deleted are "troubleshooting" and "view-alerts". (#37395) 2021-07-30 08:07:23 -04:00
Emil Tullstedt
55efeb0c02 Revert "AccessControl: Implement a way to register fixed roles (#35641)" (#37397)
This reverts commit 88c11f1cc0.
2021-07-30 13:58:49 +02:00
Jack Westbrook
9494c2cd4f Plugins: Add filter for plugin type and update search, filter and sort ui (#37301)
* feat(catalog): introduce additive filters for plugin type, installed status and search

* feat(catalog): prefer FilterInput over custom styled search field

* feat(catalog): update Browse page to use new search, filter features

* refactor(catalog): keep filters with usePluginsByFilter hook

* test(catalog): update tests to reflect new filtering and searching

* refactor(catalog): rearrange filterByType radio buttons

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* feat(catalog): ntroduce css for responsive filter layout

* refactor(catalog): introduce pluginfilter type and give filter methods better names

* fix(catalog): default q param to empty string so FiterInput doesn't show clear button on load

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-30 13:23:33 +02:00
Vardan Torosyan
53072bcad1 Update Settings Update documentation with the information about fine-grained access control (#37300) 2021-07-30 13:04:13 +02:00
Gabriel MABILLE
88c11f1cc0 AccessControl: Implement a way to register fixed roles (#35641)
* AccessControl: Implement a way to register fixed roles

* Add context to register func

* Use FixedRoleGrantsMap instead of FixedRoleGrants

* Removed FixedRoles map to sync.map


* Wrote test for accesscontrol and provisioning

* Use mutexes+map instead of sync maps

* Create a sync map struct out of a Map and a Mutex

* Create a sync map struct for grants as well

* Validate builtin roles

* Make validation public to access control

* Handle errors consistently with what seeder does

* Keep errors consistant amongst accesscontrol impl

* Handle registration error

* Reverse the registration direction thanks to a RoleRegistrant interface

* Removed sync map in favor for simple maps since registration now happens during init

* Work on the Registrant interface

* Remove the Register Role from the interface to have services returning their registrations instead

* Adding context to RegisterRegistrantsRoles and update descriptions

* little bit of cosmetics

* Making sure provisioning is ran after role registration

* test for role registration

* Change the accesscontrol interface to use a variadic

* check if accesscontrol is enabled

* Add a new test for RegisterFixedRoles and fix assign which was buggy

* Moved RegistrationList def to roles.go

* Change provisioning role's description

* Better comment on RegisterFixedRoles

* Correct comment on ValidateFixedRole

* Simplify helper func to removeRoleHelper

* Add log to saveFixedRole and assignFixedRole

Co-authored-by: Vardan Torosyan <vardants@gmail.com>
Co-authored-by: Jeremy Price <Jeremy.price@grafana.com>
2021-07-30 09:52:09 +02:00
Petros Kolyvas
faf1653230 Fixed image urls for Geopmap and Annotation list, added prettify JSON… (#37382)
* Fixed image urls for Geopmap and Annotation list, added prettify JSON logs

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

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

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-07-30 02:24:47 +02:00
Ryan McKinley
d269d901fc Geomap: fix scale calculations (#37375) 2021-07-29 23:27:52 +02:00
Petros Kolyvas
bee185b637 Doc: second draft of 8.1 what's new (#37370)
* Updated first half of what's new

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

Fixes for the intro

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

* Moved geomap and annitations panel sections.

* Had to update the intro again, all set now.

* Added more content.

* Updated enterprise section

* Few more changes.

* Fixed annotations image caption.

* minor updates to intro verbiage,

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <aparajita.chatterjee@grafana.com>
2021-07-29 17:22:30 -04:00
An
c564736c68 Transformers: allow label fields in the reduce processor (#37373)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-29 13:56:07 -07:00
Connor Lindsey
c4c28a5b63 Explore: Support custom display label for derived fields buttons for Loki datasource (#37273) 2021-07-29 12:42:20 -06:00
Kyle Brandt
aa904a5a04 NGAlert: Send resolve signal to alertmanager on alerting -> Normal (#37363) 2021-07-29 20:29:17 +02:00
Velociraptor85
c8216244a2 Update overview.md (#37260)
* Update overview.md

* Update grafana.md

* Update grafana.md
2021-07-29 13:03:02 -04:00
Zoltán Bedi
e3dde3510e Jaeger: upload json file (#37205)
* Dropzone component

* Add file list

* Add progress, error and cancelation to filelistitem

* Update Dropzone component to support progress

Cancelation
Retry

* Update file name changes

* Rename to FileDropzone

* FileListItem tests

A11y updates for icon buttons
Use value formatter from grafana/data

* Add tests for FileDropzone

Review comments

* export FileDropzoneDefaultChildren

* Jaeger: Upload trace json

* Change primary text when multiple false

* styling

* Review comments addressed

* Add test for upload trace json

* Add docs for Jaeger upload

* Fix strict type check error

* Update docs/sources/datasources/jaeger.md

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

* Minor changes

Render all the options from one function.
Add graph frames to the result.

* Address review comments

* Update docs/sources/datasources/jaeger.md

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

* docs: move image

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-07-29 18:07:07 +02:00
idafurjes
d9d795ef2c Update latest json (#37361) 2021-07-29 17:34:27 +02:00
Grot (@grafanabot)
cba765c5f2 ReleaseNotes: Updated changelog and release notes for 8.1.0-beta3 (#37342) 2021-07-29 16:31:10 +02:00
Ganesh Vernekar
10f8a138ae Alerting: Deduplicate receivers during migration (#36812)
* Alerting: Deduplicate receivers during migration

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

* Fix review comments

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

* Better naming of contact points

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

* Handle some edge cases

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

* Don't add routes which point to default contact point

Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-07-29 15:56:19 +02:00
idafurjes
2bf2f30e97 Add release note link for 8.1.0-beta3 (#37343) 2021-07-29 12:56:19 +02:00
Will Browne
08a73a5291 Plugins: Perform plugin update check prior to uninstall (#36909)
* only uninstall if update is possible

* add .

* update lingo for clarity
2021-07-29 11:52:23 +02:00
Leonard Gram
8ebba0a93d Auth: refactor to not use the global bus (#37345) 2021-07-29 11:47:32 +02:00
Vardan Torosyan
2c810506a5 Add fine-grained access control information to the features which now support it (#37303)
* Add fine-grained access control information to the features which now support it

* Mention the new permissions in Explore docs
2021-07-29 10:38:46 +02:00
Leonard Gram
d51b2630c7 Auth: creates a hook in the user mapping flow (#37190)
* wip

* Auth Info: refactored out into it's own service

* Auth: adds extension point where users are being mapped

* Update pkg/services/login/authinfoservice/service.go

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>

* Update pkg/services/login/authinfoservice/service.go

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>

* Auth: simplified code

* moved most authinfo stuff to its own package

* added back code

* linter

* simplified

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
2021-07-29 10:18:42 +02:00
Ivana Huckova
4f340550ee Change master to latest for docker block (#37310) 2021-07-29 10:10:45 +02:00
Ilya Stoliar
b62fe58cac CloudWatch: Add AWS LookoutMetrics (#37329) 2021-07-29 09:31:04 +02:00
idafurjes
180b1973e0 SQL: Fix SQL dataframe resampling (fill mode + time intervals) (#36937)
* Refactor resample logic

* Adjust test to have one more timestamp out of range

* adjust test + ensure filling

* revert flag flip

* Undo logic - should be timeseries only

* change data calculation based on previous interval

* fix the logics

* fix typo

* fix resample start time, to reuse what sql api returned

* calculate the start point with from truncate by interval

Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Ying WANG <ying.wang@grafana.com>
2021-07-29 08:38:41 +02:00
Leon Sorokin
78f46e28c7 Stat: fix shared y scale range, reduce plot re-inits (#37324) 2021-07-28 22:42:18 -07:00
Ryan McKinley
ced26bc624 Geomap: implement basic tooltip support (#37318)
Co-authored-by: Bryan Uribe <buribe@hmc.edu>
2021-07-29 03:34:42 +02:00
Leon Sorokin
8b80d2256d GraphNG: stack by % (#37127) 2021-07-28 20:31:07 -05:00
Petros Kolyvas
4fa17c8040 Docs: Initial docs for the annotation panel launching in 8.1 (#37230)
* closed issues

* First draft of annotation panel

* Update docs/sources/panels/visualizations/annotations.md

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Update docs/sources/panels/visualizations/annotations.md

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Removal of extraneous file

* Update docs/sources/panels/visualizations/annotations.md

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

* Update docs/sources/panels/visualizations/annotations.md

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

* Update docs/sources/panels/visualizations/annotations.md

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

* Update docs/sources/panels/visualizations/annotations.md

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

* Update docs/sources/panels/visualizations/annotations.md

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

* Update docs/sources/panels/visualizations/annotations.md

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

* Update docs/sources/panels/visualizations/annotations.md

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

* Update docs/sources/panels/visualizations/annotations.md

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

* Update docs/sources/panels/visualizations/annotations.md

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

* Added additional help text related to the Display section

* Removed additional files

* Apply suggestions from code review

Included Jita's suggestions in final commit.

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

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-07-29 02:06:42 +02:00
Zoltán Bedi
9a62db6943 Exemplars: Disable exemplars only on query it failed (#37296) 2021-07-28 16:34:46 +02:00
Jack Westbrook
99891e1a88 Catalog: Add breadcrumb to plugin details page (#37095)
* feat(catalog): introduce a breadcrumb to plugindetails page

* refactor(catalog): use aria-labels and nav element for a11y breadcrumbs
2021-07-28 15:32:14 +02:00
Olof Bourghardt
ddf5b65c51 Prometheus: add functionality to specify desired step interval in dashboards panels (#36422)
* Add select component for choosing step option

* Add onStepChange

* Add functionality for max step

* Rename minInterval to stepInterval to describe min, max and exact step interval

* Change select option from standard to exact

* Add new type StepType for better type safety

* Add tests for adjustInterval

* Add functionality and tests for exact step option

* Prometheus: Spell out min and max in select component

* Prometheus: Change width of step select component and add placeholder

* Prometheus: Adjust for the factor in exact step

* Prometheus: Update tooltip of step lable to include max and exact options and add padding to select component to give it some breathing room from other components

* Update snapshot for step tooltip

* Prometheus: make tooltip more informative

* Prometheus: add tooltip to interval input element

* Prometheus: extract default step option

* Prometheus: update snapshot for PromQueryEditor

* Prometheus: change step labels to uppercase

* Prometheus: define a default step option

* Prometheus: use default step option in both ui component and logic

* Prometheus: update snapshot for PromQueryEditor

* Prometheus: refactor datasource.ts for better readability

* Prometheus: change tool tip for step

* Prometheus: update snapshots

* Prometheus: add correct styling

* Prometheus: update snapshots

* Prometheus change variable name to something less superfluous

* Prometheus: refactor

* Prometheus: add new test for adjustInterval

* Docs: Update docummentation on the step parameter for prometheus

* Prometheus: make step input field smaller and change placeholder text to 15s

* Prometheus: update snapshots

* Prometheus: Make stepMode uniform in all places in the code

* Prometheus: update documentation and tooltip for step

* Prometheus: update snapshots
2021-07-28 08:26:09 +02:00
Domas
69dff96c1b Alerting: ability to edit alertmanager config as json via UI (#37268) 2021-07-28 09:21:42 +03:00
Ryan McKinley
5f41c2f334 Geomap: fix esri server config (#37283) 2021-07-27 22:26:42 -07:00
Eunice Kim
ee51df3715 Geomap: Document the Geomap plugin (#37221)
* Add base layer documentation

* Add initial overlay documentation

* Fix title of overlays

* Fix typos

* Add details on each overlay options

* Add location doc

* Address comments

* Address comments

* Address Base layer comments

* Address data layer comments

* Update image names

* Change titles to sentence case

* Follow UI for capitalizations
2021-07-27 22:47:38 +02:00
Karl Persson
4127db3d3a Remove Licensing as dependency of UsageStats (#37259)
* Remove Licensing as dependency

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-07-27 17:19:03 +02:00
Dimitris Sotirakis
c189851339 Chore: Update grabpl version (#37253)
* Update grabpl version to 2.3.1

* Update grabpl version to 2.3.2
2021-07-27 13:18:06 +02:00
Piotr Jamróz
8d7e22e1bb Graphite: Migrate to React (part 2B: migrate FunctionEditor) (#37070)
* Add UMLs

* Add rendered diagrams

* Move QueryCtrl to flux

* Remove redundant param in the reducer

* Use named imports for lodash and fix typing for GraphiteTagOperator

* Add missing async/await

* Extract providers to a separate file

* Clean up async await

* Rename controller functions back to main

* Simplify creating actions

* Re-order controller functions

* Separate helpers from actions

* Rename vars

* Simplify helpers

* Move controller methods to state reducers

* Remove docs (they are added in design doc)

* Move actions.ts to state folder

* Add docs

* Add old methods stubs for easier review

* Check how state dependencies will be mapped

* Rename state to store

* Rename state to store

* Rewrite spec tests for Graphite Query Controller

* Update docs

* Update docs

* Add GraphiteTextEditor

* Add play button

* Add AddGraphiteFunction

* Use Segment to simplify AddGraphiteFunction

* Memoize function defs

* Fix useCallback deps

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/helpers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Update public/app/plugins/datasource/graphite/state/providers.ts

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

* Add more type definitions

* Remove submitOnClickAwayOption

This behavior is actually needed to remove parameters in functions

* Load function definitions before parsing the target on initial load

* Add button padding

* Fix loading function definitions

* Change targetChanged to updateQuery to avoid mutating state directly

It's also needed for extra refresh/runQuery execution as handleTargetChanged doesn't handle changing the raw query

* Fix updating query after adding a function

* Simplify updating function params

* Migrate function editor to react

* Simplify setting Segment Select min width

* Remove unnecessary changes to SegmentInput

* Extract view logic to a helper and update types definitions

* Clean up types

* Update FuncDef types and add tests

* Show red border for unknown functions

* Autofocus on new params

* Extract params mapping to a helper

* Split code between params and function editor

* Focus on the first param when a function is added even if it's an optional argument

* Add function editor tests

* Remove todo marker

* Fix adding new functions

* Allow empty value in selects for removing function params

* Add placeholders and fix styling

* Add more docs

* Rename .tsx -> .ts

* Update types

* Use ?? instead of || + add test for mapping options

* Use const (let is not needed here)

* Revert test name change

* Allow removing only optional params and mark additional params as optional (only the first one is required)

* Use theme.typography.bodySmall.fontSize

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-07-27 13:10:39 +02:00
gotjosh
442a6677fc Alerting: Refactor Run of the scheduler (#37157)
* Alerting: Refactor `Run` of the scheduler

A bit of a refactor to make the diff easier to read for supporting
external Alertmanagers.

We'll introduce another routine that checks the database for
configuration and spawns other routines accordingly.

* Block the wait.

* Fix test
2021-07-27 11:52:59 +01:00
Dimitris Sotirakis
0c804df763 Update grabpl version to 2.3.1 (#37208) 2021-07-27 12:52:01 +03:00
Will Browne
56702376b6 delay go mod verify until all is copied (#37246) 2021-07-27 11:50:25 +02:00
Piotr Jamróz
e8eb73f271 Graphite: Update text editor state on initial load (#37202)
* Update current query when props change

* Remove managed state in GraphiteTextEditor

* Fix tests
2021-07-27 11:41:11 +02:00
Alexander Emelin
75bd0bbacd live: experimental HA with Redis (#36787)
Grafana 8.1.0 will include experimental high availability setup support by
using Redis PUB/SUB and data structures for inter-node state sharing.
This commit documents this but also explicitly marks feature as experimental
since integration of Live with Redis may slightly evolve with time as soon as
we get more understanding about Grafana Live usage scenarios.
2021-07-27 10:40:00 +03:00
Ganesh Vernekar
e8ac802e4f Alerting: Remove unused fields in Pagerduty struct (#37198)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-07-27 10:41:48 +05:30
nikki-kiga
01e984c394 ColorPicker: display colors as rgba in input (#37231)
* SpectrumPalette: change input to display rgba string

* fieldOverrides: remove extra hex string check
2021-07-26 15:54:13 -07:00
An
154c380c8c Geomap: configure legend on map (#37077)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-27 00:50:15 +02:00
Nathan Rodman
5f0bc252bc Alerting: support label matcher syntax in alert rule list filter (#36408)
* Add filter parsing to rule list filters

* Add unit tests for label parsing

* Make label operators an enum

* add example for parsing function

* Update labels operator regex

* Add tests to rule list for filtering

* add additional test for testing alert instances filtering

* Use tooltip for query syntax example

* refactor to use Matchers for filtering

* Update docs for label filtering on rules list

* style fixes
2021-07-26 12:05:49 -07:00
Ryan McKinley
ffa0ef9b3d Annotations: fire an event when changing annotations (#37175) 2021-07-26 20:57:52 +02:00
nikki-kiga
3e35021f7e ColorPicker: return values as hex strings and update theme (#37173)
* Color: fix alpha calculation < 16/255 and State-timeline threshold alpha

* SpectrumPalette: Update to getColorByName

* ColorValueEditor: Update to theme2

* SpectrumPalette: Update to theme2

* ColorPickerPopover: Format hex color

* SpectrumPalette: Format hex color

* SpectrumPalette: Refactor hex color alpha helper

* SpectrumPalette: Fix import and update helper

* ColorPickerPopover: Fix test to not make lowercase

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-26 11:11:53 -07:00
Ryan McKinley
be4b753aa0 Panels: allow interaction in corners when no title exists (#37169) 2021-07-26 19:19:07 +02:00
Alex Khomenko
8c8d2fe08b Use dateTime vs new Date() (#37210) 2021-07-26 18:18:15 +02:00
David Parrott
b5f464412d Alerting: automatically remove stale alerting states (#36767)
* initial attempt at automatic removal of stale states

* test case, need espected states

* finish unit test

* PR feedback

* still multiply by time.second

* pr feedback
2021-07-26 18:12:04 +02:00
jmrieger
81b98745c0 Docs: Add missing backtick in time range table (#37209) 2021-07-26 11:12:49 -04:00
Olof Bourghardt
5d101fece1 Docs: add documentation with regards to the new prettify function (#36856)
* Docs: add information about prettify function

* Docs: add info in logs-panel

* Docs: update prettify function in logs-integration

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

* Docs: update prettify function in logs-panel

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

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-07-26 16:20:29 +02:00
Connor Lindsey
b644ea9e6e Loki: Add fuzzy search to label browser (#36864) 2021-07-26 08:04:03 -06:00
Ganesh Vernekar
a65975cca0 Alerting: Remove the fixed wait for notification delivery (#37203)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
2021-07-26 15:15:09 +02:00
Ilya Stoliar
59c691a777 CloudWatch: Add AWS IVS metrics and dimensions (#37178) 2021-07-26 14:53:18 +02:00
Zoltán Bedi
04a196da4b UI: Dropzone component (#36646)
* Dropzone component

* Add file list

* Add progress, error and cancelation to filelistitem

* Update Dropzone component to support progress

Cancelation
Retry

* Update file name changes

* Rename to FileDropzone

* FileListItem tests

A11y updates for icon buttons
Use value formatter from grafana/data

* Add tests for FileDropzone

Review comments

* export FileDropzoneDefaultChildren

* Change primary text when multiple false

* Review comments addressed

* Extract remove file to constant

* No need to await after await
2021-07-26 13:21:35 +02:00
Gábor Farkas
b254e4eb31 influxdb: influxql: fix dataframe column-names (#37195) 2021-07-26 12:08:02 +02:00
Serge Zaitsev
e42a597e87 Remove unused Macaron code and interfaces (#37194) 2021-07-26 11:47:13 +02:00
Luca Fenu
e3622ac1da Influx: fix typo (#37181) 2021-07-26 08:44:09 +02:00
Serge Zaitsev
827a5b7021 add FromContext API for macaron and reqcontext, add API for standard middleware in macaron (#37057) 2021-07-26 06:11:43 +02:00
Leon Sorokin
f78452be30 Color: fix alpha calculation < 16/255 and State-timeline threshold alpha (#35911) 2021-07-23 20:50:47 -05:00
Dmitry
81dce0716b Change PostgeSQL version selector (#37166) 2021-07-23 16:29:46 -07:00
Ryan McKinley
feb9e528aa Geomap: zoom full extent (#37174) 2021-07-23 16:23:35 -07:00
Leon Sorokin
4c3e197e26 TimeSeries: make cursor hover the nearest non-null/undefined datapoint (#34552) 2021-07-23 16:05:09 -05:00
Alexander Emelin
32b74e75a3 live: various code cleanups (#37165) 2021-07-23 19:47:08 +03:00
achatterjee-grafana
72cac20e1d Removed note about frequent changes. (#37119) 2021-07-23 11:27:21 -04:00
Ashley Harrison
26abec2287 Chore: Update slate types to fix more strict TypeScript errors (#37159) 2021-07-23 15:33:53 +01:00
idafurjes
2601a4dd6e Update latest.json (#37156) 2021-07-23 15:04:15 +02:00
Grot (@grafanabot)
c39a4e9c4e ReleaseNotes: Updated changelog and release notes for 8.1.0-beta2 (#37150)
* ReleaseNotes: Updated changelog and release notes for 8.1.0-beta2

* Update CHANGELOG.md

* Update release-notes-8-1-0-beta2.md

* Update CHANGELOG.md

* Update release-notes-8-1-0-beta2.md

* Update release-notes-8-1-0-beta2.md

* Update CHANGELOG.md

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-07-23 13:34:13 +02:00
Grot (@grafanabot)
3b875def76 ReleaseNotes: Updated changelog and release notes for 8.1.0-beta2 (#37144)
* ReleaseNotes: Updated changelog and release notes for 8.1.0-beta2

* Update docs/sources/release-notes/release-notes-8-1-0-beta2.md

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

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-07-23 12:48:28 +02:00
Will Browne
0069d13929 Docs: Add 8.1.0 beta1 and beta2 release note links (#37140) 2021-07-23 13:00:23 +03:00
Ashley Harrison
75ff031789 Chore: Fix TypeScript strict errors with components using connect (#37109)
* Chore: Fix TypeScript strict errors with components using connect

* Chore: More TypeScript fixes

* Chore: Update strict check values

* Still need to export these types...

* Declare connector at the top of the file

* Careful with find and replace...
2021-07-23 11:33:26 +02:00
Bryan Uribe
2b51e94537 Gazetteer: Update Countries Json (#37129) 2021-07-23 00:42:34 +02:00
nikki-kiga
a1bbe797df StatPanel: Disable selection on Sparkline (#37125) 2021-07-22 15:12:31 -07:00
nikki-kiga
1de14ea257 check for bar value visibility never (#37122) 2021-07-22 14:09:43 -07:00
Sergey Kostrukov
c1963024ec Infra: Azure authentication in HttpClientProvider (#36932)
* Azure middleware in HttpClientProxy

* Azure authentication under feature flag

* Minor fixes

* Add prefixes to not clash with JsonData

* Return error if JsonData cannot be parsed

* Return original string if URL invalid

* Tests for datasource_cache
2021-07-22 21:43:10 +01:00
Sergey Kostrukov
4664cba935 Prometheus: Azure authentication in configuration UI (#35860)
* Azure authentication settings

* Persisting credentials

* Azure settings

* Prometheus-specific settings component

* Azure Prometheus Resource ID configuration

* DataSourceHttpSettings with extensibility for Azure

* Feature toggle for Azure auth

* Fix snapshot

* Update format of persisted credentials

* AzureSettings renamed to AzureAuthSettings
2021-07-22 19:53:49 +01:00
achatterjee-grafana
013218e075 Doc: first draft of 8.1 what's new (#37021)
* Create whats-new-in-v8-1.md

* Updated index page.

* Fixed two relrefs.

* Added section for annotation panel
2021-07-22 14:27:32 -04:00
Dan Cech
5a56594f0c add instructions for managing redirects when moving docs pages around (#37113) 2021-07-22 13:46:40 -04:00
Grot (@grafanabot)
ddde5a5f2d ReleaseNotes: Updated changelog and release notes for 8.1.0-beta1 (#37111) 2021-07-22 18:10:11 +02:00
Tobias Skarhed
437424d5d6 Storybook: Add a11y addon (#36790)
* Storybook: Add a11y addon

* Update lockfile

* Bump Storybook addon versions

* Put Icon at top

* addon-knobs 6.3.0
2021-07-22 17:28:38 +02:00
Alexander Emelin
6b2d33dc14 fix sample.ini (#37106) 2021-07-22 16:50:27 +02:00
George Robinson
2f4c893cf3 Expand the value string in annotations and labels of alerts (#37051)
This commit makes it possible to use the value string in
annotations and labels for alerts with "{{ $value }}"
2021-07-22 15:20:44 +01:00
yuwaMSFT2
ad1f792b8b Auth: Pass user role to Grafana using auth proxy (#36729)
* Pass role to Grafana using auth proxy

By default, the role will be applied to the default org of the user.
If the request uses the standard header "X-Grafana-Org-Id", the role will be applied to the specified org

Tested in both unit test and manually E2E

* Address comment: only allow the user role to be applied to the default org

Co-authored-by: Leonard Gram <leo@xlson.com>
2021-07-22 15:49:58 +02:00
Andrej Ocenas
93b4cc7035 Explore: Fix encoding of internal URLs (#36919)
* Encode internal explore url

* Fix tests

* Fix comma
2021-07-22 14:42:20 +02:00
Tobias Skarhed
8af83b8b78 IconButton: Put tooltip text as aria-label (#36760)
* Make tooltip prop aria-label

* Add ariaLabel prop
2021-07-22 13:56:25 +02:00
Sofia Papagiannaki
b96dd1877c Folder API: optionally force deleting Grafana 8 alerts when deleting a folder (or error) (#36427)
* Folder API: Add an optional query parameter for allowing deleting a  folder containing rules

* Update frontend

- Set forceDeleteRules=true when frontend deletes a folder
- Improve modal text

* Update docs

* Apply suggestions from code review

Co-authored-by: gotjosh <josue@grafana.com>
Co-authored-by: Nathan Rodman <nathanrodman@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-07-22 12:27:13 +03:00
2559 changed files with 102155 additions and 42333 deletions

12
.bingo/.gitignore vendored Normal file
View File

@@ -0,0 +1,12 @@
# Ignore everything
*
# But not these files:
!.gitignore
!*.mod
!README.md
!Variables.mk
!variables.env
*tmp.mod

14
.bingo/README.md Normal file
View File

@@ -0,0 +1,14 @@
# Project Development Dependencies.
This is directory which stores Go modules with pinned buildable package that is used within this repository, managed by https://github.com/bwplotka/bingo.
- Run `bingo get` to install all tools having each own module file in this directory.
- Run `bingo get <tool>` to install <tool> that have own module file in this directory.
- For Makefile: Make sure to put `include .bingo/Variables.mk` in your Makefile, then use $(<upper case tool name>) variable where <tool> is the .bingo/<tool>.mod.
- For shell: Run `source .bingo/variables.env` to source all environment variable for each tool.
- For go: Import `.bingo/variables.go` to for variable names.
- See https://github.com/bwplotka/bingo or -h on how to add, remove or change binaries dependencies.
## Requirements
- Go 1.14+

25
.bingo/Variables.mk Normal file
View File

@@ -0,0 +1,25 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.4.3. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
GOPATH ?= $(shell go env GOPATH)
GOBIN ?= $(firstword $(subst :, ,${GOPATH}))/bin
GO ?= $(shell which go)
# Below generated variables ensure that every time a tool under each variable is invoked, the correct version
# will be used; reinstalling only if needed.
# For example for wire variable:
#
# In your main Makefile (for non array binaries):
#
#include .bingo/Variables.mk # Assuming -dir was set to .bingo .
#
#command: $(WIRE)
# @echo "Running wire"
# @$(WIRE) <flags/args..>
#
WIRE := $(GOBIN)/wire-v0.5.0
$(WIRE): $(BINGO_DIR)/wire.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/wire-v0.5.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=wire.mod -o=$(GOBIN)/wire-v0.5.0 "github.com/google/wire/cmd/wire"

1
.bingo/go.mod Normal file
View File

@@ -0,0 +1 @@
module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files.

12
.bingo/variables.env Normal file
View File

@@ -0,0 +1,12 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.4.3. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk.
GOBIN=${GOBIN:=$(go env GOBIN)}
if [ -z "$GOBIN" ]; then
GOBIN="$(go env GOPATH)/bin"
fi
WIRE="${GOBIN}/wire-v0.5.0"

5
.bingo/wire.mod Normal file
View File

@@ -0,0 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
require github.com/google/wire v0.5.0 // cmd/wire

View File

@@ -1,5 +1,6 @@
[run]
init_cmds = [
["make", "gen-go"],
["go", "run", "build.go", "-dev", "build-cli"],
["go", "run", "build.go", "-dev", "build-server"],
["./bin/grafana-server", "-packaging=dev", "cfg:app_mode=development"]

View File

@@ -4,12 +4,12 @@
# 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')
load('scripts/version.star', 'version_branch_pipelines')
load('scripts/job.star', 'cronjobs')
load('scripts/vault.star', 'secrets')
load('scripts/drone/pipelines/pr.star', 'pr_pipelines')
load('scripts/drone/pipelines/main.star', 'main_pipelines')
load('scripts/drone/pipelines/release.star', 'release_pipelines', 'test_release_pipelines')
load('scripts/drone/version.star', 'version_branch_pipelines')
load('scripts/drone/pipelines/cron.star', 'cronjobs')
load('scripts/drone/vault.star', 'secrets')
def main(ctx):
edition = 'oss'

File diff suppressed because it is too large Load Diff

4
.github/CODEOWNERS vendored
View File

@@ -22,6 +22,10 @@
go.mod @grafana/backend-platform
go.sum @grafana/backend-platform
# Continuous Integration
.drone.yml @malcolmholmes @dsotirakis @zserge
/scripts/drone/ @malcolmholmes @dsotirakis @zserge
# Cloud Datasources backend code
/pkg/tsdb/cloudwatch @grafana/cloud-datasources @grafana/observability-squad
/pkg/tsdb/azuremonitor @grafana/cloud-datasources

View File

@@ -66,9 +66,6 @@
"packaging/**/*",
"scripts/build/**/*",
"scripts/*.sh",
"scripts/*.star",
".drone.star",
".drone.yml",
"Makefile",
"Dockerfile",
"Dockerfile.ubuntu"
@@ -76,6 +73,16 @@
"action": "updateLabel",
"addLabel": "type/build-packaging"
},
{
"type": "changedfiles",
"matches": [
"scripts/*.star",
".drone.star",
".drone.yml"
],
"action": "updateLabel",
"addLabel": "type/ci"
},
{
"type": "changedfiles",
"matches": [ "public/app/plugins/datasource/grafana-azure-monitor-datasource/**/*", "pkg/tsdb/azuremonitor/**/*"],

View File

@@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- run: git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.GH_BOT_ACCESS_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync
- uses: actions/cache@v2.1.5
- uses: actions/cache@v2.1.6
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

8
.gitignore vendored
View File

@@ -75,6 +75,7 @@ profile.cov
/pkg/cmd/grafana-server/grafana-server
/pkg/cmd/grafana-server/debug
/pkg/extensions/*
/pkg/server/wireexts_enterprise.go
!/pkg/extensions/main.go
/public/app/extensions
debug.test
@@ -122,8 +123,15 @@ compilation-stats.json
!/e2e/**/screenshots/expected/*
/e2e/**/videos/*
# a11y tests
/pa11y-ci-results.json
/pa11y-ci-report
# report dumping the whole system env
/report.*.json
# auto generated frontend docs
/docs/sources/packages_api
# auto generated Go files
*_gen.go

96
.pa11yci-pr.conf.js Normal file
View File

@@ -0,0 +1,96 @@
var config = {
defaults: {
concurrency: 1,
runners: ['axe'],
chromeLaunchConfig: {
args: ['--no-sandbox'],
},
},
urls: [
{
url: '${HOST}/login',
actions: [
"set field input[name='user'] to admin",
"set field input[name='password'] to admin",
"click element button[aria-label='Login button']",
"wait for element [aria-label='Skip change password button'] to be visible",
],
threshold: 3,
},
{
url: '${HOST}/?orgId=1',
threshold: 7,
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge',
hideElements: '.sidemenu',
threshold: 2,
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=settings',
rootElement: '.dashboard-settings',
threshold: 10,
},
{
url: '${HOST}/?orgId=1&search=open',
rootElement: '.main-view',
threshold: 15,
},
{
url: '${HOST}/alerting/list',
rootElement: '.main-view',
threshold: 7,
},
{
url: '${HOST}/datasources',
rootElement: '.main-view',
threshold: 36,
},
{
url: '${HOST}/org/users',
rootElement: '.main-view',
threshold: 4,
},
{
url: '${HOST}/org/teams',
rootElement: '.main-view',
threshold: 1,
},
{
url: '${HOST}/plugins',
rootElement: '.main-view',
threshold: 41,
},
{
url: '${HOST}/org',
rootElement: '.main-view',
threshold: 2,
},
{
url: '${HOST}/org/apikeys',
rootElement: '.main-view',
threshold: 5,
},
{
url: '${HOST}/dashboards',
rootElement: '.main-view',
threshold: 8,
},
],
};
function myPa11yCiConfiguration(urls, defaults) {
const HOST_SERVER = process.env.HOST || 'localhost';
const PORT_SERVER = process.env.PORT || '3000';
for (var idx = 0; idx < urls.length; idx++) {
urls[idx] = { ...urls[idx], url: urls[idx].url.replace('${HOST}', `${HOST_SERVER}:${PORT_SERVER}`) };
}
return {
defaults: defaults,
urls: urls,
};
}
module.exports = myPa11yCiConfiguration(config.urls, config.defaults);

83
.pa11yci.conf.js Normal file
View File

@@ -0,0 +1,83 @@
var config = {
defaults: {
concurrency: 1,
runners: ['axe'],
chromeLaunchConfig: {
args: ['--no-sandbox'],
},
},
urls: [
{
url: '${HOST}/login',
actions: [
"set field input[name='user'] to admin",
"set field input[name='password'] to admin",
"click element button[aria-label='Login button']",
"wait for element [aria-label='Skip change password button'] to be visible",
],
},
{
url: '${HOST}/?orgId=1',
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge',
hideElements: '.sidemenu',
},
{
url: '${HOST}/d/O6f11TZWk/panel-tests-bar-gauge?orgId=1&editview=settings',
rootElement: '.dashboard-settings',
},
{
url: '${HOST}/?orgId=1&search=open',
rootElement: '.main-view',
},
{
url: '${HOST}/alerting/list',
rootElement: '.main-view',
},
{
url: '${HOST}/datasources',
rootElement: '.main-view',
},
{
url: '${HOST}/org/users',
rootElement: '.main-view',
},
{
url: '${HOST}/org/teams',
rootElement: '.main-view',
},
{
url: '${HOST}/plugins',
rootElement: '.main-view',
},
{
url: '${HOST}/org',
rootElement: '.main-view',
},
{
url: '${HOST}/org/apikeys',
rootElement: '.main-view',
},
{
url: '${HOST}/dashboards',
rootElement: '.main-view',
},
],
};
function myPa11yCiConfiguration(urls, defaults) {
const HOST_SERVER = process.env.HOST || 'localhost';
const PORT_SERVER = process.env.PORT || '3000';
for (var idx = 0; idx < urls.length; idx++) {
urls[idx] = { ...urls[idx], url: urls[idx].url.replace('${HOST}', `${HOST_SERVER}:${PORT_SERVER}`) };
}
return {
defaults: defaults,
urls: urls,
};
}
module.exports = myPa11yCiConfiguration(config.urls, config.defaults);

View File

@@ -5,8 +5,9 @@ pkg/
node_modules
public/vendor/
vendor/
data/
/data/
e2e/tmp
public/build/
public/sass/*.generated.scss
devenv/
public/lib/monaco

File diff suppressed because it is too large Load Diff

View File

@@ -26,10 +26,12 @@ Report a bug by submitting a [bug report](https://github.com/grafana/grafana/iss
Follow the issue template and add additional information that will help us replicate the problem.
For data visualization issues:
- Query results from the inspect drawer (data tab & query inspector)
- Panel settings can be extracted in the panel inspect drawer JSON tab
For a dashboard related issues:
- Dashboard JSON can be found in the dashboard settings JSON model view
For authentication and alerting Grafana server logs are useful.
@@ -40,7 +42,7 @@ If you believe you've found a security vulnerability, please read our [security
### Suggest enhancements
If you have an idea of how to improve Grafana, submit an [enhancement request](https://github.com/grafana/grafana/issues/new?labels=type%3A+feature+request&template=2-feature_request.md).
If you have an idea of how to improve Grafana, submit an [enhancement request](https://github.com/grafana/grafana/discussions/new).
We want to make Grafana accessible to even more people. Submit an [accessibility issue](https://github.com/grafana/grafana/issues/new?labels=type%3A+accessibility&template=3-accessibility.md) to help us understand what we can improve.

View File

@@ -1,4 +1,4 @@
FROM node:14.16.0-alpine3.13 as js-builder
FROM node:16-alpine3.14 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.13 as go-builder
FROM golang:1.17.0-alpine3.14 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.13
FROM alpine:3.14.2
LABEL maintainer="Grafana team <hello@grafana.com>"

View File

@@ -17,19 +17,19 @@ COPY emails emails
ENV NODE_ENV production
RUN yarn build
FROM golang:1.16 AS go-builder
FROM golang:1.17.0 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

@@ -2,7 +2,10 @@
##
## For more information, refer to https://suva.sh/posts/well-documented-makefiles/
WIRE_TAGS = "oss"
-include local/Makefile
include .bingo/Variables.mk
.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
@@ -27,7 +30,11 @@ node_modules: package.json yarn.lock ## Install node modules.
##@ Building
build-go: ## Build all Go binaries.
gen-go: $(WIRE)
@echo "generate go files"
$(WIRE) gen -tags $(WIRE_TAGS) ./pkg/server
build-go: gen-go ## Build all Go binaries.
@echo "build go files"
$(GO) run build.go build
@@ -36,7 +43,7 @@ build-server: ## Build Grafana server.
$(GO) run build.go build-server
build-cli: ## Build Grafana CLI application.
@echo "build in CI environment"
@echo "build grafana-cli"
$(GO) run build.go build-cli
build-js: ## Build frontend assets.
@@ -91,7 +98,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 pkg-archive latest
$(GO) run build.go -goos linux -pkg-arch amd64 ${OPT} build latest
cp dist/grafana-latest.linux-x64.tar.gz packaging/docker
cd packaging/docker && docker build --tag grafana/grafana:dev .
@@ -141,7 +148,7 @@ clean: ## Clean up intermediate build artifacts.
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
# Use this make target to regenerate the configuration YAML files when
# you modify starlark files.
drone:
drone starlark

466
build.go
View File

@@ -3,476 +3,14 @@
package main
import (
"bytes"
"crypto/md5"
"crypto/sha256"
"encoding/json"
"flag"
"fmt"
"go/build"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"strconv"
"strings"
"time"
)
const (
windows = "windows"
linux = "linux"
)
var (
//versionRe = regexp.MustCompile(`-[0-9]{1,3}-g[0-9a-f]{5,10}`)
goarch string
goos string
gocc string
cgo bool
libc string
pkgArch string
version string = "v1"
buildTags []string
// deb & rpm does not support semver so have to handle their version a little differently
linuxPackageVersion string = "v1"
linuxPackageIteration string = ""
race bool
workingDir string
includeBuildId bool = true
buildId string = "0"
serverBinary string = "grafana-server"
cliBinary string = "grafana-cli"
binaries []string = []string{serverBinary, cliBinary}
isDev bool = false
enterprise bool = false
skipRpmGen bool = false
skipDebGen bool = false
printGenVersion bool = false
"github.com/grafana/grafana/pkg/build"
)
func main() {
log.SetOutput(os.Stdout)
log.SetFlags(0)
var buildIdRaw string
var buildTagsRaw string
flag.StringVar(&goarch, "goarch", runtime.GOARCH, "GOARCH")
flag.StringVar(&goos, "goos", runtime.GOOS, "GOOS")
flag.StringVar(&gocc, "cc", "", "CC")
flag.StringVar(&libc, "libc", "", "LIBC")
flag.StringVar(&buildTagsRaw, "build-tags", "", "Sets custom build tags")
flag.BoolVar(&cgo, "cgo-enabled", cgo, "Enable cgo")
flag.StringVar(&pkgArch, "pkg-arch", "", "PKG ARCH")
flag.BoolVar(&race, "race", race, "Use race detector")
flag.BoolVar(&includeBuildId, "includeBuildId", includeBuildId, "IncludeBuildId in package name")
flag.BoolVar(&enterprise, "enterprise", enterprise, "Build enterprise version of Grafana")
flag.StringVar(&buildIdRaw, "buildId", "0", "Build ID from CI system")
flag.BoolVar(&isDev, "dev", isDev, "optimal for development, skips certain steps")
flag.BoolVar(&skipRpmGen, "skipRpm", skipRpmGen, "skip rpm package generation (default: false)")
flag.BoolVar(&skipDebGen, "skipDeb", skipDebGen, "skip deb package generation (default: false)")
flag.BoolVar(&printGenVersion, "gen-version", printGenVersion, "generate Grafana version and output (default: false)")
flag.Parse()
buildId = shortenBuildId(buildIdRaw)
readVersionFromPackageJson()
if pkgArch == "" {
pkgArch = goarch
}
if printGenVersion {
printGeneratedVersion()
return
}
if len(buildTagsRaw) > 0 {
buildTags = strings.Split(buildTagsRaw, ",")
}
log.Printf("Version: %s, Linux Version: %s, Package Iteration: %s\n", version, linuxPackageVersion, linuxPackageIteration)
if flag.NArg() == 0 {
log.Println("Usage: go run build.go build")
return
}
workingDir, _ = os.Getwd()
for _, cmd := range flag.Args() {
switch cmd {
case "setup":
setup()
case "build-srv", "build-server":
clean()
doBuild("grafana-server", "./pkg/cmd/grafana-server", buildTags)
case "build-cli":
clean()
doBuild("grafana-cli", "./pkg/cmd/grafana-cli", buildTags)
case "build":
//clean()
for _, binary := range binaries {
doBuild(binary, "./pkg/cmd/"+binary, buildTags)
}
case "build-frontend":
yarn("build")
case "sha-dist":
shaFilesInDist()
case "latest":
makeLatestDistCopies()
case "clean":
clean()
default:
log.Fatalf("Unknown command %q", cmd)
}
}
}
func makeLatestDistCopies() {
files, err := ioutil.ReadDir("dist")
if err != nil {
log.Fatalf("failed to create latest copies. Cannot read from /dist")
}
latestMapping := map[string]string{
"_amd64.deb": "dist/grafana_latest_amd64.deb",
".x86_64.rpm": "dist/grafana-latest-1.x86_64.rpm",
".linux-amd64.tar.gz": "dist/grafana-latest.linux-x64.tar.gz",
".linux-amd64-musl.tar.gz": "dist/grafana-latest.linux-x64-musl.tar.gz",
".linux-armv7.tar.gz": "dist/grafana-latest.linux-armv7.tar.gz",
".linux-armv7-musl.tar.gz": "dist/grafana-latest.linux-armv7-musl.tar.gz",
".linux-armv6.tar.gz": "dist/grafana-latest.linux-armv6.tar.gz",
".linux-arm64.tar.gz": "dist/grafana-latest.linux-arm64.tar.gz",
".linux-arm64-musl.tar.gz": "dist/grafana-latest.linux-arm64-musl.tar.gz",
}
for _, file := range files {
for extension, fullName := range latestMapping {
if strings.HasSuffix(file.Name(), extension) {
runError("cp", path.Join("dist", file.Name()), fullName)
}
}
}
}
func readVersionFromPackageJson() {
reader, err := os.Open("package.json")
if err != nil {
log.Fatal("Failed to open package.json")
return
}
defer reader.Close()
jsonObj := map[string]interface{}{}
jsonParser := json.NewDecoder(reader)
if err := jsonParser.Decode(&jsonObj); err != nil {
log.Fatal("Failed to decode package.json")
}
version = jsonObj["version"].(string)
linuxPackageVersion = version
linuxPackageIteration = ""
// handle pre version stuff (deb / rpm does not support semver)
parts := strings.Split(version, "-")
if len(parts) > 1 {
linuxPackageVersion = parts[0]
linuxPackageIteration = parts[1]
}
// add timestamp to iteration
if includeBuildId {
if buildId != "0" {
linuxPackageIteration = fmt.Sprintf("%s%s", buildId, linuxPackageIteration)
} else {
linuxPackageIteration = fmt.Sprintf("%d%s", time.Now().Unix(), linuxPackageIteration)
}
}
}
func yarn(params ...string) {
runPrint(`yarn run`, params...)
}
func genPackageVersion() string {
if includeBuildId {
return fmt.Sprintf("%v-%v", linuxPackageVersion, linuxPackageIteration)
} else {
return version
}
}
func setup() {
args := []string{"install", "-v"}
if goos == windows {
args = append(args, "-buildmode=exe")
}
args = append(args, "./pkg/cmd/grafana-server")
runPrint("go", args...)
}
func printGeneratedVersion() {
fmt.Print(genPackageVersion())
}
func test(pkg string) {
setBuildEnv()
args := []string{"test", "-short", "-timeout", "60s"}
if goos == windows {
args = append(args, "-buildmode=exe")
}
args = append(args, pkg)
runPrint("go", args...)
}
func doBuild(binaryName, pkg string, tags []string) {
libcPart := ""
if libc != "" {
libcPart = fmt.Sprintf("-%s", libc)
}
binary := fmt.Sprintf("./bin/%s-%s%s/%s", goos, goarch, libcPart, binaryName)
if isDev {
//don't include os/arch/libc in output path in dev environment
binary = fmt.Sprintf("./bin/%s", binaryName)
}
if goos == windows {
binary += ".exe"
}
if !isDev {
rmr(binary, binary+".md5")
}
args := []string{"build", "-ldflags", ldflags()}
if goos == windows {
// Work around a linking error on Windows: "export ordinal too large"
args = append(args, "-buildmode=exe")
}
if len(tags) > 0 {
args = append(args, "-tags", strings.Join(tags, ","))
}
if race {
args = append(args, "-race")
}
args = append(args, "-o", binary)
args = append(args, pkg)
if !isDev {
setBuildEnv()
runPrint("go", "version")
libcPart := ""
if libc != "" {
libcPart = fmt.Sprintf("/%s", libc)
}
fmt.Printf("Targeting %s/%s%s\n", goos, goarch, libcPart)
}
runPrint("go", args...)
if !isDev {
// Create an md5 checksum of the binary, to be included in the archive for
// automatic upgrades.
err := md5File(binary)
if err != nil {
log.Fatal(err)
}
}
}
func ldflags() string {
var b bytes.Buffer
b.WriteString("-w")
b.WriteString(fmt.Sprintf(" -X main.version=%s", version))
b.WriteString(fmt.Sprintf(" -X main.commit=%s", getGitSha()))
b.WriteString(fmt.Sprintf(" -X main.buildstamp=%d", buildStamp()))
b.WriteString(fmt.Sprintf(" -X main.buildBranch=%s", getGitBranch()))
if v := os.Getenv("LDFLAGS"); v != "" {
b.WriteString(fmt.Sprintf(" -extldflags \"%s\"", v))
}
return b.String()
}
func rmr(paths ...string) {
for _, path := range paths {
log.Println("rm -r", path)
os.RemoveAll(path)
}
}
func clean() {
if isDev {
return
}
rmr("dist")
rmr("tmp")
rmr(filepath.Join(build.Default.GOPATH, fmt.Sprintf("pkg/%s_%s/github.com/grafana", goos, goarch)))
}
func setBuildEnv() {
os.Setenv("GOOS", goos)
if goos == windows {
// require windows >=7
os.Setenv("CGO_CFLAGS", "-D_WIN32_WINNT=0x0601")
}
if goarch != "amd64" || goos != linux {
// needed for all other archs
cgo = true
}
if strings.HasPrefix(goarch, "armv") {
os.Setenv("GOARCH", "arm")
os.Setenv("GOARM", goarch[4:])
} else {
os.Setenv("GOARCH", goarch)
}
if cgo {
os.Setenv("CGO_ENABLED", "1")
}
if gocc != "" {
os.Setenv("CC", gocc)
}
}
func getGitBranch() string {
v, err := runError("git", "rev-parse", "--abbrev-ref", "HEAD")
if err != nil {
return "main"
}
return string(v)
}
func getGitSha() string {
v, err := runError("git", "rev-parse", "--short", "HEAD")
if err != nil {
return "unknown-dev"
}
return string(v)
}
func buildStamp() int64 {
// use SOURCE_DATE_EPOCH if set.
if s, _ := strconv.ParseInt(os.Getenv("SOURCE_DATE_EPOCH"), 10, 64); s > 0 {
return s
}
bs, err := runError("git", "show", "-s", "--format=%ct")
if err != nil {
return time.Now().Unix()
}
s, _ := strconv.ParseInt(string(bs), 10, 64)
return s
}
func runError(cmd string, args ...string) ([]byte, error) {
ecmd := exec.Command(cmd, args...)
bs, err := ecmd.CombinedOutput()
if err != nil {
return nil, err
}
return bytes.TrimSpace(bs), nil
}
func runPrint(cmd string, args ...string) {
log.Println(cmd, strings.Join(args, " "))
ecmd := exec.Command(cmd, args...)
ecmd.Stdout = os.Stdout
ecmd.Stderr = os.Stderr
err := ecmd.Run()
if err != nil {
log.Fatal(err)
}
}
func md5File(file string) error {
fd, err := os.Open(file)
if err != nil {
return err
}
defer fd.Close()
h := md5.New()
_, err = io.Copy(h, fd)
if err != nil {
return err
}
out, err := os.Create(file + ".md5")
if err != nil {
return err
}
_, err = fmt.Fprintf(out, "%x\n", h.Sum(nil))
if err != nil {
return err
}
return out.Close()
}
func shaFilesInDist() {
filepath.Walk("./dist", func(path string, f os.FileInfo, err error) error {
if path == "./dist" {
return nil
}
if !strings.Contains(path, ".sha256") {
err := shaFile(path)
if err != nil {
log.Printf("Failed to create sha file. error: %v\n", err)
}
}
return nil
})
}
func shaFile(file string) error {
fd, err := os.Open(file)
if err != nil {
return err
}
defer fd.Close()
h := sha256.New()
_, err = io.Copy(h, fd)
if err != nil {
return err
}
out, err := os.Create(file + ".sha256")
if err != nil {
return err
}
_, err = fmt.Fprintf(out, "%x\n", h.Sum(nil))
if err != nil {
return err
}
return out.Close()
}
func shortenBuildId(buildId string) string {
buildId = strings.Replace(buildId, "-", "", -1)
if len(buildId) < 9 {
return buildId
}
return buildId[0:8]
os.Exit(build.RunCmd())
}

View File

@@ -172,6 +172,12 @@ idle_conn_timeout_seconds = 90
# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request.
send_user_header = false
# Limit the amount of bytes that will be read/accepted from responses of outgoing HTTP requests.
response_limit = 0
# Limits the number of rows that Grafana will process from SQL data sources.
row_limit = 1000000
#################################### Analytics ###########################
[analytics]
# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
@@ -202,6 +208,12 @@ rudderstack_write_key =
# Rudderstack data plane url, enabled only if rudderstack_write_key is also set
rudderstack_data_plane_url =
# Application Insights connection string. Specify an URL string to enable this feature.
application_insights_connection_string =
# Optional. Specifies an Application Insights endpoint URL where the endpoint string is wrapped in backticks ``.
application_insights_endpoint_url =
#################################### Security ############################
[security]
# disable creation of admin user on first start of grafana
@@ -498,9 +510,11 @@ role_attribute_path =
role_attribute_strict = false
groups_attribute_path =
id_token_attribute_name =
team_ids_attribute_path =
auth_url =
token_url =
api_url =
teams_url =
allowed_domains =
team_ids =
allowed_organizations =
@@ -715,11 +729,67 @@ global_session = -1
# global limit of alerts
global_alert_rule = -1
#################################### Unified Alerting ####################
[unified_alerting]
# Enable the Unified Alerting sub-system and interface. When enabled we'll migrate all of your alert rules and notification channels to the new system. New alert rules will be created and your notification channels will be converted into an Alertmanager configuration. Previous data is preserved to enable backwards compatibility but new data is removed.
enabled = false
# Comma-separated list of organization IDs for which to disable unified alerting. Only supported if unified alerting is enabled.
disabled_orgs =
# Specify the frequency of polling for admin config changes.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
admin_config_poll_interval = 60s
# Specify the frequency of polling for Alertmanager config changes.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
alertmanager_config_poll_interval = 60s
# Listen address/hostname and port to receive unified alerting messages for other Grafana instances. The port is used for both TCP and UDP. It is assumed other Grafana instances are also running on the same port.
ha_listen_address = "0.0.0.0:9094"
# Explicit address/hostname and port to advertise other Grafana instances. The port is used for both TCP and UDP.
ha_advertise_address = ""
# Comma-separated list of initial instances (in a format of host:port) that will form the HA cluster. Configuring this setting will enable High Availability mode for alerting.
ha_peers = ""
# Time to wait for an instance to send a notification via the Alertmanager. In HA, each Grafana instance will
# be assigned a position (e.g. 0, 1). We then multiply this position with the timeout to indicate how long should
# each instance wait before sending the notification to take into account replication lag.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
ha_peer_timeout = 15s
# The interval between sending gossip messages. By lowering this value (more frequent) gossip messages are propagated
# across cluster more quickly at the expense of increased bandwidth usage.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
ha_gossip_interval = 200ms
# The interval between gossip full state syncs. Setting this interval lower (more frequent) will increase convergence speeds
# across larger clusters at the expense of increased bandwidth usage.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
ha_push_pull_interval = 60s
# Enable or disable alerting rule execution. The alerting UI remains visible. This option has a legacy version in the `[alerting]` section that takes precedence.
execute_alerts = true
# Alert evaluation timeout when fetching data from the datasource. This option has a legacy version in the `[alerting]` section that takes precedence.
# The timeout string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
evaluation_timeout = 30s
# Number of times we'll attempt to evaluate an alert rule before giving up on that evaluation. This option has a legacy version in the `[alerting]` section that takes precedence.
max_attempts = 3
# Minimum interval to enforce between rule evaluations. Rules will be adjusted if they are less than this value or if they are not multiple of the scheduler interval (10s). Higher values can help with resource management as we'll schedule fewer evaluations over time. This option has a legacy version in the `[alerting]` section that takes precedence.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
min_interval = 10s
#################################### Alerting ############################
[alerting]
# Disable alerting engine & UI features
# Disable legacy alerting engine & UI features
enabled = true
# Makes it possible to turn off alert rule execution but alerting UI is visible
# Makes it possible to turn off alert execution but alerting UI is visible
execute_alerts = true
# Default setting for new alert rules. Defaults to categorize error and timeouts as alerting. (alerting, keep_state)
@@ -895,7 +965,7 @@ 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.
allow_loading_unsigned_plugins =
# Enable or disable installing plugins directly from within Grafana.
plugin_admin_enabled = false
plugin_admin_enabled = true
plugin_admin_external_manage_enabled = false
plugin_catalog_url = https://grafana.com/grafana/plugins/

View File

@@ -178,6 +178,12 @@
# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false.
;send_user_header = false
# Limit the amount of bytes that will be read/accepted from responses of outgoing HTTP requests.
;response_limit = 0
# Limits the number of rows that Grafana will process from SQL data sources.
;row_limit = 1000000
#################################### Analytics ####################################
[analytics]
# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
@@ -483,12 +489,14 @@
;auth_url = https://foo.bar/login/oauth/authorize
;token_url = https://foo.bar/login/oauth/access_token
;api_url = https://foo.bar/user
;teams_url =
;allowed_domains =
;team_ids =
;allowed_organizations =
;role_attribute_path =
;role_attribute_strict = false
;groups_attribute_path =
;team_ids_attribute_path =
;tls_skip_verify_insecure = false
;tls_client_cert =
;tls_client_key =
@@ -698,11 +706,67 @@
# global limit of alerts
;global_alert_rule = -1
#################################### Unified Alerting ####################
[unified_alerting]
#Enable the Unified Alerting sub-system and interface. When enabled we'll migrate all of your alert rules and notification channels to the new system. New alert rules will be created and your notification channels will be converted into an Alertmanager configuration. Previous data is preserved to enable backwards compatibility but new data is removed.```
;enabled = false
# Comma-separated list of organization IDs for which to disable unified alerting. Only supported if unified alerting is enabled.
;disabled_orgs =
# Specify the frequency of polling for admin config changes.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
;admin_config_poll_interval = 60s
# Specify the frequency of polling for Alertmanager config changes.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
;alertmanager_config_poll_interval = 60s
# Listen address/hostname and port to receive unified alerting messages for other Grafana instances. The port is used for both TCP and UDP. It is assumed other Grafana instances are also running on the same port. The default value is `0.0.0.0:9094`.
;ha_listen_address = "0.0.0.0:9094"
# Listen address/hostname and port to receive unified alerting messages for other Grafana instances. The port is used for both TCP and UDP. It is assumed other Grafana instances are also running on the same port. The default value is `0.0.0.0:9094`.
;ha_advertise_address = ""
# Comma-separated list of initial instances (in a format of host:port) that will form the HA cluster. Configuring this setting will enable High Availability mode for alerting.
;ha_peers = ""
# Time to wait for an instance to send a notification via the Alertmanager. In HA, each Grafana instance will
# be assigned a position (e.g. 0, 1). We then multiply this position with the timeout to indicate how long should
# each instance wait before sending the notification to take into account replication lag.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
;ha_peer_timeout = "15s"
# The interval between sending gossip messages. By lowering this value (more frequent) gossip messages are propagated
# across cluster more quickly at the expense of increased bandwidth usage.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
;ha_gossip_interval = "200ms"
# The interval between gossip full state syncs. Setting this interval lower (more frequent) will increase convergence speeds
# across larger clusters at the expense of increased bandwidth usage.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
;ha_push_pull_interval = "60s"
# Enable or disable alerting rule execution. The alerting UI remains visible. This option has a legacy version in the `[alerting]` section that takes precedence.
;execute_alerts = true
# Alert evaluation timeout when fetching data from the datasource. This option has a legacy version in the `[alerting]` section that takes precedence.
# The timeout string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
;evaluation_timeout = 30s
# Number of times we'll attempt to evaluate an alert rule before giving up on that evaluation. This option has a legacy version in the `[alerting]` section that takes precedence.
;max_attempts = 3
# Minimum interval to enforce between rule evaluations. Rules will be adjusted if they are less than this value or if they are not multiple of the scheduler interval (10s). Higher values can help with resource management as we'll schedule fewer evaluations over time. This option has a legacy version in the `[alerting]` section that takes precedence.
# The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
;min_interval = 10s
#################################### Alerting ############################
[alerting]
# Disable alerting engine & UI features
# Disable legacy alerting engine & UI features
;enabled = true
# Makes it possible to turn off alert rule execution but alerting UI is visible
# Makes it possible to turn off alert execution but alerting UI is visible
;execute_alerts = true
# Default setting for new alert rules. Defaults to categorize error and timeouts as alerting. (alerting, keep_state)
@@ -715,7 +779,6 @@
# This limit will protect the server from render overloading and make sure notifications are sent out quickly
;concurrent_render_limit = 5
# Default setting for alert calculation timeout. Default value is 30
;evaluation_timeout_seconds = 30
@@ -995,12 +1058,12 @@
[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"
}
}`
; "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

@@ -6,6 +6,7 @@ This directory contains guides for contributors to the Grafana project.
- [Contributing documentation](documentation.md)
- [Developer guide](developer-guide.md)
- [Triage issues](triage-issues.md)
- [Merge a pull request](merge-pull-request.md)
The `style-guides` directory contains style guides for the Grafana software project and documentation.

View File

@@ -2,71 +2,136 @@
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_.
The service registry keeps track of all available services during runtime. On start-up, Grafana uses the registry to build a dependency graph of services, a _service graph_.
Grafana uses [Wire](https://github.com/google/wire), which is a code generation tool that automates connecting components using [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection). Dependencies between components are represented in Wire as function parameters, encouraging explicit initialization instead of global variables.
Even though the services in Grafana do different things, they share a number of patterns. To better understand how a service works, let's build one from scratch!
## Create a service
Before a service can start communicating with the rest of Grafana, it needs to be registered with Wire, see `ProvideService` factory function/method in the service example below and how it's being referenced in the wire.go example below.
To start building a service:
When Wire is run it will inspect the parameters of `ProvideService` and make sure that all it's dependencies has been wired up and initialized properly.
- Create a new Go package `mysvc` in the [pkg/services](/pkg/services) directory.
- Create a `service.go` file inside your new directory.
All services need to implement the [Service](https://godoc.org/github.com/grafana/grafana/pkg/registry#Service) interface:
**Service example:**
```go
type MyService struct {
package example
// Service service is the service responsible for X, Y and Z.
type Service struct {
logger log.Logger
cfg *setting.Cfg
sqlStore *sqlstore.SQLStore
}
func (s *MyService) Init() error {
// ProvideService provides Service as dependency for other services.
func ProvideService(cfg *setting.Cfg, sqlStore *sqlstore.SQLStore) (*Service, error) {
s := &Service{
logger: log.New("service"),
cfg: cfg,
sqlStore: sqlStore,
}
if s.IsDisabled() {
// skip certain initialization logic
return s, nil
}
if err := s.init(); err != nil {
return nil, err
}
return s, nil
}
func (s *Service) init() error {
// additional initialization logic...
return nil
}
```
The `Init` method is used to initialize and configure the service to make it ready to use. Services that return an error halt Grafana's startup process and cause the error to be logged as it exits.
// IsDisabled returns true if the service is disabled.
//
// Satisfies the registry.CanBeDisabled interface which will guarantee
// that Run() is not called if the service is disabled.
func (s *Service) IsDisabled() bool {
return !s.cfg.IsServiceEnabled()
}
## Register a service
Every service needs to be registered with the application for it to be included in the service graph.
To register a service, call the `registry.RegisterService` function in an `init` function within your package.
```go
func init() {
registry.RegisterService(&MyService{})
// Run runs the service in the background.
//
// Satisfies the registry.BackgroundService interface which will
// guarantee that the service can be registered as a background service.
func (s *Service) Run(ctx context.Context) error {
// background service logic...
<-ctx.Done()
return ctx.Err()
}
```
`init` functions are only run whenever a package is imported, so we also need to import the package in the application. In the `server.go` file under `pkg/server`, import the package we just created:
[wire.go](/pkg/server/wire.go)
```go
import _ "github.com/grafana/grafana/pkg/services/mysvc"
```
// +build wireinject
## Dependencies
package server
Grafana uses the [inject](https://github.com/facebookgo/inject) package to inject dependencies during runtime.
import (
"github.com/google/wire"
"github.com/grafana/grafana/pkg/example"
"github.com/grafana/grafana/pkg/services/sqlstore"
)
For example, to access the [bus](communication.md), add it to the `MyService` struct:
var wireBasicSet = wire.NewSet(
example.ProvideService,
```go
type MyService struct {
Bus bus.Bus `inject:""`
)
var wireSet = wire.NewSet(
wireBasicSet,
sqlstore.ProvideService,
)
var wireTestSet = wire.NewSet(
wireBasicSet,
)
func Initialize(cla setting.CommandLineArgs, opts Options, apiOpts api.ServerOptions) (*Server, error) {
wire.Build(wireExtsSet)
return &Server{}, nil
}
```
You can also inject other services in the same way:
```go
type MyService struct {
Service other.Service `inject:""`
func InitializeForTest(cla setting.CommandLineArgs, opts Options, apiOpts api.ServerOptions, sqlStore *sqlstore.SQLStore) (*Server, error) {
wire.Build(wireExtsTestSet)
return &Server{}, nil
}
```
> **Note:** Any injected dependency needs to be an exported field. Any unexported fields result in a runtime error.
## Background services
A background service is a service that runs in the background of the lifecycle between Grafana starts up and shutdown. If you want a service to be run in the background your Service should satisfy the `registry.BackgroundService` interface and add it as argument to the [ProvideBackgroundServiceRegistry](/pkg/server/backgroundsvcs/background_services.go) function and add it as argument to `NewBackgroundServiceRegistry` to register it as a background service.
You can see an example implementation above of the Run method.
## Disabled services
If you want to guarantee that a background service is not run by Grafana when certain criteria is met/service is disabled your service should satisfy the `registry.CanBeDisabled` interface. When the service.IsDisabled method return false Grafana would not call the service.Run method.
If you want to run certain initialization code if service is disabled or not, you need to handle this in the service factory method.
You can see an example implementation above of the IsDisabled method and custom initialization code when service is disabled.
## Run Wire / generate code
When running `make run` it will call `make gen-go` on the first run. `gen-go` in turn will call the wire binary and generate the code in [wire_gen.go](/pkg/server/wire_gen.go). The wire binary is installed using [bingo](https://github.com/bwplotka/bingo) which will make sure to download and install all the tools needed, including the Wire binary at using a specific version.
## OSS vs Enterprise
Grafana OSS and Grafana Enterprise shares code and dependencies. Grafana Enterprise might need to override/extend certain OSS services.
There's a [wireexts_oss.go](/pkg/server/wireexts_oss.go) that has the `wireinject` and `oss` build tags as requirements. Here services that might have other implementations, e.g. Grafana Enterprise, can be registered.
Similarly, there's a wireexts_enterprise.go file in the Enterprise source code repository where other service implementations can be overridden/be registered.
To extend oss background service create a specific background interface for that type and inject that type to [ProvideBackgroundServiceRegistry](/pkg/server/backgroundsvcs/background_services.go) instead of the concrete type. Then add a wire binding for that interface in [wireexts_oss.go](/pkg/server/wireexts_oss.go) and in the enterprise wireexts file.
## Methods

View File

@@ -55,6 +55,17 @@ Pull requests that create new UI components or modify existing ones must adhere
- 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.
Pull requests that introduce accessibility(a11y) errors:
We use [pa11y-ci](https://github.com/pa11y/pa11y-ci) to collect accessibility errors on [some URLs on the project](https://github.com/grafana/grafana/issues/36555), threshold errors are specified per URL.
If the contribution introduces new a11y errors, our continuous integration will fail, preventing you to merge on the main branch. In those cases there are two alternatives for moving forward:
- Check the error log on the pipeline step `test-a11y-frontend-pr`, identify what was the error, and fix it.
- Locally run the command `yarn test:accessibility-report` that generates an HTML accessibility report, then go to the URL that contains your change, identify the error, and fix it. Keep in mind, a local Grafana instance needs to be running on `http://localhost:3000`.
You can also prevent introducing a11y errors by installing an a11y plugin in your browser, for example, axe DevTools, Accessibility Insights for Web among others.
### Backend-specific guidelines
Please refer to the [backend style guidelines](/contribute/style-guides/backend.md).
@@ -102,6 +113,8 @@ For changes to panels, the area should be the name of the panel, suffixed with P
- `GraphPanel: Fix legend sorting issues`
- `Docs: Changed url to URL in all documentation files`
If you're unsure, please have a look at the existing [changelog](https://github.com/grafana/grafana/blob/main/CHANGELOG.md) for inspiration/guidance.
### Pull request titles
The Grafana team _squashes_ all commits into one when we accept a pull request. The title of the pull request becomes the subject line of the squashed commit message. We still encourage contributors to write informative commit messages, as they becomes a part of the Git commit body.

View File

@@ -0,0 +1,118 @@
# Merge a pull request
When a pull request has been reviewed and approved by at least one person and all checks have passed it's time to merge the pull request.
## Who is expected to merge a pull request?
Maintainers are responsible for merging all pull requests. If a maintainer has opened a pull request the general rule is that the same maintainer merges the pull request. If a non-maintainer has opened a pull request it's suggested that one of the maintainers reviewing the pull request merges the pull request.
## Checklist/summary
The following checklist/summary should give you a quick overview of what to ask/consider before merging a pull request.
- Reviewed and approved?
- All checks passed?
- Proper pull request title?
- Milestone assigned?
- Add to changelog/release notes?
- Needs backporting?
## Before merge
Before actually merging a pull request there's a couple of things to take into consideration.
### Format the pull request title
Make sure that the pull request title is properly formatted according to `<Area>: <Summary>` and try to make the summary short and understandable for the community as a whole.
All commits in a pull request are squashed when merged and the pull request title will be the default subject line of the squashed commit message. It's also used for [changelog/release notes](#include-in-changelog-and-release-notes).
See [formatting guidelines](create-pull-request.md#formatting-guidelines) for more information.
### Assign a milestone
It's recommended to add a milestone to every pull request. This makes it easier to track what changes did go into a certain release. Without this you're basically left with going through git commits which could be a lot harder.
There's also various tooling built that in some cases requires a pull request to be assigned a milestone, for example [generating changelog/release notes](#include-in-changelog-and-release-notes).
### Include in changelog and release notes?
At Grafana we generate the [changelog](https://github.com/grafana/grafana/blob/main/CHANGELOG.md) and [release notes](https://grafana.com/docs/grafana/latest/release-notes/) based on merged pull requests. Including changes in the changelog/release notes is very important to provide a somewhat complete picture of what changes a Grafana release actually includes.
Exactly what changes should be added to the changelog is hard to answer but some general guidance would be any change that you think would be interesting for the community as a whole. Use your best judgement and/or ask other maintainers for advice.
There's a GitHub action available in the repository named [Update changelog](https://github.com/grafana/grafana/blob/main/.github/workflows/update-changelog.yml) that can manually be triggered to re-generate the changelog and release notes for any release.
To include a pull request in the changelog/release notes the general rule of thumb is that a milestone should be assigned and labeled with `add to changelog`.
The changelog/release notes are divided into sections and here's a description of how you make a pull request show up in a certain section.
**Features and enhancements:**
Milestone assigned and labeled with `add to changelog` and any of the other section rules don't apply.
**Bug fixes:**
Milestone assigned and labeled with `add to changelog` and either labeled with `type/bug` or the pull request title contains `fix` or `fixes`.
**Plugin development fixes & changes:**
Milestone assigned and labeled with `area/grafana/toolkit`, `area/grafana/ui` or `area/grafana/runtime`.
**Deprecations:**
In case the pull request introduces a deprecation you should document this. Label the pull request with `add to changelog` and use the following template at the end of the pull request description describing the deprecation change.
```md
# Deprecation notice
<Deprecation description>
```
**Breaking changes:**
In case the pull request introduces a breaking change you should document this. Label the pull request with `add to changelog` and `breaking change` and use the following template at the end of the pull request description describing the breaking change.
```md
# Release notice breaking change
<Breaking change description>
```
### Should the pull request be backported?
If your pull request has changes that need to go into one or several existing release branches you need to backport the changes. Please refer to [Backport PR](.github/bot.md#backport-pr) for detailed instructions.
Some examples when backport is required:
- The change needs to be released in the next upcoming patch release, e.g. v8.1.3, so you have to backport it, e.g. into the v8.1.x release branch.
- You have a change to be released in the next major/minor release, e.g. v8.0.0, and there's already a release branch, e.g. v8.0.x, you have to backport it, e.g. into the v8.0.x release branch.
- The change includes documentation changes that needs to be updated for one or multiple older versions, then you have to backport it to each release branch.
Some examples when backport is not required:
- The change is supposed to be released in the next major/minor release, e.g. v8.0.0, but the release branch, e.g. v8.0.x, has not yet been created.
> **Note:** You can still backport a pull request after it's been merged.
## Doing the actual merge
Time to actually merge the pull request changes. All commits in a pull request are squashed, hence the GitHub `Squash and merge` button is used to initialize the merge.
This will present you with options allowing you to optionally change the commit message before merging. Please remember that developers might use the commit information when reviewing changes of files, doing git blame and resolving merge conflicts etc., trying to quickly figure out what the actual change was. But there's not really any best practices around this, the following is an attempt to bring some guidance.
Do:
- Make sure the pull request title is formatted properly before merging, this will automatically give you a good and short summary of the commit/change.
- Leave `Co-authored-by:` lines as is so that co-authors will be accounted for the contribution.
- Remove any commit information that doesn't bring any context to the change.
Consider:
- Add any references to issues that the pull request fixes/closes/references to ease giving quick context to things. Doing this allows cross-reference between the commit and referenced issue(s).
Finalize the merge by clicking on the `Confirm squash and merge` button.
## After the merge
Make sure to close any referenced/related issues. It's recommended to assign the same milestone on the issues that the pull request fixes/closes, but not required.

View File

@@ -4,13 +4,13 @@ This style guide applies to all documentation created for Grafana products.
For information about how to write technical documentation, refer to the following resources:
* [Google Technical Writing courses](https://developers.google.com/tech-writing)
* [Divio documentation system](https://documentation.divio.com/)
* [Vue writing principles](https://v3.vuejs.org/guide/contributing/writing-guide.html#principles)
- [Google Technical Writing courses](https://developers.google.com/tech-writing)
- [Divio documentation system](https://documentation.divio.com/)
- [Vue writing principles](https://v3.vuejs.org/guide/contributing/writing-guide.html#principles)
## Contributing
The *Documentation style guide* is a living document. Add to it whenever a style decision is made or a question is answered regarding style, grammar, or word choice.
The _Documentation style guide_ is a living document. Add to it whenever a style decision is made or a question is answered regarding style, grammar, or word choice.
## Published guides
@@ -46,10 +46,14 @@ Avoid _master_ or _slave_.
## Grafana-specific style
The following guidelines are specific to Grafana documentation. For the most part, these are *guidelines* are not rigid rules. If you have questions, then please ask in the #docs channel of Grafana Slack.
The following guidelines are specific to Grafana documentation. For the most part, these are _guidelines_ are not rigid rules. If you have questions, then please ask in the #docs channel of Grafana Slack.
### General
Per the [Voice and tone](https://developers.google.com/style/tone) section of the Google developer documentation style guide:
> In your documents, aim for a voice and tone that's conversational, friendly, and respectful without being overly colloquial or frivolous; a voice that's casual and natural and approachable, not pedantic or pushy. Try to sound like a knowledgeable friend who understands what the developer wants to do.
- Use active voice:
- Active: Grafana displays the heatmap visualization.
- Passive: The heatmap visualization is displayed.
@@ -104,6 +108,7 @@ However, sometimes we need to use headings as numbered steps. This is mostly in
If that is the case, then use the following format for headings:
##### Step 1. Install the software
##### Step 2. Run the software
### Images
@@ -149,6 +154,7 @@ In general, "integration" is not capitalized. Only capitalize it if it is capita
The first letter of the name of an integration is always capitalized, even if the original named source is lowercase.
**Examples:**
- MySQL Integration
- CockroachDB Integration
- Etcd Integration
@@ -212,16 +218,20 @@ Warnings tell the user not to do something. For example:
- Do not assume everyone is using Linux. Make sure instructions include enough information for Windows and Mac users to successfully complete procedures.
- Do not add `$` before commands. Make it easy for users to copy and paste commands.
- **Right:** `sudo yum install grafana`
- **Wrong:** `$ sudo yum install grafana`
- Include `sudo` before commands that require `sudo` to work.
For terminal examples and Grafana configuration, use a `bash` code block:
```bash
sudo yum install grafana
```
For HTTP request/response, use an `http` code block:
```http
GET /api/dashboards/id/1/permissions HTTP/1.1
Accept: application/json
@@ -259,6 +269,7 @@ Two words if used as a verb, one word if used as a noun.
Two words, not one.
**Exceptions:**
- "datasource" used as an identifier
- "datasource" in a URL
- Use "data source" instead of "datasource" unless used as an identifier, in code, or as part of a URL.
@@ -267,7 +278,8 @@ Two words, not one.
#### display (verb)
*Display* is a transitive verb, which means it always needs a direct object.
_Display_ is a transitive verb, which means it always needs a direct object.
- Correct, active voice: Grafana displays your list of active alarms.
- Correct, but passive voice: Your list of active alarms is displayed.
- Incorrect: The list of active alarms displays.
@@ -327,6 +339,7 @@ Two words, not one.
**Incorrect:** webserver
### MS SQL Server
Always use "MS SQL" when referring to MS SQL Server application.
Incorrect UI spellings will be corrected in a later version of Grafana.

View File

@@ -23,20 +23,13 @@ Inspired by https://martinfowler.com/bliki/PageObject.html
Let's start with a simple [JSX](https://reactjs.org/docs/introducing-jsx.html) example containing a single input field that we want to populate during our E2E test:
```jsx
<input
className="gf-form-input login-form-input"
type="text"
/>
<input className="gf-form-input login-form-input" type="text" />
```
We _could_ target the field with a CSS selector like `.gf-form-input.login-form-input` but that would be brittle as style changes occur frequently. Furthermore there is nothing that signals to future developers that this input is part of an E2E test. At Grafana, we use `aria-label` attributes as our preferred way of defining selectors instead of [`data-*`](https://mdn.io/docs/Web/HTML/Global_attributes/data-*) as they also aid in [accessibility](https://mdn.io/docs/Learn/Accessibility/What_is_accessibility):
```jsx
<input
aria-label="Username input field"
className="gf-form-input login-form-input"
type="text"
/>
<input aria-label="Username input field" className="gf-form-input login-form-input" type="text" />
```
The next step is to create a `Page` representation in our E2E framework to glue the test with the real implementation using the `pageFactory` function. For that function we can supply a `url` and `selectors` like in the example below:
@@ -45,7 +38,6 @@ The next step is to create a `Page` representation in our E2E framework to glue
export const Login = {
// Called via `Login.visit()`
url: '/login',
// Called via `Login.username()`
username: 'Username input field',
};
@@ -67,11 +59,7 @@ Now that we have a `Page` called `Login` in our `Pages` const we can use that to
```jsx
import { selectors } from '@grafana/e2e-selectors';
<input
aria-label={selectors.pages.Login.username}
className="gf-form-input login-form-input"
type="text"
/>
<input aria-label={selectors.pages.Login.username} className="gf-form-input login-form-input" type="text" />;
```
The last step in our example is to use our `Login` page as part of a test.
@@ -86,9 +74,7 @@ describe('Login test', () => {
e2e.pages.Login.visit();
// To prevent flaky tests, always do a `.should` on any selector that you expect to be in the DOM.
// Read more here: https://docs.cypress.io/guides/core-concepts/retry-ability.html#Commands-vs-assertions
e2e.pages.Login.username()
.should('be.visible')
.type('admin');
e2e.pages.Login.username().should('be.visible').type('admin');
});
});
```
@@ -154,25 +140,28 @@ describe('List test', () => {
e2e.pages.DataSources.visit();
// To prevent flaky tests, always do a .should on any selector that you expect to be in the DOM.
// Read more here: https://docs.cypress.io/guides/core-concepts/retry-ability.html#Commands-vs-assertions
e2e.pages.DataSources.dataSources('B')
.should('be.visible')
.click();
e2e.pages.DataSources.dataSources('B').should('be.visible').click();
});
});
```
## 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.
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.
The example might read aloud to a user as "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.
@@ -185,16 +174,18 @@ In such cases rather than adding unnecessary aria-labels to components so as to
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
openButton: 'open-button', // this would look for an aria-label
closeButton: 'data-testid modal-close-button', // this would look for a data-testid
},
};
```
and in your component, import the selectors and add the data test id:
```
<button data-testid={Selectors.Components.Login.closeButton}>
```
<button data-testid={Selectors.Components.Login.openButton}>
```

View File

@@ -5,6 +5,7 @@ Generally we follow the Airbnb [React Style Guide](https://github.com/airbnb/jav
## Table of Contents
- [Frontend Style Guide](#frontend-style-guide)
- [Table of Contents](#table-of-contents)
- [Basic rules](#basic-rules)
- [Naming conventions](#naming-conventions)
@@ -28,12 +29,12 @@ Generally we follow the Airbnb [React Style Guide](https://github.com/airbnb/jav
- [Linting](#linting)
- [React](#react)
- [Props](#props)
- [Name callback props and handlers with an "on" prefix.](#name-callback-props-and-handlers-with-an-on-prefix)
- [React Component definitions](#react-component-definitions)
- [React Component constructor](#react-component-constructor)
- [React Component defaultProps](#react-component-defaultprops)
- [Name callback props and handlers with an "on" prefix.](#name-callback-props-and-handlers-with-an-on-prefix)
- [React Component definitions](#react-component-definitions)
- [React Component constructor](#react-component-constructor)
- [React Component defaultProps](#react-component-defaultprops)
- [State management](#state-management)
- [Proposal for removing or replacing Angular dependencies](https://github.com/grafana/grafana/pull/23048)
## Basic rules
@@ -194,12 +195,12 @@ _SASS styles are deprecated. Please migrate to Emotion whenever you need to modi
### Typing
In general, you should let Typescript infer the types so that there's no need to explicitly define type for each variable.
In general, you should let Typescript infer the types so that there's no need to explicitly define type for each variable.
There are some exceptions to this:
```typescript
// Typescript needs to know type of arrays or objects otherwise it would infer it as array of any
// Typescript needs to know type of arrays or objects otherwise it would infer it as array of any
// bad
const stringArray = [];
@@ -208,7 +209,7 @@ const stringArray = [];
const stringArray: string[] = [];
```
Specify function return types explicitly in new code. This improves readability by being able to tell what a function returns just by looking at the signature. It also prevents errors when a function's return type is broader than expected by the author.
Specify function return types explicitly in new code. This improves readability by being able to tell what a function returns just by looking at the signature. It also prevents errors when a function's return type is broader than expected by the author.
> **Note:** We don't have linting for this enabled because of lots of old code that needs to be fixed first.
@@ -216,18 +217,18 @@ Specify function return types explicitly in new code. This improves readability
// bad
function transform(value?: string) {
if (!value) {
return undefined
return undefined;
}
return applyTransform(value)
};
return applyTransform(value);
}
// good
function transform(value?: string): TransformedValue | undefined {
if (!value) {
return undefined
return undefined;
}
return applyTransform(value)
};
return applyTransform(value);
}
```
### File and directory naming conventions
@@ -244,6 +245,8 @@ For files exporting multiple utility functions, use the name that describes the
- Use `reducers.ts` Redux reducers.
- Use `*.test.ts(x)` for test files.
- Use kebab case for directory names: lowercase, words delimited by hyphen ( `-` ). For example, `features/new-important-feature/utils.ts`.
### Code organization
Organize your code in a directory that encloses feature code:

View File

@@ -120,7 +120,7 @@ Example use cases:
### Typography
For font family, font sizes and line heights use the variables under `theme.typography`.
For font family, font sizes and line heights use the variables under `theme.typography`.
#### Using `ThemeContext` directly

View File

@@ -1,212 +0,0 @@
package grafanaschema
import "github.com/grafana/grafana/cue/scuemata"
Family: scuemata.#Family & {
lineages: [
[
{ // 0.0
// Unique numeric identifier for the dashboard.
// TODO must isolate or remove identifiers local to a Grafana instance...?
id?: number
// Unique dashboard identifier that can be generated by anyone. string (8-40)
uid?: string
// Title of dashboard.
title?: string
// Description of dashboard.
description?: string
gnetId?: string
// Tags associated with dashboard.
tags?: [...string]
// Theme of dashboard.
style: *"light" | "dark"
// Timezone of dashboard,
timezone?: *"browser" | "utc"
// Whether a dashboard is editable or not.
editable: bool | *true
// 0 for no shared crosshair or tooltip (default).
// 1 for shared crosshair.
// 2 for shared crosshair AND shared tooltip.
graphTooltip: >=0 & <=2 | *0
// Time range for dashboard, e.g. last 6 hours, last 7 days, etc
time?: {
from: string | *"now-6h"
to: string | *"now"
}
// Timepicker metadata.
timepicker?: {
// Whether timepicker is collapsed or not.
collapse: bool | *false
// Whether timepicker is enabled or not.
enable: bool | *true
// Whether timepicker is visible or not.
hidden: bool | *false
// Selectable intervals for auto-refresh.
refresh_intervals: [...string] | *["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"]
}
// Templating.
templating?: list: [...{...}]
// Annotations.
annotations?: list: [...{
builtIn: number | *0
// Datasource to use for annotation.
datasource: string
// Whether annotation is enabled.
enable?: bool | *true
// Whether to hide annotation.
hide?: bool | *false
// Annotation icon color.
iconColor?: string
// Name of annotation.
name?: string
type: string | *"dashboard"
// Query for annotation data.
rawQuery?: string
showIn: number | *0
}]
// Auto-refresh interval.
refresh?: string
// Version of the JSON schema, incremented each time a Grafana update brings
// changes to said schema.
schemaVersion: number | *25
// Version of the dashboard, incremented each time the dashboard is updated.
version?: number
panels?: [...#Panel]
// Dashboard panels. Panels are canonically defined inline
// because they share a version timeline with the dashboard
// schema; they do not vary independently. We create a separate,
// synthetic Family to represent them in Go, for ease of generating
// e.g. JSON Schema.
#Panel: {
// The panel plugin type id.
type: !=""
// Internal - the exact major and minor versions of the panel plugin
// schema. Hidden and therefore not a part of the data model, but
// expected to be filled with panel plugin schema versions so that it's
// possible to figure out which schema version matched on a successful
// unification.
// _pv: { maj: int, min: int }
// The major and minor versions of the panel plugin for this schema.
// TODO 2-tuple list instead of struct?
panelSchema?: { maj: number, min: number }
// Panel title.
title?: string
// Description.
description?: string
// Whether to display the panel without a background.
transparent: bool | *false
// Name of default datasource.
datasource?: string
// Grid position.
gridPos?: {
// Panel
h: number & >0 | *9
// Panel
w: number & >0 & <=24 | *12
// Panel x
x: number & >=0 & <24 | *0
// Panel y
y: number & >=0 | *0
// true if fixed
static?: bool
}
// Panel links.
// links?: [..._panelLink]
// Name of template variable to repeat for.
repeat?: string
// Direction to repeat in if 'repeat' is set.
// "h" for horizontal, "v" for vertical.
repeatDirection: *"h" | "v"
// Schema for panel targets is specified by datasource
// plugins. We use a placeholder definition, which the Go
// schema loader either left open/as-is with the Base
// variant of the Dashboard and Panel families, or filled
// with types derived from plugins in the Instance variant.
// When working directly from CUE, importers can extend this
// type directly to achieve the same effect.
targets?: [...{...}]
// The values depend on panel type
options: {...}
fieldConfig: {
defaults: {
// The display value for this field. This supports template variables blank is auto
displayName?: string
// This can be used by data sources that return and explicit naming structure for values and labels
// When this property is configured, this value is used rather than the default naming strategy.
displayNameFromDS?: string
// Human readable field metadata
description?: string
// An explict path to the field in the datasource. When the frame meta includes a path,
// This will default to `${frame.meta.path}/${field.name}
//
// When defined, this value can be used as an identifier within the datasource scope, and
// may be used to update the results
path?: string
// True if data source can write a value to the path. Auth/authz are supported separately
writeable?: bool
// True if data source field supports ad-hoc filters
filterable?: bool
// Numeric Options
unit?: string
// Significant digits (for display)
decimals?: number
min?: number
max?: number
// // Convert input values into a display string
// mappings?: ValueMapping[];
// // Map numeric values to states
// thresholds?: ThresholdsConfig;
// // Map values to a display color
// color?: FieldColor;
// // Used when reducing field values
// nullValueMode?: NullValueMode;
// // The behavior when clicking on a result
links?: [...]
// Alternative to empty string
noValue?: string
// Can always exist. Valid fields within this are
// defined by the panel plugin - that's the
// PanelFieldConfig that comes from the plugin.
custom?: {}
}
overrides: [...{
matcher: {
id: string | *""
options?: _
}
properties: [...{
id: string | *""
value?: _
}]
}]
}
}
}
]
]
}
#Latest: {
#Dashboard: Family.latest
#Panel: Family.latest._Panel
}

View File

@@ -8,10 +8,10 @@ package scuemata
// the larger Dashboard schema.
#PanelSchema: {
// Defines plugin specific options for a panel
PanelOptions: {...}
PanelOptions: {...} @cuetsy(kind="interface")
// Define the custom properties that exist within standard field config
PanelFieldConfig?: {...}
PanelFieldConfig?: {...} @cuetsy(kind="interface")
// Panels may define their own types
...

View File

@@ -14,6 +14,7 @@ package scuemata
// its position in the list of lineages - e.g., 0.0 corresponds to the first
// schema in the first lineage.
#Family: {
compose?: {...}
lineages: [#Lineage, ...#Lineage]
migrations: [...#Migration]
let lseq = lineages[len(lineages)-1]

View File

@@ -1,93 +0,0 @@
package grafanaschema
TableCellDisplayMode: {
Auto: "auto",
ColorText: "color-text",
ColorBackground: "color-background",
GradientGauge: "gradient-gauge",
LcdGauge: "lcd-gauge",
JSONView: "json-view",
BasicGauge: "basic",
Image: "image",
} @cuetsy(targetType="enum")
TableFieldOptions: {
width?: number
align: FieldTextAlignment | *"auto"
displayMode: TableCellDisplayMode | *"auto"
hidden?: bool // ?? default is missing or false ??
} @cuetsy(targetType="interface")
TableSortByFieldState: {
displayName: string
desc?: bool
} @cuetsy(targetType="interface")
TooltipDisplayMode: "single" | "multi" | "none" @cuetsy(targetType="enum")
FieldTextAlignment: "auto" | "left" | "right" | "center" @cuetsy(targetType="type")
AxisPlacement: "auto" | "top" | "right" | "bottom" | "left" | "hidden" @cuetsy(targetType="enum")
PointVisibility: "auto" | "never" | "always" @cuetsy(targetType="enum")
DrawStyle: "line" | "bars" | "points" @cuetsy(targetType="enum")
LineInterpolation: "linear" | "smooth" | "stepBefore" | "stepAfter" @cuetsy(targetType="enum")
ScaleDistribution: "linear" | "log" @cuetsy(targetType="enum")
GraphGradientMode: "none" | "opacity" | "hue" | "scheme" @cuetsy(targetType="enum")
LineStyle: {
fill?: "solid" | "dash" | "dot" | "square"
dash?: [number]
} @cuetsy(targetType="interface")
LineConfig: {
lineColor?: string
lineWidth?: number
lineInterpolation?: LineInterpolation
lineStyle?: LineStyle
spanNulls?: bool
} @cuetsy(targetType="interface")
FillConfig: {
fillColor?: string
fillOpacity?: number
fillBelowTo?: string
} @cuetsy(targetType="interface")
PointsConfig: {
showPoints?: PointVisibility
pointSize?: number
pointColor?: string
pointSymbol?: string
} @cuetsy(targetType="interface")
ScaleDistributionConfig: {
type: ScaleDistribution
log?: number
} @cuetsy(targetType="interface")
AxisConfig: {
axisPlacement?: AxisPlacement
axisLabel?: string
axisWidth?: number
axisSoftMin?: number
axisSoftMax?: number
scaleDistribution?: ScaleDistributionConfig
} @cuetsy(targetType="interface")
HideSeriesConfig: {
tooltip: bool
legend: bool
graph: bool
} @cuetsy(targetType="interface")
LegendPlacement: "bottom" | "right" @cuetsy(targetType="type")
LegendDisplayMode: "list" | "table" | "hidden" @cuetsy(targetType="enum")
TableFieldOptions: {
width?: number
align: FieldTextAlignment | *"auto"
displayMode: TableCellDisplayMode | *"auto"
hidden?: bool
} @cuetsy(targetType="interface")
GraphFieldConfig: LineConfig & FillConfig & PointsConfig & AxisConfig & {
drawStyle?: DrawStyle
gradientMode?: GraphGradientMode
hideFrom?: HideSeriesConfig
} @cuetsy(targetType="interface")
VizLegendOptions: {
displayMode: LegendDisplayMode
placement: LegendPlacement
calcs: [string]
} @cuetsy(targetType="interface")
VizTooltipOptions: {
mode: TooltipDisplayMode
} @cuetsy(targetType="interface")

View File

@@ -55,6 +55,9 @@ Jaeger block runs both Jaeger and Loki container. Loki container sends traces to
| 1.0 | graphite1 | 8280 | 2203 | 2203 |
| 0.9 | graphite09 | 8380 | 2303 | 2303 |
## Debugging setup in VS Code
An example of launch.json is provided in `devenv/vscode/launch.json`. It basically does what Makefile and .bra.toml do. The 'program' field is set to the folder name so VS Code loads all *.go files in it instead of just main.go.
## Troubleshooting
### Containers that read from log files fail to start (Mac OS)

View File

@@ -13,7 +13,6 @@
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 3151,
"links": [],
@@ -90,9 +89,7 @@
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "CPU per host",
"tooltip": {
"shared": true,
@@ -101,33 +98,24 @@
},
"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
"align": false
}
},
{
@@ -199,9 +187,7 @@
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Login Count per host",
"tooltip": {
"shared": true,
@@ -210,33 +196,24 @@
},
"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
"align": false
}
}
],
@@ -255,4 +232,4 @@
"title": "Datasource tests - OpenTSDB v2.3",
"uid": "rZRUGik7k",
"version": 3
}
}

View File

@@ -511,7 +511,6 @@
},
"id": 41,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -613,7 +612,6 @@
},
"id": 42,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -716,7 +714,6 @@
},
"id": 32,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -819,7 +816,6 @@
},
"id": 44,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -2070,7 +2066,6 @@
"id": 29,
"maxDataPoints": 500,
"options": {
"graph": {},
"legend": {
"calcs": [
"last"

View File

@@ -13,13 +13,11 @@
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 625,
"links": [],
"panels": [
{
"datasource": null,
"gridPos": {
"h": 4,
"w": 24,
@@ -38,13 +36,10 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"transparent": true,
"type": "text"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 8,
@@ -107,8 +102,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -166,7 +160,6 @@
"type": "state-timeline"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 15,
@@ -207,8 +200,7 @@
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
"color": "blue"
},
{
"color": "green",
@@ -267,10 +259,9 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
@@ -293,8 +284,7 @@
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
"color": "blue"
},
{
"color": "green",
@@ -343,7 +333,6 @@
"type": "timeseries"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 13,
@@ -386,8 +375,7 @@
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
"color": "blue"
},
{
"color": "#EAB839",
@@ -473,8 +461,7 @@
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
"color": "blue"
},
{
"color": "#EAB839",
@@ -522,7 +509,6 @@
"type": "status-history"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 3,
@@ -562,7 +548,7 @@
"fillOpacity": 74,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -573,8 +559,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -679,7 +664,7 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -713,8 +698,7 @@
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
"color": "blue"
}
]
},
@@ -757,7 +741,6 @@
"type": "barchart"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 3,
@@ -783,7 +766,6 @@
"type": "text"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 6,
@@ -823,7 +805,7 @@
"fillOpacity": 50,
"gradientMode": "hue",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -848,8 +830,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -924,8 +905,6 @@
"stringInput": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Interpolation mode: smooth",
"type": "timeseries"
},
@@ -944,7 +923,7 @@
"fillOpacity": 40,
"gradientMode": "hue",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -969,8 +948,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -1045,8 +1023,6 @@
"stringInput": "1,20,90,30,5,0"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Interpolation mode: Step before",
"type": "timeseries"
},
@@ -1065,7 +1041,7 @@
"fillOpacity": 40,
"gradientMode": "hue",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -1090,8 +1066,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -1166,13 +1141,10 @@
"stringInput": "1,20,90,30,5,0"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Interpolation mode: Step after",
"type": "timeseries"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 8,
@@ -1210,12 +1182,9 @@
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": {
"label": "None",
"value": "none"
},
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -1240,8 +1209,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -1261,7 +1229,6 @@
},
"id": 41,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -1300,8 +1267,6 @@
"stringInput": "10,11,12,11,10,11,12,12,11,10,9,10,11,12,10,10,11,12,13,11,10,9,10,11,12,13,14,10,10"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Auto min max",
"type": "timeseries"
},
@@ -1319,12 +1284,9 @@
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": {
"label": "None",
"value": "none"
},
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -1351,8 +1313,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -1372,7 +1333,6 @@
},
"id": 32,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -1411,8 +1371,6 @@
"stringInput": "10,11,12,11,10,11,12,12,11,10,9,10,11,12,200,10,11,12,13,11,10,9,10,11,12,13,14,10,10"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Hard min 0, max 30",
"type": "timeseries"
},
@@ -1432,12 +1390,9 @@
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": {
"label": "None",
"value": "none"
},
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -1462,8 +1417,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -1483,7 +1437,6 @@
},
"id": 44,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -1522,13 +1475,10 @@
"stringInput": "10,11,12,11,10,11,12,12,11,10,9,10,11,12,200,10,11,12,13,11,10,9,10,11,12,13,14,10,10"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Soft min 0, soft max 30",
"type": "timeseries"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 5,
@@ -1570,7 +1520,7 @@
"fillOpacity": 0,
"gradientMode": "opacity",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -1595,8 +1545,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -1769,7 +1718,6 @@
"type": "timeseries"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 5,
@@ -1807,12 +1755,9 @@
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": {
"label": "None",
"value": "none"
},
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -1844,8 +1789,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -2133,12 +2077,9 @@
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": {
"label": "None",
"value": "none"
},
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -2170,8 +2111,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -2461,7 +2401,7 @@
"fillOpacity": 82,
"gradientMode": "hue",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -2493,8 +2433,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -2573,7 +2512,6 @@
"type": "timeseries"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 3,
@@ -2609,7 +2547,7 @@
"fillOpacity": 80,
"gradientMode": "hue",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -2620,8 +2558,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -2655,7 +2592,6 @@
"y": 83
},
"id": 49,
"maxDataPoints": null,
"options": {
"bucketOffset": 0,
"bucketSize": 10,
@@ -2719,8 +2655,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -2754,7 +2689,6 @@
"y": 83
},
"id": 77,
"maxDataPoints": null,
"options": {
"showHeader": true
},
@@ -2838,4 +2772,4 @@
"title": "New Features in v8.0",
"uid": "8mux8PqGz",
"version": 17
}
}

View File

@@ -19,12 +19,10 @@
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"links": [],
"panels": [
{
"datasource": null,
"gridPos": {
"h": 26,
"w": 6,
@@ -34,7 +32,6 @@
"id": 7,
"links": [],
"options": {
"folderId": null,
"maxItems": 100,
"query": "",
"showHeadings": true,
@@ -45,13 +42,10 @@
},
"pluginVersion": "8.1.0-pre",
"tags": [],
"timeFrom": null,
"timeShift": null,
"title": "Starred",
"type": "dashlist"
},
{
"datasource": null,
"gridPos": {
"h": 13,
"w": 6,
@@ -75,13 +69,10 @@
"tags": [
"panel-tests"
],
"timeFrom": null,
"timeShift": null,
"title": "tag: panel-tests",
"type": "dashlist"
},
{
"datasource": null,
"gridPos": {
"h": 13,
"w": 6,
@@ -91,7 +82,6 @@
"id": 3,
"links": [],
"options": {
"folderId": null,
"maxItems": 1000,
"query": "",
"showHeadings": false,
@@ -108,13 +98,10 @@
"gdev",
"demo"
],
"timeFrom": null,
"timeShift": null,
"title": "tag: dashboard-demo",
"type": "dashlist"
},
{
"datasource": null,
"gridPos": {
"h": 26,
"w": 6,
@@ -124,7 +111,6 @@
"id": 5,
"links": [],
"options": {
"folderId": null,
"maxItems": 1000,
"query": "",
"showHeadings": false,
@@ -141,13 +127,10 @@
"gdev",
"datasource-test"
],
"timeFrom": null,
"timeShift": null,
"title": "Data source tests",
"type": "dashlist"
},
{
"datasource": null,
"gridPos": {
"h": 13,
"w": 6,
@@ -173,13 +156,10 @@
"templating",
"gdev"
],
"timeFrom": null,
"timeShift": null,
"title": "tag: templating ",
"type": "dashlist"
},
{
"datasource": null,
"gridPos": {
"h": 13,
"w": 6,
@@ -205,8 +185,6 @@
"gdev",
"demo"
],
"timeFrom": null,
"timeShift": null,
"title": "tag: transforms",
"type": "dashlist"
}
@@ -250,4 +228,4 @@
"title": "Grafana Dev Overview & Home",
"uid": "j6T00KRZz",
"version": 2
}
}

View File

@@ -19,12 +19,10 @@
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"links": [],
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -37,7 +35,6 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -49,8 +46,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -80,6 +76,7 @@
},
"orientation": "auto",
"showValue": "auto",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -87,7 +84,7 @@
},
"targets": [
{
"csvContent": "Name,Stat1,Stat2\nStockholm, 10, 15\nNew York, 19, 5\nLondon, 10, 1\nNegative, 15, -5\nLong value, 15,10",
"csvContent": "Time,Name,Stat1,Stat2\n2020-01-01T00:00:00Z,Stockholm, 10, 15\n2020-01-01T00:00:00Z,New York, 19, 5\n2020-01-01T00:00:00Z,London, 10, 1\n2020-01-01T00:00:00Z,Negative, 15, -5\n2020-01-01T00:00:00Z,Long value, 15,10",
"refId": "A",
"scenarioId": "csv_content"
}
@@ -96,7 +93,6 @@
"type": "barchart"
},
{
"datasource": null,
"description": "Should be smaller given the longer value",
"fieldConfig": {
"defaults": {
@@ -110,7 +106,6 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -123,8 +118,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -154,6 +148,7 @@
},
"orientation": "auto",
"showValue": "auto",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -170,7 +165,6 @@
"type": "barchart"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -183,7 +177,6 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -195,8 +188,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -226,6 +218,7 @@
},
"orientation": "auto",
"showValue": "auto",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -242,7 +235,6 @@
"type": "barchart"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -255,7 +247,6 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -267,8 +258,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -298,6 +288,7 @@
},
"orientation": "auto",
"showValue": "always",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -327,7 +318,6 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -339,8 +329,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -368,8 +357,9 @@
},
"orientation": "auto",
"showValue": "auto",
"stacking": "none",
"text": {
"size": 10,
"titleSize": 10,
"valueSize": 25
},
"tooltip": {
@@ -386,7 +376,6 @@
"type": "barchart"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -399,7 +388,6 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -412,8 +400,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -443,6 +430,7 @@
},
"orientation": "horizontal",
"showValue": "auto",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -459,7 +447,6 @@
"type": "barchart"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
@@ -473,7 +460,6 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -485,8 +471,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -516,6 +501,7 @@
},
"orientation": "horizontal",
"showValue": "auto",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -552,4 +538,4 @@
"title": "BarChart - Panel Tests - Value sizing",
"uid": "WFlOM-jM1",
"version": 9
}
}

View File

@@ -0,0 +1,395 @@
{
"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,
"graphTooltip": 0,
"links": [],
"liveNow": false,
"panels": [
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 11,
"w": 9,
"x": 0,
"y": 0
},
"id": 62,
"options": {
"basemap": {
"config": {},
"type": "default"
},
"controls": {
"mouseWheelZoom": true,
"showAttribution": true,
"showDebug": false,
"showScale": false,
"showZoom": true
},
"layers": [
{
"config": {
"color": {
"field": "Price",
"fixed": "dark-green"
},
"fillOpacity": 0.4,
"shape": "circle",
"showLegend": true,
"size": {
"field": "Count",
"fixed": 5,
"max": 15,
"min": 2
}
},
"location": {
"gazetteer": "public/gazetteer/usa-states.json",
"lookup": "State",
"mode": "auto"
},
"type": "markers"
}
],
"view": {
"id": "coords",
"lat": 38.297683,
"lon": -99.228359,
"shared": true,
"zoom": 3.98
}
},
"targets": [
{
"csvFileName": "flight_info_by_state.csv",
"refId": "A",
"scenarioId": "csv_file"
}
],
"title": "Size, color mapped to different fields + share view",
"type": "geomap"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
},
{
"color": "#EAB839",
"value": 90
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 11,
"w": 9,
"x": 9,
"y": 0
},
"id": 66,
"options": {
"basemap": {
"config": {},
"type": "default"
},
"controls": {
"mouseWheelZoom": true,
"showAttribution": true,
"showDebug": false,
"showScale": false,
"showZoom": true
},
"layers": [
{
"config": {
"color": {
"field": "Price",
"fixed": "dark-green"
},
"fillOpacity": 0.4,
"shape": "circle",
"showLegend": true,
"size": {
"field": "Count",
"fixed": 5,
"max": 15,
"min": 2
}
},
"location": {
"gazetteer": "public/gazetteer/usa-states.json",
"lookup": "State",
"mode": "auto"
},
"type": "markers"
}
],
"view": {
"id": "coords",
"lat": 38.297683,
"lon": -99.228359,
"shared": true,
"zoom": 3.98
}
},
"targets": [
{
"csvFileName": "flight_info_by_state.csv",
"refId": "A",
"scenarioId": "csv_file"
}
],
"title": "Thresholds legend",
"type": "geomap"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-BlYlRd"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 11,
"w": 9,
"x": 0,
"y": 11
},
"id": 63,
"options": {
"basemap": {
"config": {},
"type": "default"
},
"controls": {
"mouseWheelZoom": true,
"showAttribution": true,
"showDebug": false,
"showScale": false,
"showZoom": true
},
"layers": [
{
"config": {
"blur": 27,
"radius": 25,
"weight": {
"field": "Count",
"fixed": 1,
"max": 1,
"min": 0
}
},
"location": {
"gazetteer": "public/gazetteer/usa-states.json",
"lookup": "State",
"mode": "auto"
},
"type": "heatmap"
}
],
"view": {
"id": "coords",
"lat": 38.251497,
"lon": -100.932144,
"shared": false,
"zoom": 4.15
}
},
"targets": [
{
"csvFileName": "flight_info_by_state.csv",
"refId": "A",
"scenarioId": "csv_file"
}
],
"title": "Heatmap data layer",
"transformations": [],
"type": "geomap"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "continuous-GrYlRd"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 11,
"w": 9,
"x": 9,
"y": 11
},
"id": 65,
"options": {
"basemap": {
"config": {
"server": "world-imagery"
},
"type": "esri-xyz"
},
"controls": {
"mouseWheelZoom": true,
"showAttribution": true,
"showDebug": false,
"showScale": false,
"showZoom": true
},
"layers": [
{
"config": {
"color": {
"fixed": "#ff001e"
},
"fillOpacity": 0.4,
"shape": "star",
"showLegend": true,
"size": {
"field": "Count",
"fixed": 5,
"max": 15,
"min": 2
}
},
"location": {
"gazetteer": "public/gazetteer/usa-states.json",
"lookup": "State",
"mode": "auto"
},
"type": "markers"
}
],
"view": {
"id": "coords",
"lat": 40.159084,
"lon": -96.508021,
"shared": true,
"zoom": 3.83
}
},
"targets": [
{
"csvFileName": "flight_info_by_state.csv",
"refId": "A",
"scenarioId": "csv_file"
}
],
"title": "Base layer ArcGIS wold imagery + star shape + share view",
"type": "geomap"
}
],
"refresh": "",
"schemaVersion": 30,
"style": "dark",
"tags": [
"gdev",
"panel-tests"
],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"timezone": "",
"title": "Panel Tests - Geomap",
"uid": "2xuwrgV7z",
"version": 5
}

View File

@@ -92,7 +92,6 @@
"interval": "1m",
"links": [],
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"
@@ -181,7 +180,6 @@
"links": [],
"maxDataPoints": 10,
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"
@@ -270,7 +268,6 @@
"links": [],
"maxDataPoints": 20,
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"
@@ -358,7 +355,6 @@
"interval": "1m",
"links": [],
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"
@@ -447,7 +443,6 @@
"links": [],
"maxDataPoints": 80,
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"
@@ -536,7 +531,6 @@
"links": [],
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"

View File

@@ -99,7 +99,6 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -194,7 +193,6 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -289,7 +287,6 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -384,7 +381,6 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -479,7 +475,6 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -574,7 +569,6 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -669,7 +663,6 @@
"links": [],
"maxDataPoints": 100,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -764,7 +757,6 @@
"links": [],
"maxDataPoints": 100,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -859,7 +851,6 @@
"links": [],
"maxDataPoints": 100,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",

View File

@@ -8,12 +8,17 @@
"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": [
{
@@ -43,7 +48,6 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -69,8 +73,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -91,7 +94,6 @@
"id": 3,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -132,8 +134,6 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Show gaps",
"type": "timeseries"
},
@@ -153,7 +153,6 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -180,8 +179,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -202,7 +200,6 @@
"id": 2,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -251,8 +248,6 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Gaps & null between every point for series B",
"type": "timeseries"
},
@@ -272,7 +267,6 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -299,8 +293,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -321,7 +314,6 @@
"id": 6,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -390,8 +382,6 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "No nulls but unaligned series",
"type": "timeseries"
},
@@ -410,7 +400,6 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -436,8 +425,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -458,7 +446,6 @@
"id": 4,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -499,8 +486,6 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Connected",
"type": "timeseries"
},
@@ -520,7 +505,6 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -547,8 +531,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -569,7 +552,6 @@
"id": 5,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -618,8 +600,6 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Same as above but connected",
"type": "timeseries"
},
@@ -639,7 +619,6 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -666,8 +645,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -688,7 +666,6 @@
"id": 7,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -757,8 +734,6 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Same as above but connected",
"type": "timeseries"
},
@@ -777,7 +752,6 @@
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -803,8 +777,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -855,9 +828,6 @@
},
"id": 11,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"calcs": [],
@@ -903,8 +873,6 @@
"stringInput": "1,20,90,30,5,0"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Null values in first series & show gaps ",
"transformations": [],
"type": "timeseries"
@@ -924,7 +892,6 @@
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -950,8 +917,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -1002,9 +968,6 @@
},
"id": 9,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"calcs": [],
@@ -1050,14 +1013,11 @@
"stringInput": "10,25,null,null,50,10"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Null values in second series show gaps (bugged)",
"transformations": [],
"type": "timeseries"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -1071,7 +1031,6 @@
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -1097,8 +1056,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -1118,7 +1076,6 @@
},
"id": 13,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -1157,13 +1114,10 @@
"stringInput": "1,20,90,null,30,5,0"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Span nulls below 1hr",
"type": "timeseries"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -1205,8 +1159,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -1263,5 +1216,5 @@
"timezone": "",
"title": "Panel Tests - Graph NG - Gaps and Connected",
"uid": "8mmCAF1Mz",
"version": 12
}
"version": 2
}

View File

@@ -80,7 +80,6 @@
"id": 2,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -151,7 +150,6 @@
"id": 3,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -222,7 +220,6 @@
"id": 4,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -293,7 +290,6 @@
"id": 5,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -364,7 +360,6 @@
"id": 6,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -435,7 +430,6 @@
"id": 7,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",

View File

@@ -113,9 +113,6 @@
"id": 47,
"maxDataPoints": 500,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -237,9 +234,6 @@
"id": 48,
"maxDataPoints": 20,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -361,9 +355,6 @@
"id": 55,
"maxDataPoints": 20,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -485,9 +476,6 @@
"id": 56,
"maxDataPoints": 90,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -609,9 +597,6 @@
"id": 52,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -733,9 +718,6 @@
"id": 53,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -857,9 +839,6 @@
"id": 54,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -981,9 +960,6 @@
"id": 57,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -1184,9 +1160,6 @@
},
"id": 60,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -1468,7 +1441,6 @@
"interval": null,
"maxDataPoints": 100,
"options": {
"graph": {},
"legend": {
"displayMode": "list",
"placement": "right"
@@ -1599,9 +1571,6 @@
"id": 63,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -1737,9 +1706,6 @@
"id": 64,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -1875,9 +1841,6 @@
"id": 65,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -2013,9 +1976,6 @@
"id": 66,
"maxDataPoints": 100,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -2179,9 +2139,6 @@
"id": 32,
"maxDataPoints": 100,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "list",
@@ -2319,9 +2276,6 @@
"id": 35,
"maxDataPoints": 100,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "list",
@@ -2473,9 +2427,6 @@
"id": 31,
"maxDataPoints": 200,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": true,
"displayMode": "table",
@@ -2626,9 +2577,6 @@
"id": 51,
"maxDataPoints": 200,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": true,
"displayMode": "table",
@@ -2768,9 +2716,6 @@
},
"id": 19,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -2876,9 +2821,6 @@
},
"id": 20,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -2983,9 +2925,6 @@
},
"id": 21,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -3091,9 +3030,6 @@
},
"id": 9,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -3215,9 +3151,6 @@
},
"id": 46,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "list",
@@ -3358,7 +3291,6 @@
},
"id": 68,
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"

View File

@@ -13,13 +13,11 @@
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 632,
"links": [],
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -29,7 +27,7 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -40,8 +38,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -89,7 +86,7 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -100,8 +97,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -139,7 +135,6 @@
"type": "histogram"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -149,7 +144,7 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -160,8 +155,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -212,7 +206,6 @@
"type": "histogram"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -222,7 +215,7 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"viz": false,
"legend": false,
"tooltip": false
},
@@ -233,8 +226,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -285,7 +277,6 @@
"type": "histogram"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -300,8 +291,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -353,7 +343,6 @@
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -368,8 +357,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -439,4 +427,4 @@
"title": "Panel Tests - Histogram",
"uid": "UTv--wqMk",
"version": 4
}
}

View File

@@ -8,17 +8,21 @@
"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,
"fieldConfig": {
"defaults": {
"color": {
@@ -55,8 +59,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -82,9 +85,12 @@
"displayMode": "list",
"placement": "bottom"
},
"mode": "changes",
"mergeValues": true,
"rowHeight": 0.98,
"showValue": "always"
"showValue": "always",
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "7.5.0-pre",
"targets": [
@@ -113,7 +119,6 @@
"type": "state-timeline"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -151,8 +156,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -173,9 +177,17 @@
"options": {
"alignValue": "center",
"colWidth": 1,
"legend": {
"displayMode": "list",
"placement": "bottom"
},
"mergeValues": true,
"mode": "changes",
"rowHeight": 0.98,
"showValue": "always"
"showValue": "always",
"tooltip": {
"mode": "single"
}
},
"targets": [
{
@@ -207,7 +219,6 @@
"type": "state-timeline"
},
{
"datasource": null,
"description": "Should show gaps",
"fieldConfig": {
"defaults": {
@@ -246,8 +257,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -268,9 +278,17 @@
"options": {
"alignValue": "center",
"colWidth": 1,
"legend": {
"displayMode": "list",
"placement": "bottom"
},
"mergeValues": true,
"mode": "changes",
"rowHeight": 0.98,
"showValue": "always"
"showValue": "always",
"tooltip": {
"mode": "single"
}
},
"targets": [
{
@@ -301,7 +319,6 @@
"type": "state-timeline"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -319,8 +336,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -339,7 +355,6 @@
"y": 19
},
"id": 4,
"interval": null,
"maxDataPoints": 20,
"options": {
"alignValue": "center",
@@ -349,9 +364,11 @@
"displayMode": "list",
"placement": "bottom"
},
"mode": "samples",
"rowHeight": 0.98,
"showValue": "always"
"showValue": "always",
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "7.5.0-pre",
"targets": [
@@ -410,5 +427,5 @@
"timezone": "utc",
"title": "Timeline Demo",
"uid": "mIJjFy8Kz",
"version": 13
}
"version": 3
}

View File

@@ -8,18 +8,22 @@
"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,
"id": 329,
"links": [],
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -34,8 +38,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -63,7 +66,10 @@
},
"mergeValues": true,
"rowHeight": 0.9,
"showValue": "always"
"showValue": "always",
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "7.5.0-pre",
"targets": [
@@ -165,7 +171,6 @@
1616557148000
],
[
null,
1616558756000
],
[
@@ -173,7 +178,6 @@
1616561658000
],
[
null,
1616562446000
],
[
@@ -181,7 +185,6 @@
1616564104000
],
[
null,
1616564548000
],
[
@@ -197,7 +200,6 @@
"type": "state-timeline"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -212,8 +214,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -241,7 +242,10 @@
},
"mergeValues": true,
"rowHeight": 0.9,
"showValue": "always"
"showValue": "always",
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "7.5.0-pre",
"targets": [
@@ -267,7 +271,6 @@
"type": "state-timeline"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -282,8 +285,7 @@
"mode": "percentage",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "#EAB839",
@@ -306,7 +308,6 @@
"y": 21
},
"id": 4,
"interval": null,
"maxDataPoints": 20,
"options": {
"colWidth": 0.9,
@@ -316,7 +317,10 @@
"placement": "bottom"
},
"rowHeight": 0.9,
"showValue": "always"
"showValue": "always",
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "7.5.0-pre",
"targets": [
@@ -371,5 +375,5 @@
"timezone": "utc",
"title": "Timeline Modes",
"uid": "mIJjFy8Gz",
"version": 12
"version": 13
}

View File

@@ -20,12 +20,10 @@
},
"description": "",
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"links": [],
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -51,10 +49,6 @@
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "line"
}
@@ -64,8 +58,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -122,7 +115,6 @@
"type": "timeseries"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -137,8 +129,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -209,7 +200,6 @@
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -224,8 +214,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -291,7 +280,6 @@
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -306,8 +294,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -377,7 +364,6 @@
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -392,8 +378,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -446,7 +431,6 @@
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -470,8 +454,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -565,4 +548,4 @@
"title": "Transforms - Config from query",
"uid": "Juj4_7ink",
"version": 1
}
}

View File

@@ -19,7 +19,6 @@
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"links": [],
"panels": [
@@ -39,8 +38,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -87,8 +85,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -146,7 +143,6 @@
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -157,8 +153,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -209,7 +204,6 @@
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -221,8 +215,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -286,8 +279,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -334,8 +326,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -393,7 +384,6 @@
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -404,8 +394,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -454,7 +443,6 @@
"type": "bargauge"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -466,8 +454,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
}
]
}
@@ -530,7 +517,6 @@
"type": "gauge"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -541,8 +527,7 @@
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
"color": "green"
},
{
"color": "red",
@@ -612,4 +597,4 @@
"title": "Transforms - Rows to fields",
"uid": "PMtIInink",
"version": 1
}
}

View File

@@ -24,12 +24,12 @@
- influxdb
telegraf:
image: telegraf:1.19.1
image: telegraf:latest
links:
- influxdb
depends_on:
- influxdb_cli
volumes:
- ./docker/blocks/influxdb/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/log:/var/log
- /var/log:/var/log/host
- ../data/log:/var/log/grafana

View File

@@ -44,7 +44,7 @@
[[inputs.logparser]]
files = [
"/var/log/*.log",
"/var/log/host/*.log",
"/var/log/grafana/*.log"
]
[inputs.logparser.grok]

View File

@@ -1,5 +1,5 @@
influxdb1:
image: influxdb:1.8.6
image: influxdb:1.8
container_name: influxdb1
ports:
- '2004:2004'
@@ -22,11 +22,11 @@
FD_PORT: 8086
telegraf-influxdb1:
image: telegraf:1.19.1
image: telegraf:latest
links:
- influxdb1
volumes:
- ./docker/blocks/influxdb1/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/log:/var/log
- /var/log:/var/log/host
- ../data/log:/var/log/grafana

View File

@@ -52,7 +52,7 @@
[[inputs.logparser]]
files = [
"/var/log/*.log",
"/var/log/host/*.log",
"/var/log/grafana/*.log"
]
[inputs.logparser.grok]

View File

@@ -1,11 +1,11 @@
# datasource URL: http://localhost:3100/
loki:
image: grafana/loki:master
image: grafana/loki:latest
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
promtail:
image: grafana/promtail:master
image: grafana/promtail:latest
volumes:
- ./docker/blocks/loki/config.yaml:/etc/promtail/docker-config.yaml
- /var/log:/var/log

View File

@@ -1,18 +1,13 @@
# This Dockerfile builds an image for a client_golang example.
# Builder image, where we build the example.
FROM golang:1.15.1 AS builder
FROM golang:1.17 AS builder
# Download prometheus/client_golang/examples/random first
RUN go get github.com/prometheus/client_golang/examples/random
WORKDIR /go/src/github.com/prometheus/client_golang
WORKDIR /go/src/github.com/prometheus/client_golang/prometheus
RUN go get -d
WORKDIR /go/src/github.com/prometheus/client_golang/examples/random
RUN CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w'
RUN CGO_ENABLED=0 GOOS=linux go install -tags netgo -ldflags '-w' github.com/prometheus/client_golang/examples/random@latest
# Final image.
FROM scratch
LABEL maintainer "The Prometheus Authors <prometheus-developers@googlegroups.com>"
COPY --from=builder /go/src/github.com/prometheus/client_golang/examples/random .
COPY --from=builder /go/bin/random .
EXPOSE 8080
ENTRYPOINT ["/random"]

View File

@@ -0,0 +1 @@
grafana/provisioning/dashboards/alerts/alert-*

View File

@@ -0,0 +1,66 @@
# Grafana Unified Alerting High Availability (HA) test setup
A set of docker compose services which together creates a Grafana HA test setup for unified alerting.
Included services
- Grafana
- Mysql - Grafana configuration database, exporter for metrics and session storage
- Prometheus - Monitoring of Grafana and used as data source
- Nginx - Reverse proxy for Grafana and Prometheus. Enables browsing Grafana/Prometheus UI using a hostname
## Prerequisites
### Build grafana docker container
Build a Grafana docker container from current branch and commit and tag it as grafana/grafana:dev.
```bash
$ cd <grafana repo>
$ make build-docker-full
```
### Virtual host names
#### Alternative 1 - Use dnsmasq
```bash
$ sudo apt-get install dnsmasq
$ echo 'address=/loc/127.0.0.1' | sudo tee /etc/dnsmasq.d/dnsmasq-loc.conf > /dev/null
$ sudo /etc/init.d/dnsmasq restart
$ ping whatever.loc
PING whatever.loc (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.076 ms
--- whatever.loc ping statistics ---
1 packet transmitted, 1 received, 0% packet loss, time 1998ms
```
#### Alternative 2 - Manually update /etc/hosts
Update your `/etc/hosts` to be able to access Grafana and/or Prometheus UI using a hostname.
```bash
$ cat /etc/hosts
127.0.0.1 grafana.loc
127.0.0.1 prometheus.loc
```
## Start services
```bash
$ docker-compose up -d
```
Browse
- http://grafana.loc/
- http://prometheus.loc/
## Test alerting
### Create contact points
TBD
### Create alerts
TBD
### Create silences
TBD

View File

@@ -0,0 +1,90 @@
version: "2.1"
services:
db:
image: mysql:5.6
platform: linux/x86_64
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: grafana
MYSQL_USER: grafana
MYSQL_PASSWORD: password
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb_monitor_enable=all, --max-connections=1001]
ports:
- 3306
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 10s
retries: 10
mysqld-exporter:
image: prom/mysqld-exporter
environment:
- DATA_SOURCE_NAME=root:rootpass@(db:3306)/
ports:
- 9104
depends_on:
db:
condition: service_healthy
prometheus:
image: prom/prometheus:v2.4.2
volumes:
- ./prometheus/:/etc/prometheus/
environment:
- VIRTUAL_HOST=prometheus.loc
ports:
- 909
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
depends_on:
db:
condition: service_healthy
grafana1:
image: grafana/grafana:dev
volumes:
- ./grafana/provisioning/:/etc/grafana/provisioning/
environment:
- VIRTUAL_HOST=grafana.loc
- GF_FEATURE_TOGGLES_ENABLE=ngalert
- GF_UNIFIED_ALERTING_HA_PEERS=ha-test-unified-alerting_grafana2_1:9094,ha-test-unified-alerting_grafana1_1:9094
- GF_SERVER_ROOT_URL=http://grafana.loc
- GF_DATABASE_NAME=grafana
- GF_DATABASE_USER=grafana
- GF_DATABASE_PASSWORD=password
- GF_DATABASE_TYPE=mysql
- GF_DATABASE_HOST=db:3306
- GF_DATABASE_MAX_OPEN_CONN=300
- GF_SESSION_PROVIDER=mysql
- GF_SESSION_PROVIDER_CONFIG=grafana:password@tcp(db:3306)/grafana?allowNativePasswords=true
ports:
- 3010:3000
depends_on:
db:
condition: service_healthy
grafana2:
image: grafana/grafana:dev
volumes:
- ./grafana/provisioning/:/etc/grafana/provisioning/
environment:
- VIRTUAL_HOST=grafana.loc
- GF_FEATURE_TOGGLES_ENABLE=ngalert
- GF_UNIFIED_ALERTING_HA_PEERS=ha-test-unified-alerting_grafana2_1:9094,ha-test-unified-alerting_grafana1_1:9094
- GF_SERVER_ROOT_URL=http://grafana.loc
- GF_DATABASE_NAME=grafana
- GF_DATABASE_USER=grafana
- GF_DATABASE_PASSWORD=password
- GF_DATABASE_TYPE=mysql
- GF_DATABASE_HOST=db:3306
- GF_DATABASE_MAX_OPEN_CONN=300
- GF_SESSION_PROVIDER=mysql
- GF_SESSION_PROVIDER_CONFIG=grafana:password@tcp(db:3306)/grafana?allowNativePasswords=true
ports:
- 3020:3000
depends_on:
db:
condition: service_healthy

View File

@@ -0,0 +1,203 @@
local numAlerts = std.extVar('alerts');
local condition = std.extVar('condition');
local arr = std.range(1, numAlerts);
local alertDashboardTemplate = {
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": null,
"links": [],
"panels": [
{
"alert": {
"conditions": [
{
"evaluator": {
"params": [
65
],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": [
"A",
"5m",
"now"
]
},
"reducer": {
"params": [],
"type": "avg"
},
"type": "query"
}
],
"executionErrorState": "alerting",
"frequency": "10s",
"handler": 1,
"for": "1m",
"name": "bulk alerting",
"noDataState": "no_data",
"notifications": [
{
"id": 2
}
]
},
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"fill": 1,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"$$hashKey": "object:117",
"expr": "go_goroutines",
"format": "time_series",
"intervalFactor": 1,
"refId": "A"
}
],
"thresholds": [
{
"colorMode": "critical",
"fill": true,
"line": true,
"op": "gt",
"value": 50
}
],
"timeFrom": null,
"timeShift": null,
"title": "Panel Title",
"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
}
]
}
],
"schemaVersion": 16,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"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"
]
},
"timezone": "",
"title": "New dashboard",
"uid": null,
"version": 0
};
{
['alert-' + std.toString(x) + '.json']:
alertDashboardTemplate + {
panels: [
alertDashboardTemplate.panels[0] +
{
alert+: {
name: 'Alert rule ' + x,
conditions: [
alertDashboardTemplate.panels[0].alert.conditions[0] +
{
evaluator+: {
params: [condition]
}
},
],
},
},
],
uid: 'alert-' + x,
title: 'Alert ' + x
},
for x in arr
}

View File

@@ -0,0 +1,172 @@
{
"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,
"links": [],
"panels": [
{
"aliasColors": {
"Active alerts": "#bf1b00"
},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus",
"fill": 1,
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 0
},
"id": 2,
"interval": "",
"legend": {
"alignAsTable": true,
"avg": false,
"current": true,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [
{
"alias": "Active grafana instances",
"dashes": true,
"fill": 0
}
],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum(increase(grafana_alerting_notification_sent_total[1m])) by(job)",
"format": "time_series",
"instant": false,
"interval": "1m",
"intervalFactor": 1,
"legendFormat": "Notifications sent",
"refId": "A"
},
{
"expr": "min(grafana_alerting_active_alerts) without(instance)",
"format": "time_series",
"interval": "1m",
"intervalFactor": 1,
"legendFormat": "Active alerts",
"refId": "B"
},
{
"expr": "count(up{job=\"grafana\"})",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "Active grafana instances",
"refId": "C"
}
],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Notifications sent vs active alerts",
"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": "0",
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": 3
}
}
],
"schemaVersion": 16,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-1h",
"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"
]
},
"timezone": "",
"title": "Overview",
"uid": "xHy7-hAik",
"version": 6
}

View File

@@ -0,0 +1,14 @@
apiVersion: 1
providers:
- name: 'Alerts'
folder: 'Alerts'
type: file
options:
path: /etc/grafana/provisioning/dashboards/alerts
- name: 'MySQL'
folder: 'MySQL'
type: file
options:
path: /etc/grafana/provisioning/dashboards/mysql

View File

@@ -0,0 +1,16 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
jsonData:
timeInterval: 10s
queryTimeout: 30s
httpMethod: POST
- name: Loki
type: loki
access: proxy
url: http://loki:3100

View File

@@ -0,0 +1,47 @@
# my global config
global:
scrape_interval: 10s # By default, scrape targets every 15 seconds.
evaluation_interval: 10s # By default, scrape targets every 15 seconds.
# scrape_timeout is set to the global default (10s).
# Load and evaluate rules in this file every 'evaluation_interval' seconds.
#rule_files:
# - "alert.rules"
# - "first.rules"
# - "second.rules"
# alerting:
# alertmanagers:
# - scheme: http
# static_configs:
# - targets:
# - "127.0.0.1:9093"
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'grafana'
dns_sd_configs:
- names:
- 'grafana'
type: 'A'
port: 3000
refresh_interval: 10s
- job_name: 'mysql'
dns_sd_configs:
- names:
- 'mysqld-exporter'
type: 'A'
port: 9104
refresh_interval: 10s
- job_name: 'loki'
dns_sd_configs:
- names:
- 'loki'
type: 'A'
port: 3100
refresh_interval: 10s

21
devenv/vscode/launch.json Normal file
View File

@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "grafana-server",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/pkg/cmd/grafana-server",
"env": {},
"args": [
"--homepath=${workspaceFolder}",
"--packaging=dev",
"cfg:app_mode=development",
]
}
]
}

View File

@@ -25,17 +25,29 @@ Edit content in the `sources` directory.
Use the Hugo shortcode [relref](https://gohugo.io/content-management/cross-references/#use-ref-and-relref) any time you are linking to other internal docs pages.
Syntax is:
```
{{< relref "example.md" >}}
```
You might need to add more context for the link (containing folders and so on, `folder/example.md`) if Hugo says the relref is ambiguous.
You might need to add more context for the link (containing folders and so on, `folder/example.md`) if Hugo says the relref is ambiguous.
### Managing redirects
When moving content around or removing pages it's important that users following old links are properly redirected to the new location. We do this using the [aliases](https://gohugo.io/content-management/urls/#aliases) feature in Hugo.
If you are moving a page, add an `aliases` entry in the front matter referencing the old location of the page which will redirect the old url to the new location.
If you are removing a page, add an `aliases` entry in the front matter of the most-applicable page referencing the location of the page being removed.
If you are copying an existing page as the basis for a new one, be sure to remove any `aliases` entries in the front matter in your copy to avoid conflicting redirects.
### Edit the side menu
The side menu is automatically build from the file structure. Use the [weight](https://gohugo.io/templates/lists/#by-weight) front matter parameter to order pages.
To specify different menu text from the page title, use the front matter parameter `menuTitle`.
### Add images
Images are currently hosted in the grafana/website repo.
@@ -44,6 +56,9 @@ Images are currently hosted in the grafana/website repo.
## Deploy changes to grafana.com
When a PR is merged to main with changes in the `docs/sources` directory, those changes are automatically synced to the grafana/website repo and published to the staging site.
When a PR is merged with changes in the `docs/sources` directory, those changes are automatically synced by a GitHub action (`.github/workflows/publish.yml`) to the grafana/website repo.
Generally, someone from marketing will publish to production each day: so as long as the sync is successful your docs edits will be published. Alternatively, you can refer to [publishing to production](https://github.com/grafana/website#publishing-to-production-grafanacom) if you'd like to do it yourself.
- A PR that targets the `main` branch syncs to the `content/docs/grafana/next` directory in the `website` repository, and publishes to `https://grafana.com/docs/grafana/next/`.
- A PR targeting the `latest/current` release branch syncs to the `content/docs/grafana/latest` directory in the `website` repository, and publishes to `https://grafana.com/docs/grafana/latest/`.
Once the sync is complete, the website will automatically publish to production - no further action is needed.

View File

@@ -94,7 +94,7 @@ 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/cloudwatch.md" >}}" class="nav-cards__item nav-cards__item--ds">
<a href="{{< relref "datasources/aws-cloudwatch/_index.md" >}}" class="nav-cards__item nav-cards__item--ds">
<img src="/static/img/docs/logos/icon_cloudwatch.svg">
<h5>AWS CloudWatch</h5>
</a>

View File

@@ -10,18 +10,21 @@ 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...]
```
@@ -37,6 +40,7 @@ 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
```
@@ -46,6 +50,7 @@ grafana-cli -h
`--version` or `-v` prints the version of Grafana CLI currently running.
**Example:**
```bash
grafana-cli -v
```
@@ -55,6 +60,7 @@ 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>
```
@@ -64,6 +70,7 @@ 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>
```
@@ -73,6 +80,7 @@ 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>
```
@@ -84,6 +92,7 @@ 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>
```
@@ -93,6 +102,7 @@ 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>
```
@@ -104,6 +114,7 @@ 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>
```
@@ -113,6 +124,7 @@ 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>
```
@@ -122,6 +134,7 @@ 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
```
@@ -157,6 +170,7 @@ grafana-cli plugins ls
```
### Update all installed plugins
```bash
grafana-cli plugins update-all
```
@@ -208,6 +222,7 @@ 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

@@ -16,6 +16,8 @@ To see all settings currently applied to the Grafana server, refer to [View serv
## Config file locations
The default settings for a Grafana instance are stored in the `$WORKING_DIR/conf/defaults.ini` file. _Do not_ change the location in this file.
_Do not_ change `defaults.ini`! Grafana defaults are stored in this file. Depending on your OS, make all configuration changes in either `custom.ini` or `grafana.ini`.
- Default configuration from `$WORKING_DIR/conf/defaults.ini`
@@ -206,7 +208,6 @@ Another way is to put a web server like Nginx or Apache in front of Grafana and
### domain
### enforce_domain
Redirect to correct domain if the host header does not match the domain. Prevents DNS rebinding attacks. Default is `false`.
@@ -423,6 +424,7 @@ For more details check the [Transport.MaxConnsPerHost](https://golang.org/pkg/ne
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.
@@ -435,6 +437,14 @@ The length of time that Grafana maintains idle connections before closing them.
If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request. Default is `false`.
### response_limit
Limits the amount of bytes that will be read/accepted from responses of outgoing HTTP requests. Default is `0` which means disabled.
### row_limit
Limits the number of rows that Grafana will process from SQL (relational) data sources. Default is `1000000`.
<hr />
## [analytics]
@@ -460,6 +470,14 @@ Analytics ID here. By default this feature is disabled.
Google Tag Manager ID, only enabled if you enter an ID here.
### application_insights_connection_string
If you want to track Grafana usage via Azure Application Insights, then specify _your_ Application Insights connection string. Since the connection string contains semicolons, you need to wrap it in backticks (`). By default, tracking usage is disabled.
### application_insights_endpoint_url
Optionally, use this option to override the default endpoint address for Application Insights data collecting. For details, refer to the [Azure documentation](https://docs.microsoft.com/en-us/azure/azure-monitor/app/custom-endpoints?tabs=js).
<hr />
## [security]
@@ -588,7 +606,7 @@ As of Grafana v7.3, this also limits the refresh interval options in Explore.
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.
> **Note:** On Linux, Grafana uses `/usr/share/grafana/public/dashboards/home.json` as the default home dashboard location.
<hr />
@@ -828,7 +846,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 |
@@ -1099,13 +1117,97 @@ 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" >}}).
### enabled
Enable the Unified Alerting sub-system and interface. When enabled we'll migrate all of your alert rules and notification channels to the new system. New alert rules will be created and your notification channels will be converted into an Alertmanager configuration. Previous data is preserved to enable backwards compatibility but new data is removed. The default value is `false`.
Alerting Rules migrated from dashboards and panels will include a link back via the `annotations`.
### disabled_orgs
Comma-separated list of organization IDs for which to disable Grafana 8 Unified Alerting.
### admin_config_poll_interval
Specify the frequency of polling for admin config changes. The default value is `60s`.
The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
### alertmanager_config_poll_interval
Specify the frequency of polling for Alertmanager config changes. The default value is `60s`.
The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
### ha_listen_address
Listen address/hostname and port to receive unified alerting messages for other Grafana instances. The port is used for both TCP and UDP. It is assumed other Grafana instances are also running on the same port. The default value is `0.0.0.0:9094`.
### ha_advertise_address
Explicit address/hostname and port to advertise other Grafana instances. The port is used for both TCP and UDP.
### ha_peers
Comma-separated list of initial instances (in a format of host:port) that will form the HA cluster. Configuring this setting will enable High Availability mode for alerting.
### ha_peer_timeout
Time to wait for an instance to send a notification via the Alertmanager. In HA, each Grafana instance will
be assigned a position (e.g. 0, 1). We then multiply this position with the timeout to indicate how long should
each instance wait before sending the notification to take into account replication lag. The default value is `15s`.
The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
### ha_gossip_interval
The interval between sending gossip messages. By lowering this value (more frequent) gossip messages are propagated
across cluster more quickly at the expense of increased bandwidth usage. The default value is `200ms`.
The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
### ha_push_pull_interval
The interval between gossip full state syncs. Setting this interval lower (more frequent) will increase convergence speeds
across larger clusters at the expense of increased bandwidth usage. The default value is `60s`.
The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
### execute_alerts
Enable or disable alerting rule execution. The default value is `true`. The alerting UI remains visible. This option has a [legacy version in the alerting section]({{< relref "#execute_alerts-1">}}) that takes precedence.
### evaluation_timeout
Sets the alert evaluation timeout when fetching data from the datasource. The default value is `30s`. This option has a [legacy version in the alerting section]({{< relref "#evaluation_timeout_seconds">}}) that takes precedence.
The timeout string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
### max_attempts
Sets a maximum number of times we'll attempt to evaluate an alert rule before giving up on that evaluation. The default value is `3`. This option has a [legacy version in the alerting section]({{< relref "#max_attempts-1">}}) that takes precedence.
### min_interval
Sets the minimum interval to enforce between rule evaluations. The default value is `10s` which equals the scheduler interval. Rules will be adjusted if they are less than this value or if they are not multiple of the scheduler interval (10s). Higher values can help with resource management as we'll schedule fewer evaluations over time. This option has [a legacy version in the alerting section]({{< relref "#min_interval_seconds">}}) that takes precedence.
The interval string is a possibly signed sequence of decimal numbers, followed by a unit suffix (ms, s, m, h, d), e.g. 30s or 1m.
> **Note.** This setting has precedence over each individual rule frequency. If a rule frequency is lower than this value, then this value is enforced.
<hr>
## [alerting]
For more information about the Alerting feature in Grafana, refer to [Alerts overview]({{< relref "../alerting/_index.md" >}}).
### enabled
Set to `false` to disable alerting engine and hide Alerting in the Grafana UI. Default is `true`.
Set to `false` to [enable Grafana 8 alerting]({{<relref "#unified_alerting">}}) and to disable legacy alerting engine. Default is `true`.
### execute_alerts
@@ -1416,7 +1518,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
@@ -1520,7 +1622,7 @@ The `allowed_origins` option is a comma-separated list of additional origins (`O
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 "*".
Origin patterns support wildcard symbol "\*".
For example:
@@ -1529,11 +1631,35 @@ For example:
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]
For more information, refer to [Image rendering]({{< relref "image_rendering.md" >}}).
For more information, refer to [Image rendering]({{< relref "../image-rendering/" >}}).
### rendering_timezone
@@ -1569,7 +1695,7 @@ It can be useful to set this to `true` when troubleshooting.
### rendering_args
Additional arguments to pass to the headless browser instance. Default is --no-sandbox. The list of Chromium flags can be found at (https://peter.sh/experiments/chromium-command-line-switches/). Separate multiple arguments with commas.
Additional arguments to pass to the headless browser instance. Defaults are `--no-sandbox,--disable-gpu`. The list of Chromium flags can be found at (https://peter.sh/experiments/chromium-command-line-switches/). Separate multiple arguments with commas.
### rendering_chrome_bin
@@ -1627,7 +1753,7 @@ For more information about Grafana Enterprise, refer to [Grafana Enterprise]({{<
### enable
Keys of alpha features to enable, separated by space. Available alpha features are: `ngalert`
Keys of alpha features to enable, separated by space.
## [date_formats]
@@ -1694,4 +1820,4 @@ default_baselayer_config = `{
### enable_custom_baselayers
Set this to `true` to disable loading other custom base maps and hide them in the Grafana UI. Default is `false`.
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

@@ -1,212 +0,0 @@
+++
title = "Image rendering"
description = ""
keywords = ["grafana", "image", "rendering", "plugin"]
weight = 300
+++
# Image rendering
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.
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.
A background job runs every 10 minutes and removes temporary images. You can configure how long an image should be stored before being removed by configuring the [temp-data-lifetime]({{< relref "../administration/configuration/#temp-data-lifetime" >}}) setting.
You can also render a PNG by clicking the dropdown arrow next to a panel title, then clicking **Share > Direct link rendered image**.
## Memory requirements
Minimum free memory recommendation is 16GB on the system doing the rendering.
Rendering images can require a lot of memory, mainly because Grafana creates browser instances in the background for the actual rendering. If multiple images are rendered in parallel, then the rendering has a bigger memory footprint. One advantage of using the remote rendering service is that the rendering will be done on the remote system, so your local system resources will not be affected by rendering.
## Alerting and render limits
Alert notifications can include images, but rendering many images at the same time can overload the server where the renderer is running. For instructions of how to configure this, see [concurrent_render_limit]({{< relref "../administration/configuration/#concurrent_render_limit" >}}).
## Install Grafana Image Renderer plugin
The [Grafana image renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer) is a plugin that runs on the backend and handles rendering panels and dashboards as PNG images using headless Chrome.
To install the plugin, refer to the [Grafana Image Renderer Installation instructions](https://grafana.com/grafana/plugins/grafana-image-renderer/?tab=installation).
## 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.
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" >}}).
## Remote rendering service
> Requires an internet connection.
The [Grafana Image Renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer) can also be run as a remote HTTP rendering service. In this setup, Grafana renders an image by making a HTTP request to the remote rendering service, which in turn renders the image and returns it back in the HTTP response to Grafana.
You can run the remote HTTP rendering service using Docker or as a standalone Node.js application.
### Run in Docker
The following example shows how to run Grafana and the remote HTTP rendering service in two separate Docker containers using Docker Compose.
Create a `docker-compose.yml` with the following content:
```yaml
version: '2'
services:
grafana:
image: grafana/grafana:main
ports:
- "3000:3000"
environment:
GF_RENDERING_SERVER_URL: http://renderer:8081/render
GF_RENDERING_CALLBACK_URL: http://grafana:3000/
GF_LOG_FILTERS: rendering:debug
renderer:
image: grafana/grafana-image-renderer:latest
ports:
- 8081
```
And then run:
```bash
docker-compose up
```
## Run as standalone Node.js application
The following example describes how to build and run the remote HTTP rendering service as a standalone Node.js application and configure Grafana appropriately.
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
```
1. Run the server:
```bash
node build/app.js server --port=8081
```
1. Update Grafana configuration:
```
[rendering]
server_url = http://localhost:8081/render
callback_url = http://localhost:3000/
```
1. Restart Grafana.
## PhantomJS
> Starting from Grafana v7.0.0, all PhantomJS support has been removed. Please use the Grafana Image Renderer plugin or remote rendering service.
## Troubleshoot image rendering
Enable debug log messages for rendering in the Grafana configuration file and inspect the Grafana server log.
```bash
[log]
filters = rendering:debug
```
### Grafana image renderer plugin and remote rendering service
The plugin and rendering service uses [Chromium browser](https://www.chromium.org/) which depends on certain libraries.
If you don't have all of those libraries installed in your system you may encounter errors when trying to render an image, e.g.
```bash
Rendering failed: Error: Failed to launch chrome!/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome:
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
are not installed in your system:
```bash
cd <grafana-image-render plugin directory>
ldd chrome-linux/chrome
linux-vdso.so.1 (0x00007fff1bf65000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2047945000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2047924000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f204791a000)
libX11.so.6 => not found
libX11-xcb.so.1 => not found
libxcb.so.1 => not found
libXcomposite.so.1 => not found
...
```
**Ubuntu:**
On Ubuntu 18.10 the following dependencies have been confirmed as needed for the image rendering to function.
```bash
libx11-6 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrender1 libxtst6 libglib2.0-0 libnss3 libcups2 libdbus-1-3 libxss1 libxrandr2 libgtk-3-0 libgtk-3-0 libasound2 libxcb-dri3-0 libgbm1
```
**Debian:**
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
```
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
```
**Centos:**
On a minimal Centos installation, the following dependencies have been confirmed as needed for the image rendering to function:
```bash
libXcomposite libXdamage libXtst cups libXScrnSaver pango atk adwaita-cursor-theme adwaita-icon-theme at at-spi2-atk at-spi2-core cairo-gobject colord-libs dconf desktop-file-utils ed emacs-filesystem gdk-pixbuf2 glib-networking gnutls gsettings-desktop-schemas gtk-update-icon-cache gtk3 hicolor-icon-theme jasper-libs json-glib libappindicator-gtk3 libdbusmenu libdbusmenu-gtk3 libepoxy liberation-fonts liberation-narrow-fonts liberation-sans-fonts liberation-serif-fonts libgusb libindicator-gtk3 libmodman libproxy libsoup libwayland-cursor libwayland-egl libxkbcommon m4 mailx nettle patch psmisc redhat-lsb-core redhat-lsb-submod-security rest spax time trousers xdg-utils xkeyboard-config alsa-lib
```
### Certificate signed by internal certificate authorities
In many cases, Grafana runs on internal servers and uses certificates that have not been signed by a CA ([Certificate Authority](https://en.wikipedia.org/wiki/Certificate_authority)) known to Chrome, and therefore cannot be validated. Chrome internally uses NSS ([Network Security Services](https://en.wikipedia.org/wiki/Network_Security_Services)) for cryptographic operations such as the validation of certificates.
If you are using the Grafana Image Renderer with a Grafana server that uses a certificate signed by such a custom CA (for example a company-internal CA), rendering images will fail and you will see messages like this in the Grafana log:
```
t=2019-12-04T12:39:22+0000 lvl=error msg="Render request failed" logger=rendering error=map[] url="https://192.168.106.101:3443/d-solo/zxDJxNaZk/graphite-metrics?orgId=1&refresh=1m&from=1575438321300&to=1575459921300&var-Host=master1&panelId=4&width=1000&height=500&tz=Europe%2FBerlin&render=1" timestamp=0001-01-01T00:00:00.000Z
t=2019-12-04T12:39:22+0000 lvl=error msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="Rendering failed: Error: net::ERR_CERT_AUTHORITY_INVALID at https://192.168.106.101:3443/d-solo/zxDJxNaZk/graphite-metrics?orgId=1&refresh=1m&from=1575438321300&to=1575459921300&var-Host=master1&panelId=4&width=1000&height=500&tz=Europe%2FBerlin&render=1"
t=2019-12-04T12:39:22+0000 lvl=error msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/zxDJxNaZk/graphite-metrics status=500 remote_addr=192.168.106.101 time_ms=310 size=1722 referer="https://grafana.xxx-xxx/d/zxDJxNaZk/graphite-metrics?orgId=1&refresh=1m"
```
(The severity-level `error` in the above messages might be misspelled with a single `r`)
If this happens, then you have to add the certificate to the trust store. If you have the certificate file for the internal root CA in the file `internal-root-ca.crt.pem`, then use these commands to create a user specific NSS trust store for the Grafana user (`grafana` for the purpose of this example) and execute the following steps:
```[root@server ~]# [ -d /usr/share/grafana/.pki/nssdb ] || mkdir -p /usr/share/grafana/.pki/nssdb
[root@merver ~]# certutil -d sql:/usr/share/grafana/.pki/nssdb -A -n internal-root-ca -t C -i /etc/pki/tls/certs/internal-root-ca.crt.pem
[root@server ~]# chown -R grafana: /usr/share/grafana/.pki/nssdb
```
### Custom Chrome/Chromium
As a last resort, if you already have [Chrome](https://www.google.com/chrome/) or [Chromium](https://www.chromium.org/)
installed on your system, then you can configure [Grafana Image renderer plugin](#grafana-image-renderer-plugin) to use this
instead of the pre-packaged version of Chromium.
> Please note that this is not recommended, since you may encounter problems if the installed version of Chrome/Chromium is not
> compatible with the [Grafana Image renderer plugin](#grafana-image-renderer-plugin).
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"
```

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,10 +20,11 @@ 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
@@ -31,14 +32,16 @@ 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,9 +52,10 @@ 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,9 +30,10 @@ 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
@@ -41,4 +42,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

@@ -40,7 +40,7 @@ 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.
> **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
@@ -59,9 +59,10 @@ 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,49 +141,50 @@ 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. |
| 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. |
| 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+) |
#### Secure Json Data
@@ -191,15 +192,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 |
@@ -319,9 +320,11 @@ 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
@@ -331,18 +334,21 @@ 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.
@@ -426,7 +432,7 @@ The following sections detail the supported settings and secure settings for eac
#### Alert notification `pushover`
| Name | Secure setting |
| -------- | -------------- |
| ---------- | -------------- |
| apiToken | yes |
| userKey | yes |
| device | |
@@ -439,11 +445,11 @@ The following sections detail the supported settings and secure settings for eac
#### Alert notification `discord`
| Name | Secure setting |
| -------------- | -------------- |
| url | yes |
| avatar_url | |
| message | |
| Name | Secure setting |
| ---------- | -------------- |
| url | yes |
| avatar_url | |
| content | |
#### Alert notification `slack`
@@ -500,7 +506,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

@@ -16,6 +16,12 @@ To prevent this type of exploitation from happening, we recommend that you apply
You can configure Grafana to only allow certain IP addresses or hostnames to be used as data source URLs and proxied through the Grafana data source proxy. Refer to [data_source_proxy_whitelist]({{< relref "../administration/configuration/#data-source-proxy-whitelist" >}}) for usage instructions.
## Request security
The request security configuration option allows users to limit requests from the Grafana server. It targets requests that are generated by users. For more information, refer to [Request security]({{< relref "../enterprise/request-security.md" >}}) in [Grafana Enterprise]({{< relref "../enterprise" >}}).
> **Note:** Request security is available in Grafana Enterprise v7.4 and later versions.
## Firewall rules
Configure a firewall to restrict Grafana from making network requests to sensitive internal web services.
@@ -28,7 +34,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 +47,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,7 +18,7 @@ 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 for 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 the database you're using.
## Alerting

View File

@@ -59,6 +59,7 @@ 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.
@@ -81,6 +82,7 @@ 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,6 +8,8 @@ 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,14 +7,16 @@ weight = 400
# View Grafana server stats
If you are a Grafana server admin, then you can view useful statistics about your Grafana server in the Stats tab.
> 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 & Licensing 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" >}}).
## View server stats
1. Log in to your Grafana server with an account that has the Grafana Admin flag set.
1. Hover your cursor over the **Server Admin** (shield) icon in the side menu and then click the **Stats** tab.
1. Hover your cursor over the **Server Admin** (shield) icon in the side menu and then click the **Stats & Licensing** tab.
## Available stats
@@ -45,5 +47,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

@@ -7,7 +7,9 @@ weight = 110
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 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.
Grafana 8.0 has new and improved alerts that centralizes alerting information for Grafana managed alerts as well as alerts from Prometheus-compatible data sources into one user interface and API.
> **Note:** Grafana 8 alerts is an [opt-in]({{< relref "./unified-alerting/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 Grafana 8 alerts.
Alerts have four main components:
@@ -26,4 +28,4 @@ As part of the new alert changes, we have introduced a new data source, Alertman
> **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

@@ -1,21 +1,26 @@
+++
title = "What's New with Grafana 8 Alerts"
title = "What's New with Grafana 8 alerts"
description = "What's New with Grafana 8 Alerts"
keywords = ["grafana", "alerting", "guide"]
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.
# What's New with Grafana 8 alerts
The alerts released with Grafana 8.0 centralizes alerting information for Grafana managed alerts and alerts from Prometheus-compatible datasources in one UI and API. 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 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

@@ -17,7 +17,7 @@ Currently only the graph panel visualization supports alerts.
Legacy alerts 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,20 +37,21 @@ 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

@@ -96,16 +96,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,4 +124,3 @@ 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

@@ -37,41 +37,40 @@ 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
[Zenduty](#zenduty) | `webhook` | yes, external only | yes
| Name | Type | Supports images | Supports 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 |
### Email
@@ -83,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
@@ -98,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.
@@ -116,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`.
@@ -129,45 +128,47 @@ Send notification tags as | Specify how you would like [Notification Tags]({{< r
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
@@ -178,26 +179,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"
}
```
@@ -213,7 +214,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.
@@ -226,11 +227,11 @@ In DingTalk PC Client:
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).
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.
@@ -255,18 +256,14 @@ 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
[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.
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).
## 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/" >}}).
[image rendering]({{< relref "../../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.

View File

@@ -12,4 +12,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

@@ -17,4 +17,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

@@ -5,11 +5,12 @@ 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:** 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 [legacy dashboard alerts]({{< relref "../old-alerting/_index.md" >}}) out of the box
Grafana 8.0 has a new and improved alerting sub-system that centralizes alerting information for Grafana managed alerts and alerts from Prometheus-compatible data sources into one user interface and API.
Alerts have four main components:
> **Note:** Grafana 8 alerts is an [opt-in]({{< relref "../unified-alerting/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 Grafana 8 alerts.
Grafana 8 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.
@@ -20,11 +21,10 @@ 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" >}})
- [Test alert rules and troubleshoot]({{< relref "./troubleshoot-alerts.md" >}})
- [View state and health of alerting rules]({{< relref "alerting-rules/state-and-health.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" >}})
@@ -38,23 +38,25 @@ The current alerting system doesn't support high availability. Alert notificatio
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" >}}))
## Metrics from the alerting engine
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" >}}).
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" >}}). See also, [View alert rules and their current state]({{< relref "alerting-rules/rule-list.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 |
| ------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------- |
| `grafana_alerting_alerts` | gauge | How many alerts by state |
| `grafana_alerting_request_duration` | histogram | Histogram of requests to the Alerting API |
| `grafana_alerting_active_configurations` | gauge | The number of active, non default Alertmanager configurations for grafana managed alerts |
| `grafana_alerting_rule_evaluations_total` | counter | The total number of rule evaluations |
| `grafana_alerting_rule_evaluation_failures_total` | counter | The total number of rule evaluation failures |
| `grafana_alerting_rule_evaluation_duration` | summary | The duration for a rule to execute |
| `grafana_alerting_rule_group_rules` | gauge | The number of rules |
## Limitation
- [View alert rules and their current state]({{< relref "alerting-rules/rule-list.md" >}})
Grafana 8 alerting system can retrieve rules from all available Prometheus, Loki, and Alertmanager data sources. It might not be able to fetch rules from all other supported data sources at this time.

View File

@@ -4,10 +4,13 @@ aliases = ["/docs/grafana/latest/alerting/rules/"]
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.
# 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.
- [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

@@ -0,0 +1,55 @@
+++
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,30 +7,29 @@ weight = 400
# Create a Cortex or Loki managed alerting rule
Grafana allows you manage alerting rules for an external Cortex or Loki instance.
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.
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.
## 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 **Alert type** drop down and select **Cortex / Loki managed alert**.
1. Click on the **Rule 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.
### Alert type
### Rule 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 **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.
- **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 type section screenshot](/static/img/docs/alerting/unified/rule-edit-cortex-alert-type-8-0.png 'Alert type section screenshot')
@@ -42,7 +41,7 @@ Enter a PromQL or LogQL expression. Rule will fire if evaluation result has at l
### 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')
@@ -52,11 +51,11 @@ 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')

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')
### 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`
@@ -67,25 +67,24 @@ See or [expressions documentation]({{< relref "../../../panels/expressions.md" >
### 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.
| 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` |
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` (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')
@@ -95,11 +94,11 @@ 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')
@@ -107,10 +106,11 @@ Labels are key value pairs that categorize or identify an alert. Labels are use
The following template variables are available when expanding annotations and labels.
| Name | Description |
| ------- | --------------- |
| $labels | Labels contains the labels from the query or condition. For example, `{{ $labels.instance }}` and `{{ $labels.job }}`. |
| $values | Values contains 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. |
| 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 ]`. |
## Preview alerts

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