Compare commits

..

471 Commits

Author SHA1 Message Date
Sofia Papagiannaki
822ff7595e Improve comments and error message. 2021-12-06 09:27:52 +02:00
Kyle Brandt
515ebf4b4c security: fix dir traversal issue 2021-12-03 13:21:53 -05:00
Dimitris Sotirakis
68fe9e3431 [v8.0.x] Backport 36759 to v8.0.x (#36774)
* Delete verify-drone from windows

* Sync drone yaml

* Downgrade grabpl version

* Move publish-frontend-metrics step
2021-07-15 09:49:19 +02:00
Grot (@grafanabot)
beeef8b96b Update queries.md (#31941) (#36765)
* Update queries.md

Completing some examples to allow newbie people to understand relative time and time shift time

* Update docs/sources/panels/queries.md

Co-authored-by: Geshi <ohayo@geshii.moe>

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

Co-authored-by: castillo92 <37965565+castillo92@users.noreply.github.com>
2021-07-14 18:47:21 +02:00
Grot (@grafanabot)
634112e1d4 "Release: Updated versions in package to 8.0.6" (#36750) 2021-07-14 13:15:33 +02:00
Marcus Andersson
1116ef1983 [v8.0.x] Transformations: add 'prepare time series' transformer (#36748)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-14 12:23:02 +02:00
Grot (@grafanabot)
dfaae953f8 Postgres/MySQL/MSSQL: Fix name of time field should be named Time for time series queries (#36720) (#36746)
Name of time field changed in v8 for time series queries from Time to the name of the selected
time column, i.e. time or time_sec. These changes should make sure that the name of time field
is always returned as Time for time series queries.

Fixes #36059

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
(cherry picked from commit 10c892fa5b)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-07-14 11:52:27 +02:00
Grot (@grafanabot)
d6135f54a9 change template expansion missing value handling (#36679) (#36715)
(cherry picked from commit 310d3ebe3d)

Co-authored-by: David Parrott <stomp.box.yo@gmail.com>
2021-07-14 10:30:40 +01:00
Grot (@grafanabot)
1d5ca3ae77 fix gzipped plugin asset response (#36721) (#36741)
(cherry picked from commit 7dbe388d4e)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-07-14 10:11:12 +02:00
Alexander Emelin
9fec4a7f80 Live: handle influx input with incomplete/asymmetrical field set (#36664) (#36726)
(cherry picked from commit 607c5d2555)
2021-07-13 22:17:46 +03:00
Alexander Emelin
ad3d82abee Live: avoid panic when type changes (#35394) (#36723)
(cherry picked from commit 4b8d796c54)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-07-13 20:55:18 +03:00
Grot (@grafanabot)
2575e64e8a Add ValueString to the documentation for alerts (#36654) (#36676)
(cherry picked from commit 36cb396568)

Co-authored-by: George Robinson <85952834+gerobinson@users.noreply.github.com>
2021-07-13 14:20:58 +01:00
Grot (@grafanabot)
278c85ca07 Fix Postgres query handling null values for smallint (#36648) (#36688)
* Fix Postgres query handling null values for smallint

* Fix converting to int16

(cherry picked from commit 5d01add7da)

Co-authored-by: idafurjes <36131195+idafurjes@users.noreply.github.com>
2021-07-13 13:49:31 +02:00
Grot (@grafanabot)
d11e65d3ac live: better error logging in push API (#36601) (#36623)
(cherry picked from commit e1358eeb76)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-07-13 14:43:15 +03:00
Grot (@grafanabot)
028e41b152 Plugins: Improve grafana-cli UX + API response messaging for plugin install incompatibility scenario (#36556) (#36692)
* improve UX for plugin install incompatability

* refactor test

(cherry picked from commit e06335ffe9)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-07-13 10:21:41 +02:00
Grot (@grafanabot)
68374a988a Avoid breaking on fieldConfig without defaults field (#36666) (#36690)
This would result in a `Dashboard init failed` error when migrating
dashboards with a folded panel that has a `fieldConfig` but has not
defined `fieldConfig.defaults`.

(cherry picked from commit 81511e34d9)

Co-authored-by: Gustaf Lindstedt <gustaflindstedt@protonmail.com>
2021-07-13 10:14:05 +02:00
Grot (@grafanabot)
fb60ab66f1 TimeSeries: Improve tooltip positioning when tooltip overflows (#36440) (#36672)
* TimeSeries: Improve tooltip positioning when tooltip overflows

* VizTooltip: Use react-popper, extract positioning calculation into util function + add unit tests

* VizTooltip: Keep ref as tooltipRef

* Use popper only for VizTooltip positioning

* VizTooltip: Set altAxis to true to prevent overflow on y axis

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

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-07-12 18:15:05 +02:00
Grot (@grafanabot)
3d786313c2 Alerting: A better and cleaner way to know if Alertmanager is initialised (#36659) (#36665)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit 8efe1856e2)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-07-12 19:22:35 +05:30
Grot (@grafanabot)
a65c0a491e Links: Fixes issue with some links causing full page reload (#36631) (#36649)
(cherry picked from commit 6c5d0db255)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-07-12 15:40:35 +02:00
Grot (@grafanabot)
fea410ebb1 Add StreamName dimension for AWS/KinesisVideo namespace (#36655) (#36663)
(cherry picked from commit 37c3e6f9b9)

Co-authored-by: Brent Cetinich <73208365+brentcetinich@users.noreply.github.com>
2021-07-12 14:46:08 +02:00
Grot (@grafanabot)
fb9e6d3286 Tempo: show hex strings instead of uints for ids (#36471) (#36662)
(cherry picked from commit ee89e51c48)

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-07-12 14:33:51 +02:00
Grot (@grafanabot)
e439828db9 Alerting: Fix potential panic in Alertmanager when starting up (#36562) (#36638)
* Alerting: Fix potential panic in Alertmanager when starting up

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

* Fix reviews

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

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-07-12 13:52:27 +02:00
Grot (@grafanabot)
1e4cd19824 A11y: ARIA hide image/link duplicate in news panel (#36642) (#36651)
* fix(a11y): Hide image/link duplicate

* fix: proper heading and time markup

(cherry picked from commit b8fbe70c14)

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
2021-07-12 11:12:27 +02:00
Grot (@grafanabot)
b4e40c3280 influxdb: influxql: better tag-value filtering (#36570) (#36639)
(cherry picked from commit cc460110b1)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-07-12 10:15:32 +02:00
Grot (@grafanabot)
249ad5c256 InfluxDB: Flux: fix backward compatibility for some queries (#36603) (#36615)
* influxdb: flux: better backward-compatibility

* added comment-explanation

(cherry picked from commit e4ece0530a)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-07-12 09:16:49 +02:00
Grot (@grafanabot)
ae7e4811b1 DashboardList: Fix issue not re-fetching dashboard list after variable change (#36591) (#36625)
(cherry picked from commit c7d2d70799)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-07-11 10:59:25 +02:00
Grot (@grafanabot)
bb3432361c Database: Fix incorrect format of isolation level configuration parameter for MySQL (#36565) (#36618)
(cherry picked from commit ca2223f705)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-07-09 20:06:08 +02:00
Grot (@grafanabot)
2dd848c344 Stat: use shared data min/max for y auto-ranging (#36497) (#36617)
(cherry picked from commit bb1dac3c72)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-07-09 18:54:51 +02:00
Grot (@grafanabot)
cb71fddd24 Add AWS/AmazonMQ dimensions (#36573) (#36613)
(cherry picked from commit 1dc5d037e4)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2021-07-09 16:41:04 +02:00
Grot (@grafanabot)
1623150bb5 CloudWatch/Logs: Fix log alerts in new unified alerting (#36558) (#36605)
* Pass FromAlert header from new alerting

* Add better error messages

(cherry picked from commit ea2ba06b93)

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2021-07-09 14:58:35 +02:00
Grot (@grafanabot)
1734acbc9f live: better overview in docs (#36506) (#36577)
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
(cherry picked from commit 10a942aad0)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-07-08 20:28:08 +02:00
Grot (@grafanabot)
2d406f13de ReleaseNotes: Updated changelog and release notes for 8.0.5 (#36554) (#36566)
* ReleaseNotes: Updated changelog and release notes for 8.0.5

* Update _index.md

* Update CHANGELOG.md

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

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
(cherry picked from commit 6266a9e77a)
2021-07-08 17:38:14 +02:00
Grot (@grafanabot)
6bc37296c7 Alerting: Allow space in label and annotation names (#36549) (#36557)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit 94d2520a84)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-07-08 09:54:21 -04:00
Grot (@grafanabot)
cbb2aa5001 Release: Updated versions in package to 8.0.5 (#36553) 2021-07-08 12:30:44 +02:00
Grot (@grafanabot)
4c16d55e11 allow for appropriate content-type to be set (#36545) (#36550)
(cherry picked from commit 2616580bae)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-07-08 11:35:42 +02:00
Grot (@grafanabot)
d9858e0af9 Timeseries Panel: Retain alerts when migrating from old graph (#36514) (#36546)
Closes #36106

(cherry picked from commit 8d66db09bf)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2021-07-08 11:07:16 +02:00
Grot (@grafanabot)
18c547d695 Live: document allowed_origins (#36433) (#36495)
(cherry picked from commit e60950a8c7)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-07-07 10:56:43 -07:00
Grot (@grafanabot)
2671c7d6cd Alerting API: Restrict access to Alertmanager configuration (#36507) (#36516)
* Alerting API: Restrict access to Alertmanager configuration to viewers

(cherry picked from commit fc90d47863)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-07-07 16:56:00 +03:00
Grot (@grafanabot)
fffbb74aaf Links: Fix links to other apps outside Grafana when under sub path (#36498) (#36515)
(cherry picked from commit eed1f36613)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-07-07 15:49:31 +02:00
Grot (@grafanabot)
074ef08db3 Table: Fixes color for data links (#36446) (#36496)
* Table: add styling for anchor tag

* inherit color from parent to anchor tag

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

Co-authored-by: Tharun Rajendran <rajendrantharun@live.com>
2021-07-07 15:26:46 +02:00
Grot (@grafanabot)
5e83e3862a CloudWatch Logs: If Grafana Live isn't enabled, don't use the Live Channel (#36358) (#36510)
* If Live isn't enabled, don't use the Live Channel

* ..Import Config if you want to use it!

(cherry picked from commit 3e95c3826a)

Co-authored-by: Thomas Cave <github@thomas.cave.dev>
2021-07-07 14:08:35 +02:00
Grot (@grafanabot)
350bb10cdd Plugins: Improve API response for plugin assets (#36352) (#36505)
* improve API response for plugin assets 403

* remove unnecessary newline

(cherry picked from commit 333d520528)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-07-07 12:40:37 +02:00
achatterjee-grafana
5cdd8dfed1 Docs: Removed folder and 3 files within. (#36487) 2021-07-06 21:13:25 +02:00
Will Browne
79e2da441a resolve conflicts (#36431) 2021-07-06 17:44:30 +02:00
Grot (@grafanabot)
0131a8ef05 Docs: Fix Azure Monitor refs (#36458) (#36478)
* Docs: Fix Azure Monitor refs

* more fixes

Co-authored-by: Robby Milo <robbymilo@gmail.com>
(cherry picked from commit eabf3fb674)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-07-06 16:47:56 +02:00
Grot (@grafanabot)
cc843e67ae TooltipPlugin: Prevent Tooltip render if field is undefined (#36260) (#36464)
* Tooltip Plugin: Prevent tooltip render if focusedSeriesIdx is out of range

* TooltipPlugin: Also prevent render in multi case

* TooltipPlugin: Return null if field is undefined

(cherry picked from commit 96a3cc3cd8)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-07-06 12:19:40 +02:00
Grot (@grafanabot)
efbfb42f15 AzureMonitor: Fix issue where resource group name is missing on the resource picker button (#36400) (#36462)
* AzureMonitor: Fix issue where resource group name is missing in the UI

* fix

(cherry picked from commit 2a4191a2ee)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-07-06 11:46:08 +02:00
Grot (@grafanabot)
fd515d1318 Folders: Return 409 Conflict status when folder already exists (#36429) (#36461)
* Return 409 Conflict when trying to post folder that already exists

* Fix tests

* Update documentation for new error message in folders api

(cherry picked from commit a18d3007a7)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2021-07-06 11:32:58 +02:00
Grot (@grafanabot)
4efbf432a4 CloudwatchLogs: send error down to client (#36277) (#36438)
* CloudwatchLogs: send error down to client

* Move error handling down to startLiveQuery

(cherry picked from commit 0ae8a85828)

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-07-05 16:34:29 +02:00
Grot (@grafanabot)
61ea316f10 DateFormats: Fix reading correct setting key for use_browser_locale (#36428) (#36434)
(cherry picked from commit 4932b9dfa4)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-07-05 15:27:35 +02:00
Leonard Gram
ab26f9c820 Azure OAuth: debug logs for user information (#36389) (#36394)
(cherry picked from commit 09a96ad2ad)
2021-07-05 11:05:49 +02:00
Grot (@grafanabot)
92ab8a4189 TimeSeries: Do not show series in tooltip if it's hidden in the viz (#36353) (#36423)
(cherry picked from commit 7ae656ff16)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-07-05 10:44:33 +02:00
Grot (@grafanabot)
190d7d12e3 Alerting: Fix prometheus API to check folder permissions (#36301) (#36421)
(cherry picked from commit 8a3edf280e)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-07-05 11:31:58 +03:00
Grot (@grafanabot)
6c79c846ba Snapshots: Fixex snapshots absolute time range issue (#36350) (#36382)
(cherry picked from commit 09fed51be5)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-07-05 10:14:38 +02:00
Grot (@grafanabot)
862c9a2c73 fix: #36322 HistoryWrapper constructor history param not work (#36367) (#36399)
(cherry picked from commit 63715dcdef)

Co-authored-by: MeetzhDing <meet.zhding@foxmail.com>
2021-07-05 09:02:35 +02:00
Grot (@grafanabot)
fc45cf178e Allow white labeling loading logo (#36174) (#36386)
* Allow to whitelabeling loading logo

* Add loading_logo to documentation

* Change loading_logo to loading_logo_url

(cherry picked from commit ef05596e07)

Co-authored-by: Selene <selenepinillos@gmail.com>
2021-07-05 09:50:57 +03:00
Grot (@grafanabot)
d03007de01 Dashboards: Add IsFolder field into models.GetDashboardQuery (#36214) (#36388)
* Add IsFolder field into models.GetDashboardQuery

* Reverted folderId - return dummy success when calling get folder with id 0

* Moved condition to upper level - add test

(cherry picked from commit 084c9c8746)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2021-07-02 19:19:08 +03:00
Grot (@grafanabot)
1b23e38a86 AzureMonitor: Refresh documentation (#35371) (#36397)
* AzureMonitor: Refresh documentation

* logs/kusto

* finish up logs

* variables for log analytics

* Apply suggestions from code review

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

* finish up main topics

* finish docs?

* typos and other review comments

* add link to sample arg queries

* split up azure docs

* workaround weird code duplication issue

* Update docs/sources/datasources/azuremonitor/template-variables.md

Co-authored-by: Sarah Zinger <sarahzinger@users.noreply.github.com>

* Apply suggestions from code review

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

* feedback

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

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-07-02 17:17:24 +02:00
Grot (@grafanabot)
7eb704f49d Docs: Update bar-gauge-panel.md (#36250) (#36395)
may be a mistake here?

(cherry picked from commit 379ed0a6f7)

Co-authored-by: dreamChenp12 <86648316+dreamChenp12@users.noreply.github.com>
2021-07-02 17:13:35 +02:00
Grot (@grafanabot)
df2500a928 Docs: Add $__rate_interval variable to global variables (#36378) (#36391)
* Add  variable documentation to global variables

* Update docs/sources/variables/variable-types/global-variables.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>
(cherry picked from commit 0ca6fdd310)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-07-02 16:38:24 +02:00
Grot (@grafanabot)
1a598bf75e Docs: Improve title and documentation for share shortened link in Explore (#36380) (#36392)
* Improve title and documentation for share shortened link in Explore

* Update docs/sources/explore/_index.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>
(cherry picked from commit 09e49f6118)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-07-02 16:34:22 +02:00
Grot (@grafanabot)
bc0c5f118b DashboardQueryRunner: Fixes unrestrained subscriptions being created (#36371) (#36375)
(cherry picked from commit b741245960)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-07-02 11:13:58 +02:00
Grot (@grafanabot)
ef45e1016a Remove AWS CW client cache (#36311) (#36372)
(cherry picked from commit 30dc4025c2)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2021-07-02 10:35:28 +02:00
Grot (@grafanabot)
468523a1ce Docs: Add security warning about using Grafana 8 alerts with multiple organisations (#36308) (#36354)
* Docs: Add security warning about using Grafana 8 alerts with multiple orgs

(cherry picked from commit d525a5a469)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-07-01 18:53:20 +03:00
Grot (@grafanabot)
740aedbcbb ReleaseNotes: Updated changelog and release notes for 8.0.4 (#36347) (#36356)
* ReleaseNotes: Updated changelog and release notes for 8.0.4

* Update _index.md

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
(cherry picked from commit 3cce67c044)
2021-07-01 17:49:17 +02:00
Grot (@grafanabot)
dc4007e7bd TimeSeries: Fixes x-axis time format when tick increment is larger than a year (#36335) (#36348)
* TimeSeries: Fixes x-axis time format when tick increment is larger than a year

* removed modal change

* removed modal change

(cherry picked from commit f152180dc3)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-07-01 14:00:45 +02:00
Grot (@grafanabot)
81fef5b4b4 "Release: Updated versions in package to 8.0.4" (#36343) 2021-07-01 13:35:58 +02:00
Alexander Emelin
acd0d18552 live: add allowed_origins option (#36318) (#36327)
* live: add allowed_origins option (#36318)

(cherry picked from commit 483418dbb0)

* Profile: Fix failing FE reducer test (#36331)

(cherry picked from commit 4434eeaf59)

* update option description to only commit to wilcard symbol for now

* Chore: dummy change to trigger Drone sync

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2021-07-01 13:30:27 +02:00
Grot (@grafanabot)
682d4134d6 Web compat: polyfill MediaQueryList.addEventListener() for Safari < 14 (#36274) (#36321)
(cherry picked from commit b8010ba9f5)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-07-01 11:20:20 +02:00
Grot (@grafanabot)
fd1d0a2a7c Profile: Fix failing FE reducer test (#36331) (#36333)
(cherry picked from commit 4434eeaf59)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-07-01 10:26:48 +02:00
Torkel Ödegaard
f4cf33a81d Graph: Workaround for DashboardQueryRunner race condition (#36254) (#36299)
* Graph: Workaround for DashboardQueryRunner race condition

* Removed deepClone

(cherry picked from commit 6f38883583)
2021-07-01 08:32:03 +02:00
Grot (@grafanabot)
070fc7dbef Prometheus: Fix performance issue in editor when too many ids (#36176) (#36315)
(cherry picked from commit 8aeb1cc030)

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-06-30 21:50:59 +02:00
Grot (@grafanabot)
601c113dbf Fix Graph story (#36259) (#36305)
(cherry picked from commit 1ab4ffb03d)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-06-30 16:36:14 +02:00
Grot (@grafanabot)
5f114cb3f0 Elasticsearch: Persist custom value for size option in Terms Bucket Agg (#36194) (#36296)
* Add custom hook to handle creatable select options

* Refactor Terms Settings Editor

* Make props of Bucket Aggregation settings editors consistent

* Rename hook to something more descriptive

* Move render test helper

* Add tests

* small refactor

* Remove useless test

(cherry picked from commit 1490c255f1)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-06-30 11:46:00 +02:00
Grot (@grafanabot)
e97c02ef12 TimeSeries: Bring back axis label padding (#36281) (#36288)
* TimeSeries: bring back some axis label padding

* Update snaps

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

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-06-30 11:32:14 +02:00
Grot (@grafanabot)
d15a70371f Chore: adds buffersize to ReplaySubject (#36286) (#36287)
(cherry picked from commit 3999d670cf)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-06-30 09:27:56 +02:00
Grot (@grafanabot)
d478184e47 Update getTimeRangeParams to return start & end instead of from & to (#36268) (#36275)
(cherry picked from commit abb1c10776)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-06-29 18:28:18 +02:00
Grot (@grafanabot)
2ca6b89d8f Update _index.md (#36248) (#36272)
Spelling error on line 18.
aerts -> alerts

(cherry picked from commit 603d1cddb8)

Co-authored-by: Dawnpool <57010815+Dawnpool@users.noreply.github.com>
2021-06-29 10:32:03 -04:00
Grot (@grafanabot)
469b805515 [Alerting] Update documentation with regards to clustering (#36261) (#36264)
* [Alerting] Update documentation with regards to clustering

* 8.1 not 8.2

(cherry picked from commit 91751d7e38)

Co-authored-by: gotjosh <josue@grafana.com>
2021-06-29 07:56:38 -04:00
Grot (@grafanabot)
16c2a2b6cb Elasticsearch: Allow case sensitive custom options in date_histogram interval (#36168) (#36255)
* Elasticsearch: make interval select handle case-sensitive input

* Elasticsearch: Allow case sensitive custom options in date_histogram interval

* asd is not a good input id

(cherry picked from commit 0a2a6690d9)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-06-29 11:50:18 +01:00
Grot (@grafanabot)
89ac0a79ad Update whats-new-in-v8-0.md (#36249) (#36251)
Double periods to a single period

(cherry picked from commit 228372522b)

Co-authored-by: Dawnpool <57010815+Dawnpool@users.noreply.github.com>
2021-06-29 09:36:48 +02:00
Grot (@grafanabot)
4410fe538d AccessControl: Fix docs link to localhost (#36233) (#36234)
* AccessControl Correct link to localhost

* Removed extra parenthesis in relref definition

(cherry picked from commit d42d874240)

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2021-06-28 21:40:31 +02:00
Grot (@grafanabot)
1d2bbce1cf Added note about location of the default home dashboard. (#36231) (#36232)
(cherry picked from commit cdc780e9c6)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-06-28 21:08:36 +02:00
Grot (@grafanabot)
392dfd7e15 Doc: Updated broken relrefs to "Value mappings in topic "State timeline". (#36225) (#36227)
* Updated broken relrefs and adjusted some weights.

* Fixed. There was some issue with ", rendering OK in local build.

(cherry picked from commit 258b3b7078)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-06-28 17:50:58 +02:00
Grot (@grafanabot)
f1db840fe1 Azure monitor: ensure that time column has a name (#36144) (#36217)
Fixes bug when switching from Timeseries to Table view when viewing Azure Monitor Metrics Data.

(cherry picked from commit 493d35ccc6)

Co-authored-by: Sarah Zinger <sarahzinger@users.noreply.github.com>
2021-06-28 11:45:26 -04:00
Grot (@grafanabot)
cbae9dda34 Explore: Fix import of queries between SQL data sources (#36210) (#36224)
* Remove datasource property when importing same ds type queries

* Refactor imported queries

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

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

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
(cherry picked from commit a721dd42b3)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-06-28 16:36:09 +02:00
Grot (@grafanabot)
28c0f8c49e fix broken link to play (#36148) (#36183)
closes https://github.com/grafana/grafana/issues/36103

(cherry picked from commit e6e7ba209c)

Co-authored-by: Matt Abrams <37156449+zuchka@users.noreply.github.com>
2021-06-25 20:41:37 +02:00
Grot (@grafanabot)
592cf2ac72 Docs: Document caching defaults in enterprise config (#36181) (#36182)
* Docs: Document caching defaults in enterprise config

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>

* adding missed period

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

* more missed periods!

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

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

Co-authored-by: Dave Henderson <dhenderson@gmail.com>
2021-06-25 14:28:26 -04:00
achatterjee-grafana
a1972c0f5b Added note that anonymous access permission is no longer available. (#36142) (#36173) 2021-06-25 11:13:55 -04:00
Grot (@grafanabot)
164148b3de Grafana-UI: allow custom validity checks for creatable selects (#36118) (#36162)
* add actions handling to Select in storybook

* Grafana-UI: allow custom validity checks for creatable selects

(cherry picked from commit 58bbe17d84)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-06-25 12:27:30 +02:00
Grot (@grafanabot)
b5b8d226ad TimeSeries: Preserve RegExp series overrides when transforming from old graph (#36134) (#36158)
(cherry picked from commit b8b90ec74f)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-06-25 11:16:26 +02:00
Grot (@grafanabot)
60074192e9 put environmental variable in inline code (#36100) (#36123)
this puts the code in question in the same style as the other environmental variables on the page

(cherry picked from commit 6b0c75cfd6)

Co-authored-by: Matt Abrams <37156449+zuchka@users.noreply.github.com>
2021-06-24 13:58:49 -04:00
Grot (@grafanabot)
d2a59bd78d Alerting: Add additional newlines to Microsoft Teams notification message where necessary (#36126) (#36137)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit 8fe58fc2e3)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-06-24 17:42:44 +02:00
Grot (@grafanabot)
1e77c2941b Docs: Add note about time series replacing graph vis (#36101) (#36135)
(cherry picked from commit 4f84a09286)

Co-authored-by: Ben Bodenmiller <bbodenmiller@gmail.com>
2021-06-24 17:19:19 +02:00
Grot (@grafanabot)
37bef2d0b2 add note about HA limitation (#36112) (#36129)
(cherry picked from commit ea8aee0432)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-06-24 16:40:56 +02:00
Grot (@grafanabot)
3a12aa00c0 Signup: Add verify email route (#36113) (#36115)
(cherry picked from commit 4be9afb7e2)

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
2021-06-24 13:29:42 +02:00
Grot (@grafanabot)
42471f1031 Alerting: Change __value__ label to __value_string__ annotation and add ValueString variable in notifications (#36032) (#36105)
* Alerting: Allow __value__ label in notifications
was being removed by removePrivateItems
discoverd in #36020, but issue is not about that specifically

* __value__ label to __value_string__ annotation
and .ValueString extended property for notifications

(cherry picked from commit 19f764739b)

Co-authored-by: Kyle Brandt <kyle@grafana.com>
2021-06-24 09:40:48 +02:00
Grot (@grafanabot)
833014d924 fix typo in template (#36082) (#36090)
(cherry picked from commit e91f12bde3)

Co-authored-by: Jan Steinke <jan.steinke@gmail.com>
2021-06-23 14:09:57 -04:00
Grot (@grafanabot)
24c98204e3 Live: rely on app url for origin check (#35983) (#36089)
(cherry picked from commit 5bbf45592e)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-06-23 20:30:40 +03:00
Grot (@grafanabot)
c447ff2581 Updated content to specify method to use to get keyboard shortcuts wh… (#36084) (#36088)
* Updated content to specify method to use to get keyboard shortcuts when user is on Windows.

* Added changes from doc review.

(cherry picked from commit 5da8f3e258)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-06-23 18:58:16 +02:00
Grot (@grafanabot)
0d33b57428 PieChart: sort legend descending, update placeholder to show default field display values limit (#36062) (#36081)
(cherry picked from commit 15171ffa3b)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-06-23 16:53:58 +02:00
Grot (@grafanabot)
d38a50c2f3 Docs: document cortex/loki data source caveats for alerting (#36074) (#36078)
* Document cortex/loki datasource caveats

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

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

* Update docs/sources/alerting/unified-alerting/alerting-rules/create-cortex-loki-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>
(cherry picked from commit d427b57c0e)

Co-authored-by: Domas <domas.lapinskas@grafana.com>
2021-06-23 10:51:44 -04:00
Grot (@grafanabot)
f0fb1edb7c ReleaseNotes: Updated changelog and release notes for 7.5.9 (#36057) (#36076)
* ReleaseNotes: Updated changelog and release notes for 7.5.9

* Add link to notes

* Apply suggestions from code review

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

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
(cherry picked from commit 49a64f8d44)
2021-06-23 15:57:18 +02:00
Andres Martinez Gotor
f84f9d5b44 AzureMonitor: Add cloud specific deep linking (#35784) (#36066)
(cherry picked from commit 83860bdcc3)

Co-authored-by: shuotli <63325084+shuotli@users.noreply.github.com>
2021-06-23 14:39:35 +01:00
Grot (@grafanabot)
5f26262655 influxdb: influxql: fix retention-policy handling (#36022) (#36058)
(cherry picked from commit ec9dbdd93c)

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
2021-06-23 10:17:08 +02:00
Grot (@grafanabot)
0f9168953b Elasticsearch: Restore fields naming when using variables (#35624) (#36034)
(cherry picked from commit 185bf8f9a2)

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2021-06-22 19:33:22 +02:00
Grot (@grafanabot)
901cc09416 Update custom-panel-option-editors.md (#36005) (#36006)
Variable name fix

(cherry picked from commit f84a74018c)

Co-authored-by: DBaldovskiy <d.baldovskiy@mail.ru>
2021-06-22 09:39:32 -04:00
Grot (@grafanabot)
f98a092a96 Variables: Fix for changing readonly query property (#35992) (#36014)
* Variables: Fix for changing readonly query property

* Docs: adds release

* Docs: adds release

(cherry picked from commit ffc18ebbcf)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-06-22 09:17:22 +02:00
Grot (@grafanabot)
b3611ab407 Alerting: fix conflicting folder and dashboard permissions during migration (#35967) (#36013)
* Alerting: Fix conflicting user and team permissions

* Avoid duplicate perrmissions

* Fix lint

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

Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit 91cf062d0b)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-22 09:05:23 +02:00
Grot (@grafanabot)
354727ae32 [MYSQL] convert explicitely smallint and tinyint (#35897) (#35997)
* [MYSQL] convert explicitely smallint and tinyint

* clean up code

* fix comments

(cherry picked from commit 73fdd9dc22)

Co-authored-by: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com>
2021-06-21 18:30:16 +02:00
Grot (@grafanabot)
ec01ce9cae TimeSeries panel: Do not reinitialize plot when thresholds mode change (#35952) (#35978)
(cherry picked from commit 6f3887ca88)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-06-21 09:15:12 +02:00
Grot (@grafanabot)
07bfa64bb4 Alerting: Decouple default template from channel tests (#35239) (#35973)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit 33d6e11175)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-06-21 04:54:29 +02:00
Grot (@grafanabot)
46d1c1c112 Templating: Add default ref id for data source variable queries (#35923) (#35946)
* add default ref id for ds variable queries

* cleanup

(cherry picked from commit 7ff26bdfae)

Co-authored-by: Erik Sundell <erik.sundell@grafana.com>
2021-06-18 14:26:20 +02:00
Grot (@grafanabot)
1cbc05abd1 Chore: Refactors flaky Frontend test (#35645) (#35738)
* Chore: Refactors flaky Frontend test

* Refactor: update after PR comments

(cherry picked from commit 3395142ece)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-06-18 13:36:53 +02:00
Grot (@grafanabot)
e9e67c3d98 ReleaseNotes: Updated changelog and release notes for 8.0.3 (#35936) (#35938)
* ReleaseNotes: Updated changelog and release notes for 8.0.3

* Update _index.md

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
(cherry picked from commit fb91302e52)
2021-06-18 13:13:35 +02:00
Giordano Ricci
cd00485304 Update release notes url (#35937) 2021-06-18 12:39:37 +02:00
Grot (@grafanabot)
cae5c5e46b "Release: Updated versions in package to 8.0.3" (#35929) 2021-06-18 10:56:02 +02:00
Grot (@grafanabot)
9ab2fd5ec9 Prometheus: Fixes issue where legend name was replaced with name Value in stat & gauge panels (#35863) (#35905)
(cherry picked from commit 22203fd4df)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-18 09:19:26 +01:00
Grot (@grafanabot)
3805f72b6a Dashboard: Fixes blank / empty panels after duplicate and add library panel (#35906) (#35924)
(cherry picked from commit 333932812d)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-18 09:12:39 +02:00
Grot (@grafanabot)
a95eca61ff Dashboard: Fix changes doesn't reflect after changing panel sizes in inspect JSON and click on apply (#35276) (#35744)
* Trigger DashboardPanelsChangedEvent from InspectJSONTab if the panel.gridPos changed and if the dashboard needs to re-render, if yes we will  that will update the positioning
* Minor cleanup

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

Co-authored-by: Maria Alexandra <239999+axelavargas@users.noreply.github.com>
2021-06-18 09:06:44 +02:00
Grot (@grafanabot)
276dc632f6 LibraryPanels: Fixes crash in libray panels list when panel plugin is not found (#35907) (#35921)
(cherry picked from commit 941936cf97)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-18 08:31:16 +02:00
Grot (@grafanabot)
80db97f134 SQL: Fixes issues with showing value column name prefix in legends (#35839) (#35922)
* rename strategy

* Update pkg/tsdb/sqleng/sql_engine.go

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

* more strict constraints

* Fixed so that it works on multi series results

* only apply the logic when original query returns 3 fields

* removed part of comment

* Update mysql test

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

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-06-18 08:28:23 +02:00
Grot (@grafanabot)
1f65d8a899 Time series: always show single points if surrounded by nulls (#35845) (#35909)
(cherry picked from commit 503c3b8f66)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-06-17 23:08:54 +02:00
Grot (@grafanabot)
a4808d12ed GraphNG: more precise axis auto-sizing (#35842) (#35903)
(cherry picked from commit e1e2bd545a)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-06-17 20:48:29 +02:00
Grot (@grafanabot)
2745265f99 GraphNG: uPlot 1.6.13 (#35844) (#35902)
(cherry picked from commit 9eac9aefde)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-06-17 20:46:18 +02:00
Grot (@grafanabot)
2b0291f997 Alerting: recalculate EndsAt (#35830) (#35898)
* setEndsAt

* one more test case

* add should clause to tests

(cherry picked from commit 4732f832f7)

Co-authored-by: David Parrott <stomp.box.yo@gmail.com>
2021-06-17 19:26:32 +02:00
Grot (@grafanabot)
43ab6bee9c Postgres/MySQL: Fixes issue with toggle query editor mode (#35890) (#35894)
* Postgres/MySQL: Fixes issue with toggle query editor mode

* PostGres/MySQL: Use $evalAsync instead of manual $digest

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

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-17 18:53:52 +02:00
Grot (@grafanabot)
b6689bdf47 PanelEdit: VisulizationPicker doesn't show if panel has an unknown panel plugin (#35831) (#35892)
* feat(dashboard): introduce selector with fallback for unknown plugin

* refactor(dashboard): replace redux connect with redux hooks

* fix(dashboard): add a fallback for vizpicker when a panel plugin cannot be found

* feat(dashboard): add an icon for fallback plugins for vizpicker

* refactor(dashboard): prefer HOF selector

(cherry picked from commit 0fea1cf970)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-06-17 18:02:26 +02:00
Grot (@grafanabot)
e01b1285b9 Docs/SSE: Misc updates and corrections (#35882) (#35889)
* Docs/SSE: Misc updates and coorections

* Update docs/sources/panels/expressions.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>
(cherry picked from commit fe61d20794)

Co-authored-by: Kyle Brandt <kyle@grafana.com>
2021-06-17 17:05:45 +02:00
Grot (@grafanabot)
14a76fecf1 Docs: Link to the new alerting API spec (#35812) (#35888)
* Docs: Link to the new alerting API spec

* Update docs/sources/http_api/alerting.md

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

* Update docs/sources/http_api/alerting.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>
(cherry picked from commit a42ace4d4c)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-17 16:34:33 +02:00
Grot (@grafanabot)
dd4f6f383d Fix spelling mistake in docs for expressions (#35873) (#35877)
(cherry picked from commit 066189588f)

Co-authored-by: George Robinson <85952834+gerobinson@users.noreply.github.com>
2021-06-17 09:45:36 -04:00
Grot (@grafanabot)
a4d72f0e5d Alerting: Fix alert permissions migration (#35869) (#35881)
* Alerting: Fix alert permissions migration

for MySQL >= 5.7 and PostgreSQL

* Do not use import struct

(cherry picked from commit 5e534d212c)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-17 16:34:20 +03:00
Grot (@grafanabot)
f300bdfa15 TimeSeries: ensure series overrides containing color are migrated, and migrate previous fieldConfig when changing panel type (#35676) (#35872)
* migrate previous fieldConfig when changing panel type

* TimeSeries: ensure a color series override is migrated correctly

* TimeSeries: update test description to be more accurate

* TimeSeries: update snapshot

(cherry picked from commit 4618fd34a9)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-06-17 12:43:45 +02:00
Grot (@grafanabot)
21d7936007 AzureMonitor: Fix workspace template variable queries without default workspace (#35836) (#35868)
(cherry picked from commit 4cdcb3103a)

Co-authored-by: Josh Hunt <joshhunt@users.noreply.github.com>
2021-06-17 10:55:58 +01:00
Grot (@grafanabot)
d246127b2b Table: Set width 100% if the calced width is 0 (#35802) (#35825)
(cherry picked from commit a693b2eaef)

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
2021-06-17 11:46:58 +02:00
Grot (@grafanabot)
f9c70dc834 AzureMonitor: Avoid instantiating appInsights for AppInsights for gov cloud (#35772) (#35867)
(cherry picked from commit 4ac2ed5de6)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2021-06-17 11:38:11 +02:00
Grot (@grafanabot)
21a0d45b63 Memoize SearchResults (#35851) (#35862)
(cherry picked from commit 91e9ef232d)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-06-17 10:43:11 +02:00
Grot (@grafanabot)
7ab2f13c87 MSSQL: Fixes issue with hidden queries still being executed (#35837) (#35861)
(cherry picked from commit 5f07381796)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-17 10:41:35 +02:00
Grot (@grafanabot)
9e39855e33 LogsPanel: Fix performance drop when moving logs panel in dashboard. (#35379) (#35859)
(cherry picked from commit 16a0e7b6a4)

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2021-06-17 10:30:33 +02:00
Grot (@grafanabot)
4451724573 test: fix e2e dashboard and configure panel flows for Grafana 8 (#35498) (#35856)
* fix e2e flows

* trigger build

* remove aria-label

(cherry picked from commit 768c190bc0)

Co-authored-by: Vicky Lee <36230812+vickyyyyyyy@users.noreply.github.com>
2021-06-17 09:01:53 +01:00
Grot (@grafanabot)
cfea2a61f1 test: remove health check request for e2e flow (#35494) (#35855)
* remove health check request

* add deprecation notice

(cherry picked from commit e9a4484daf)

Co-authored-by: Vicky Lee <36230812+vickyyyyyyy@users.noreply.github.com>
2021-06-17 09:01:34 +01:00
Grot (@grafanabot)
23931ef3af ReleaseNotes: Updated changelog and release notes for 7.5.8 (#35703) (#35826)
* ReleaseNotes: Updated changelog and release notes for 7.5.8

* Add missing 7.5.8 link

* Update 7.5.8 release date

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
(cherry picked from commit ef59020f3d)
2021-06-16 16:51:01 +02:00
Grot (@grafanabot)
1569452425 Chore: Improve save dashboard error messages (#35780) (#35819)
Includes panel and dashboard id in alert
extractor errors.
Logs all non-400 dashboard errors.

Fixes #35751

(cherry picked from commit 477d4197fb)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-06-16 15:19:27 +02:00
Grot (@grafanabot)
3f0e41cd93 Alerting: Don't reset value when changing evaluator method on classic condition (#35750) (#35814)
(cherry picked from commit 407bd2d619)

Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
2021-06-16 14:34:59 +02:00
Grot (@grafanabot)
c5cff65563 CloudWatch/Logs: Fix missing response data for log queries (#35724) (#35746)
(cherry picked from commit 9a3e3014dd)

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2021-06-16 13:58:48 +02:00
Grot (@grafanabot)
9252d6b05f Alerting: Fill the empty GeneratorURL (#35740) (#35803)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit dcd4bf1615)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-06-16 12:27:49 +02:00
Grot (@grafanabot)
a376e41ff1 SideMenu: Make sure the menu overlaps the border to prevent leaving hover state #35728 (#35795)
(cherry picked from commit b118e06b6a)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2021-06-16 10:46:44 +02:00
Grot (@grafanabot)
638ea61172 [v8.0.x] Dashboard Settings: Fix TimeZone dropdown doesn't change the timezone (#35788)
* Use redux action to update dashboard.timezone
* Added unit test

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
(cherry picked from commit 182b03aa8f)

Co-authored-by: Maria Alexandra <239999+axelavargas@users.noreply.github.com>
2021-06-16 08:54:45 +02:00
Grot (@grafanabot)
13f367ed27 grafana/ui: Do not wrap words inside RadioButton (#35654) (#35753)
(cherry picked from commit e5e93134cf)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-06-16 08:48:38 +02:00
Grot (@grafanabot)
9a2970b5e8 Log level determined from striped message (#35607) (#35754)
(cherry picked from commit 41fca2e2df)

Co-authored-by: Olof Bourghardt <olof.bourghardt@gmail.com>
2021-06-16 08:47:41 +02:00
Grot (@grafanabot)
ff07379029 State Timeline: Fix crash when hovering over panel (#35692) (#35786)
* State Timeline: Fix crash when hovering over panel

* Refactor: fixes after PR comments

* Chore: fixes infinite loop

(cherry picked from commit 7a9d8e4230)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-06-16 06:59:19 +02:00
Grot (@grafanabot)
7e838c511c Time series: fix soft scale limits when all values are 0 (#35596) (#35782)
(cherry picked from commit d3c1a2bf8e)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2021-06-16 01:05:13 +02:00
Grot (@grafanabot)
6cd8305467 TimeSeries: Reduce tick size from 10 to 4 (#35632) (#35781)
(cherry picked from commit b3fcad947b)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-16 00:32:15 +02:00
Grot (@grafanabot)
da9c028c7e GraphNG: Handle infinite numbers as nulls when converting to plot array (#35638) (#35778)
(cherry picked from commit 60f5865ee2)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-06-15 17:15:21 -05:00
Grot (@grafanabot)
36b94c5a67 doc: fix link to label and detected fields doc (#35609) (#35777)
* Fix link to label and detected fields doc

* Update docs/sources/datasources/loki.md

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

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

Co-authored-by: Andrea Scarpino <andrea@scarpino.dev>
2021-06-15 21:14:20 +02:00
Grot (@grafanabot)
242577ad33 Alerting: Fix updating alert rule properties with missing/zero values (#35512) (#35776)
* Fix deleting labels and annotations

* Add test

* Keep no data and error start if not provided

* Allow setting interval and for to zero during rule updates

(cherry picked from commit e5a5b8e3fe)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-15 21:42:25 +03:00
Grot (@grafanabot)
55829f1646 Plugins: Improve wording around allow_loading_unsigned_plugins configuration (#35731) (#35775)
* improve wording

* Update docs/sources/administration/configuration.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 conf/sample.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>
(cherry picked from commit 89d8dedece)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-06-15 13:45:01 -04:00
Grot (@grafanabot)
6a9f5b260d Alerting: Add error recovery during rule evaluations (#35450) (#35773)
* Alerting: Eval recovery after query failure

* Apply suggestions from code review

(cherry picked from commit abe35c8c01)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-15 19:54:33 +03:00
Grot (@grafanabot)
c78da2c50c Docs: Add upgrade/breaking note about SQL data sources and data frames (#35766) (#35771)
Add upgrade/breaking note about SQL data sources and data frames.

Ref #35534

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

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-06-15 18:37:34 +02:00
Grot (@grafanabot)
15c9d4e3e2 Avoid log entry if not set for debug (#35741) (#35748)
(cherry picked from commit 6b786e7f68)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2021-06-15 18:01:38 +02:00
Grot (@grafanabot)
4fd5765354 Docs: Clarify data streaming with plugins documentation (#35576) (#35696)
(cherry picked from commit 898c314946)

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-06-15 11:21:40 -04:00
Grot (@grafanabot)
17a091dfb6 Docs: Document migration of dashboard alert permissions (#35559) (#35764)
* Docs: Document migration of dashbard alert permissions

* Add reference to the configuration

* Apply suggestions from code review

* Apply suggestions from code review

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

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

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-15 17:03:00 +02:00
Grot (@grafanabot)
86be18a668 Plugins: fix test with bad symlink target (#35737) (#35755)
(cherry picked from commit adbb15a3a7)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-06-15 16:16:49 +02:00
Grot (@grafanabot)
dd24946f0f Fix: fix loading symbolically linked plugins (#35635) (#35693)
(cherry picked from commit 5b5cb94809)

Co-authored-by: Domas <domas.lapinskas@grafana.com>
2021-06-15 13:24:53 +03:00
Giordano Ricci
9fce4436ea Update What's New & Release notes URLs (#35673)
* Update What's New & Release notes URLs

* Update package.json

* Update package.json
2021-06-15 11:24:19 +01:00
Grot (@grafanabot)
c9b8c851fa Plugins: Ignore symlinked folders when verifying plugin signature (#34434) (#35719)
* add check + test

* fix test

* add manifest

* fix linter

* add nolint

* separate err cond checks

* only collect relevant plugin files

* skip symlinks

* refactor

* add missing test files + enable scanning Chromium.app/

* remove test since case already covered

* remove unnecessary changes from before

* refactor

* remove comment

(cherry picked from commit 303352a89b)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-06-15 12:19:24 +02:00
Grot (@grafanabot)
eb018c417d Alerting: Fix alert migration RefID generation (#35667) (#35679)
* Alerting: Fix alert migration RefID generation

if the alert has more than 26 conditions

* Remove TODO comment

* Make similar change under pkg/expr

(cherry picked from commit c997f646cc)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-15 11:49:40 +03:00
Grot (@grafanabot)
fd50fc8ec7 Chore: Move immutable, is-hotkey, and react-inlinesvg deps to grafana-ui (#34290) (#35627)
(cherry picked from commit aa14621d29)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2021-06-15 09:49:09 +01:00
Grot (@grafanabot)
4c274d1615 Login: Require user to not be signed in to get request password email (#35421) (#35672)
(cherry picked from commit 7f882eea05)

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
2021-06-14 18:25:24 +02:00
Grot (@grafanabot)
d86e6c072e doc: fix link to Loki's doc (#35611) (#35671)
(cherry picked from commit 74a6e6d973)

Co-authored-by: Andrea Scarpino <andrea@scarpino.dev>
2021-06-14 17:58:17 +02:00
Grot (@grafanabot)
7a3163da1f Alerting: Increase alertmanager_conf column size if mysql (#35657) (#35668)
fixes #35583

(cherry picked from commit 8a3d7b6446)
2021-06-14 17:30:17 +02:00
Grot (@grafanabot)
732f794e16 Alerting: fix postgres migration on conflict (#35556) (#35653)
(cherry picked from commit 423474325a)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-14 18:09:27 +03:00
Grot (@grafanabot)
8ac34f9c76 Docs: Fix Prometheus data source provisioning example about httpMethod (#35660) (#35664)
(cherry picked from commit 61a718cf8d)

Co-authored-by: hanjm <hanjinming@outlook.com>
2021-06-14 17:01:01 +02:00
Grot (@grafanabot)
72b5f5fdff PanelEdit: Always have bottom border to make sections easier to see when expanded (#35565) (#35626)
(cherry picked from commit 7599ab8217)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-14 16:58:36 +02:00
Grot (@grafanabot)
4e2ee85751 Add Panel: fixes No gap between rows in safari (#35570) (#35661)
* Add Panel: fixes No gap between rows in safari

* removes extra margin from bottom and far right

* fixes frontend test

* make add panel actions accessible and rewrite test using RTL

(cherry picked from commit 6ee2f1fe3e)

Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
2021-06-14 16:46:29 +02:00
Grot (@grafanabot)
059c5905bb ReleaseNotes: Updated changelog and release notes for 8.0.2 (#35615) (#35644)
* ReleaseNotes: Updated changelog and release notes for 8.0.2

* Update release notes for 8.0.2

* Update CHANGELOG.md

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

* Update docs/sources/release-notes/release-notes-8-0-2.md

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

Co-authored-by: Ivana <ivana.huckova@gmail.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
(cherry picked from commit 4cb62e4292)
2021-06-14 15:15:36 +02:00
Grot (@grafanabot)
e7c0b6a248 Docs: Fix template example for unified alerting (#35620) (#35639)
Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
(cherry picked from commit 673b03671d)

Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
2021-06-14 14:31:59 +02:00
Grot (@grafanabot)
8db130f746 ValueMappings: Improve singlestat value mappings migration (#35578) (#35636)
* Migrate singlestat value mappings to new value mappings

* Update public/app/features/dashboard/state/DashboardMigrator.ts

* Update migration to produce single value map

(cherry picked from commit 08bc2b402b)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2021-06-14 14:11:50 +02:00
Grot (@grafanabot)
7a96df875b Annotations: Fix annotation line and marker colors (#35608) (#35619)
(cherry picked from commit 75ff02a9fb)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-14 12:39:40 +02:00
Grot (@grafanabot)
5c5d45e19f "Release: Updated versions in package to 8.0.2" (#35614) 2021-06-14 10:55:02 +02:00
Grot (@grafanabot)
ffd39d5f36 Fix typo (#35452) (#35454)
(cherry picked from commit e4a4446004)

Co-authored-by: Nolan Crooks <58015900+crockk@users.noreply.github.com>
2021-06-14 10:06:35 +02:00
Grot (@grafanabot)
a97ad5e6e4 AlertList: make sure we sort the alert list when displayed in "recent state changes" mode. (#35544) (#35545)
(cherry picked from commit 5ac2a7cca6)

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2021-06-14 09:53:02 +02:00
Grot (@grafanabot)
4a7c0eafd4 Variables: Hides default data source if missing from regex (#35561) (#35605)
(cherry picked from commit d94817146e)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-06-14 06:29:39 +02:00
Grot (@grafanabot)
982dfe21f5 Snapshots: Remove dashboard links from snapshots (#35567) (#35586)
(cherry picked from commit 4907d09ffe)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-12 08:11:02 +02:00
Grot (@grafanabot)
a156582fc4 Theme: Change white base in dark theme (#35564) (#35582)
* Theme: Change white base in dark theme

* Updated

* Updated snapshots

(cherry picked from commit f884381a68)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-12 08:10:50 +02:00
Grot (@grafanabot)
e3ea4f839b PieChart: Fixes legend dimension limits (#35563) (#35584)
* PieChart: Fixes legend size limits

* Fixing table legend

* remove legend

(cherry picked from commit a328afd631)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-12 08:10:38 +02:00
Grot (@grafanabot)
be3032c4e8 Stat: improve color mode migration from singlestat panels (#35538) (#35587)
(cherry picked from commit 056e17216e)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-06-11 18:29:41 +02:00
Grot (@grafanabot)
b4e30f1bd3 Dashboard: handle the case where refresh_intervals could be null (#35511) (#35579)
* handle the case where refresh_intervals === null + add unit test

* have a clean _dashboard for each test

* modify check to see if refresh_intervals is an array

(cherry picked from commit 60f79a3548)

Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
2021-06-11 17:45:32 +02:00
Marcus Efraimsson
906af3bf4b [v8.0.x] Datasource: Add support for max_conns_per_host in dataproxy settings (#35520) (#35573)
Allow configuring dataproxy.max_conns_per_host for HTTP data sources.

Ref #35519
Ref #35257

(cherry picked from commit 6531424c72)

Co-authored-by: Javier Palomo <javier.palomo@grafana.com>
2021-06-11 17:18:44 +02:00
Grot (@grafanabot)
603c7ce2aa Graph and GraphNG: make the stories internal (#35491) (#35499)
(cherry picked from commit bea8747405)

Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
2021-06-11 15:46:09 +02:00
Grot (@grafanabot)
601b9e3e8a Postgres/MySQL/MSSQL: Fix concurrent map writes panic (#35510) (#35562)
Fixes panic/fatal error concurrent map writes in SQL data sources when multiple
queries are executed concurrently and you interpolate SQL query before executing it.

Fixes #35469

(cherry picked from commit 0611207f3b)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-06-11 15:24:06 +02:00
Grot (@grafanabot)
e442c3e790 TimeSeries: Fix fill below for dataframes with name (#35453) (#35560)
Use original dataframes for matching config.

(cherry picked from commit 38734366d1)

Co-authored-by: Oscar Kilhed <oscar.kilhed@grafana.com>
2021-06-11 14:24:24 +02:00
Grot (@grafanabot)
748e99a923 Configuration: Fix changing org preferences on FireFox (#35549) (#35551)
(cherry picked from commit 1838e6b774)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-06-11 12:23:28 +02:00
Grot (@grafanabot)
ab7efc2bb6 Search: runAllTimers => runOnlyPendingTimers (#35509) (#35550)
(cherry picked from commit 8e827337ea)

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-06-11 12:08:23 +02:00
Grot (@grafanabot)
7b10cf8b87 Doc add note to alerting docs (#35528) (#35530)
* Added note about retrieving rules from data sources.

* Polishing content.

* Fixed typos

* Update docs/sources/alerting/unified-alerting/opt-in.md

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

* Update docs/sources/alerting/unified-alerting/opt-in.md

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

* Update docs/sources/alerting/unified-alerting/opt-in.md

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

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

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-06-10 14:32:28 -04:00
Grot (@grafanabot)
0e3c8b6aa3 Docs: Update intro-histograms.md (#35462) (#35527)
(cherry picked from commit 34e4985a44)

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2021-06-10 18:05:54 +02:00
Grot (@grafanabot)
8a2e2aa063 Fix: only recurse a symbolic link if it is a directory (#35455) (#35521)
* only recurse a symbolic link if it is a directory

* added test for detecting valid plugins using lib dirs with symbolic links in them (like oracle)

* fix linting errors

* added extra checks as per code-review

(cherry picked from commit 83f26e9ce2)

Co-authored-by: Stephanie Closson <srclosson@gmail.com>
2021-06-10 17:54:50 +02:00
Grot (@grafanabot)
a23ff23deb ReleaseNotes: Updated changelog and release notes for 8.0.1 (#35502) (#35522)
* ReleaseNotes: Updated changelog and release notes for 8.0.1

* add link to index

* Apply suggestions from code review

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

* Wording changes

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
(cherry picked from commit c45c6655d0)
2021-06-10 17:06:06 +02:00
Grot (@grafanabot)
8849243d27 "Release: Updated versions in package to 8.0.1" (#35501) 2021-06-10 13:31:37 +02:00
Grot (@grafanabot)
ded96ea901 Upgrade ARG API version (#35464) (#35492)
(cherry picked from commit 05f3985108)

Co-authored-by: shuotli <63325084+shuotli@users.noreply.github.com>
2021-06-10 12:56:38 +02:00
Grot (@grafanabot)
658388573e StatPanel: Fixes issue with graph look when switching color mode (#35460) (#35482) 2021-06-10 11:53:18 +02:00
Grot (@grafanabot)
fcdf4ee25c GoogleCloudMonitoring: Fix query object for panels prior to v7 (#35449) (#35483)
* Fix query object for cloudmonitor panel from v6

* Use proper function

(cherry picked from commit 83b6df738e)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2021-06-10 11:38:53 +02:00
Grot (@grafanabot)
f0a975fc09 Routing: Remove subPath only at start of href (#35416) (#35485)
* fix(routing): remove baseUrl only if at start of url

* test(routing): add subdirectory suburl tests for stripBaseFromUrl

* test(routing): add absolute url check to fix tests, add extra tests

(cherry picked from commit 8b2ee06f3c)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-06-10 11:33:42 +02:00
Grot (@grafanabot)
422e388fa2 Datasource: Fix storing timeout option as numeric (#35441) (#35481)
#31871 introduced support for configuring timeout in seconds
for HTTP data sources. That had a bug where backend expected
a numeric timeout value where it was actually stored as a
string. This should resolve this by requiring input to be
numbers, storing input as numeric and falling back to string
value if there's no numeric value.

Ref #31871

(cherry picked from commit d15d87db8a)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-06-10 10:51:47 +02:00
Grot (@grafanabot)
ad6f9a0c32 Cloudwatch: Fix duplicated time series (#35433) (#35480)
* make sure queries are only ran once

* test aliases

* use correct dates

(cherry picked from commit eff2410bae)

Co-authored-by: Erik Sundell <erik.sundell@grafana.com>
2021-06-10 10:48:16 +02:00
Grot (@grafanabot)
56d51e45ae Grafana-UI: Removes knobs still showing in storybook stories (#35381) (#35409)
* Grafana-UI: Removes knobs from storybook addons pane

* removed other knobs settings since we are disabling it

* remove the knobs disable config in individual stories

(cherry picked from commit 8d9e1d75a5)

Co-authored-by: Uchechukwu Obasi <obasiuche62@gmail.com>
2021-06-10 10:42:08 +02:00
Grot (@grafanabot)
1bdd2c54d9 HTTP Client: Introduce go-conntrack into http client provider (#35314) (#35477)
* Introduce go-conntrack into http client provider

* Fixes according to reviewer's comments

* Fixes according to reviewer's comments

(cherry picked from commit 7cdf8b3705)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
2021-06-10 10:21:30 +02:00
Grot (@grafanabot)
c4075fe2e3 Alerting/SSE: Fix "count_non_null" reducer validation (#35451) (#35457)
fixes error "reducer 'count_non_null' in condition 2 is not a valid reducer"

(cherry picked from commit f4e9dcd40b)
2021-06-09 21:06:07 +02:00
Grot (@grafanabot)
8c1b326585 Live: only connect when user has a role (#35339) (#35395)
(cherry picked from commit 78d53c5e3d)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-06-09 09:40:51 -07:00
Grot (@grafanabot)
8b6c978d6d Logs panel: Add paddings so first and last lines can be copied (#35410) (#35444)
* Logs panel: Add paddings so all lines can be copied

* Update public/app/plugins/panel/logs/LogsPanel.tsx

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

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
(cherry picked from commit 34f680a20d)

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2021-06-09 18:33:34 +02:00
Grot (@grafanabot)
f4750c7a6b Fix missing defaultRegion (#35436) (#35440)
(cherry picked from commit 086309700e)

Co-authored-by: Andres Martinez Gotor <andres.martinez@grafana.com>
2021-06-09 17:44:32 +02:00
Grot (@grafanabot)
bd331f76ed Docs: Update panel-library.md (#35435) (#35439)
(cherry picked from commit ccd3ec5f2f)

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2021-06-09 17:41:38 +02:00
Grot (@grafanabot)
4fca76a631 [v8.0.x] Postgres/MySQL/MSSQL: Fix annotation parsing for empty responses (#35367) (#35430)
* fix sql annotation parsing for empty responses

* fix backend when no data returned

* add back frontend changes

Co-authored-by: Ying WANG <ying.wang@grafana.com>
(cherry picked from commit 9a5e10e6fb)

Co-authored-by: Marc Bachmann <marc.brookman@gmail.com>
2021-06-09 17:39:33 +02:00
Grot (@grafanabot)
3cae0e4d18 remove box-shadow from sidenav items using images for consistency (#35428) (#35434)
(cherry picked from commit 445356d6aa)

Co-authored-by: Ashley Harrison <ashharrison90@gmail.com>
2021-06-09 15:17:06 +01:00
Grot (@grafanabot)
f1810430a9 Dashboard: Fixes Dashboard init failed error on dashboards with old singlestat panels in collapsed rows (#35432)
(cherry picked from commit b3a2740d57)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-09 16:09:12 +02:00
Grot (@grafanabot)
aee6c15316 Postgres/MySQL/MSSQL: Fix so that numeric/non-string values are returned from query variables (#35411) (#35423)
Fixes a problem with query variables where SQL query returning for example only
numeric values didn't populate the query variables with values.

Fixes #35391

(cherry picked from commit bf7301e485)

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-06-09 14:42:17 +02:00
Grot (@grafanabot)
688d68af7e Docs: Fix code sample for access control provisioning (#35406) (#35419)
(cherry picked from commit dc7a641978)

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-06-09 14:22:27 +02:00
Grot (@grafanabot)
ed605c97f9 Plugins: Ignore trailing slash in root URL check (#35338) (#35402)
* ignore trailing slash in root URL check

* apply pr feedback

(cherry picked from commit 873e20b7ae)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
2021-06-09 10:22:24 +02:00
Grot (@grafanabot)
dd5b51527d Chore: Fix observable function in DashboardQueryRunnerImpl (#35398) (#35399)
(cherry picked from commit 35168764c3)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-06-09 08:10:42 +02:00
Grot (@grafanabot)
6fc58b6ea0 Toolkit: Resolve external fonts when Grafana is served from a sub path(#35352) (#35383)
(cherry picked from commit 044acf727b)

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2021-06-08 19:22:14 +02:00
achatterjee-grafana
8784364f59 Removed duplicate content and folder. (#35389) 2021-06-08 18:42:17 +02:00
Grot (@grafanabot)
6ee6dbc8df Added a note to differentiate legacy and new alerts. (#35385) (#35387)
(cherry picked from commit ec9b9d6ab1)

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-06-08 17:51:24 +02:00
Grot (@grafanabot)
11f2a91377 Visualizations: Fixes Stat/BarGauge/Gauge/PieChart all values mode showing same name if same value (#35368) (#35384)
(cherry picked from commit c425c30d7e)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-08 17:13:45 +02:00
Alex Khomenko
7360428b3e Search: minor UI fixes (#35335) (#35377)
* Increase margin between search item so it's visible

* Fix manage dashboards height overflow

* Align folder icon

* Increase margin

* Update container height

* Fix className not being passed to CardContainer
2021-06-08 15:14:00 +02:00
Grot (@grafanabot)
fa5309a3a8 Docs: Fix image paths (#35334) (#35375)
(cherry picked from commit 6a39fc9ae1)

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2021-06-08 16:09:37 +03:00
Grot (@grafanabot)
4e4dad60ce Dashboard: Removed console log prompt (#35366) (#35370)
(cherry picked from commit 26027fea2a)

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2021-06-08 14:32:08 +02:00
Giordano Ricci
d5e06ffcf4 Chore: fix docs publish branch for v8 (#35361)
* Chore: fix docs publish branch for v8

* Docs: remove notice in what's new
2021-06-08 13:23:46 +02:00
Giordano Ricci
331756990d Docs: Fix publishing path (#35359) 2021-06-08 10:46:03 +01:00
Grot (@grafanabot)
0c75b8c92a ReleaseNotes: Updated changelog and release notes for 8.0.0 (#35350) (#35355)
* ReleaseNotes: Updated changelog and release notes for 8.0.0

* Update release notes index

Co-authored-by: Elfo404 <me@giordanoricci.com>
(cherry picked from commit d4c129a9b4)
2021-06-08 09:50:27 +01:00
Grot (@grafanabot)
41f0542c1e Release: Bump version to 8.0.0 (#35341)
* "Release: Updated versions in package to 8.0.0"

* Update whats new & release notes URL

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

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

* update docs, provisioning:

* minor updates, mainly images

* fix typos

* fixes

* few other minor fixes

* Update docs/sources/datasources/azuremonitor.md

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

* Apply suggestions from code review

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

* Update azuremonitor.md

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

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

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

* Updated a title

(cherry picked from commit 1f012871b4)

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

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

* Simplified layout

(cherry picked from commit aae6e86547)

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

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

* Add test

(cherry picked from commit 8cda1f5153)

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

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

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

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

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

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

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

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

* Add tests

(cherry picked from commit 7a304223e6)

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

* fixes the GraphWithLegend story too

(cherry picked from commit 70155c7fd0)

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

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

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

* chore(playlistpage): remove title from edit button

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

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

* Fix POSTing Alertmanager configuration if no current configuration exists

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

* Change CreatedAt field type

(cherry picked from commit 15c55b0115)

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

* fix alerting test

(cherry picked from commit 5f6c172b5a)

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

* Update API version compatible with Azure China

(cherry picked from commit 412bcf1fb0)

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

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

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

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

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

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

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

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

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

* Apply suggestions from code review

* Update test

* Remove TODO

(cherry picked from commit eeb84d09c2)

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

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

* Remove commented lines

* Move test folder

(cherry picked from commit 4c8ce8a450)

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

* Fix sorting

* Changed icon for sorting

(cherry picked from commit 1dc387536e)

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

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

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

* Fix annotation not updating for same alert

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

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

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

* Chore: updates after PR comments

(cherry picked from commit abd4e70792)

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

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

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

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

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

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

* Fix review

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

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

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

* reorganise css

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

(cherry picked from commit 32d9b04666)

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

* More cleanups

* Lint fixes

* Remove unnecessary funcs

* Cleanup frontend code

* Remove deprecated endpoints from docs

* Revert change according to reviewer's comments

(cherry picked from commit 1c49986b2f)

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

* Tooltips workin

* Use getValueFormat to get the duration

* Separate boxes highlight from tooltip interpolation

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

* create an onHover/onLeave API and optimize implementation

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

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

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

* Fix review

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

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

* Fix typo in the println message

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

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

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

Ref #21510

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

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

* Updated based on ux feedback

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

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

* adds test cases for subscribe event

(cherry picked from commit 395d7eb74c)

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

* reverted text alignment to right

* implemented a more readable solution for tabble legend spacing

(cherry picked from commit 4d574bb8aa)

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

* Fix layout worker mocking

(cherry picked from commit 0b94f33813)

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

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

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

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

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

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

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

* Added histogram test dashboard

* Fixed so panels share same data

(cherry picked from commit 119dbc4d76)

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

* add timeline value cache

* with console logs

* cleanup

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

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

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

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

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

* Iterate through all response data

* Don't store linkedQuery as a property

(cherry picked from commit bf96f5e285)

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

* better docs-formatting

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

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

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

* go mod tidy

(cherry picked from commit 5d41e83896)

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

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

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

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

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

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

* Listen to save event

* add missing delay argument

* migrated the change tracker unit tests

* Updated snapshot

* Removed unessary action

* removed updateSourcePanel

* Fix hiding save library panel modal prompt when clicking discard

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

* Fixed issue with saving new dashboard

* Now all scenarios work

* increase wait time

* Fixed one more race condition

(cherry picked from commit e6f2b10a36)

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

* de-pluralize resource types

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

* add comments

(cherry picked from commit 3be0a2d328)

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

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

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

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

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

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

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

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

* Docs: adds Beta3 to index

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

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

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

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

(cherry picked from commit ff03b456f1)

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

No-op for OSS grafana

(cherry picked from commit 22544bd135)

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

* Add version

* Add empty jobs and workflows

* Add job with docker image

* Add step

(cherry picked from commit ec29c3b84f)

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

* Apply suggestions from code review

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

* Update docs/sources/datasources/tempo.md

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

* Apply suggestions from code review

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

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

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

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

* fixes small nit

* extracted the getLink logic to be a standalone utility function

* Updates table tests to suit current structure

* fixes small syntax nit

* fixes bad typing issue

* annotes the getCellLinks logic as an internal utility function

* removes blank whitespace

* Tests: updates test cases to use getByRole

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

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

* Update docs/sources/enterprise/_index.md

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

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

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

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

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

* test(timeseries): update snapshots

* test(timeseries): add additional tests for legend

(cherry picked from commit cb3c317e81)

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

* Remove redundant timeZone

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

* Add tests for creating logs histogram data

* Update decoractors tests

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

* Fix tooltip pointer color

* Test tooltip pointer color

* Decouple graph config from uPlot internals

* Ensure nested properties are not mutated when overrides are applied

* Add legend toggling for Explore graphs

* Remove unused component

ExploreGraphNGPanel is now used in Explore

* Code formatting

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

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

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

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

* Add info about pausing reports

* Add version note

* Update docs/sources/enterprise/reporting.md

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

* Docs: update report form information

* Docs: update report scheduling

* Docs: re-order reporting sections

* Update docs/sources/enterprise/reporting.md

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

* Update docs/sources/enterprise/reporting.md

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

* Update docs/sources/enterprise/reporting.md

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

* Update docs/sources/enterprise/reporting.md

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

* Update docs/sources/enterprise/reporting.md

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

* Update docs/sources/enterprise/reporting.md

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

* Update docs/sources/enterprise/reporting.md

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

* Update docs/sources/enterprise/reporting.md

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

* Update docs/sources/enterprise/reporting.md

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

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

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

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

* Apply field overrides

(cherry picked from commit fcdab32750)

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

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

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

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

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

* fix

(cherry picked from commit aba1801193)

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

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

* Hide totals

(cherry picked from commit 05f3161f8e)

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

* 30555:Remove unused condition

(cherry picked from commit 48f6d6f7e6)

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

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

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

* Fix lint

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

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

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

(cherry picked from commit 8c93899b15)

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

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

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

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

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

* Fix test

(cherry picked from commit 573d7b8893)

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

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

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

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

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

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

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

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

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

* Refactor: changes after PR comments

* Refactor: found a bug

(cherry picked from commit 37ab5ec7f4)

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

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

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

This reverts commit f08d2d9eca.

* Revert "update api doc"

This reverts commit cc09ceb853.

* Revert "remove post trim"

This reverts commit 46fe8ed596.

* Revert "fix typo"

This reverts commit 3b3ceee16e.

* Revert "Apply suggestions from code review"

This reverts commit 3b7f3b8e15.

* Revert "update comments"

This reverts commit b9c6260876.

* Revert "update doc"

This reverts commit 8e4c4d7c93.

* Revert "remove feature toggle + add libraryPaneldefinition"

This reverts commit d01cfcc2ed.

* fix some typos

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

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

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

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

* fix comments

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

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

* Updated

(cherry picked from commit d6a9a9b975)

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

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

based/copied from the same features from the prometheus datasource

(cherry picked from commit 261319a4be)

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

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

* util & testing consistent errors

* consistent errors for rest of ngalert apis

* updates expected errors in testware

* bump ci

* linting

* unrelated: dashboard.go lint

(cherry picked from commit 9aca032d10)

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

* Usage Stats: Update MetricsFunc definition and implementations

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

This reverts commit 910ecce3e8.

* Usage Stats: Update MetricsFunc definition and implementations

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

* Docs: Settings HTTP API

* Docs: Minor changes on settings updates at runtime docs

* Docs: Settings updates at runtime description

* Docs: Minor fix

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

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

* Apply suggestions from code review

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

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

* Update docs/sources/http_api/admin.md

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

* Apply suggestions from code review

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

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

* Fix ugly error when loki as prometheus used

* Refactor, add test

* Fix type error

* Fix test by passing missing method

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

* Remove optionality in prop

(cherry picked from commit add1b827ae)

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

(cherry picked from commit b47e7d12e6)

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

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

* apply PR feedback

* use mp4 instead of gif

* update wording

* Add note about org admins

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

* apply pr feedback

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

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

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

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

* Only run different exemplars

* Address review comment

* Do the same for dashboard + tests

(cherry picked from commit 4435895833)

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

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

* fix test

(cherry picked from commit 2205464a8d)

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

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

* Fix nits

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

* Fix lint

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

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

* Fix explore URLs when default subscription not set

* Test datasource fixes

* Added comment

* Fix first or default subscription/workspace

* SubscriptionField doesn't depend on Log Analytics

* Tests fixed

* Select default subscription only when user clicked

(cherry picked from commit 179eb0898e)

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

* Apply feedback. Use @testing-library

(cherry picked from commit 48dc78fd48)

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

* cleanup

(cherry picked from commit 888cddb834)

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

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

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

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

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

* Make color override work

* removed thing

* Minor refactoring

(cherry picked from commit 658cc5dd2d)

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

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

* AzureMonitor: Hide Application Insights config

* simplify

* fix test

(cherry picked from commit 7646246d8c)

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

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

(cherry picked from commit 6d750c000e)

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

* Fix secret reset when subscription selected

* Remove unused exports

(cherry picked from commit de86114b66)

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

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

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

* test(addpanelwidget): update snapshot

(cherry picked from commit 8ced249c91)

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

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

* Fix misaligned type

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

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

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

* minor adjustments.

* adding clock icon.

(cherry picked from commit da6236d89a)

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

* renamed according to feedback in PR.

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

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

(cherry picked from commit ec3f8ce04c)

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

* Apply suggestions from code review

(cherry picked from commit a5082ab112)

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

* extracts upstream instant queries into data frame for alerting

* eval string parity

(cherry picked from commit 0e0ed43153)

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

* Use syncRect uPlot hook instead of polling

* update snap?!

(cherry picked from commit 1fa755bada)

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

* add prop to hide disable query

* move panel plugin state outside the vizwrapper

(cherry picked from commit 23cf31a567)

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

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

(cherry picked from commit 9016d20c4c)

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

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

* set to false

* fix styling for uninstall

* remove advertising config + simplify callout URL

* add entry to configuration.md

* update config name

* update lingo

(cherry picked from commit c7b58fe186)

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

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

* Removed the console.log

(cherry picked from commit ca79d08dd8)

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

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

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

* tests

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

(cherry picked from commit b4ce068f0e)

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

* update doc

* update comments

* Apply suggestions from code review

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

* fix typo

* remove post trim

* update api doc

* solve comments and retrigger the test

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

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

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

* Chore: fixes doc errors

* Tests: fixes snapshot

* Tests: dummy change to restart Drone

* Tests: tries to fix snapshot

(cherry picked from commit 3a68409e5d)

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

* Allow custom field config properties that extend standard categories

(cherry picked from commit 811704fd2e)

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

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

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

(cherry picked from commit cebe67ab01)

* fix: remove snapshot for wrapper test

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

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

* Updates snapshot

(cherry picked from commit 6394a60a08)

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

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

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

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

* handle bad folder UID as 400 error

* 12591:Add tests for request with folderUid

* Use more descriptive error status for missing folders

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

* return 400 when folder id is missing

* put error checking in the right place this time

* mention folderUid in the docs

* Clarify usage of folderUid and folderId when both present

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

* Capitalise UID

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

* mention folder UID in the metadata for a GET response

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

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

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

* Fix rename variable

* Change the message

* Add test

* Fix e2e test

* Remove expect in exemplars test

* Align icon

* review fixes

(cherry picked from commit 9dafd4f863)

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

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

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

* Fix tests

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

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

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

* Added v8 demo dashboard

(cherry picked from commit 6fb0560a84)

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

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

* Memoize onScrollStop callback

(cherry picked from commit 8d05df83ed)

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

* Update free text references to predefined roles

(cherry picked from commit 0f4806db8a)

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

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

* fix(dashboardsettings): prevent subheader overlap

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

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

* refactor: update padding values for components that use PageToolbar

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

* test(dashboard): update snapshot

(cherry picked from commit ad3b0b2272)

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

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

(cherry picked from commit b7ea66b00d)

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

* Add some resourcePickerData tests

* update tests

* some quick NestedResourceTable tests

(cherry picked from commit 1d3bcb0e90)

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

* CSV file & content scenarios working

* Removing categorical data

* fixing handler names

* Update pkg/tsdb/testdatasource/csv_data.go

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

* Update pkg/tsdb/testdatasource/csv_data.go

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

* Update pkg/tsdb/testdatasource/csv_data.go

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

* Update pkg/tsdb/testdatasource/csv_data.go

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

* Update pkg/tsdb/testdatasource/csv_data.go

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

* Update pkg/tsdb/testdatasource/csv_data.go

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

* Update pkg/tsdb/testdatasource/csv_data.go

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

* Fixed lint issues

* updated so it uses the same parsing

* more CSV tests

* lint fixes

* more lint

* lint

* support time field

* migrate manual entry to csv

* more test output

* more test output

* missing file

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

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

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

* wip

* first version of test rule.

* reverted file.

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

* fix labels in evalmatch

* fix be test

* refactored using observables.

* moved widht/height div to outside panel rendere.

* adding docs api level.

* adding container styles to error div.

* increasing size of preview.

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

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

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

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

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

* Add LambdaValidationError to AWS/CloudFront

* Add LambdaLimitExceededErrors to AWS/CloudFront

(cherry picked from commit f9b8f3777a)

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

* Update comment

* Add tests

* Update Whats new

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

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

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

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

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

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

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

* normalize data-type strings based on documentation

* reference missing data type

(cherry picked from commit ab26c4dfa4)

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

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

* Refactor: some clean up

* Refactor: some more cleanup

* Tests: Adds tests for UserProfileEditPage

* Chore: updates after PR comments

* Refactor: removes unnecessary unmount/mount

(cherry picked from commit 881abb3af8)

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

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

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

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

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

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

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

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

* Fixes according to reviewer's comments

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

(cherry picked from commit 91657dad18)

* Small change

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

* Update Azure SDK with scopes fix

* Credential initialization in cache

(cherry picked from commit a337f70469)

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

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

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

* adjusted message to be similar to other messages

* simplify code

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

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

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

fix missing "httpClientProvider" in NewClient

* Update client.go

(cherry picked from commit 530072fce7)

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

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

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

* Add duplicate key check

* Clean up

* Clean up

* Add tests for caching

* Remove unused variables

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

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

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

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

* Use decorateData to apply all decorators

* Remove unused variables

* Change loading stte to Done

* Clear cache when running query from navigation

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

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

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

* style: Lint

(cherry picked from commit 6796a89e9d)

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

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

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

check for CanSave instead of CanEdit

* Clear ngalert tables when deleting the folder

* Apply suggestions from code review

* Log failure to check save permission

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

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

* Refactor: renames Panel and Variable consts

* Chore: initialize stats

* Refactor: moves library element migrations to migration namespace

(cherry picked from commit 7204a64717)

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

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

* Exclude release-branch pipelines

* Fixes according to reviewer's comments

* Refactor

* Remove unused arguments

* Remove magic number

(cherry picked from commit 292789ba2d)

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

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

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

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

(cherry picked from commit b76dfc8ed0)

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

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

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

* enrich error message

* ignore previous changes

* revert manual version bump

* remove condition

* fix version param

(cherry picked from commit c4dcfdef56)

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

12
.bingo/.gitignore vendored
View File

@@ -1,12 +0,0 @@
# Ignore everything
*
# But not these files:
!.gitignore
!*.mod
!README.md
!Variables.mk
!variables.env
*tmp.mod

View File

@@ -1,14 +0,0 @@
# 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+

View File

@@ -1,31 +0,0 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.5.1. 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 drone variable:
#
# In your main Makefile (for non array binaries):
#
#include .bingo/Variables.mk # Assuming -dir was set to .bingo .
#
#command: $(DRONE)
# @echo "Running drone"
# @$(DRONE) <flags/args..>
#
DRONE := $(GOBIN)/drone-v1.2.4
$(DRONE): $(BINGO_DIR)/drone.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)/drone-v1.2.4"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=drone.mod -o=$(GOBIN)/drone-v1.2.4 "github.com/drone/drone-cli/drone"
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"

View File

@@ -1,7 +0,0 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.17
replace github.com/docker/docker => github.com/docker/engine v17.12.0-ce-rc1.0.20200309214505-aa6a9891b09c+incompatible
require github.com/drone/drone-cli v1.2.4 // drone

View File

@@ -1 +0,0 @@
module _ // Fake go.mod auto-created by 'bingo' for go -moddir compatibility with non-Go projects. Commit this file, together with other .mod files.

View File

@@ -1,14 +0,0 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.5.1. 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
DRONE="${GOBIN}/drone-v1.2.4"
WIRE="${GOBIN}/wire-v0.5.0"

View File

@@ -1,5 +0,0 @@
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,6 +1,5 @@
[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

@@ -1,15 +1,9 @@
# To generate the .drone.yml file:
# 1. Modify the *.star definitions
# 2. Login to drone and export the env variables (token and server) shown here: https://drone.grafana.net/account
# 3. Run `make drone`
# More information about this process here: https://github.com/grafana/deployment_tools/blob/master/docs/infrastructure/drone/signing.md
load('scripts/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')
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')
def main(ctx):
edition = 'oss'

1014
.drone.yml

File diff suppressed because it is too large Load Diff

10
.github/CODEOWNERS vendored
View File

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

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

View File

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

View File

@@ -66,6 +66,9 @@
"packaging/**/*",
"scripts/build/**/*",
"scripts/*.sh",
"scripts/*.star",
".drone.star",
".drone.yml",
"Makefile",
"Dockerfile",
"Dockerfile.ubuntu"
@@ -73,16 +76,6 @@
"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/**/*"],

44
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: publish_docs
on:
push:
branches:
- v8.0.x
paths:
- 'docs/sources/**'
- 'packages/grafana-*/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: git clone --single-branch --no-tags --depth 1 -b master https://grafanabot:${{ secrets.GH_BOT_ACCESS_TOKEN }}@github.com/grafana/website-sync ./.github/actions/website-sync
- uses: actions/cache@v2.1.5
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: generate-packages-docs
uses: actions/setup-node@v2.1.5
id: generate-docs
with:
node-version: '14'
- run: yarn install --pure-lockfile --no-progress
- run: ./scripts/ci-reference-docs-build.sh
- name: publish-to-git
uses: ./.github/actions/website-sync
id: publish
with:
repository: grafana/website
branch: master
host: github.com
github_pat: '${{ secrets.GH_BOT_ACCESS_TOKEN }}'
source_folder: docs/sources
target_folder: content/docs/grafana/latest
allow_no_changes: 'true'
- shell: bash
run: |
test -n "${{ steps.publish.outputs.commit_hash }}"
test -n "${{ steps.publish.outputs.working_directory }}"

9
.gitignore vendored
View File

@@ -50,7 +50,6 @@ public/css/*.min.css
*.tmp
.DS_Store
.vscode/
!.vscode/launch.json
.vs/
.eslintcache
@@ -75,7 +74,6 @@ 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
@@ -123,15 +121,8 @@ 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

View File

@@ -1,96 +0,0 @@
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);

View File

@@ -1,83 +0,0 @@
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,9 +5,8 @@ pkg/
node_modules
public/vendor/
vendor/
/data/
data/
e2e/tmp
public/build/
public/sass/*.generated.scss
devenv/
public/lib/monaco

14
.vscode/launch.json vendored
View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -26,12 +26,10 @@ 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.
@@ -42,7 +40,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/discussions/new).
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).
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,10 +1,9 @@
FROM node:16-alpine3.14 as js-builder
FROM node:14.16.0-alpine3.13 as js-builder
WORKDIR /usr/src/app/
COPY package.json yarn.lock ./
COPY packages packages
COPY plugins-bundled plugins-bundled
RUN apk --no-cache add git
RUN yarn install --pure-lockfile --no-progress
@@ -18,26 +17,25 @@ COPY emails emails
ENV NODE_ENV production
RUN yarn build
FROM golang:1.17.3-alpine3.14 as go-builder
FROM golang:1.16.1-alpine3.13 as go-builder
RUN apk add --no-cache gcc g++ make
RUN apk add --no-cache gcc g++
WORKDIR $GOPATH/src/github.com/grafana/grafana
COPY go.mod go.sum embed.go ./
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 Makefile build.go package.json ./
COPY .bingo .bingo
RUN go mod verify
RUN make build-go
COPY cue cue
COPY public/app/plugins public/app/plugins
COPY pkg pkg
COPY build.go package.json ./
RUN go run build.go build
# Final stage
FROM alpine:3.14.3
FROM alpine:3.13
LABEL maintainer="Grafana team <hello@grafana.com>"

View File

@@ -4,7 +4,6 @@ WORKDIR /usr/src/app/
COPY package.json yarn.lock ./
COPY packages packages
COPY plugins-bundled plugins-bundled
RUN apt-get update && apt-get install -yq git
RUN yarn install --pure-lockfile
@@ -18,23 +17,20 @@ COPY emails emails
ENV NODE_ENV production
RUN yarn build
FROM golang:1.17.3 AS go-builder
RUN apk add --no-cache make
FROM golang:1.16 AS go-builder
WORKDIR /src/grafana
COPY go.mod go.sum embed.go ./
COPY Makefile build.go package.json ./
COPY .bingo .bingo
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 make build-go
COPY build.go package.json ./
COPY pkg pkg/
COPY cue cue/
COPY public/app/plugins public/app/plugins/
RUN go run build.go build
FROM ubuntu:20.04

View File

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

View File

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

View File

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

View File

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

470
build.go
View File

@@ -3,14 +3,480 @@
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"
)
"github.com/grafana/grafana/pkg/build"
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
)
func main() {
log.SetOutput(os.Stdout)
log.SetFlags(0)
os.Exit(build.RunCmd())
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 goarch == "386" {
os.Setenv("GO386", "387")
}
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.Env = append(os.Environ(), "GO111MODULE=on")
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]
}

View File

@@ -166,18 +166,15 @@ max_conns_per_host = 0
# The maximum number of idle connections that Grafana will keep alive.
max_idle_connections = 100
# The maximum number of idle connections per host that Grafana will keep alive.
max_idle_connections_per_host = 2
# How many seconds the data proxy keeps an idle connection open before timing out.
idle_conn_timeout_seconds = 90
# 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,18 +199,6 @@ google_analytics_ua_id =
# Google Tag Manager ID, only enabled if you specify an id here
google_tag_manager_id =
# Rudderstack write key, enabled only if rudderstack_data_plane_url is also set
rudderstack_write_key =
# Rudderstack data plane url, enabled only if rudderstack_write_key is also set
rudderstack_data_plane_url =
# 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
@@ -508,13 +493,10 @@ login_attribute_path =
name_attribute_path =
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 =
@@ -609,8 +591,7 @@ startTLS_policy =
[emails]
welcome_email_on_sign_up = false
templates_pattern = emails/*.html, emails/*.txt
content_types = text/html
templates_pattern = emails/*.html
#################################### Logging ##########################
[log]
@@ -729,67 +710,11 @@ 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 legacy alerting engine & UI features
# Disable alerting engine & UI features
enabled = true
# Makes it possible to turn off alert execution but alerting UI is visible
# Makes it possible to turn off alert rule 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)
@@ -965,7 +890,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 = true
plugin_admin_enabled = false
plugin_admin_external_manage_enabled = false
plugin_catalog_url = https://grafana.com/grafana/plugins/
@@ -980,17 +905,6 @@ max_connections = 100
# If not set then origin will be matched over root_url. Supports wildcard symbol "*".
allowed_origins =
# engine defines an HA (high availability) engine to use for Grafana Live. By default no engine used - in
# this case Live features work only on a single Grafana server.
# Available options: "redis".
# Setting ha_engine is an EXPERIMENTAL feature.
ha_engine =
# ha_engine_address sets a connection address for Live HA engine. Depending on engine type address format can differ.
# For now we only support Redis connection address in "host:port" format.
# This option is EXPERIMENTAL.
ha_engine_address = "127.0.0.1:6379"
#################################### Grafana Image Renderer Plugin ##########################
[plugin.grafana-image-renderer]
# Instruct headless browser instance to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert.
@@ -1034,14 +948,12 @@ rendering_chrome_bin =
# Mode 'reusable' will have one browser instance and will create a new incognito page on each request.
rendering_mode =
# When rendering_mode = clustered, you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser'
# When rendering_mode = clustered you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser'
# and will cluster using browser instances.
# Mode 'context' will cluster using incognito pages.
rendering_clustering_mode =
# When rendering_mode = clustered, you can define the maximum number of browser instances/incognito pages that can execute concurrently. Default is '5'.
# When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently..
rendering_clustering_max_concurrency =
# When rendering_mode = clustered, you can specify the duration a rendering request can take before it will time out. Default is `30` seconds.
rendering_clustering_timeout =
# Limit the maximum viewport width, height and device scale factor that can be requested.
rendering_viewport_max_width =
@@ -1083,10 +995,3 @@ default_timezone = browser
[expressions]
# Enable or disable the expressions functionality.
enabled = true
[geomap]
# Set the JSON configuration for the default basemap
default_baselayer_config =
# Enable or disable loading other base map layers
enable_custom_baselayers = true

View File

@@ -172,18 +172,15 @@
# The maximum number of idle connections that Grafana will keep alive.
;max_idle_connections = 100
# The maximum number of idle connections per host that Grafana will keep alive.
;max_idle_connections_per_host = 2
# How many seconds the data proxy keeps an idle connection open before timing out.
;idle_conn_timeout_seconds = 90
# 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.
@@ -489,14 +486,11 @@
;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 =
@@ -586,8 +580,7 @@
[emails]
;welcome_email_on_sign_up = false
;templates_pattern = emails/*.html, emails/*.txt
;content_types = text/html
;templates_pattern = emails/*.html
#################################### Logging ##########################
[log]
@@ -706,67 +699,11 @@
# 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 legacy alerting engine & UI features
# Disable alerting engine & UI features
;enabled = true
# Makes it possible to turn off alert execution but alerting UI is visible
# Makes it possible to turn off alert rule 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)
@@ -779,6 +716,7 @@
# 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
@@ -953,16 +891,6 @@
# If not set then origin will be matched over root_url. Supports wildcard symbol "*".
;allowed_origins =
# engine defines an HA (high availability) engine to use for Grafana Live. By default no engine used - in
# this case Live features work only on a single Grafana server. Available options: "redis".
# Setting ha_engine is an EXPERIMENTAL feature.
;ha_engine =
# ha_engine_address sets a connection address for Live HA engine. Depending on engine type address format can differ.
# For now we only support Redis connection address in "host:port" format.
# This option is EXPERIMENTAL.
;ha_engine_address = "127.0.0.1:6379"
#################################### Grafana Image Renderer Plugin ##########################
[plugin.grafana-image-renderer]
# Instruct headless browser instance to use a default timezone when not provided by Grafana, e.g. when rendering panel image of alert.
@@ -1006,14 +934,12 @@
# Mode 'reusable' will have one browser instance and will create a new incognito page on each request.
;rendering_mode =
# When rendering_mode = clustered, you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser'
# When rendering_mode = clustered you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser'
# and will cluster using browser instances.
# Mode 'context' will cluster using incognito pages.
;rendering_clustering_mode =
# When rendering_mode = clustered, you can define the maximum number of browser instances/incognito pages that can execute concurrently. Default is '5'.
# When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently..
;rendering_clustering_max_concurrency =
# When rendering_mode = clustered, you can specify the duration a rendering request can take before it will time out. Default is `30` seconds.
;rendering_clustering_timeout =
# Limit the maximum viewport width, height and device scale factor that can be requested.
;rendering_viewport_max_width =
@@ -1056,16 +982,3 @@
[expressions]
# Enable or disable the expressions functionality.
;enabled = true
[geomap]
# Set the JSON configuration for the default basemap
;default_baselayer_config = `{
; "type": "xyz",
; "config": {
; "attribution": "Open street map",
; "url": "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
; }
;}`
# Enable or disable loading other base map layers
;enable_custom_baselayers = true

View File

@@ -6,7 +6,6 @@ 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

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

View File

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

View File

@@ -1,138 +1,69 @@
# Services
A Grafana _service_ encapsulates and exposes application logic to the rest of the application, through a set of related operations.
A Grafana _service_ encapsulates and exposes application logic to the rest of the application, through a set of related operations.
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.
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_.
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!
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.
## Create 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.
To start building a service:
**Service example:**
- 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:
```go
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
type MyService struct {
}
// 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...
func (s *MyService) Init() error {
return nil
}
// 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()
}
// 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()
}
```
[wire.go](/pkg/server/wire.go)
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.
## 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
// +build wireinject
package server
import (
"github.com/google/wire"
"github.com/grafana/grafana/pkg/example"
"github.com/grafana/grafana/pkg/services/sqlstore"
)
var wireBasicSet = wire.NewSet(
example.ProvideService,
)
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
func init() {
registry.RegisterService(&MyService{})
}
func InitializeForTest(cla setting.CommandLineArgs, opts Options, apiOpts api.ServerOptions, sqlStore *sqlstore.SQLStore) (*Server, error) {
wire.Build(wireExtsTestSet)
return &Server{}, nil
}
```
## Background services
`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:
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.
```go
import _ "github.com/grafana/grafana/pkg/services/mysvc"
```
You can see an example implementation above of the Run method.
## Dependencies
## Disabled services
Grafana uses the [inject](https://github.com/facebookgo/inject) package to inject dependencies during runtime.
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.
For example, to access the [bus](communication.md), add it to the `MyService` struct:
If you want to run certain initialization code if service is disabled or not, you need to handle this in the service factory method.
```go
type MyService struct {
Bus bus.Bus `inject:""`
}
```
You can see an example implementation above of the IsDisabled method and custom initialization code when service is disabled.
You can also inject other services in the same way:
## Run Wire / generate code
```go
type MyService struct {
Service other.Service `inject:""`
}
```
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
Any public method of a service should take `context.Context` as its first argument. If the method calls the bus, other services or the database the context should be propagated, if possible.
> **Note:** Any injected dependency needs to be an exported field. Any unexported fields result in a runtime error.

View File

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

View File

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

View File

@@ -1,118 +0,0 @@
# 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,14 +46,10 @@ 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.
@@ -108,7 +104,6 @@ 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
@@ -154,7 +149,6 @@ 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
@@ -218,20 +212,16 @@ 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
@@ -269,7 +259,6 @@ 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.
@@ -278,8 +267,7 @@ 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.
@@ -339,7 +327,6 @@ 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,13 +23,20 @@ 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:
@@ -38,6 +45,7 @@ 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',
};
@@ -59,7 +67,11 @@ 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.
@@ -74,7 +86,9 @@ 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');
});
});
```
@@ -140,52 +154,9 @@ 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.
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 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.
In such cases rather than adding unnecessary aria-labels to components so as to make them selectable for testing, it is preferable to use a data attribute that would not be read aloud with an assistive technology for example:
```
<button data-testid="modal-close-button">Close<button>
```
We have added support for this in our selectors, to use:
Prefix your selector string with "data-testid":
```typescript
export const Components = {
Login: {
openButton: '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}>
```

View File

@@ -5,7 +5,6 @@ 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)
@@ -29,12 +28,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
@@ -195,12 +194,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 = [];
@@ -209,7 +208,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.
@@ -217,18 +216,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
@@ -245,8 +244,6 @@ 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

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

214
cue/data/gen.cue Normal file
View File

@@ -0,0 +1,214 @@
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: {...} @cuetsy(kind="interface")
PanelOptions: {...}
// Define the custom properties that exist within standard field config
PanelFieldConfig?: {...} @cuetsy(kind="interface")
PanelFieldConfig?: {...}
// Panels may define their own types
...

View File

@@ -14,7 +14,6 @@ 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]

93
cue/ui/gen.cue Normal file
View File

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

View File

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

View File

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

View File

@@ -511,6 +511,7 @@
},
"id": 41,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -612,6 +613,7 @@
},
"id": 42,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -714,6 +716,7 @@
},
"id": 32,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -816,6 +819,7 @@
},
"id": 44,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -2066,6 +2070,7 @@
"id": 29,
"maxDataPoints": 500,
"options": {
"graph": {},
"legend": {
"calcs": [
"last"

View File

@@ -13,11 +13,13 @@
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 625,
"links": [],
"panels": [
{
"datasource": null,
"gridPos": {
"h": 4,
"w": 24,
@@ -36,10 +38,13 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"transparent": true,
"type": "text"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 8,
@@ -102,7 +107,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -160,6 +166,7 @@
"type": "state-timeline"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 15,
@@ -200,7 +207,8 @@
"mode": "absolute",
"steps": [
{
"color": "blue"
"color": "blue",
"value": null
},
{
"color": "green",
@@ -259,9 +267,10 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
@@ -284,7 +293,8 @@
"mode": "absolute",
"steps": [
{
"color": "blue"
"color": "blue",
"value": null
},
{
"color": "green",
@@ -333,6 +343,7 @@
"type": "timeseries"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 13,
@@ -375,7 +386,8 @@
"mode": "absolute",
"steps": [
{
"color": "blue"
"color": "blue",
"value": null
},
{
"color": "#EAB839",
@@ -461,7 +473,8 @@
"mode": "absolute",
"steps": [
{
"color": "blue"
"color": "blue",
"value": null
},
{
"color": "#EAB839",
@@ -509,6 +522,7 @@
"type": "status-history"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 3,
@@ -548,7 +562,7 @@
"fillOpacity": 74,
"gradientMode": "none",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -559,7 +573,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -664,7 +679,7 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -698,7 +713,8 @@
"mode": "absolute",
"steps": [
{
"color": "blue"
"color": "blue",
"value": null
}
]
},
@@ -741,6 +757,7 @@
"type": "barchart"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 3,
@@ -766,6 +783,7 @@
"type": "text"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 6,
@@ -805,7 +823,7 @@
"fillOpacity": 50,
"gradientMode": "hue",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -830,7 +848,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -905,6 +924,8 @@
"stringInput": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Interpolation mode: smooth",
"type": "timeseries"
},
@@ -923,7 +944,7 @@
"fillOpacity": 40,
"gradientMode": "hue",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -948,7 +969,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -1023,6 +1045,8 @@
"stringInput": "1,20,90,30,5,0"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Interpolation mode: Step before",
"type": "timeseries"
},
@@ -1041,7 +1065,7 @@
"fillOpacity": 40,
"gradientMode": "hue",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -1066,7 +1090,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -1141,10 +1166,13 @@
"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,
@@ -1182,9 +1210,12 @@
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"gradientMode": {
"label": "None",
"value": "none"
},
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -1209,7 +1240,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -1229,6 +1261,7 @@
},
"id": 41,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -1267,6 +1300,8 @@
"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"
},
@@ -1284,9 +1319,12 @@
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"gradientMode": {
"label": "None",
"value": "none"
},
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -1313,7 +1351,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -1333,6 +1372,7 @@
},
"id": 32,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -1371,6 +1411,8 @@
"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"
},
@@ -1390,9 +1432,12 @@
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"gradientMode": {
"label": "None",
"value": "none"
},
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -1417,7 +1462,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -1437,6 +1483,7 @@
},
"id": 44,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -1475,10 +1522,13 @@
"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,
@@ -1520,7 +1570,7 @@
"fillOpacity": 0,
"gradientMode": "opacity",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -1545,7 +1595,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -1718,6 +1769,7 @@
"type": "timeseries"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 5,
@@ -1755,9 +1807,12 @@
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"gradientMode": {
"label": "None",
"value": "none"
},
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -1789,7 +1844,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -2077,9 +2133,12 @@
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"gradientMode": {
"label": "None",
"value": "none"
},
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -2111,7 +2170,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -2401,7 +2461,7 @@
"fillOpacity": 82,
"gradientMode": "hue",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -2433,7 +2493,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -2512,6 +2573,7 @@
"type": "timeseries"
},
{
"cacheTimeout": null,
"datasource": "gdev-testdata",
"gridPos": {
"h": 3,
@@ -2547,7 +2609,7 @@
"fillOpacity": 80,
"gradientMode": "hue",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -2558,7 +2620,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -2592,6 +2655,7 @@
"y": 83
},
"id": 49,
"maxDataPoints": null,
"options": {
"bucketOffset": 0,
"bucketSize": 10,
@@ -2655,7 +2719,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -2689,6 +2754,7 @@
"y": 83
},
"id": 77,
"maxDataPoints": null,
"options": {
"showHeader": true
},
@@ -2772,4 +2838,4 @@
"title": "New Features in v8.0",
"uid": "8mux8PqGz",
"version": 17
}
}

View File

@@ -8,188 +8,127 @@
"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": [
{
"folderId": null,
"gridPos": {
"h": 26,
"w": 6,
"x": 0,
"y": 0
},
"headings": true,
"id": 7,
"limit": 100,
"links": [],
"options": {
"maxItems": 100,
"query": "",
"showHeadings": true,
"showRecentlyViewed": true,
"showSearch": false,
"showStarred": true,
"tags": []
},
"pluginVersion": "8.1.0-pre",
"query": "",
"recent": true,
"search": false,
"starred": true,
"tags": [],
"timeFrom": null,
"timeShift": null,
"title": "Starred",
"type": "dashlist"
},
{
"folderId": null,
"gridPos": {
"h": 13,
"w": 6,
"x": 6,
"y": 0
},
"headings": false,
"id": 2,
"limit": 1000,
"links": [],
"options": {
"maxItems": 1000,
"query": "",
"showHeadings": false,
"showRecentlyViewed": false,
"showSearch": true,
"showStarred": false,
"tags": [
"panel-tests"
]
},
"pluginVersion": "8.1.0-pre",
"tags": [
"panel-tests"
],
"query": "",
"recent": false,
"search": true,
"starred": false,
"tags": ["panel-tests"],
"timeFrom": null,
"timeShift": null,
"title": "tag: panel-tests",
"type": "dashlist"
},
{
"folderId": null,
"gridPos": {
"h": 13,
"h": 26,
"w": 6,
"x": 12,
"y": 0
},
"headings": false,
"id": 3,
"limit": 1000,
"links": [],
"options": {
"maxItems": 1000,
"query": "",
"showHeadings": false,
"showRecentlyViewed": false,
"showSearch": true,
"showStarred": false,
"tags": [
"gdev",
"demo"
]
},
"pluginVersion": "8.1.0-pre",
"tags": [
"gdev",
"demo"
],
"query": "",
"recent": false,
"search": true,
"starred": false,
"tags": ["gdev", "demo"],
"timeFrom": null,
"timeShift": null,
"title": "tag: dashboard-demo",
"type": "dashlist"
},
{
"folderId": null,
"gridPos": {
"h": 26,
"w": 6,
"x": 18,
"y": 0
},
"headings": false,
"id": 5,
"limit": 1000,
"links": [],
"options": {
"maxItems": 1000,
"query": "",
"showHeadings": false,
"showRecentlyViewed": false,
"showSearch": true,
"showStarred": false,
"tags": [
"gdev",
"datasource-test"
]
},
"pluginVersion": "8.1.0-pre",
"tags": [
"gdev",
"datasource-test"
],
"query": "",
"recent": false,
"search": true,
"starred": false,
"tags": ["gdev", "datasource-test"],
"timeFrom": null,
"timeShift": null,
"title": "Data source tests",
"type": "dashlist"
},
{
"folderId": null,
"gridPos": {
"h": 13,
"w": 6,
"x": 6,
"y": 13
},
"headings": false,
"id": 4,
"limit": 1000,
"links": [],
"options": {
"maxItems": 1000,
"query": "",
"showHeadings": false,
"showRecentlyViewed": false,
"showSearch": true,
"showStarred": false,
"tags": [
"templating",
"gdev"
]
},
"pluginVersion": "8.1.0-pre",
"tags": [
"templating",
"gdev"
],
"query": "",
"recent": false,
"search": true,
"starred": false,
"tags": ["templating", "gdev"],
"timeFrom": null,
"timeShift": null,
"title": "tag: templating ",
"type": "dashlist"
},
{
"gridPos": {
"h": 13,
"w": 6,
"x": 12,
"y": 13
},
"id": 8,
"links": [],
"options": {
"maxItems": 1000,
"query": "",
"showHeadings": false,
"showRecentlyViewed": false,
"showSearch": true,
"showStarred": false,
"tags": [
"gdev",
"transform"
]
},
"pluginVersion": "8.1.0-pre",
"tags": [
"gdev",
"demo"
],
"title": "tag: transforms",
"type": "dashlist"
}
],
"schemaVersion": 30,
"schemaVersion": 18,
"style": "dark",
"tags": [],
"templating": {
@@ -200,29 +139,8 @@
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"],
"time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"]
},
"timezone": "",
"title": "Grafana Dev Overview & Home",

View File

@@ -8,21 +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": [],
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -35,9 +31,9 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -46,7 +42,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -76,7 +73,6 @@
},
"orientation": "auto",
"showValue": "auto",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -84,7 +80,7 @@
},
"targets": [
{
"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",
"csvContent": "Name,Stat1,Stat2\nStockholm, 10, 15\nNew York, 19, 5\nLondon, 10, 1\nNegative, 15, -5\nLong value, 15,10",
"refId": "A",
"scenarioId": "csv_content"
}
@@ -93,6 +89,7 @@
"type": "barchart"
},
{
"datasource": null,
"description": "Should be smaller given the longer value",
"fieldConfig": {
"defaults": {
@@ -106,9 +103,9 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -118,7 +115,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -148,7 +146,6 @@
},
"orientation": "auto",
"showValue": "auto",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -165,6 +162,7 @@
"type": "barchart"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -177,9 +175,9 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -188,7 +186,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -218,7 +217,6 @@
},
"orientation": "auto",
"showValue": "auto",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -235,6 +233,7 @@
"type": "barchart"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -247,9 +246,9 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -258,7 +257,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -288,7 +288,6 @@
},
"orientation": "auto",
"showValue": "always",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -318,9 +317,9 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -329,7 +328,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -357,9 +357,8 @@
},
"orientation": "auto",
"showValue": "auto",
"stacking": "none",
"text": {
"titleSize": 10,
"size": 10,
"valueSize": 25
},
"tooltip": {
@@ -376,6 +375,7 @@
"type": "barchart"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -388,19 +388,19 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
"decimals": 7,
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -430,7 +430,6 @@
},
"orientation": "horizontal",
"showValue": "auto",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -438,7 +437,7 @@
},
"targets": [
{
"csvContent": "Name,Stat1,Stat2\nStockholm, 10, 15\nNew York, 19, -5\nLondon, 10, 1\nLong value, 15,10",
"csvContent": "Name,Stat1,Stat2\nStockholm, 10, 15\nNew York, 19, 5\nLondon, 10, 1\nLong value, 15,10",
"refId": "A",
"scenarioId": "csv_content"
}
@@ -447,6 +446,7 @@
"type": "barchart"
},
{
"datasource": null,
"description": "",
"fieldConfig": {
"defaults": {
@@ -460,9 +460,9 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
"tooltip": false
},
"lineWidth": 0
},
@@ -471,7 +471,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -501,7 +502,6 @@
},
"orientation": "horizontal",
"showValue": "auto",
"stacking": "none",
"text": {},
"tooltip": {
"mode": "single"
@@ -537,5 +537,5 @@
"timezone": "",
"title": "BarChart - Panel Tests - Value sizing",
"uid": "WFlOM-jM1",
"version": 9
}
"version": 3
}

View File

@@ -1,395 +0,0 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"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

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

View File

@@ -92,6 +92,7 @@
"interval": "1m",
"links": [],
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"
@@ -180,6 +181,7 @@
"links": [],
"maxDataPoints": 10,
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"
@@ -268,6 +270,7 @@
"links": [],
"maxDataPoints": 20,
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"
@@ -355,6 +358,7 @@
"interval": "1m",
"links": [],
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"
@@ -443,6 +447,7 @@
"links": [],
"maxDataPoints": 80,
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"
@@ -531,6 +536,7 @@
"links": [],
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"

View File

@@ -99,6 +99,7 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -193,6 +194,7 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -287,6 +289,7 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -381,6 +384,7 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -475,6 +479,7 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -569,6 +574,7 @@
"links": [],
"maxDataPoints": 9,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -663,6 +669,7 @@
"links": [],
"maxDataPoints": 100,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -757,6 +764,7 @@
"links": [],
"maxDataPoints": 100,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -851,6 +859,7 @@
"links": [],
"maxDataPoints": 100,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",

View File

@@ -8,17 +8,12 @@
"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": [
{
@@ -48,6 +43,7 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -73,7 +69,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -94,6 +91,7 @@
"id": 3,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -134,6 +132,8 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Show gaps",
"type": "timeseries"
},
@@ -153,6 +153,7 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -179,7 +180,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -200,6 +202,7 @@
"id": 2,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -248,6 +251,8 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Gaps & null between every point for series B",
"type": "timeseries"
},
@@ -267,6 +272,7 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -293,7 +299,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -314,6 +321,7 @@
"id": 6,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -382,6 +390,8 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "No nulls but unaligned series",
"type": "timeseries"
},
@@ -400,6 +410,7 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -425,7 +436,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -446,6 +458,7 @@
"id": 4,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -486,6 +499,8 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Connected",
"type": "timeseries"
},
@@ -505,6 +520,7 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -531,7 +547,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -552,6 +569,7 @@
"id": 5,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -600,6 +618,8 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Same as above but connected",
"type": "timeseries"
},
@@ -619,6 +639,7 @@
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -645,7 +666,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -666,6 +688,7 @@
"id": 7,
"links": [],
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -734,6 +757,8 @@
"target": ""
}
],
"timeFrom": null,
"timeShift": null,
"title": "Same as above but connected",
"type": "timeseries"
},
@@ -752,6 +777,7 @@
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -777,7 +803,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -828,6 +855,9 @@
},
"id": 11,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"calcs": [],
@@ -873,6 +903,8 @@
"stringInput": "1,20,90,30,5,0"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Null values in first series & show gaps ",
"transformations": [],
"type": "timeseries"
@@ -892,6 +924,7 @@
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -917,7 +950,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -968,6 +1002,9 @@
},
"id": 9,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"calcs": [],
@@ -1013,11 +1050,14 @@
"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": {
@@ -1031,6 +1071,7 @@
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"graph": false,
"legend": false,
"tooltip": false,
"viz": false
@@ -1056,7 +1097,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -1076,6 +1118,7 @@
},
"id": 13,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "list",
@@ -1114,10 +1157,13 @@
"stringInput": "1,20,90,null,30,5,0"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Span nulls below 1hr",
"type": "timeseries"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -1159,7 +1205,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -1216,5 +1263,5 @@
"timezone": "",
"title": "Panel Tests - Graph NG - Gaps and Connected",
"uid": "8mmCAF1Mz",
"version": 2
}
"version": 12
}

View File

@@ -80,6 +80,7 @@
"id": 2,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -150,6 +151,7 @@
"id": 3,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -220,6 +222,7 @@
"id": 4,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -290,6 +293,7 @@
"id": 5,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -360,6 +364,7 @@
"id": 6,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",
@@ -430,6 +435,7 @@
"id": 7,
"maxDataPoints": 50,
"options": {
"graph": {},
"legend": {
"calcs": [],
"displayMode": "hidden",

View File

@@ -113,6 +113,9 @@
"id": 47,
"maxDataPoints": 500,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -234,6 +237,9 @@
"id": 48,
"maxDataPoints": 20,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -355,6 +361,9 @@
"id": 55,
"maxDataPoints": 20,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -476,6 +485,9 @@
"id": 56,
"maxDataPoints": 90,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -597,6 +609,9 @@
"id": 52,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -718,6 +733,9 @@
"id": 53,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -839,6 +857,9 @@
"id": 54,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -960,6 +981,9 @@
"id": 57,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -1160,6 +1184,9 @@
},
"id": 60,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -1441,6 +1468,7 @@
"interval": null,
"maxDataPoints": 100,
"options": {
"graph": {},
"legend": {
"displayMode": "list",
"placement": "right"
@@ -1571,6 +1599,9 @@
"id": 63,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -1706,6 +1737,9 @@
"id": 64,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -1841,6 +1875,9 @@
"id": 65,
"maxDataPoints": 10,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -1976,6 +2013,9 @@
"id": 66,
"maxDataPoints": 100,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -2139,6 +2179,9 @@
"id": 32,
"maxDataPoints": 100,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "list",
@@ -2276,6 +2319,9 @@
"id": 35,
"maxDataPoints": 100,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "list",
@@ -2427,6 +2473,9 @@
"id": 31,
"maxDataPoints": 200,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": true,
"displayMode": "table",
@@ -2577,6 +2626,9 @@
"id": 51,
"maxDataPoints": 200,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": true,
"displayMode": "table",
@@ -2716,6 +2768,9 @@
},
"id": 19,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -2821,6 +2876,9 @@
},
"id": 20,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -2925,6 +2983,9 @@
},
"id": 21,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -3030,6 +3091,9 @@
},
"id": 9,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "hidden",
@@ -3151,6 +3215,9 @@
},
"id": 46,
"options": {
"graph": {
"realTimeUpdates": false
},
"legend": {
"asTable": false,
"displayMode": "list",
@@ -3291,6 +3358,7 @@
},
"id": 68,
"options": {
"graph": {},
"legend": {
"displayMode": "hidden",
"placement": "bottom"

View File

@@ -13,11 +13,13 @@
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 632,
"links": [],
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -27,7 +29,7 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -38,7 +40,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -86,7 +89,7 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -97,7 +100,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -135,6 +139,7 @@
"type": "histogram"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -144,7 +149,7 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -155,7 +160,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -206,6 +212,7 @@
"type": "histogram"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -215,7 +222,7 @@
"fillOpacity": 80,
"gradientMode": "none",
"hideFrom": {
"viz": false,
"graph": false,
"legend": false,
"tooltip": false
},
@@ -226,7 +233,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -277,6 +285,7 @@
"type": "histogram"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -291,7 +300,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -343,6 +353,7 @@
"type": "table"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -357,7 +368,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -427,4 +439,4 @@
"title": "Panel Tests - Histogram",
"uid": "UTv--wqMk",
"version": 4
}
}

View File

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

View File

@@ -8,21 +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": [],
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -59,7 +55,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -85,12 +82,9 @@
"displayMode": "list",
"placement": "bottom"
},
"mergeValues": true,
"mode": "changes",
"rowHeight": 0.98,
"showValue": "always",
"tooltip": {
"mode": "single"
}
"showValue": "always"
},
"pluginVersion": "7.5.0-pre",
"targets": [
@@ -119,6 +113,7 @@
"type": "state-timeline"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -156,7 +151,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -177,17 +173,9 @@
"options": {
"alignValue": "center",
"colWidth": 1,
"legend": {
"displayMode": "list",
"placement": "bottom"
},
"mergeValues": true,
"mode": "changes",
"rowHeight": 0.98,
"showValue": "always",
"tooltip": {
"mode": "single"
}
"showValue": "always"
},
"targets": [
{
@@ -219,6 +207,7 @@
"type": "state-timeline"
},
{
"datasource": null,
"description": "Should show gaps",
"fieldConfig": {
"defaults": {
@@ -257,7 +246,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -278,17 +268,9 @@
"options": {
"alignValue": "center",
"colWidth": 1,
"legend": {
"displayMode": "list",
"placement": "bottom"
},
"mergeValues": true,
"mode": "changes",
"rowHeight": 0.98,
"showValue": "always",
"tooltip": {
"mode": "single"
}
"showValue": "always"
},
"targets": [
{
@@ -319,6 +301,7 @@
"type": "state-timeline"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -336,7 +319,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -355,6 +339,7 @@
"y": 19
},
"id": 4,
"interval": null,
"maxDataPoints": 20,
"options": {
"alignValue": "center",
@@ -364,11 +349,9 @@
"displayMode": "list",
"placement": "bottom"
},
"mode": "samples",
"rowHeight": 0.98,
"showValue": "always",
"tooltip": {
"mode": "single"
}
"showValue": "always"
},
"pluginVersion": "7.5.0-pre",
"targets": [
@@ -427,5 +410,5 @@
"timezone": "utc",
"title": "Timeline Demo",
"uid": "mIJjFy8Kz",
"version": 3
}
"version": 13
}

View File

@@ -8,22 +8,18 @@
"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": {
@@ -38,7 +34,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -66,10 +63,7 @@
},
"mergeValues": true,
"rowHeight": 0.9,
"showValue": "always",
"tooltip": {
"mode": "single"
}
"showValue": "always"
},
"pluginVersion": "7.5.0-pre",
"targets": [
@@ -171,6 +165,7 @@
1616557148000
],
[
null,
1616558756000
],
[
@@ -178,6 +173,7 @@
1616561658000
],
[
null,
1616562446000
],
[
@@ -185,6 +181,7 @@
1616564104000
],
[
null,
1616564548000
],
[
@@ -200,6 +197,7 @@
"type": "state-timeline"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -214,7 +212,8 @@
"mode": "absolute",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "red",
@@ -242,10 +241,7 @@
},
"mergeValues": true,
"rowHeight": 0.9,
"showValue": "always",
"tooltip": {
"mode": "single"
}
"showValue": "always"
},
"pluginVersion": "7.5.0-pre",
"targets": [
@@ -271,6 +267,7 @@
"type": "state-timeline"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
@@ -285,7 +282,8 @@
"mode": "percentage",
"steps": [
{
"color": "green"
"color": "green",
"value": null
},
{
"color": "#EAB839",
@@ -308,6 +306,7 @@
"y": 21
},
"id": 4,
"interval": null,
"maxDataPoints": 20,
"options": {
"colWidth": 0.9,
@@ -317,10 +316,7 @@
"placement": "bottom"
},
"rowHeight": 0.9,
"showValue": "always",
"tooltip": {
"mode": "single"
}
"showValue": "always"
},
"pluginVersion": "7.5.0-pre",
"targets": [
@@ -375,5 +371,5 @@
"timezone": "utc",
"title": "Timeline Modes",
"uid": "mIJjFy8Gz",
"version": 13
"version": 12
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -24,12 +24,12 @@
- influxdb
telegraf:
image: telegraf:latest
image: telegraf:1.10.4
links:
- influxdb
depends_on:
- influxdb_cli
volumes:
- ./docker/blocks/influxdb/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/log:/var/log/host
- /var/log:/var/log
- ../data/log:/var/log/grafana

View File

@@ -44,7 +44,7 @@
[[inputs.logparser]]
files = [
"/var/log/host/*.log",
"/var/log/*.log",
"/var/log/grafana/*.log"
]
[inputs.logparser.grok]

View File

@@ -1,5 +1,5 @@
influxdb1:
image: influxdb:1.8
image: influxdb:1.8.4-alpine
container_name: influxdb1
ports:
- '2004:2004'
@@ -22,11 +22,11 @@
FD_PORT: 8086
telegraf-influxdb1:
image: telegraf:latest
image: telegraf:1.10.4
links:
- influxdb1
volumes:
- ./docker/blocks/influxdb1/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/log:/var/log/host
- /var/log:/var/log
- ../data/log:/var/log/grafana

View File

@@ -52,7 +52,7 @@
[[inputs.logparser]]
files = [
"/var/log/host/*.log",
"/var/log/*.log",
"/var/log/grafana/*.log"
]
[inputs.logparser.grok]

View File

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

View File

@@ -1,11 +1,11 @@
# datasource URL: http://localhost:3100/
loki:
image: grafana/loki:latest
image: grafana/loki:master
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
promtail:
image: grafana/promtail:latest
image: grafana/promtail:master
volumes:
- ./docker/blocks/loki/config.yaml:/etc/promtail/docker-config.yaml
- /var/log:/var/log

View File

@@ -1,13 +1,18 @@
# This Dockerfile builds an image for a client_golang example.
# Builder image, where we build the example.
FROM golang:1.17 AS builder
FROM golang:1.15.1 AS builder
# Download prometheus/client_golang/examples/random first
RUN CGO_ENABLED=0 GOOS=linux go install -tags netgo -ldflags '-w' github.com/prometheus/client_golang/examples/random@latest
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'
# Final image.
FROM scratch
LABEL maintainer "The Prometheus Authors <prometheus-developers@googlegroups.com>"
COPY --from=builder /go/bin/random .
COPY --from=builder /go/src/github.com/prometheus/client_golang/examples/random .
EXPOSE 8080
ENTRYPOINT ["/random"]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1 +0,0 @@
grafana/provisioning/dashboards/alerts/alert-*

View File

@@ -1,66 +0,0 @@
# 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

@@ -1,90 +0,0 @@
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

@@ -1,203 +0,0 @@
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

@@ -1,172 +0,0 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"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

@@ -1,14 +0,0 @@
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

@@ -1,16 +0,0 @@
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

@@ -1,47 +0,0 @@
# 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

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