Compare commits

..

732 Commits

Author SHA1 Message Date
Leonard Gram
3039f9c3bd Release v7.1.1 2020-07-24 12:08:01 +02:00
Sofia Papagiannaki
ba5886d42c DashboardImport: Fix variable interpolation when property contains multiple variable expressions (#26574)
(cherry picked from commit 5e73a92327)
2020-07-24 12:08:01 +02:00
Sofia Papagiannaki
9c7776cd58 Alerting: Change settings column type to mediumtext (#26549)
* Alerting: Change settings column type to mediumtext

* Remove unnecessary newline

(cherry picked from commit ad4f8b7091)
2020-07-24 12:08:01 +02:00
Torkel Ödegaard
5b7d1c7fe1 Dashboard: Restore panel edit permission check, fixes 26555' (#26556)
(cherry picked from commit 1df4f71197)
2020-07-24 12:08:01 +02:00
Ryan McKinley
e44acff11c Graph: support setting field units (#26529)
(cherry picked from commit ad5f1c953b)
2020-07-24 12:08:01 +02:00
Ivana Huckova
758c47e13f Fix self cloosing bracket to display input (#26552)
(cherry picked from commit 44f0200a58)
2020-07-24 12:08:01 +02:00
Agnès Toulet
100819fe09 LDAP: fix LDAP test with special chars in username (#26539)
(cherry picked from commit 2e931a0ee1)
2020-07-24 12:08:01 +02:00
Yuriy Vidineev
cada7a4eb8 change the year in email templates (#26507)
(cherry picked from commit b12d08d9de)
2020-07-24 12:08:01 +02:00
Zoltán Bedi
2d2963561a Add errorIconColor prop to TraceSpanData (#26509)
(cherry picked from commit cd8049d8a3)
2020-07-24 12:08:01 +02:00
Zoltán Bedi
754597e116 Explore: parse queryType from explore url (#26349)
* Explore: parse queryType from explore url

* Modify explore.ts parse logic

(cherry picked from commit 7b218b7198)
2020-07-24 12:08:01 +02:00
Zoltán Bedi
58a23cd27d Jaeger: Add stack trace to span detail row (#26427)
* Add stack trace to span detail row

* Modify accordian text not to have a whitespace

* Modify stackTrace to stackTraces

* Modify AccordianText ti get text component as prop

* Fix typecheck and test failure

* Span details text area do not wrap line

(cherry picked from commit ba50e96544)
2020-07-24 12:08:01 +02:00
Torkel Ödegaard
7031793d06 Dashboard: Fix empty panels after scrolling on Safari/iOS (#26495)
(cherry picked from commit 7417ff015d)
2020-07-24 12:08:01 +02:00
Ivana Huckova
7c0c77cc1c Fix matrics comparison to know when to refresh (#26382)
(cherry picked from commit 85f3a999f3)
2020-07-24 12:08:01 +02:00
Kyle Brandt
3199365ead Azure: Insights metrics - do not sort if no data (#26486)
fixes #26473

(cherry picked from commit fb5ff6a70f)
2020-07-24 12:08:01 +02:00
Ryan McKinley
3570bd0cca Azure: convert azure units to grafana units (#26429)
(cherry picked from commit 5d09e4539c)
2020-07-24 12:08:01 +02:00
Zoltán Bedi
e353e42e96 Jaeger: upstream fix for hovering on log lines (#26426)
* Jaeger: upstream fix for hovering on log lines

* Modify active style to change border color only

(cherry picked from commit 43033ddf74)
2020-07-24 12:08:01 +02:00
Ben RUBSON
65c46c08d4 Branding: Use AppTitle as document title (#26425)
* Branding: Use AppTitle as document title

* Missing Branding include

(cherry picked from commit c65cef2327)
2020-07-24 12:08:01 +02:00
Dominik Prokop
534feb1e5e Bring back scripts evaluation in TextPanel (#26413)
(cherry picked from commit 718b78c4ce)
2020-07-24 12:08:01 +02:00
Ryan McKinley
8101355285 Influx: fix flux panic. cherry picks for #26329 (#26331)
* influx fix for 7.1.0

* don't upgrade sdk

* revert go mod changes
2020-07-16 13:04:17 +02:00
Dominik Prokop
226cba97e1 Release v7.1.0 2020-07-16 13:04:17 +02:00
Marcus Efraimsson
7d7f2d9262 Provisioning: Fix bug when provision app plugins using Enterprise edition (#26340)
In OSS provisioning service init after plugin registration, but in
Enterprise it's the opposite order and installed app plugin check
fails. This adjusts service registry init priority to make sure plugins
are registered before provisioning inits.

Which issue(s) this PR fixes:
Fixes #26336

(cherry picked from commit b97d1f4170)
2020-07-16 13:04:17 +02:00
Kyle Brandt
7ac9057f71 Azure: Insights Analytics, fix possible panics and return error body (#26361)
missing return statements can result in panic

(cherry picked from commit c980f37509)
2020-07-16 13:04:17 +02:00
Ivana Huckova
8673bd4974 Update bg color based on theme (#26359)
(cherry picked from commit 21971a4df8)
2020-07-16 13:04:17 +02:00
Sofia Papagiannaki
f870bea288 Cloud monitoring: Add query parameter (#26354)
(cherry picked from commit 9d8ae39108)
2020-07-16 13:04:17 +02:00
Kyle Brandt
1ab8109892 Azure: Handle real type nan/inf values in Log/Insights Analytics (#26342)
Before this, if the user were to divide by 0.0, "Infinity" would be returned in the result and the user would get an error: "unexpected type, expected json.Number but got string". Now these values are properly set as Inf values (and also made sure to handle NaN as well).

(cherry picked from commit 590702c497)
2020-07-16 13:04:17 +02:00
Ivana Huckova
3655752bae Elasticsearch: Create Raw Doc metric to render raw JSON docs in columns in the new table panel (#26233)
* test

* WIP: Create v2 version

* Update tests, remove conosole logs, refactor

* Remove incorrect types

* Update type

* Rename legacy and new metrics

* Update

* Run request when Raw Data tto Raw Document switch

* Fix size updating

* Remove _source field from table results as we are showing each source field as column

* Remove _source just for metrics, not logs

* Revert "Remove _source just for metrics, not logs"

This reverts commit 611b6922f7.

* Revert "Remove _source field from table results as we are showing each source field as column"

This reverts commit 31a9d5f81b.

* Add vis preference for logs

* Update visualisation to logs

* Revert "Revert "Remove _source just for metrics""

This reverts commit a102ab2894.

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
(cherry picked from commit 3fd810417f)
2020-07-16 13:04:17 +02:00
Ivana Huckova
d44da8786f Docs: Add derived field datasourceUid information (#26285)
* Add datasourceUid info

* Revert "Add datasourceUid info"

This reverts commit 84dce1dcfd.

* Add datasourceUid info

* Update docs/sources/features/datasources/loki.md

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

* Update derived fields info

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
(cherry picked from commit 5b2ff4498e)
2020-07-16 13:04:17 +02:00
kay delaney
2df8fe30da Docs: Add info about logs/metrics unification to What's New docs (#26325)
* Docs: Add info about logs/metrics unification to What's New docs

* Apply suggestions from code review

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 1de810b26a)
2020-07-16 13:04:17 +02:00
Alex Khomenko
562e811179 Admin: Update org list after delete (#26277)
(cherry picked from commit 208f95a76c)
2020-07-16 13:04:17 +02:00
Dominik Prokop
2747607805 DashboardLinks: do not over-query search endpoint (#26311)
* DashboardLinks: WIP fix for dashboard links issue

* Make the dashboard links update on change(hacky)

* Replace dashboard links with new array when updating/adding dash links

* Update snaps

* Deep clone dashboard links on save

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
(cherry picked from commit 23e93175d1)
2020-07-16 13:04:17 +02:00
Andreas Opferkuch
10a9031b1b ThemeContext: Fix useStyles memoization (#26200)
(cherry picked from commit 72cd9a3222)
2020-07-16 13:04:17 +02:00
Dominik Prokop
a74d03b807 SignIn button - use correct url (#26239)
* SignIn button - use correct url

* Fix SignIn test (#26266)

* Don't use absolute URL

* post review

* Fix snap

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
(cherry picked from commit 187612ca8d)
2020-07-16 13:04:17 +02:00
kay delaney
e621f54fe3 CloudWatch Logs: Fixes grouping of results by numeric field (#26298)
* CloudWatch Logs: Fixes grouping of results by numeric field
Closes #25721

(cherry picked from commit 54ad5b869e)
2020-07-16 13:04:17 +02:00
Zoltán Bedi
05a0019fcb PluginsListPage: More plugins button should open in new window (#26305)
Fixes #24622

(cherry picked from commit 7bbfb57dd1)
2020-07-16 13:04:17 +02:00
Mitsuhiro Tanda
dfb2119afa Implicit import symbol-observable to avoid inconsistent symbol (#26288)
(cherry picked from commit 077aec465c)
2020-07-16 13:04:17 +02:00
Kyle Brandt
e931df8ab9 Docs: Flux support in influxdb data source in 7.1 (#25551)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
(cherry picked from commit d28b62740b)
2020-07-16 13:04:17 +02:00
Harrison Shoff
1e35109d3e AdminUsers: reset page to zero on query change (#26293)
(cherry picked from commit e63028e8c6)
2020-07-16 13:04:17 +02:00
Peter Holmberg
ee35db1b8b Fix: Make the JSON in JSONCell Tooltip more visible (#26048)
* add white background to tooltip component

* remove faulty background

* new theme for tooltip

* correct colors, remove custom box-shadow

* rename theme and add documentation

* use useStyles for style memo

(cherry picked from commit 7cdbae4ae6)
2020-07-16 13:04:17 +02:00
Zoltán Bedi
236ac5c394 Prometheus: Fix prom links in mixed mode (#26244)
* Prometheus: Fix prom links in mixed mode

* Modify PromLink with code style changes

(cherry picked from commit 0dd2bc8953)
2020-07-16 13:04:17 +02:00
Torkel Ödegaard
81014a717d BarGauge: Fixed width of unfilled region not being correct when value is close to 100% (#26193)
* BarGauge: Fixed width of unfilled region not being correct when value is close to 100%

* removed accidental change

* updated snapshot

(cherry picked from commit b1e48f429f)
2020-07-16 13:04:17 +02:00
Ivana Huckova
fab8bea6f7 Chore: Fix failing master due to strictNullCheck error (#26283)
* Fix typecheck error on master

* Fix typecheck error on master

(cherry picked from commit 95bf064776)
2020-07-16 13:04:17 +02:00
Ivana Huckova
ea469bf48f Jaeger/Zipkin: URL-encode service names and trace ids for API calls (#26115)
* Encode services and id

* Encode URL for Zipkin API calls

* Add test coverage

(cherry picked from commit 73468e1481)
2020-07-16 13:04:17 +02:00
Kamal Galrani
85ca9c933b removes erroneous $ (#26257)
(cherry picked from commit c136f7da39)
2020-07-16 13:04:17 +02:00
Kamal Galrani
051c7a7c8e fixes footer inconsistency (#26255)
(cherry picked from commit f4b6abb05e)
2020-07-16 13:04:17 +02:00
Kyle Brandt
28978db293 backend: use latest go plugin sdk (0.74.0) to sort wide frames (#26207)
This makes it so results are more stable between refreshes of data and fixes sorting issues with Azure Application Insights service as well as the two Azure Analytics services.

fixes #22937

(cherry picked from commit c1ede4fc71)
2020-07-16 13:04:17 +02:00
Ivana Huckova
56a0b90559 Elastic: Fix error "e.buckets[Symbol.iterator] is not a function" when using filter (#26217)
* Add bucket to array if it is not in array

* Fix issue one level above

* Rename variable

* Move array check to processAggregationDocs

(cherry picked from commit 6d8545da63)
2020-07-16 13:04:17 +02:00
Ivana Huckova
461fc94103 Explore/Loki: Escape \ in labels for show context queries (#26116)
* Hot fix, keep the file

* Add comment

* Update public/app/plugins/datasource/loki/datasource.ts

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

* Remove script.go file

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
(cherry picked from commit 52f12d10c5)
2020-07-16 13:04:17 +02:00
Marcus Efraimsson
ee21c1be81 Docker: Make sure to create default plugin provisioning directory (#26017)
(cherry picked from commit e25c6db7e9)
2020-07-16 13:04:17 +02:00
Ryan McKinley
a3a9ce7f24 AppPlugin: give full control to page layout when navigation is missing (#26247)
(cherry picked from commit 5f8eb93db1)
2020-07-13 14:41:21 +02:00
Ryan McKinley
1e3265d047 Flux: use monaco query editor (#26179)
(cherry picked from commit 33acf4c056)
2020-07-13 14:41:21 +02:00
Alex Khomenko
88270a2bf8 Grafana UI: Make FileUpload button size customizable (#26013)
(cherry picked from commit c3d4e69a32)
2020-07-13 14:41:21 +02:00
Andrej Ocenas
f8bdda7adf Release v7.1.0-beta3 2020-07-13 14:41:21 +02:00
Ryan McKinley
7618fd36ac DataLinks: add internal flag in comments (#26215)
(cherry picked from commit 3d98641a45)
2020-07-13 14:41:21 +02:00
Tobias Skarhed
bca82d8814 Issue Template: @grafana/ui component request (#25981)
* Add first draft of issue template

* Remove feature request line

* Update PR feedback

* Minor tweaks

* Update .github/ISSUE_TEMPLATE/4-grafana_ui_component.md

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

* Fix punctuation

Co-authored-by: Clarity-89 <homes89@ukr.net>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
(cherry picked from commit 5a3eb413d9)
2020-07-13 14:41:21 +02:00
Andrej Ocenas
783e5d12c7 Explore: Unification of logs/metrics/traces user interface (#25890)
Removes "Metrics"/"Logs" mode switcher from Explore, allowing for both
metrics and logs queries at the same time.

Co-authored-by: kay delaney <kay@grafana.com>
(cherry picked from commit 64bc85963b)
2020-07-13 14:41:21 +02:00
Peter Holmberg
e39fef1649 Fix: Redirect to correct url after creating a folder (#26160)
(cherry picked from commit 9948e9298f)
2020-07-13 14:41:21 +02:00
kay delaney
2145633e9b Datasource/CloudWatch: More robust handling of different query modes (#25691)
* Datasource/CloudWatch: More robust handling of different query modes
A small refactor which changes how the CloudWatch datasource handles
multiple queries with different query modes. Groundwork for future
Logs/Metrics unification work.

(cherry picked from commit 2ac1bfcc79)
2020-07-13 14:41:21 +02:00
Andrej Ocenas
6503962013 Explore: Run query on splitOpen action (#26161)
(cherry picked from commit 53eb856d20)
2020-07-13 14:41:21 +02:00
Torkel Ödegaard
40a33c56c2 Templating: Fix recursive loop of template variable queries when changing ad-hoc-variable (#26191)
* Templating: Fix url sync issue with adhoc variables

* Update packages/grafana-ui/src/components/Segment/SegmentAsync.tsx

* Update packages/grafana-ui/src/components/Segment/SegmentAsync.tsx

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
(cherry picked from commit 0428f27194)
2020-07-13 14:41:21 +02:00
Ivana Huckova
42069bb254 Loki: Improve error message for unescaped \ and add LogQL link to docs (#26136)
* Add custom escaping error message

* Include regex escape error message

* Update docs, add logql link

* Refactor

(cherry picked from commit d3dcb19a5b)
2020-07-13 14:41:21 +02:00
Torkel Ödegaard
4684c7971c BarGauge: Fix space bug in single series mode (#26176)
(cherry picked from commit 7b80e300d9)
2020-07-13 14:41:21 +02:00
Kyle Brandt
903eccad20 Docs: Azure Monitor data source changes for 7.1 (#26096)
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
(cherry picked from commit c6a3afb4b8)
2020-07-13 14:41:21 +02:00
kay delaney
2bc9374a9e Backend: use latest Go plugin SDK (#26162)
(cherry picked from commit fd29b952a6)
2020-07-13 14:41:21 +02:00
Torkel Ödegaard
47e162d6b2 Templating: Fixed recursive queries triggered when switching dashboard settings view (#26137)
* Templating: Fixed recursive queries triggered when going into dashboard settings

* Fixed unused import

* use locationUtil

(cherry picked from commit cace879c96)
2020-07-13 14:41:21 +02:00
Torkel Ödegaard
b8c5174461 Dashboard: Refresh intervals should not always add the server min refresh interval (#26150)
(cherry picked from commit 8ab5d2ddd9)
2020-07-13 14:41:21 +02:00
Marcus Andersson
eedf6e53de Transform: adding missing "table"-transform and "series to rows"-transform to Grafana v7-transforms. (#26042)
* Fixed so the merge for table values works as it did before.

* wip

* fixed tests.

* merge tests are green.

* removed unused code and simplify the seriesToRows.

* added time series to rows editor.

* using getFrameDisplayName for the metric value.

* updated description of transforms.

* updated docs.

* fixed according to feedback.

* changed from images to markdown tables for the examples.

* forgot to save :P

(cherry picked from commit 17d87071e6)
2020-07-13 14:41:21 +02:00
Torkel Ödegaard
5f539230da DataLinks: Fixed interpolation of repeated variables used in data links (#26147)
(cherry picked from commit 89b56782c6)
2020-07-13 14:41:21 +02:00
Ryan McKinley
c14ac88b8d CSV: force UTF-8 encoding for download (#26145)
(cherry picked from commit b26ef1db25)
2020-07-13 14:41:21 +02:00
Dominik Prokop
9417a0c277 Do not break dashboard settings UI when time intervals end with trailing comma (#26126)
(cherry picked from commit 30a682a4da)
2020-07-13 14:41:21 +02:00
Ryan McKinley
4c27708b7b DataSourceWithBackend: add internal comment for new method (#26139)
(cherry picked from commit 2b6833d0da)
2020-07-13 14:41:21 +02:00
Kyle Brandt
763d28ad96 Azure: Restore Insights Metrics alias feature (#26098)
also fix case sensitivity for azure monitor metrics

(cherry picked from commit 9164a35240)
2020-07-13 14:41:21 +02:00
Dominik Prokop
949988219f grafana/ui: Do not rename export for InlineFormLabel (#26118)
(cherry picked from commit eb4391a228)
2020-07-13 14:41:21 +02:00
Arve Knudsen
4aa1d28683 Upgrade build pipeline tool (#26112)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
(cherry picked from commit e7e854ea33)
2020-07-13 14:41:21 +02:00
Dominik Prokop
a4846ee4fd Chore: Bump rxjs to latest (#26084)
(cherry picked from commit aa671c863e)
2020-07-13 14:41:21 +02:00
Torkel Ödegaard
c2403767a0 StatPanel: Fixes issue with name showing for single series / field results (#26070)
* StatPanel: Fix text mode auto logic

* Removed import

(cherry picked from commit c9f22b72e3)
2020-07-13 14:41:21 +02:00
Peter Holmberg
fce35e7aa9 Fix: Icon and Tooltip on Variables editor (#26086)
(cherry picked from commit 8f1115c6ac)
2020-07-13 14:41:21 +02:00
Marcus Olsson
0d47601175 Docs: Add guidelines for inclusive language (#25533)
* Docs: Add guidelines for inclusive language

* Fix review comments

* Fix review comments

* Update documentation-style-guide.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
(cherry picked from commit 0f41ca620b)
2020-07-13 14:41:21 +02:00
Sofia Papagiannaki
28e50ae4fd Auth: Fix POST request failures with anonymous access (#26049)
Macaron context.QueryBool() seems to modify the request context
that causes the POST and PUT requests to fail with:
"http: proxy error: net/http: HTTP/1.x transport connection broken: http: ContentLength=333 with Body length 0"

(cherry picked from commit 44dff6fdd0)
2020-07-13 14:41:21 +02:00
Andreas Opferkuch
fc96444b23 ThemeContext: Make useStyles type-aware (#26056)
PLUS:
Make it more consise
Add unit test

(cherry picked from commit 390c80d7f5)
2020-07-13 14:41:21 +02:00
annegies
9eb16756b1 Remove break from ldap, get all groups from all the group base searches specified (#25825)
Signed-off-by: Annegies van 't Zand <ace.vtzand@gmail.com>
(cherry picked from commit a2737c0896)
2020-07-13 14:41:21 +02:00
Ryan McKinley
cde6a2de68 panel Inspect: improve structure debugging (#26065)
(cherry picked from commit af5dff8a1b)
2020-07-13 14:41:21 +02:00
Torkel Ödegaard
111c238df2 TextPanel: Fixed issue with new react text panel (#26061)
(cherry picked from commit 8be735a6ec)
2020-07-13 14:41:21 +02:00
Carl Bergquist
1630f21aee Instrument dashboard versions and annotation count (#26044)
(cherry picked from commit 26852ca788)
2020-07-13 14:41:21 +02:00
Torkel Ödegaard
c2125493a7 InfluxDB: Fixed new group by dropdown now showing (#26031)
(cherry picked from commit 66460ae740)
2020-07-13 14:41:21 +02:00
Ryan McKinley
33eec937dd Table: JSON Cell should try to convert strings to JSON (#26024)
(cherry picked from commit 3acc2a6ac2)
2020-07-13 14:41:21 +02:00
Steven Vachon
073f46e289 @grafana/e2e: close options panel before interacting with the query form (#26036)
... it's logically better, but the real reason is to appease Cypress which was cause a consistent request error for a single plugin (datadog-datasource). An error which could not be reproduced manually.

(cherry picked from commit 634d8d60d6)
2020-07-13 14:41:21 +02:00
Tobias Skarhed
7c1c0bc8c1 AdminUsersTable: Fix width (#26019)
(cherry picked from commit b06d2cf30f)
2020-07-13 14:41:21 +02:00
Josh Soref
a9fc5ff45d Graph panel: Move Stacking and null values before Hover tooltip options (#26037)
(cherry picked from commit dec76b4556)
2020-07-13 14:41:21 +02:00
Ivana Huckova
7d1f0d619d Elastic: Fix displaying of correct log message (#26020)
* Fix default field, remove redundant line field check

* Add comments

(cherry picked from commit 8b46655361)
2020-07-13 14:41:21 +02:00
Ryan McKinley
aa1cdf0a20 grafana/data: do not bundle rxjs (#26039)
(cherry picked from commit b7792de16d)
2020-07-13 14:41:21 +02:00
Alex Khomenko
0b109a1637 Forgot password: Fix styling (#26002)
(cherry picked from commit 9e47114c45)
2020-07-02 13:07:33 +03:00
Arve Knudsen
6a1f05d7ec CircleCI: Upgrade build pipeline tool (#26006)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
(cherry picked from commit 3e9e2db384)
2020-07-02 13:07:33 +03:00
Ryan McKinley
1576b16219 Monaco: check suggestions against current word (#25992)
* trigger on current word

* proper index

* test suggestsions

* test suggestsions

* fix test

(cherry picked from commit 085b2f3dbf)
2020-07-02 13:07:33 +03:00
Sofia Papagiannaki
44ba5482f1 Release v7.1.0-beta2 2020-07-02 13:07:33 +03:00
Ryan McKinley
972e07bd2e Panel Loading: spin clockwise, not counter clockwise (#25998)
* spin clockwise

* spin clockwise

(cherry picked from commit 90a5a85eb1)
2020-07-02 13:07:33 +03:00
Sebastian Widmer
22211e5bdd Loki: Allow aliasing Loki queries in dashboard (#25706)
* Loki: Add Legend field to query editor

* Loki: Basic test for legend field

* Loki: Mention legend is only for metric queries

* Loki: Fix absolute timerange never updating

(cherry picked from commit 5789f80e14)
2020-07-02 13:07:33 +03:00
Ryan McKinley
d95c494d9d Value Mappings: remove unused operator property from interface (#25989)
(cherry picked from commit 73e82af4df)
2020-07-02 13:07:33 +03:00
Ivana Huckova
6e3a9d7927 Fix href to datasources for NoDataSourceCallToAction in Explore (#25991)
(cherry picked from commit c9751707c5)
2020-07-02 13:07:33 +03:00
Dan Cech
4a68ba7b23 provide license token directly via plugin environment (#25987)
* provide license token directly via plugin environment

(cherry picked from commit b5ca2381bc)
2020-07-02 13:07:33 +03:00
Sofia Papagiannaki
74ca7121eb Fix build-in plugins failing to load in windows (#25982)
(cherry picked from commit bcaa42fbb3)
2020-07-02 13:07:33 +03:00
Marcus Andersson
4d1ea72426 release 7.1.0-beta1 2020-07-01 12:13:45 +02:00
Marcus Andersson
11385c6cfe bumped version to beta1. 2020-07-01 12:11:50 +02:00
Arve Knudsen
a7bfae67f4 CircleCI: Upgrade grabpl (#25966)
* CircleCI: Upgrade grabpl

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-01 12:09:57 +02:00
Dominik Prokop
19d27351e9 Fix few null checks to make master green (#25965) 2020-07-01 11:40:37 +02:00
Tobias Skarhed
bd27be1351 Docs: Update styling docs for useStyles (#25944) 2020-07-01 11:39:46 +02:00
Torkel Ödegaard
d65569f5d9 StatPanel: Option showing name instead of value and more (#25676)
* StatPanel: Option showing name instead of value and more

* rename option to textMode

* Move the logic of only showing name if more than one value to gauge and bar gauge panels

* Got tooltip working

* Updated devenv test dashboard

* Added docs for text mode

* Added migration logic

* Update docs/sources/panels/visualizations/stat-panel.md

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

* Update docs/sources/panels/visualizations/stat-panel.md

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

* Update docs/sources/panels/visualizations/stat-panel.md

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

* Update docs/sources/panels/visualizations/stat-panel.md

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

* Update docs/sources/panels/visualizations/stat-panel.md

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

* Update docs/sources/panels/visualizations/stat-panel.md

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

* Update docs/sources/panels/visualizations/stat-panel.md

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

* docs fix

* Fixed ts issue

* review changes

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-07-01 11:06:21 +02:00
Arve Knudsen
285c22eea0 Update release notes/what's new for v7.1 (#25962)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-01 10:08:00 +02:00
Andrej Ocenas
2ca6df814e Elastic: Internal data links (#25942)
* Allow internal datalinks for elastic

* Add docs

* Update docs/sources/features/datasources/elasticsearch.md

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

* Apply suggestions from code review

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

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-07-01 09:45:21 +02:00
Ryan McKinley
1716b706da Graph Panel: use FieldConfig for displayName and DataLinks (#25917)
* graph with new controls

* graph with new controls

* Fix categories

* fix test imports

* Chore: Fix spelling (#25905)

* grafana-ui: Make output chunks correct (#25922)

* Explore/Loki: Show results of instant queries only in table and time series only in graph (#25845)

* Show results of instant queries only in table and rest in graph

* Add type to QueryResultMeta

* Update log row hover background only if context is not open

* Revert "Update log row hover background only if context is not open"

This reverts commit 144197c954.

* Explore/Loki: Fix field type in table for instant queries (#25907)

* Update field type for instant queries to number

* Remove fieldtype as in prometheus

* Revert "Remove fieldtype as in prometheus"

This reverts commit f887ad1125.

* Chore: Disable scopelint for tests (#25923)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* grafana/ui: Fix storybook dev (#25928)

* Minimize css and js only for storybook build

* Update CodeEditor story, make it internal

* Update storybook webpack config

* TimeZonePicker: added possibility to toggle if internal time zones should be included or not. (#25934)

* made some small adjustments after feedback.

* made the flag optional.

* Docker: Upgrade to base on Alpine 3.12 (#25936)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* DataLinks: Add internal links in table and allow custom query (#25613)

* Add internal links in table and with custom query

* Add specific types for internal and external link

* Change the datalink types to be more backward compatible

* Refactor the link utils for explore

* Add internal linking to table panels

* Fix derived field condition

* Prettify

* Add and fix tests

* Prettify

* Fix imports and tests

* Remove unused type

* Update packages/grafana-data/src/types/explore.ts

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update packages/grafana-data/src/types/explore.ts

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* CircleCI: Upgrade grabpl (#25939)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Provisioning: Use folders structure from the file system to create desired folders in dashboard provisioning. (#23117)

Fixes #12016

* Added options to customize chart data listening (#25918)

* Explore: Remove legend formatting when switching from panel to Explore (#25848)

* Remove legend formatting when switching from panel to explore

* Add test coverage

* Query history: Add search for query history and starred queries (#25747)

* Add searching functionality to Queries tab

* Implement search for starred queries

* Update tests and add test coverage for searching

* Changes based on provided feedback

* Remove redundant storing of results

* Update naming of onSearchFilterChange function in tests

* Update filterQueriesBySearchFilter function

* Update filterQueriesBySearchFilter function

* Debounce search

* Remove console.log()

* Use useDebouncedCallback

* Update tests, remove redundant props

* When in starred, search only in starred

* Add timefilter as dependency

* Remove redundant dependency, refactor

* Grafana-UI: Add FileUpload (#25835)

* Grafana UI: Setup component

* Grafana UI: DashboardFileUpload => FileUpload

* Grafana UI: Expand docs

* Grafana UI: Add className

* Grafana UI: Update import

* Grafana UI: Clarify props

* Update packages/grafana-ui/src/components/FileUpload/FileUpload.tsx

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

* Grafana UI: Style icon

* Grafana UI: Show uploaded file name

* Grafana UI: Add tests

* Grafana UI: Add useStyles + useCallback

* Grafana UI: Remove stylesFactory

* Grafana UI: Revert to useTheme

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

* Fix: Value mappings match against string values (#25929)

* Use standard input for value mappings value

* add test and case for matching string values

* re add number on rangemap

* remove FieldTypeNumber required

* Docs: Changelog update 7.05 & latest.json update (#25941)

* Docs: Changelog update for 7.0.5

* Update latest.json

* Fixed alignment

* Stackdriver: Rename Stackdriver to Google Cloud Monitoring (#25807)

* Update backend

* Update frontend

* Keep old plugin id

* Update docs

* Place doc images to a new directory

* Legacy support for stackdriver-auto alignment

* Consistent plugin name

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

* Update docs

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

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

* Add reference to the data source formerly being named Stackdriver

* Update pkg/models/datasource.go

Co-authored-by: Carl Bergquist <carl@grafana.com>

* Fix gofmt

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
Co-authored-by: Carl Bergquist <carl@grafana.com>

* Fix strict null errors that resulted from search (#25950)

* Arrow: when exporting arrow use the calculated names (#25871)

* PanelHeader: Fixed loading icon position (#25949)

* PanelHeader: Fixed loading icon position

* revert back to text weak color

* Azure/Log Analytics: return more error information (#25937)

When there is an error message in the HTTP response, this copies that error so it is relayed to the user by being shown in the frontend.

This also makes it so when there is an error the interpolated query string (ExecutedQueryString) is returned so users can see it in the query inspector.

* Azure: Multiple dimension support for Azure Monitor Service (#25947)

Azure Monitor (metrics) support multiple dimensions instead of just one.

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

* Docs: Update alert-list-panel.md (#25779)

Fixed minor typo and format updates

* Docs: Update add-a-panel.md (#25780)

* Linting fixes for the provisioning package (#25690)

* Chore: whatwg-fetch version bump (#25952)

* Use latest fetch polyfill/shim

* Updated lockfile

* Monaco: option to hide line numbers (#25920)

* Docs: Reorganize reference topics (#25915)

* moved annotations.md

* Update annotations.md

* moved dashboard_folders.md

* moved dashboard_history.md

* moved playlist.md

* moved search.md

* migrations test

* docs: spelling (#24383)

* Docs: spelling

* Docs: spelling (contribute/ directory)

* Drop whats-new-in changes

* migrations test

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Richard Hartmann <RichiH@users.noreply.github.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: Maksim Nabokikh <32434187+nabokihms@users.noreply.github.com>
Co-authored-by: Steven Vachon <contact@svachon.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Carl Bergquist <carl@grafana.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2020-07-01 09:39:06 +02:00
Ryan McKinley
bbd24cd93a Monaco: add suggestions for template variables (#25921)
* now with suggestions

* using suggestions API

* using variable suggestions

* using variable suggestions

* show variables

* minor cleanup

* add @alpha warning

* Do not produce data variables if panel does not support queries

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-07-01 09:36:34 +02:00
Philipp Trulson
df72344d3c Add space after comma for placeholder text (#25931) 2020-07-01 10:34:36 +03:00
Torkel Ödegaard
650ab72c88 Panel: Cancel panel query via loading spinner (#25954)
* Panel: Cancel panel query via loading spinne

* Removed unused icon
2020-07-01 09:32:27 +02:00
Marcus Andersson
83df83fa42 Docs: updated packages reference docs for 7.1.0-beta1. (#25958) 2020-07-01 09:12:35 +02:00
Ivana Huckova
e93640878d Explore/Tooltip: Fix label value in tooltip (#25940)
* Fix value name in tooltip

* Fallback to field.name

* Use getFieldDisplayName method
2020-07-01 09:07:44 +02:00
Tobias Skarhed
07df165b86 Panel Inspect: Fix crash when transform removes selected data frame (#25924) 2020-07-01 08:53:29 +02:00
Torkel Ödegaard
199f772bcf StatPanel: Add migration for singlestat tableColumn to to fields property (#25901) 2020-07-01 08:52:49 +02:00
Agnès Toulet
a02c6f2d36 Docs: Enterprise Vault feature (#25895)
* Docs: Vault integration

* Add links to vault feature doc

* Update Enterprise configuration file with vault fields

* Small fixes on vault doc

* Update docs according to PR review

* Update docs/sources/administration/configuration.md

Co-authored-by: Leonard Gram <leo@xlson.com>

* Update docs/sources/enterprise/vault.md

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

* Update docs/sources/enterprise/vault.md

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

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-07-01 08:40:58 +02:00
Ryan McKinley
cbb9a63b9b Azure: query builder cleanup (#25956) 2020-06-30 22:55:04 -07:00
Ryan McKinley
3a9a4f4a49 InfluxDB/Flux: support timeseries with a renamed time field (#25910) 2020-06-30 16:56:03 -07:00
Sofia Papagiannaki
bb4b7381fc Stackdriver: Deep linking from Grafana panels to the Metrics Explorer (#25858)
* Add stackdriver deep link

* No deep link for SLO queries

* Add tests

* Update docs/sources/features/datasources/stackdriver.md

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

* Enforce resource type

* Navigate to google account chooser first

* Change renamed image reference

Fix misspelling in image name and change it to conform with the rest cloud monitoring images

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-07-01 01:16:20 +03:00
Josh Soref
686149966a docs: spelling (#24383)
* Docs: spelling

* Docs: spelling (contribute/ directory)

* Drop whats-new-in changes
2020-06-30 14:42:50 -07:00
Diana Payton
e07d0ae452 Docs: Reorganize reference topics (#25915)
* moved annotations.md

* Update annotations.md

* moved dashboard_folders.md

* moved dashboard_history.md

* moved playlist.md

* moved search.md
2020-06-30 14:18:38 -07:00
Ryan McKinley
d4239e6fd2 Monaco: option to hide line numbers (#25920) 2020-06-30 14:05:34 -07:00
Steven Vachon
bbce01de04 Chore: whatwg-fetch version bump (#25952)
* Use latest fetch polyfill/shim

* Updated lockfile
2020-06-30 17:04:55 -04:00
Carl Bergquist
db8d7ffbf6 Linting fixes for the provisioning package (#25690) 2020-06-30 22:46:41 +02:00
Diana Payton
891ae24f76 Docs: Update add-a-panel.md (#25780) 2020-06-30 13:36:24 -07:00
Diana Payton
885467e46e Docs: Update alert-list-panel.md (#25779)
Fixed minor typo and format updates
2020-06-30 13:36:00 -07:00
Kyle Brandt
4be56cde0d Azure: Multiple dimension support for Azure Monitor Service (#25947)
Azure Monitor (metrics) support multiple dimensions instead of just one.

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2020-06-30 16:26:46 -04:00
Kyle Brandt
72fa5ccb7b Azure/Log Analytics: return more error information (#25937)
When there is an error message in the HTTP response, this copies that error so it is relayed to the user by being shown in the frontend.

This also makes it so when there is an error the interpolated query string (ExecutedQueryString) is returned so users can see it in the query inspector.
2020-06-30 16:05:53 -04:00
Torkel Ödegaard
277b6add6d PanelHeader: Fixed loading icon position (#25949)
* PanelHeader: Fixed loading icon position

* revert back to text weak color
2020-06-30 20:57:57 +02:00
Ryan McKinley
7cf5172b8a Arrow: when exporting arrow use the calculated names (#25871) 2020-06-30 11:32:02 -07:00
Ivana Huckova
46540f3146 Fix strict null errors that resulted from search (#25950) 2020-06-30 18:55:31 +02:00
Sofia Papagiannaki
4bb3f66569 Stackdriver: Rename Stackdriver to Google Cloud Monitoring (#25807)
* Update backend

* Update frontend

* Keep old plugin id

* Update docs

* Place doc images to a new directory

* Legacy support for stackdriver-auto alignment

* Consistent plugin name

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

* Update docs

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

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

* Add reference to the data source formerly being named Stackdriver

* Update pkg/models/datasource.go

Co-authored-by: Carl Bergquist <carl@grafana.com>

* Fix gofmt

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
Co-authored-by: Carl Bergquist <carl@grafana.com>
2020-06-30 18:47:13 +03:00
Torkel Ödegaard
05bfd17b00 Docs: Changelog update 7.05 & latest.json update (#25941)
* Docs: Changelog update for 7.0.5

* Update latest.json

* Fixed alignment
2020-06-30 17:06:05 +02:00
Peter Holmberg
20db5680d2 Fix: Value mappings match against string values (#25929)
* Use standard input for value mappings value

* add test and case for matching string values

* re add number on rangemap

* remove FieldTypeNumber required
2020-06-30 17:03:39 +02:00
Alex Khomenko
275c37503a Grafana-UI: Add FileUpload (#25835)
* Grafana UI: Setup component

* Grafana UI: DashboardFileUpload => FileUpload

* Grafana UI: Expand docs

* Grafana UI: Add className

* Grafana UI: Update import

* Grafana UI: Clarify props

* Update packages/grafana-ui/src/components/FileUpload/FileUpload.tsx

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

* Grafana UI: Style icon

* Grafana UI: Show uploaded file name

* Grafana UI: Add tests

* Grafana UI: Add useStyles + useCallback

* Grafana UI: Remove stylesFactory

* Grafana UI: Revert to useTheme

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
2020-06-30 17:48:38 +03:00
Ivana Huckova
e3bbc14feb Query history: Add search for query history and starred queries (#25747)
* Add searching functionality to Queries tab

* Implement search for starred queries

* Update tests and add test coverage for searching

* Changes based on provided feedback

* Remove redundant storing of results

* Update naming of onSearchFilterChange function in tests

* Update filterQueriesBySearchFilter function

* Update filterQueriesBySearchFilter function

* Debounce search

* Remove console.log()

* Use useDebouncedCallback

* Update tests, remove redundant props

* When in starred, search only in starred

* Add timefilter as dependency

* Remove redundant dependency, refactor
2020-06-30 16:15:46 +02:00
Ivana Huckova
6c7a452726 Explore: Remove legend formatting when switching from panel to Explore (#25848)
* Remove legend formatting when switching from panel to explore

* Add test coverage
2020-06-30 16:14:27 +02:00
Steven Vachon
75a714aa51 Added options to customize chart data listening (#25918) 2020-06-30 09:45:36 -04:00
Maksim Nabokikh
810ec4c5f8 Provisioning: Use folders structure from the file system to create desired folders in dashboard provisioning. (#23117)
Fixes #12016
2020-06-30 15:33:26 +02:00
Arve Knudsen
72e418247b CircleCI: Upgrade grabpl (#25939)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-30 15:07:50 +02:00
Andrej Ocenas
81d7cb1773 DataLinks: Add internal links in table and allow custom query (#25613)
* Add internal links in table and with custom query

* Add specific types for internal and external link

* Change the datalink types to be more backward compatible

* Refactor the link utils for explore

* Add internal linking to table panels

* Fix derived field condition

* Prettify

* Add and fix tests

* Prettify

* Fix imports and tests

* Remove unused type

* Update packages/grafana-data/src/types/explore.ts

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update packages/grafana-data/src/types/explore.ts

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-06-30 14:51:04 +02:00
Arve Knudsen
463e8ffd92 Docker: Upgrade to base on Alpine 3.12 (#25936)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-30 14:26:02 +02:00
Marcus Andersson
8e36a15968 TimeZonePicker: added possibility to toggle if internal time zones should be included or not. (#25934)
* made some small adjustments after feedback.

* made the flag optional.
2020-06-30 13:30:18 +02:00
Dominik Prokop
a47fac72bf grafana/ui: Fix storybook dev (#25928)
* Minimize css and js only for storybook build

* Update CodeEditor story, make it internal

* Update storybook webpack config
2020-06-30 11:44:38 +02:00
Arve Knudsen
3651a8e976 Chore: Disable scopelint for tests (#25923)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-30 11:05:47 +02:00
Ivana Huckova
02cd1a441f Explore/Loki: Fix field type in table for instant queries (#25907)
* Update field type for instant queries to number

* Remove fieldtype as in prometheus

* Revert "Remove fieldtype as in prometheus"

This reverts commit f887ad1125.
2020-06-30 09:25:19 +02:00
Ivana Huckova
69f9b6f945 Explore/Loki: Show results of instant queries only in table and time series only in graph (#25845)
* Show results of instant queries only in table and rest in graph

* Add type to QueryResultMeta

* Update log row hover background only if context is not open

* Revert "Update log row hover background only if context is not open"

This reverts commit 144197c954.
2020-06-30 09:25:05 +02:00
Dominik Prokop
6eabe6c29f grafana-ui: Make output chunks correct (#25922) 2020-06-30 09:22:09 +02:00
Richard Hartmann
38cb3f2cb2 Chore: Fix spelling (#25905) 2020-06-30 00:13:25 -07:00
Kyle Brandt
aee5626dca chore: fix lint breaking build (#25916) 2020-06-29 19:45:50 -04:00
Andrej Ocenas
ee5b8b3fec Explore: Add join transform for timeseries shown in table (#25906)
* Add join transform if showing timeseries only in the table

* Fix typo
2020-06-29 23:20:57 +02:00
Kyle Brandt
d243cd9421 Backend: use latest Go plugin sdk (#25909)
* backend: use latest go plugin sdk which fixes #25287
* update for Frame.Meta.Custom SDK changes
2020-06-29 16:20:24 -04:00
Steven Vachon
49e629b278 @grafana/e2e: improvements (#25908)
* Set time range when creating a dashboard

* Optionally set time range when opening a dashboard

* Default time range to 6 hours instead of 1 hour

* Minor changes
2020-06-29 16:04:38 -04:00
Hugo Häggmark
d21558231f TextPanel: Adds proper editor for markdown and html (#25618) 2020-06-29 12:17:31 -07:00
Kyle Brandt
9a8289b6d9 Azure: Application Insights metrics to Frame and support multiple query dimensions (#25849)
- The Application Insights Service now returns a dataframe. This is a "wide" formatted dataframe with a single time index.
- Multiple "group by" dimensions may now be selected instead of just one with Application Insights.
- Some types are copied / slightly altered from the Azure Go SDK but that SDK is not imported at this time.

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2020-06-29 15:06:58 -04:00
Ryan McKinley
1a711e7df0 Panel Inspect: use monaco for json display (#25251) 2020-06-29 10:58:47 -07:00
Arve Knudsen
dcd5752086 Chore: Upgrade macaron (#25869)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-29 19:15:11 +02:00
Ivana Huckova
4488a4cd5a Explore/Loki: Fix scrolling of context when leaving context window (#25838)
* Fix jumping layout

* Update log row hover background only if context is not open
2020-06-29 18:24:08 +02:00
Arve Knudsen
d1e6214a4a Chore: Enable scopelint Go linter (#25896)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-29 17:04:38 +02:00
Barak Kakoun
a5fb6bddbe Update panel loading icon (#25900)
Panel's loading circle is really hard to notice.
I made it a bit bigger and changed the color.
2020-06-29 16:51:28 +02:00
Ryan McKinley
c344422a68 TimeZonePicker: expose for panel configuraiton (#23523) 2020-06-29 07:50:44 -07:00
Tobias Skarhed
1378cadb68 Switch: Deprecate checked prop in favor of value (#25862) 2020-06-29 15:48:34 +02:00
Torkel Ödegaard
75d8853aac Graphite: Fix graphite tag value dropdowns not rendering (#25889) 2020-06-29 14:27:51 +02:00
Arve Knudsen
5070f7a75b Chore: Start harmonizing linting with plugin SDK (#25854)
* Chore: Harmonize linting with plugin SDK

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Chore: Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-29 14:08:32 +02:00
Marcus Efraimsson
942a14b4ce Datasource: Make sure data proxy timeout applies to HTTP client (#25865)
For backend data sources executing in the backend (not through data proxy) make 
sure that the timeout applies to cached HTTP client.

Fixes #25863

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-06-29 14:03:18 +02:00
Peter Holmberg
6465b2f0a3 Migration: Migrate New notification channel page (#25265)
* creating page

* add types select

* adding switches

* start with converting angular templates to json

* converting more alert channels to new format

* convert remaining channels

* typing the form

* add validation, update models

* fix default value in type select

* fix type

* fix issue with validation rule

* add missing settings

* fix type errors

* test notification

* add comments to structs

* fix selectable value and minor things on each channel

* More typings

* fix strictnull

* rename ModelValue -> PropertyName

* rename show -> showWhen

* add enums and adding comments

* fix comment

* break out channel options to component

* use try catch

* adding default case to OptionElement if element not supported
2020-06-29 13:39:12 +02:00
Tobias Skarhed
61a7f6e2f3 PanelInspect: Update UI for Data display options (#25478)
* Add TableDataOptions component

* A bit along the way

* Make transforms work

* Make it work

* Add collapsed text

* Fix transformations and overflow for QueryOperationRow

* Fix layout

* Minor fixes

* Fix feedback

* Remove unused imports

* Remove unused Container

* Horizontal layout for Switches

* Fix Swicth bug

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-06-29 13:31:39 +02:00
Marcus Efraimsson
460b01f1fe Datasource: Make sure data proxy timeout applies to HTTP client (#25865)
For backend data sources executing in the backend (not through data proxy) make 
sure that the timeout applies to cached HTTP client.

Fixes #25863

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-06-29 11:22:49 +02:00
Carl Bergquist
383aa21ab6 docs: removes invalid comment (#25883) 2020-06-29 09:26:08 +02:00
Torkel Ödegaard
7e83e77dcd Theme: Fixes bug in light theme for query editor part (#25789)
* Theme: Fixes bug in light theme for query editor part

* Remove different backgrond
2020-06-28 08:29:38 +02:00
Mitsuhiro Tanda
9f82cd4713 Slack: Support use of chat.postMessage (#25818)
* set bearer token if token is provided
* update slack notification document

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-26 20:47:06 +02:00
Dominik Prokop
75706a4a8b Toolkit: fix grafana-toolkit binary path so toolkit is not run in linked mode (#25860) 2020-06-26 10:45:39 -07:00
Steven Vachon
fb3bec058a @grafana/e2e: improvements (#25708)
* Set time range when opening a dashboard

* Set UTC timezone when creating a dashboard

* Added flow for selecting options in custom select fields

* Fix flaky test
2020-06-26 13:33:05 -04:00
Emil Tullstedt
5d7cd2e9fc Teams: Add index for permission check (#25736)
* Teams: Add indices for permission check

* Teams: Remove user_id index
2020-06-26 15:13:53 +02:00
Emil Tullstedt
504b786141 Setting: Add docs for option variable expansion (#25508)
Docs for #25075
2020-06-26 13:32:05 +02:00
Marcus Andersson
9421ae93f8 adding missing namedExport for lodash. (#25857) 2020-06-26 11:18:32 +02:00
Eder Nucci
c22940fe35 MSSQL: Fix parsing of uniqueidentifier type (#25751)
Closes #17084

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-06-26 10:11:43 +02:00
Emil Tullstedt
4422ba0f2d Units: add base-pascals and rotational speed units (#22879)
* Units: Add base-Pascals and rotational speed units

* Units: Upper-case first letter in Length

* Units: Fix id of degrees per second
2020-06-26 10:02:23 +02:00
Peter A. Bigot
0e845f2bbe Units: add new unit for duration, it is optimized for displaying days, hours, minutes and seconds. (#24175) 2020-06-26 10:00:57 +02:00
Marcus Andersson
1abbb477cf TimeZone: unify the time zone pickers to one that can rule them all. (#24803)
* draft on a unified TimeZonePicker.

* most of the data structures is in place.

* wip.

* wip.

* wip: timezone selector in progress.2

* fixed so we have proper data on all timezones.

* started to add timezone into time picker.

* addeing time zone footer.

* footer is working.

* fixed so we use the timeZone picker in shared preferences.

* Added so we can change timeZone from picker.

* did some styling changes.

* will update timezone on all places that we need to update it.

* removed console.log

* removed magic string.

* fixed border on calendar.

* ignoring eslint cache.

* cleaned up the code a bit.

* made the default selectable.

* corrected so the behaviour about default works as expected.

* excluded timezone from change tracker.

* revert so default will always be the intial value.

* default will always fallback to the one in the config.

* do the country mapping on startup.

* fixed nit.

* updated snapshots for timepicker.

* fixed build errors.

* updating so snapshot tests is in sync.

* removed Date.now from prop since it will change each run in the snapshot tests.

* fixed so e2e tests works as before.

* moved files into separate folders.
2020-06-26 09:08:15 +02:00
Arve Knudsen
084542a006 Chore: Consolidate on golangci-lint (#25834)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-26 08:46:08 +02:00
Steven Vachon
10715a1c79 @grafana/e2e: added tests (#25836)
* Use at least cypress@4.9

... which has [arguably] better TypeScript definitions

* Updated lockfile

* Added tests for CLI and API

* Minor changes
2020-06-25 13:17:45 -04:00
Kyle Brandt
bc9c53389c Azure: Split insights into two services (#25410)
Azure Application Insights Analytics is no longer accessed by the edit button from within the Application Insights service. Instead, there is now an Insights Analytics option in the Service drop down.

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2020-06-25 12:48:18 -04:00
Bruce Sherrod
af0c73720e fix performance issue in processHistogramLabels() (#25813) 2020-06-25 17:51:42 +02:00
Marcus Andersson
7f587b209f removed the event listener on will unmount instead of adding it again. (#25844) 2020-06-25 17:04:43 +02:00
Arve Knudsen
8f66f5b1ca CircleCI: Install Google Cloud SDK from versioned archive (#25843)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-25 16:56:54 +02:00
Tobias Skarhed
62e1e78fbe DatatLinks: Fix open in new tab state mismatch (#25826) 2020-06-25 14:54:34 +02:00
Dominik Prokop
e4642de505 Update latest.json(7.0.4) (#25833) 2020-06-25 14:22:48 +02:00
Tobias Skarhed
6d8d0a6ba6 Template variable filters: Hide overflowing text (#25801)
* Add a span as a flex item

* Add max-width

* Removed old angular directive remnant

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-06-25 14:18:33 +02:00
Mohit Nain
564a34a9c8 Update docs/sources/variables/templates-and-variables.md (#25829)
* Update docs/sources/variables/templates-and-variables.md

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-25 12:54:21 +02:00
Dominik Prokop
657dc612d5 Update changelog (7.0.4) (#25823) 2020-06-25 12:25:12 +02:00
Emil Tullstedt
112c28033d Provisioning: Apply settings expanders (#25692)
* Provisioning: Apply settings expanders

Adds support for the variable expanders introduced to the configuration file in #25075 to provisioning.

* Update pkg/services/provisioning/values/values_test.go

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

* Update pkg/services/provisioning/values/values.go

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

* Provisioning: Handle errors when expanding JSON maps
2020-06-25 12:04:42 +02:00
Ivana Huckova
9a6bf88020 Explore/Loki: Fix context menu log line highlighting (#25731)
* Add stopPropragation to context

* Remove redundant stopPropagation from header

* Format comment
2020-06-25 11:14:19 +02:00
Peter Davids
5ab38e9409 Dashboard: fix promql query editor resolution field's position to prevent overflow (#25566)
* GraphPanel: fix promql query editor resolution field's max height to prevent overflow

* fix test

* move menuPlacement to bottom instead
2020-06-25 10:52:18 +02:00
Arve Knudsen
935d6b0ce1 Build: Let building of Go code work even if $GOPATH isn't set (#25805)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-25 08:38:17 +02:00
Hugo Häggmark
6e3e9b7c39 Templating: fixes variables not being interpolated after dashboard refresh (#25698)
* Templating: Moves global variables from TemplateSrv to Redux

* Refactor: renamed to meta

* Tests: fixed broken tests

* Chore: reduces strict null errors

* renamed meta variabel to system variable.

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2020-06-25 07:38:55 +02:00
Mohit Nain
69eb5afdf7 Docs: Typo correction (#25791)
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-25 01:45:22 +02:00
Ilya Stoliar
8ca28de305 CloudWatch: Added AWS ServiceCatalog metrics and dimensions (#25812) 2020-06-25 01:26:41 +02:00
Ryan McKinley
f59d7acee6 Arrow DataFrame: cast BigInt/UInt to numbers (#25811) 2020-06-24 14:50:24 -07:00
Ryan McKinley
629ce6897d Azure Logs: use executedQueryString in metadata (#25755) 2020-06-24 14:24:30 -07:00
Ryan McKinley
fda9b1f089 InfluxDB: add executedQueryString metadata for InfluxQL (#25786) 2020-06-24 13:52:46 -07:00
Zoltán Bedi
271cc67038 Data: Prefix trace types in data package (#25810) 2020-06-24 20:58:42 +02:00
Tobias Skarhed
615b000acd Tab: Make active tab clickable and add hyperlink functionality (#25546)
* onChangeTab for active tab and pointer mouse

* Add anchor element to tab

* Make a strict 'anchor' mode

* Add short docs

* Apply suggestions from code review

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Fix nits

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-06-24 16:58:40 +02:00
Arve Knudsen
e8e280c83e Google OAuth Docs: Fix typos (#25790)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-24 15:46:31 +02:00
Mohit Nain
2cd569219b Docs: Suggesting few changes to the document (#25435)
* Suggesting few changes to the document

* Update docs/sources/panels/visualizations/heatmap.md

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

* Update docs/sources/panels/visualizations/heatmap.md

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

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-06-24 06:37:37 -07:00
Dominik Prokop
a8b660d919 Improve yarn start output (#25773) 2020-06-24 14:37:36 +02:00
Tobias Skarhed
d3299796f5 Migration: Settings forms (#24741)
* Migrate shared preferences

* Remove unused import

* Migrate org name form

* Update TeamSettings

* Convert user settings

* Fix inital default values

* Update snapshots

* Fix CI errors

* Fix failing Ci

* Update snapshots

* Large spacing

* Move use Form for OrgSettings and add FieldSet

* Remove snapshots

* Add snapshots

* Remove unused prop
2020-06-24 10:55:39 +02:00
Ilya Stoliar
1e38a24b88 CloudWatch: Added AWS MediaStore metrics and dimensions (#25492)
* CloudWatch: Added AWS MediaStore metrics and dimensions

* Camel case dimensions

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2020-06-24 11:06:57 +03:00
Ivana Huckova
f704d103bb Rich history: Updates for default settings and starred queries deletion (#25732)
* Update show only queries for current data source to true

* Add confirmation modal when deleting starred queries
2020-06-24 09:50:46 +02:00
Torkel Ödegaard
b7d26b12dd Templating: Fix searchFilter issue in templating system (#25770) 2020-06-24 08:36:03 +02:00
Ryan McKinley
f16bf361d3 InfluxDB: improve test response (#25785) 2020-06-23 16:30:07 -07:00
Alexander Tymchuk
57f994712e Fix: typo in the Delete sub-header (#25781) 2020-06-23 14:55:14 -07:00
Mohit Nain
7b95984ad1 Docs: Suggesting few changes (#25774)
* Suggesting few changes

* Update docs/sources/features/explore/index.md

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

* Update docs/sources/features/explore/index.md

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

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-06-23 12:39:15 -07:00
Diana Payton
297a4ddd22 Docs: Update jaeger.md (#25634)
* Update jaeger.md

* Update jaeger.md

* Update docs/sources/features/datasources/jaeger.md

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

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Ivana <ivana.huckova@gmail.com>
2020-06-23 12:12:07 -07:00
Diana Payton
a1aeb4b50d Docs: Updated links (#25777) 2020-06-23 12:11:30 -07:00
Marcus Efraimsson
5d1508ed8c Instrumentation: Fix setting Jaeger tracing address through Grafana config (#25768)
Upgrades jaeger-client-go to v2.24.0 to resolve problem with setting Jaeger tracing 
address through Grafana config.

Fixes #25563
2020-06-23 19:23:49 +02:00
Diana Payton
78996516af Docs: Update configuration.md (#25707)
* Update configuration.md

* moved configuration.md to administration folder

* updated links

* Added quota section

* Update upgrading.md

* Update configuration.md

* Update configuration.md

* Update configuration.md

* Updating links

* Update configuration.md

* Update configuration.md

* Update configuration.md

Reworked the security options

* Update configuration.md

* Update configuration.md

* Update provisioning.md

* Update provisioning.md

* Update configuration.md

* Update configuration.md

* Update docs/sources/administration/configuration.md

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

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-06-23 09:56:44 -07:00
Peter Holmberg
4463b18ff5 Panel Edit: Clicking twice on a visualization closes the VizPicker (#25739)
* initial things

* recreate old behaviour

* adding guide to tooltip

* update text

* fix typings on render prop

* use conditional children
2020-06-23 18:20:08 +02:00
Arve Knudsen
e998f6e855 Chore: Remove es-check as dev dependency (#25772)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-23 18:08:23 +02:00
Arve Knudsen
ba6aefb6ec CircleCI: Upgrade build pipeline tool (#25741)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-23 17:10:52 +02:00
dependabot[bot]
19779bb961 Build(deps): Bump websocket-extensions from 0.1.3 to 0.1.4 (#25419)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-06-23 16:24:04 +02:00
Tobias Skarhed
f5de4f1fb1 ForgottenPassword: Move view to login screen (#25366)
* Add forgot password to login screen

* Add ForgottenPassword component

* Add spacing

* Generate new emails and handle resetCode

* Fix animation and small UX issues

* Extract LoginLayout and add route for reset mail

* Reset email template

* Add ChangePasswordPage

* Remove resetCode

* Move style into variable

* Fix strict null
2020-06-23 16:17:54 +02:00
Alex Khomenko
1bde4de827 Grafana UI: Unbind graph only if initialised (#25762) 2020-06-23 10:43:19 +03:00
Ryan McKinley
46df05fd9d InfluxDB: flux query editor cleanup (#25753) 2020-06-22 16:36:58 -07:00
Ryan McKinley
740a9ad5f9 InfluxDB: support aggregate results (#25726) 2020-06-22 13:44:41 -07:00
Ryan McKinley
8d1ed33e20 InfluxDB: different config UI for 1x vs 2x (#25723) 2020-06-22 13:03:34 -07:00
Torkel Ödegaard
0797fe88a1 Units: Custom unit suffix and docs for custom units (#25710)
* Units: Custom units updates and docs

* Fixed codespell

* Update docs/sources/panels/field-configuration-options.md

Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>

* Update docs/sources/panels/field-configuration-options.md

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

* Update docs/sources/panels/field-configuration-options.md

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

* Update docs/sources/panels/field-configuration-options.md

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

Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-06-22 21:30:37 +02:00
Ryan McKinley
0c61ff7672 DataSourceWithBackend: remove unused function (#25727) 2020-06-22 10:27:02 -07:00
Ryan McKinley
05ed781184 InfluxDB: use released client 1.3.0 (#25725) 2020-06-22 10:19:26 -07:00
Agnès Toulet
b5b019dfcf Notifications: fix reply-to option for emails (#25748) 2020-06-22 18:56:49 +02:00
Carl Bergquist
703f728c0c Dashboards: Make path to default dashboard configurable (#25595)
Closes #25463

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-06-22 18:00:39 +02:00
Marcus Efraimsson
cc95754e0d Provisioning: Adds support for enabling app plugins (#25649)
Adds support for enabling app plugins using provisioning. 

Ref #11409

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-06-22 17:49:13 +02:00
Diana Payton
602dd1e226 Docs: Update time-range-controls.md (#25745) 2020-06-22 08:30:02 -07:00
Marcus Efraimsson
58cefe73ee Datasources: Handle URL parsing error (#25742)
Adds handling of error returned from URL parsing.

Fixes #25714
2020-06-22 16:34:40 +02:00
Zoltán Bedi
c16890c22d Chore: use fork-ts-checker plugin for eslint check (#25631)
* Use fork-ts-checker for eslint check

* Fix lint issue

* Add packages to lint

* Add comments to webpack configs
2020-06-22 16:15:29 +02:00
Torkel Ödegaard
95d53f03a0 Explore: Use merge transform instead of DataFrame -> Table -> Merge -> toDataFrame (#25694) 2020-06-22 15:30:16 +02:00
Josh Soref
eb734a2f6e Chore: spelling - ui (#24435) 2020-06-22 15:02:58 +02:00
Kaveet Laxmidas
b5b1b9d64e Docs: Fix broken link to Slack documentation (#25720)
This change fixes a link broken due to link formatting on the docs.

The issue is present here, in the last sentence: https://grafana.com/docs/grafana/latest/alerting/notifications/#slack
2020-06-22 11:18:33 +02:00
Philipp Trulson
b8d49999b7 Units: Match 'length' case with other categories (#25702) 2020-06-22 08:36:08 +02:00
kay delaney
3b383149db CloudWatch Logs: Adds template variable support to log groups (#25604)
* CloudWatch Logs: Adds template variable support to log groups
Closes #25099
2020-06-18 15:54:29 +01:00
Alex Khomenko
47a2ee5b24 Grafana UI: Apply disabled styles to LinkButton (#25693)
* Grafana UI: Apply disabled styles to LinkButton

* Grafana UI: Add disabled knob
2020-06-18 16:22:57 +03:00
Dominik Prokop
e5d21461a0 Refactor panel inspector (#24480)
* Inspect: Should not subscribe to transformed data

* PQR- allow controll whether or not field overrides and transformations should be applied

* UI for inspector data options

* fix

* Null check fix

* Refactor PanelInspector

* TS fix

* Merge fix

* fix test

* Update public/app/features/dashboard/components/Inspector/InspectDataTab.tsx

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>

* review batch 1

* Update API of usePanelLatestData

* css

* review batch 2

* Update usePanelLatestData hook

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
2020-06-18 14:31:30 +02:00
Richard Hartmann
4a30c65a5e Docs: Fix broken link (#25664)
Signed-off-by: Richard Hartmann <richih@richih.org>
2020-06-18 14:08:26 +02:00
Kyle Brandt
36fd746c5d Influx/flux: include interpolated query with error (#25665)
with execution errors, return a Frame that has Meta.ExecutedQueryString.
2020-06-18 07:45:55 -04:00
Hugo Häggmark
e2ba0731e2 Chore: Upgrades jQuery and @types/jQuery (#25651)
* Chore: upgrades jQuery and @types/jQuery

* Chore: reduce strict null errors

* Fixed issue in graphite func editor

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-06-18 11:35:11 +02:00
Alexander Zobnin
eb792490d6 Types: add reportGrid to the feature toggles (#25689)
* Types: add reportGrid to the feature toggles

* Chore: add reportGrid to the default config
2020-06-18 12:28:41 +03:00
Agnès Toulet
4853770db3 Datasources: add new tab and feature toggle (#25663)
* Datasources: add insights tab

* Config: add feature flag
2020-06-18 09:37:13 +02:00
kay delaney
1479786fb8 Datasource/Influx: Fixes issue where toggling editor mode would cause error (#25660)
Closes #25659
2020-06-18 09:27:27 +02:00
Steven Vachon
5b5b247cb1 @grafana/e2e: improvements (#25677)
* Minor changes

* Fixed data source selection issue

… where it appeared as though the wrong one was selected

* Fixed “executing a canceled action” issue

... thrown from RxJS
2020-06-17 15:39:39 -04:00
Diana Payton
cf109df887 Docs: Update overview.md (#25672)
Updated a link.
2020-06-17 11:15:41 -07:00
Arve Knudsen
ea2bb7036c Auth proxy: Ignore stale cache entries (#23979)
* Auth proxy: Retry without cache if failing to get user
2020-06-17 18:43:16 +02:00
Torkel Ödegaard
491b8680f7 Footer: Add back footer to login page (#25656) 2020-06-17 14:33:09 +02:00
Alex Khomenko
157e54067d Docs: Remove GrafanaCONline info from readme (#25655) 2020-06-17 12:57:40 +02:00
Torkel Ödegaard
d6ed8c522c Dashboard: Redirects for old edit & view panel urls (#25653) 2020-06-17 12:51:41 +02:00
Ryan McKinley
d1b230f84a Chore: upgrade to Typescript 3.9.3 (#25154)
* upgrade to typescript 3.9.3

* Fix errors that surfaced with update

* Null check fixs

* FIx null checks

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-06-17 12:26:01 +02:00
Arve Knudsen
d352c213b3 API: Recognize MSSQL data source URLs (#25629)
* API: Recognize MSSQL URLs

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Move MSSQL URL validation into mssql package

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-17 11:17:11 +02:00
Sofia Papagiannaki
e6a5e88054 Stackdriver: Fix creating Label Values datasource query variable (#25633) 2020-06-17 12:05:06 +03:00
Lukas Siatka
7b7000c5bc Explore: updates ExploreItemState type, reduces strict null errors count to 702 (#25250)
* Chore: changes null values to undefined in explore reducer

* Chore: changes sortLogsResult param type from null to undefined

* Chore: changes null values to undefined in explore reducer

* Chore: updates strict null errors count

* Revert "Chore: changes null values to undefined in explore reducer"

This reverts commit b82d841611.

* Revert "Chore: changes sortLogsResult param type from null to undefined"

This reverts commit 21073b5d30.

* Revert "Chore: changes null values to undefined in explore reducer"

This reverts commit 798559688c.

* Chore: updates ExploreItemState type

* Chore: updates initial ExploreItemState in Explore reducer

* Chore: updates strict null errors count to 699

* Chore: changed ExploreMode and Emitter type in ExploreStateItem

* Revert "Chore: changed ExploreMode and Emitter type in ExploreStateItem"

This reverts commit 7e0e2027fc.
2020-06-17 10:08:19 +02:00
Marcus Efraimsson
03f7fd0527 Elasticsearch: Support using a variable for histogram and terms min doc count (#25392)
Support using a variable for histogram and terms min doc count. 
This is an addition to #21064.

Ref #21052
Ref #21064
2020-06-17 10:04:38 +02:00
Arve Knudsen
048f6f5301 CircleCI: Upgrade Grafana build image (#25624)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-17 09:53:39 +02:00
Carl Bergquist
4949869356 add richih to governance (#25537) 2020-06-17 09:34:20 +02:00
Hugo Häggmark
c7be689b0c Chore: cleans up unused files (#25647) 2020-06-17 09:21:38 +02:00
Alexandre de Verteuil
0fa096e0d4 Docs: Quick fix on default license_path in docs (#25641) 2020-06-17 07:53:28 +02:00
Emil Tullstedt
80e9546cec Settings: Add setting for hiding version number for anonymous users (#24919)
* Settings: Add setting for hiding version number for anonymous users

Fixes #12925

* Hide version string from footer when unavailable

* Settings: Test frontend settings with hide version for anonymous users

* Settings: Add hide version variable to frontend settings

* Make AnonymousHideVersion non-global

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Settings: Improve test neighbor friendliness, reset state before and after

* Settings: Use T.Cleanup

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-17 07:39:50 +02:00
Richard Hartmann
370791d50b Add WORKFLOW.md (#25461)
Add WORKFLOW.md

Signed-off-by: Richard Hartmann <richih@richih.org>
2020-06-16 20:47:08 +02:00
Steven Vachon
fe74abfaae @grafana/e2e: improvements (#25610)
* Added dependency for attaching files to forms

* Fixed closing of panel options

* Updated lockfile
2020-06-16 12:42:35 -04:00
Torkel Ödegaard
2288609195 Dashboard: Refactor container css to use flex for height instead of calc (#24009)
* Dashboard: Ability to hide dashboard toolbar

* Updated snapshot
2020-06-16 16:33:25 +02:00
Sofia Papagiannaki
fefbbc65a8 Auth: Add support for forcing authentication in anonymous mode and modify SignIn to use it instead of redirect (#25567)
* Forbid additional redirect urls

* Optionally force login in anonymous mode

* Update LoginCtrl page to ignore redirect parameter

* Modify SignIn to set forceLogin query instead of redirect

* Pass appUrl to frontend and use URL API for updating url query

* Apply suggestions from code review

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

* Fix SignIn test

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-16 16:33:44 +03:00
Harrison Shoff
b4136c1eca GraphPanel: fix annotations overflowing panels (#25606) 2020-06-16 15:27:12 +02:00
Carl Bergquist
35e2b87b61 removes text about alert messages supporting variables (#25622)
fixes #25605
2020-06-16 14:50:52 +02:00
Torkel Ödegaard
aa5fb20cfd Variables: Adding dashboard to test updating variables from data link (#25192) 2020-06-16 13:58:18 +02:00
Alex Ashley
4aff2d7469 Stackdriver: Use default project name if project name isn't set on the query (#25413)
* Get default project if not defined on query

* Log when using default project name

* Set query result error
2020-06-16 14:08:35 +03:00
Ben RUBSON
cd75dc93f6 Branding: Use AppTitle as document title (#25271) 2020-06-16 12:13:03 +02:00
Alex Khomenko
e6460b31df Docs: Fix typos in the issue triage doc (#25627) 2020-06-16 12:56:40 +03:00
Torkel Ödegaard
146ca7a486 Docs: Update upgrading doc with more backup details (#25512)
* Docs: Update upgrading doc with more backup details

Fixes #9159

* Update docs/sources/installation/upgrading.md

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

* Update docs/sources/installation/upgrading.md

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

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-06-16 11:23:52 +02:00
Alex Khomenko
531e658123 Search: support URL query params (#25541)
* Search: connect DashboardSearch

* Search: set url params

* Search: handle tag params

* Search: handle sort params

* Search: use getLocationQuery

* Search: fix type errors

* Docs: Save query params for manage dashboards

* Search: extract connect

* Search: add layout to URL params

* Search: update options

* Search: simplify options loading

* Search: Fix strict null errors

* Search: Change params order

* Search: Add tests

* Search: handle folder query
2020-06-16 11:52:10 +03:00
Marcus Andersson
a5b38b799a Build: scripts to build and measure packages reference docs (#24876)
* added script to check docs metrics.

* added information link on how to add code comments.

* added script for build and measure code comment metrics.

* fixed issues according to shellcheck.

* Added so we build the metrics if report folder is missing.

* added some spacing and a devider.

* Added so we can send metrics to grafana.

* added shellcheck attribute.

* Fixed spelling according to feedback.

* see if shellcheck passes.

* fixed issue with shellcheck.

* Explore/Logs: Fix tooltip display for log graph (#25544)

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
2020-06-16 09:33:23 +02:00
Arve Knudsen
3e81a626a4 ci-build: Upgrade Dockerfile to latest Debian Stretch (#25590)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-16 09:31:41 +02:00
Alexandre de Verteuil
b44c8b6f6e Add Root URL info under License file management (#24712)
* Add Root URL info under License file management

Edited through GitHub, not tested on development web server.

* Update docs/sources/enterprise/_index.md

Make updating root_url instructions more straightforward, with action first and explanation second.

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

* Update docs/sources/enterprise/_index.md

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

* Update docs/sources/enterprise/_index.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-06-16 08:57:01 +02:00
Torkel Ödegaard
54284ed9f7 Slider: Update rc-slider component (#25617) 2020-06-16 08:36:51 +02:00
Marcus Andersson
989a1a3d5d fixed failing test. (#25619) 2020-06-16 08:02:55 +02:00
Marcus Andersson
fb7d036fa4 Typescript: Fixed strict null errors. (#25609) 2020-06-16 07:34:27 +02:00
kay delaney
bd76c66e50 Explore/Logs: Fix tooltip display for log graph (#25544) 2020-06-15 15:06:43 +01:00
Ivana Huckova
8fcbea2c2f Alerting: Replace icons on for alerting (#25599)
* Update Alerting icons

* Keep critical red for alerting
2020-06-15 15:42:42 +02:00
Marcus Andersson
093383eb83 Transform: added merge transform that will merge multiple series/tables into one table (#25490)
* wip: added draft of series to rows.

* wip: building dataFrame structure first and then adding data.

* wip: added some refactorings of the seriesToRows transformer.

* did some refactorings to make the code easier to follow.

* added an editor for the transform.

* renamed some of the test data.

* added docs.

* fixed according to feedback.

* renamved files.

* fixed docs according to feedback.

* fixed so we don't keep labels or config values from.

* removed unused field.

* fixed spelling errors.

* fixed docs according to feedback.
2020-06-15 15:03:13 +02:00
Harrison Shoff
66f6b05d5e GraphPanel: Make legend values clickable series toggles (#25581)
fixes: #25402
2020-06-15 14:39:02 +02:00
Arve Knudsen
91c24e1f56 Chore: Upgrade Jest to latest (#25591)
* Chore: Upgrade Jest to latest

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Chore: reduces strict null errors

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2020-06-15 13:06:37 +02:00
kay delaney
b1dee9392b CloudWatch Logs: "limit" query command now respected (#25486)
Closes #25182
2020-06-15 11:29:04 +01:00
Hugo Häggmark
bd44d973cd Variables: Fixes maximum call stack bug for empty value (#25503) 2020-06-15 11:49:38 +02:00
Arve Knudsen
cf2343fac8 package.json: Depend on es-check since we need it for CI (#25593)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-15 10:35:32 +02:00
Hugo Häggmark
258092ec7f TextPanel: Removes text mode (#25589) 2020-06-15 10:17:46 +02:00
Arve Knudsen
7a27dfdffa Include golangci-lint with grafana/build-container (#25587)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-15 09:44:53 +02:00
Hugo Häggmark
c0139b7d42 Azure Monitor: fixes undefined is not iterable (#25586)
* Azure Monitor: fixes undefined is not iterable

* Update public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/response_parser.test.ts

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

* Update public/app/plugins/datasource/grafana-azure-monitor-datasource/azure_log_analytics/response_parser.test.ts

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

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-15 09:20:02 +02:00
Arve Knudsen
04e0ee5cfc package.json: Upgrade Volta's Node version (#25209)
* package.json: Upgrade Volta's Node version
2020-06-13 13:13:43 +02:00
Marcus Efraimsson
bd8a04a6a5 InfluxDB: Fix invalid memory address or nil pointer dereference when schema is missing in URL (#25565)
Add guard if parsing url fails in influxdb backend data source.

Fixes #25242
2020-06-12 16:04:09 +02:00
Steven Vachon
4c8ad8d031 @grafana/e2e: improvements (#25497)
* Minor changes

* Use UI for removing dashboards and datasources

… with an optional “quick” mode that instead does so via a request

* Improved URL helpers

* Simplified test teardown

* Added support for multiple tests

... instead of being forced to cram everything into a single test because the session was cleared
2020-06-11 16:31:49 -04:00
Robbert Gurdeep Singh
034abaa73a Security: Use Header.Set and Header.Del for X-Grafana-User header (#25495)
This ensures that the X-Grafana-User header can be trusted.
If the configuration enabled the setting of this header, the
server can now trust that X-Grafana-User is set/unset by Grafana.
Before this, an anonymous user could simply set the X-Grafana-User
header themselves (using the developer tool for example)
2020-06-11 21:15:17 +02:00
Daniel Lee
1e88e50822 docs: remove racially charged words (#25535)
ref #18841
2020-06-11 18:17:11 +02:00
Diana Payton
035497c7bd Docs: Edit plugin signature topics (#25491)
* Update sign-a-plugin.md

* Update plugin-signature-verification.md

* Update docs/sources/plugins/plugin-signature-verification.md

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

* Update docs/sources/plugins/plugin-signature-verification.md

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

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-06-11 08:33:27 -07:00
Mohit Nain
28ff9d2832 Docs: Typo Correction (#25538) 2020-06-11 08:06:41 -07:00
Marcus Efraimsson
c0f3b2929c Backend plugins: Refactor to allow shared contract between core and external backend plugins (#25472)
Refactor to allow shared contract between core and external backend plugins 
allowing core backend data sources in Grafana to be implemented in same 
way as an external backend plugin.
Use v0.67.0 of sdk.
Add tests for verifying plugin is restarted when process is killed.
Enable strict linting for backendplugin packages
2020-06-11 16:14:05 +02:00
Andrej Ocenas
40b3473a10 Explore: Add tracing switch (#25539)
* Add tracing switch to explore

* Prettify
2020-06-11 14:54:02 +02:00
Alex Khomenko
85d5d8a0e6 Docs: Fix intro to timeseries URL (#25530)
* Docs: Fix intro to timeseries URL

* Update docs/sources/developers/plugins/data-frames.md

Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>

Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>
2020-06-11 15:15:50 +03:00
kay delaney
12d2f2c026 UI/Switch: Makes Switch ID generation more stable (#25542) 2020-06-11 12:47:49 +01:00
Marcus Olsson
79fea5df2a Docs: Update guide on authenticating data source plugins (#24884)
* Update guide on authenticating data source plugins

* Fix broken references
2020-06-11 12:12:27 +02:00
Sam Coren
9aef680e66 Updated URL for developing plugins (#25521)
The existing link for developing plugins was redirecting to the legacy plugin docs page for developers. I updated it to the new link for latest post-7.0 release. 👍
2020-06-11 10:43:20 +02:00
Overcooked Panda
d3c57ac251 Units: Added bitcoin units milli-bitcoin (mBTC) and micro-bitcoin (μBTC) (#24182)
* Update Bitcoin Currency to use proper symbol, add mBTC and μBTC

* Apply suggestions from code review

Co-authored-by: Marcus Andersson <systemvetaren@gmail.com>

* Revert Bitcoin to use '฿'

Co-authored-by: Marcus Andersson <systemvetaren@gmail.com>
2020-06-11 09:13:03 +02:00
Barak Kakoun
1b65e889be Typo (#25516)
dashboard instead of dashboad
2020-06-11 09:24:15 +03:00
Ryan McKinley
5f1f820bb9 Influx: Support flux in the influx datasource (#25308)
* add flux 
* add token to datasource config editor
* add backend for flux
* make the interpolated query available in query inspector
* go mod tidy
* Chore: fixes a couple of strict null errors in influxdb plugin

Co-authored-by: kyle <kyle@grafana.com>
Co-authored-by: Lukas Siatka <lukasz.siatka@grafana.com>
2020-06-10 15:26:24 -04:00
Torkel Ödegaard
c7aac1fd40 Gauge: Hide orientation option in panel options (#25511) 2020-06-10 17:27:59 +02:00
Diana Payton
ed694fd88a Docs: Update _index.md (#25121) 2020-06-10 07:31:05 -07:00
Emil Tullstedt
e8b5f2330d Settings: Expand variables in configuration (#25075) 2020-06-10 14:58:42 +02:00
Hugo Häggmark
55f304f15d TextPanel: Removes Angular Text Panel (#25504)
* TextPanel: Removes Angular Text Panel

* Tests: updates snapshots
2020-06-10 14:35:30 +02:00
Lukas Siatka
aa3d893079 Chore: adds core datasources to codeowners (#25501)
* Chore: adds core datasources to codeowners

* Chore: updates opentsdb to be under backend platform team
2020-06-10 11:02:51 +02:00
Lukas Siatka
282cb73d3a Chore: adds policy interpolation in influxdb queries (#25500) 2020-06-10 10:03:32 +02:00
Theo Schlossnagle
b15a401efa Fix dense y-axis labels in heatmap using tsbuckets (#24351)
* Fix dense y-axis labels in heatmap using tsbuckets

This change emulates the non-tsbuckets Y-axis tick count by making
the y-axis label formatter treat a dense set as a sparse set.

fixes #11342

* have d3 do the work

* Update public/app/plugins/panel/heatmap/rendering.ts

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
2020-06-10 10:44:50 +03:00
Hugo Häggmark
72b8300571 Table: Adds adhoc filtering (#25467)
* Table: Adds adhoc filtering

* Refactor: changes after PR comments

* Refactor: hides filtering for data sources that do not support modifyQuery in Explore

* Refactor: fixes strict null error

* Changed tooltip position to above icon

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-06-10 07:09:02 +02:00
Mohit Nain
1040d824c5 Docs: Typo Correction (#25475) 2020-06-09 15:44:11 -07:00
Christian
9ff551edc8 Docs: Add dependencies for debian stretch to image rendering plugin documentation (#25408) 2020-06-09 15:42:59 -07:00
Zoltán Bedi
5f923be2bf Plugins: move jaeger trace type to grafana data (#25403)
* Plugins: move jaeger trace type to grafana data

* Remove unnecessary type from tsconfig
2020-06-09 22:08:51 +02:00
Brian Candler
ce127acf84 Docs: Document the front-end proxy path for live log tailing with Loki (#25440) 2020-06-09 12:55:07 -07:00
Mohit Nain
35602099d7 Docs: Typo Correction (#25477) 2020-06-09 12:54:40 -07:00
Mohit Nain
2e68425ad7 Docs: Some correction in line 58 (#25474)
All screen sizes is correct terminology to use
2020-06-09 12:53:53 -07:00
Mohit Nain
40986f3015 Docs: Typo Correction (#25437) 2020-06-09 12:51:14 -07:00
Mohit Nain
a7bdc92fd7 Docs: Couple of typos corrected (#25432) 2020-06-09 12:43:05 -07:00
Mohit Nain
47c3ae1f44 Docs: Typo Correction in line 36 (#25429) 2020-06-09 12:34:46 -07:00
Torkel Ödegaard
6fe9982ff0 Table: Support custom date formats via custom unit (#25195)
* Table: Custom date formating via custom unit

* FieldConfig: Changed so that shouldApply is not called for overrides and added unit test

* Updated
2020-06-09 17:43:29 +02:00
Lukas Siatka
1ea8346644 Elastic: prevents datasource from throwing unexpected errors for invalid JSON (#24999)
* Chore: adds error handling to get requests in elasticsearch datasource

* Chore: updates elasticsearch datasource response parsing checks

* Chore: updates elasticsearch non-json errors description

* Chore: removes error catching from query methods to move it to the request method in elasticsearch

* Chore: fixes a typo in elastic response error message

* Chore: moves elasticsearch error handling to request method

* Chore: replaces datasource url in mock elasticsearch datasource
2020-06-09 17:32:47 +02:00
David Wittman
a9d34a3e6f Docs: Images in alerts require an ext provider (#25466)
Be more explicit about the fact that providing images in alert notifications requires an external image storage provider. Previously this read as if it was only necessary for publicly accessible images, but even if they are served from Grafana, the administrator must set up the "local" image provider in the configuration.
2020-06-09 07:28:23 -07:00
Marcus Efraimsson
53175a41c9 Make tsdb dataframes response able to carry encoded/decoded frames (#25454)
Make tsdb dataframes response able to carry encoded and/or decoded frames
2020-06-09 13:13:06 +02:00
mikkokupsu
de1dc57242 CloudWatch: Added AWS WAFV2 metrics (#24048)
* Add metrics and dimensions for AWS/WAFV2

* Update pkg/tsdb/cloudwatch/metric_find_query.go

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

* Fix metric names

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-09 09:51:02 +03:00
Mohit Nain
920362537d Docs: Typo Identified (#25438) 2020-06-08 14:27:09 -07:00
Galdin Raphael
94984627ea Docs: Fix typo in GitHub Auth Doc page (#25335)
https://grafana.com/docs/grafana/latest/auth/github/#enable-github-in-grafana
2020-06-08 12:49:53 -07:00
Amal
77be352c7e Docs: Inserting a comma for better readability (#25337) 2020-06-08 12:48:13 -07:00
Amal
029b1db0d1 Docs: Grammatical correction (#25336) 2020-06-08 12:46:58 -07:00
Amal
8309e8e31a Docs: Typo fix (#25247)
* Update stackdriver.md

* Update stackdriver.md

* Update stackdriver.md

* Update index.md

* Update whats-new-in-v2.md
2020-06-08 12:46:08 -07:00
Amal
ee1be75b7b Docs: Update zipkin.md (#25246) 2020-06-08 12:44:44 -07:00
Amal
be41589b70 Docs: Correcting abbreviation (#25225)
* Correcting abbreviation

* Update azuread.md

* Update whats-new-in-v6-3.md

* Update enterprise-configuration.md

* Update enterprise-configuration.md
2020-06-08 12:43:46 -07:00
Amal
e63b548c5d Docs: Minor grammatical correction (#25224) 2020-06-08 11:42:21 -07:00
Shavonn Brown
5293c9dd84 Convert remaining profile bits to React (#24310)
* reactify user sessions

* all reactified

* more cleanup

* comment edit

* Profile: Fix casing

* Profile: Add Page wrapper

* Profile: New form styles for UserProfileEditForm

* Profile: Use new form styles for SharedPreferences

* Profile: Use radioButtonGroup for SharedPreferences

* Grafana UI: Add FieldSet

* Grafana UI: Add story

* Grafana UI: Add docs

* Grafana UI: Export FieldSet

* Profile: USe FieldSet

* Profile: Sort sessions

Co-authored-by: Clarity-89 <homes89@ukr.net>
2020-06-08 18:19:00 +03:00
Torkel Ödegaard
8474794aaa Dashboard: Fix loading custom home dashboard (#25447)
* Dashboard: Fix loading custom home dashboard

* Updated and added test
2020-06-08 17:15:56 +02:00
Dominik Prokop
c53435f7a7 Graph: Fix XSS vulnerability with series overrides (#25401)
* Fix XSS vulnerability with Graph series overrides

* Update public/app/plugins/datasource/testdata/partials/query.editor.html
2020-06-08 17:13:01 +02:00
Besart Berisha
c7e38fd47f Replace link with button component (#25446) 2020-06-08 16:09:55 +02:00
Steven Vachon
d62926b5a3 @grafana/e2e: improvements (#25342)
* Minor changes

* Remove console.* logger plugin

... as it doesn't work in Electron

* Only open/close panel editor options and groups when state is inverted

... meaning, only open when closed and only close when open. This avoids unpredictable states, causing inconsistent results.

* Support for adding multiple datasources and dashboards

... and having them all auto-removed when tests are completed

* Avoid page errors when removing dashboards and datasources [keep?]

* Wait for chart data before saving panel

... so that everything is ready when returning to the dashboard
2020-06-08 09:52:34 -04:00
Speak Your Code
5f767e2c9a TablePanel: Sort numbers correctly (#25421)
* Table sortType to basic to be able to sort negative numbers

* Table sortType based on field type
2020-06-08 14:28:45 +02:00
mueslo
70038bfd5b Fix byte-format data rates (#25424) 2020-06-08 07:23:09 +02:00
Besart Berisha
293ecbdd4f Fix scss variable typo (#25398) 2020-06-05 20:28:50 +02:00
Kyle Brandt
ef61a64c46 Azure Monitor: Log Analytics response to data frames (#25297)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2020-06-05 12:32:10 -04:00
Alex Khomenko
c3549f845e Grafana UI: Add prop table (#25387) 2020-06-05 17:29:37 +03:00
Hugo Häggmark
e55756066b Docs: updates frontend style guides (#25391)
* Update frontend.md

* Update contribute/style-guides/frontend.md

Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>

Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>
2020-06-05 13:54:27 +02:00
Fabien Wernli
93a93b5031 Elasticsearch: Add support for template variable in date histogram min_doc_count (#21064)
Fixes #21052
2020-06-05 11:41:18 +02:00
Hugo Häggmark
54565349c5 e2e: uses e2e() instead of cy to make things consistent (#25390) 2020-06-05 11:23:20 +02:00
Josh Soref
05a5a66e2f Chore: spelling - theme (#24434)
* Chore: spelling - theme

* Chore: drop phantomjs comments

* Chore: remove old phantomjs hack

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-06-05 10:53:57 +02:00
James Wang
4cf146a29d Docs: Fix loadAsyncOptions usage (#25371)
Fixed `loadAsyncOptions` in the `AsyncSelect` component usage so that works
2020-06-05 09:40:43 +02:00
Daniel Lee
fd93764784 Add Jeroen Op 't Eynde to the Grafana team (#25376)
* Add Jeroen Op 't Eynde to the Grafana team

Jeroen Op 't Eynde has been proposed as a new team member and the vote achieved the super majority required.

* Governance - sort alphabetically
2020-06-05 09:11:01 +02:00
Ilya Stoliar
cb78104db5 CloudWatch: Added AWS SDKMetrics metrics and dimensions (#25150)
* CloudWatch: Added AWS SDKMetrics metrics and dimensions
2020-06-05 10:10:38 +03:00
Daniel Lee
7c36209513 Add Malcolm Holmes to the Grafana team (#25377)
* Add Malcolm Holmes to the Grafana team

Malcolm Holmes has been proposed as a new team member and the vote achieved the super majority required.

* Governance - sort names alphabetically
2020-06-05 08:25:04 +02:00
Nagle Zhang
1b4fd9ad3c Update team.md (#25277)
document didn't metion teams can assign an orgId.
2020-06-05 07:42:53 +02:00
Hugo Häggmark
29598d83ce e2e: waits for requests to minimize flakiness (#25368) 2020-06-05 06:53:47 +02:00
Daniel Lee
69b366977a Add Chris Trott to the Grafana team (#25378)
* Add Chris Trott to the Grafana team

Chris Trott has been proposed as a new team member and the vote achieved the super majority required.

* Governance - should be alphabetical
2020-06-05 00:20:49 +02:00
Alex Khomenko
03f241a674 Grafana UI: Add FieldSet component (#25348)
* Grafana UI: Add FieldSet

* Grafana UI: Add story

* Grafana UI: Add docs

* Grafana UI: Export FieldSet

* Grafana UI: Fix issues
2020-06-04 16:52:52 +03:00
Alex Khomenko
1790ece4d5 Search: Only move dashboards into expanded folders UI-wise (#25363)
* Search: Ony move dashboards into expanded folders UI-wise

* Search: Add tests
2020-06-04 16:28:50 +03:00
Hugo Häggmark
acae33edf9 Chore: removes unused e2e packages (#25364) 2020-06-04 14:58:25 +02:00
Ryan McKinley
a65f7d666d DataSourceWithBackend: use datasource id when datasource property is not set (#25338)
* use the instance datasource id if not specified

* better tests
2020-06-04 14:46:26 +02:00
Hugo Häggmark
00a9af00fc Templating: removes old Angular variable system and featureToggle (#24779)
* Chore: initial commit

* Tests: fixes MetricsQueryEditor.test.tsx

* Tests: fixes cloudwatch/specs/datasource.test.ts

* Tests: fixes stackdriver/specs/datasource.test.ts

* Tests: remove refrences to CustomVariable

* Refactor: moves DefaultVariableQueryEditor

* Refactor: moves utils

* Refactor: moves types

* Refactor: removes variableSrv

* Refactor: removes feature toggle newVariables

* Refactor: removes valueSelectDropDown

* Chore: removes GeneralTabCtrl

* Chore: migrates RowOptions

* Refactor: adds RowOptionsButton

* Refactor: makes the interface more explicit

* Refactor: small changes

* Refactor: changed type as it can be any variable type

* Tests: fixes broken test

* Refactor: changes after PR comments

* Refactor: adds loading state and call to onChange in componentDidMount
2020-06-04 13:44:48 +02:00
Lukas Siatka
6b4d1dceb0 Explore: updates key and refId reassignment on query row operations in Explore reducer (#25249)
* Chore: adds query keys and refId reassignment on query row removal

* Chore: updates explore reducer tests to cover query row adding, removal, refId and key reassignment

* Chore: changes refId value in explore reducer from undefined to string to avoid introducing new strict null errors

* Chore: fixes a small nitpick with array spread in Explore reducer

* Chore: removes unnecessary dispatches in query row tests in Explore reducer test
2020-06-04 12:33:16 +02:00
Hugo Häggmark
e65dbcfea1 Variables: enables cancel for slow query variables queries (#24430)
* Refactor: initial commit

* Tests: updates tests

* Tests: updates snapshots

* Chore: updates after PR comments

* Chore: renamed initVariablesBatch

* Tests: adds transactionReducer tests

* Chore: updates after PR comments

* Refactor: renames cancelAllDataSourceRequests

* Refactor: reduces cancellation complexity

* Tests: adds tests for cancelAllInFlightRequests

* Tests: adds initVariablesTransaction tests

* Tests: adds tests for cleanUpVariables and cancelVariables

* Always cleanup dashboard on unmount, even if init is in progress. Check if init phase has changed after services init is completed

* fixed failing tests and added some more to test new scenario.

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2020-06-04 08:59:57 +02:00
Dominik Prokop
0f5b894256 Provide correct field scoped vars for data links interpolation (#25318) 2020-06-04 08:35:15 +02:00
Josh Soref
ed92b41d47 Chore: spelling - misc (#24438)
* Chore: spelling - misc

* fix master merge
2020-06-04 06:51:30 +02:00
Ivana Huckova
cb2d1b5f93 Fix typo (#25332) 2020-06-03 22:19:14 +02:00
Marcus Andersson
927e698993 Chore: Updates CHANGELOG.md for 7.0.3 (#25331)
* Update CHANGELOG.md

* updated according to feedback.

* Update CHANGELOG.md

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>

Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
2020-06-03 20:25:21 +02:00
Marcus Andersson
83065c9a2c updated latest.json. (#25333) 2020-06-03 19:52:29 +02:00
Ivana Huckova
2298bb951e Fix Query Field, remove unnecessary scrollbar (#25315) 2020-06-03 17:35:21 +02:00
Marcus Efraimsson
ba953be95f Only allow 32 hexadecimal digits for the avatar hash (#25322)
(cherry picked from commit 7a9c0e31ec)
2020-06-03 15:56:13 +02:00
Marcus Efraimsson
e5414f44aa 7.0.2 updates (#25323) 2020-06-03 15:47:24 +02:00
Alexander Zobnin
c4eca530ce Fix active LDAP sync (#25321)
* LDAP: sync only users with 'ldap' module as a most recent auth module

* LDAP: tests for searching ldap users
2020-06-03 16:28:13 +03:00
Sofia Papagiannaki
63463e0e46 Docs: Add upgrade note for modification of the cookie path (#25221)
* Add note for modification in the cookie path

* Update docs/sources/installation/upgrading.md

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

* Update docs/sources/installation/configuration.md

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-03 15:33:44 +03:00
Harrison Shoff
5d6af607d7 Variables: change VariableEditorList row action Icon to IconButton (#25217)
Fixes #21807
2020-06-03 13:32:44 +02:00
Sofia Papagiannaki
467348bded Cloudwatch: Fix dimensions of of DDoSProtection (#25317) 2020-06-03 12:58:05 +03:00
Sofia Papagiannaki
d040daa1cd Alerting: Add confirmation modals for deleting notifier (#25303)
* Add confirm modals for deleting notifier
* Update public/app/features/alerting/NotificationsListPage.tsx

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2020-06-03 11:04:38 +03:00
Kyle Brandt
17d3bb4287 backend: use latest Go sdk (#25304)
* uses plugin-sdk-go v0.66.0, which adds adds the ExecutedQueryString property to FrameMeta and changes s/Title/DisplayName in FieldConfig
* go mod tidy
2020-06-03 04:03:37 -04:00
Marcus Andersson
689425059f Build: adding a couple of things to try to improve the quality of the bug reports (#25282) 2020-06-03 09:52:39 +02:00
Steven Vachon
104c99f1b0 @grafana/e2e: improvements (#25307)
* Added more interaction to addPanel

* Use latest Cypress 4.x

* Updated lockfile
2020-06-02 21:08:09 -04:00
Sofia Papagiannaki
1e543d5ac1 Alerting: Ignore obsolete notification channels referenced by alerts (#25302)
* Ignore obsolete notification channel

* Fix tests

* Update pkg/services/alerting/rule.go
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-06-02 19:33:13 +03:00
Marcus Efraimsson
24673dc7d1 Docs: Adds plugin signature verification pages (#25257)
Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>
2020-06-02 16:44:02 +02:00
Hugo Häggmark
4c92bd1539 e2e: disables variables tests (#25296) 2020-06-02 16:05:31 +02:00
Josh Soref
e4fcc39e55 Chore: spelling in Go code (#24433) 2020-06-02 14:42:34 +02:00
Dominik Prokop
b12df9d64c Do not show alerts tab when alerting is disabled (#25285)
* Do not show alerts tab when alerting is disabled

* Add tests
2020-06-02 13:21:49 +02:00
Marcus Andersson
add1bcb59c Variable: removed __user.name/___.user.email from global variables and added docs for the rest of the __user variable. (#25275)
* added docs for new global variable.

* reverting the name + email so we only expose the bare minumum that should be enough for most cases.
2020-06-02 12:05:05 +02:00
Arve Knudsen
1d9f47b6a6 release_publisher: Fix Debian/RPM naming (#25276)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-02 11:01:40 +02:00
aidanmountford
f98e176d7b Templating: Add bult in __user {name, id, login, email} variable to templating system (#23378)
* Updated templating code to support the $__user variable to expose the current
userid, username, email and login.

Fixed the $__org variable as it was returning the user id instead of the ordId.

Updated the documentation to match

* Updated solution to retrieving $__user variables to pull directly from user record (thereby allowing future access to properties that
might not exist in the contextSvr).

Replicated this initialisation in the variables feature

Corrected typo's in documentation.

* Repaired typecheck issues.

* Updated patch to pull entirely from contextSrv without API calls.

* ... And removed the redundant comments.

* Updated documentation.
2020-06-02 08:47:54 +02:00
Alex Khomenko
10158c90e3 Search: uncheck dashboards after moved (#25256) 2020-06-02 09:36:04 +03:00
Kevin Retzke
51d1261a4b Elasticsearch: Adds cumulative sum aggregation support (#24820)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-06-01 23:55:15 +02:00
Arve Knudsen
b2745c3e23 CircleCI: Fix builds of forked PRs (#25272)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-01 20:32:18 +02:00
Steven Vachon
df7647b268 @grafana/e2e: improvements and dumb fixes for #25203 (#25269)
* Fix type definitions

* Fix typo

* Added support for fetch() within tests
2020-06-01 13:55:37 -04:00
Kyle Brandt
376a9d35e4 Azure Monitor: Change response to be dataframes (#25123)
note: This is just Azure Monitor within the Azure Monitor datasource (not insights, insights analytics, or log analytics yet).

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2020-06-01 12:37:39 -04:00
Arve Knudsen
07582a8e85 Chore: Fix various spelling errors in back-end code (#25241)
* Chore: Fix various spelling errors in back-end code
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>>
2020-06-01 17:11:25 +02:00
Marcus Andersson
13787294c6 Variables: fix so the variable picker will remember selected options between filtering (#25119)
* added tests to verify flow.

* refactoring picker reducer.

* made all the tests green.

* removed console.log's

* fixed toggle all and making sure the correct values are set on picker open.

* added more tets.

* refactored and added table tests.

* fixed so we select values from selectedValues instead of options.

* fixed so you can navigate and select even after you have filtered a variable.

* adding tests to verify flows when toggling by highlight.

* fixed so enter always selects value before closing.

* improved the code for tags.
2020-06-01 15:06:51 +02:00
Sofia Papagiannaki
8f72d621bf Docs: Add example for updating dashboard panel alert rule (#25260) 2020-06-01 15:53:22 +03:00
Steven Vachon
78febbbeef @grafana/e2e: screenshots and panel flow (#25203)
* Cleanup

* addPanel now supports (optional) custom dashboardUid

* addPanel now supports (optional) visualization name

* Added CLI option for updating screenshot fixtures

* Added support for console.* functions within tests

* Refactored screenshot command for greater simplicity

* addPanel now sets a unique title

* Updated lockfile
2020-06-01 08:48:23 -04:00
Arve Knudsen
01ecbae2ee CircleCI: Upgrade to Go 1.14.3 and Node 12.17.0 (#25215)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-01 11:21:57 +02:00
Ivana Huckova
e4832fa1ee Explore: Fix very narrow Query fields on mobile (#25148)
* Fix Loki and Prometheus query fields on mobile devices

* Add min widt to Elasticsearch Query Field

* Remove width for Elastic, works nicely without updating it

* Update public/app/plugins/datasource/loki/components/LokiQueryFieldForm.tsx

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

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2020-06-01 10:52:57 +02:00
Utkarsh Bhatnagar
3e5d721d9c Update GOVERNANCE.md (#25177) 2020-05-31 22:03:41 +02:00
Ryan McKinley
2760889501 Chore: cleanup after previous commits) 2020-05-31 07:45:39 -07:00
Ryan McKinley
53b9f325c0 OptionsUI: support string list (#25134) 2020-05-29 13:03:45 -07:00
Ryan McKinley
d526647005 Stats: include all fields (#24829) 2020-05-29 12:36:15 -07:00
Ryan McKinley
2a6ac88a73 QueryInspector: add common way to show the raw query (#25204) 2020-05-29 11:06:33 -07:00
David Kaltschmidt
c563633870 Fix strict null error 2020-05-29 20:01:01 +02:00
Ryan McKinley
57a9e422b0 FieldConfig: implement color picker (#24833) 2020-05-29 10:09:46 -07:00
Arve Knudsen
b703f21622 CircleCI: Upgrade grafana/build-container in order to fix arm32v7-musl (#25213)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-29 16:17:00 +02:00
David
57abf39f25 Logs: Use result range instead of timepicker range for log histogram (#25027)
* Logs: Use result range instead of timepicker range for log histogram

If a logs datasource does not send histogram data for the requested
time range, the logs model computes a timeseries based on the log row
counts, bucketed by an automcatically calculated time interval. Even
when this histogram time series did not span the whole requested time
range it was still rendered in the graph across the whole range, leaving
an empty area at its start. Users find this confusing and are lead to
believe their log data is missing.

This change fixes this by anchoring the start of the timeseries on the
first log row's timestamp from the result, and adds this smaller range
as `visibleRange` to the logs model and passes it through to the logs
component that optionally takes it into account to not render the empty
area.
The interval (bucket size) is also adjusted to account for a potentially
finer resolution on the shorter visible time interval.
The bucketsize multiplier was also changed from 10 to 20 to account for
the space between the chart's bars.

* Aligned visible range with buckets

* Extract bucket size calculation and add test
2020-05-29 15:39:13 +02:00
Arve Knudsen
f0eb124278 CircleCI: Upgrade build image (#25189)
* CircleCI: Upgrade build image
* CircleCI: Upgrade grabpl

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-29 11:39:30 +02:00
Torkel Ödegaard
3532d08cbf Docs: Update template variable overview to contain the preferred variable syntax (#25176)
* Update templates-and-variables.md

Fixes #13744

* Update templates-and-variables.md

* Update templates-and-variables.md

* Update docs/sources/variables/templates-and-variables.md

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

* Update docs/sources/variables/templates-and-variables.md

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

* Update docs/sources/variables/templates-and-variables.md

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

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-28 17:28:24 +02:00
Diana Payton
6191e08080 Docs: Update stat-panel.md (#25191) 2020-05-28 08:18:49 -07:00
Rémy G
07208d05ba Docs: Fixed invalid JSON (#25153) 2020-05-28 07:35:19 -07:00
Marcus Efraimsson
34d5ffa562 Configuration: Fix env var override of sections containing hyphen (#25178)
Fixes so that ini-sections containing hyphen is replaced with 
underscore. Fixes an issue with backend plugin settings.

Ref grafana/grafana-image-renderer#147
2020-05-28 16:17:55 +02:00
Arve Knudsen
3de3115dec CircleCI: Fix GitHub API rate limiting (#25188)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-28 16:11:20 +02:00
Ivana Huckova
9be7d5867f Add truthy rawQuery as we are interpolating raw query only (#25110) 2020-05-28 14:28:56 +02:00
Carl Bergquist
328ea80cca switches default value for security settings (#25175)
closes #25163
2020-05-28 10:38:22 +02:00
Torkel Ödegaard
3833aa416d Transformations: Fixed transformation crash issue (#25152)
* Transformations: Fixed transformation crash issue

* Updated
2020-05-28 08:06:24 +02:00
Diana Payton
6a4f45625c Update menu.yaml (#25159) 2020-05-27 12:54:47 -07:00
Alex Khomenko
4c02e9d7ea Storybook: update dark mode addon (#25151)
* Grafana UI: Remove dark mode addon from deps

* Grafana UI: Update lockfile
2020-05-27 18:03:00 +03:00
Lukas Siatka
9d04dfe41a Explore: adds table result dataframes sorting to get response columns order based on queries order (#25131)
* Chore: updates Explore result processor to sort dataframes based on their refId so results are displayed in a correct order

* Chore: adds types to Explore ResultProcessor getTableResult DataFrames
2020-05-27 16:45:53 +02:00
Diana Payton
da027bb49f Docs: Update stat-panel.md (#25147) 2020-05-27 07:08:32 -07:00
Lukas Siatka
03a5e5348d Chore: fixes jaeger duration value in cascader option label - using milliseconds now instead of microseconds (#25129) 2020-05-27 15:44:41 +02:00
Marcus Andersson
f795a1577c Fix: make sure that we the gauge panel can handle scenario with no data. (#24938)
* make sure that we can handle the empty data scenario in the gauge.

* reverted Guague.tsx and set default values on no data.
2020-05-27 14:51:15 +02:00
DanielLyons178
47b2650a99 Postgres: Add postgres versions 11 and 12 to version selector (#24750)
Closes #24320
2020-05-27 13:51:34 +02:00
Erik
3a63044f19 CloudWatch: Add Route53 DNSQueries metric and dimension (#25125)
Co-authored-by: Ilya Stoliar <52413756+ilyastoli@users.noreply.github.com>
2020-05-27 12:00:25 +02:00
Hugo Häggmark
4cd7a88e59 Chore: updates latest.json to 7.0.1 (#25112) 2020-05-27 06:52:40 +02:00
Ilya Stoliar
d3a23a617f CloudWatch: Added AWS RoboMaker metrics and dimensions (#25090) 2020-05-26 23:58:57 +02:00
Kyle Brandt
81e3f93677 Backend Readme: Add section on avoiding simplejson (#25116) 2020-05-26 14:32:00 -04:00
Kyle Brandt
fcb9dcb0b8 AzureMonitor: Types for front-end queries (#24937) 2020-05-26 10:52:33 -04:00
Sofia Papagiannaki
139be3d7ba grafana/toolkit: Modify close milestone task to remove label from more than 100 pull requests and add dry run option (#25108)
* Fix close milestone to remove label from all the required pull requests

There used to be a limit to 100 pull requests.

* Add dry run option in close-milestone task
2020-05-26 17:26:16 +03:00
Arve Knudsen
170abf2e3d Build container: Base build image on Debian Stretch (#24967)
* scripts/build/ci-build: Fix Makefile
* scripts/build/ci-build: Base Docker image on Debian Stretch
* scripts/build/ci-build: Modify Dockerfile for fewer RUN directives
2020-05-26 15:45:49 +02:00
Zoltán Bedi
7f6b75af70 Explore: fix update url on mode change (#25084) 2020-05-26 14:54:18 +02:00
Hugo Häggmark
b1cee7a424 Update CHANGELOG.md
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-26 14:50:43 +02:00
Hugo Häggmark
9648a09a8b Update CHANGELOG.md
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-26 14:50:43 +02:00
Hugo Häggmark
4af16e7673 Update CHANGELOG.md
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-26 14:50:43 +02:00
Hugo Häggmark
012fe80607 Update CHANGELOG.md 2020-05-26 14:50:43 +02:00
Torkel Ödegaard
ac38dd872d PluginsListPage: More plugins button should open in new window (#24635)
* PluginsListPage: More plugins button should open in new window

Fixes #24622

* Updated snapshot
2020-05-26 09:33:10 +02:00
Peter Holmberg
7e5f525473 Dashboard: Get panels in collapsed rows (#25079) 2020-05-26 08:56:21 +02:00
Patrick Hemmer
231a32c4a3 Postgres: Fix add button (#25087)
Previously the add button on the postgres UI would break after the first usage. This was due to the button not being fully reset after use.
2020-05-26 06:38:49 +02:00
Steven Vachon
2724f05d5e @grafana/e2e: Avoid Cypress' issue with JSON file reporter (#25092)
https://github.com/cypress-io/cypress/issues/6406
2020-05-25 19:28:35 -04:00
Steven Vachon
68154cf98d @grafana/e2e: generate JSON report file (#25033)
* Output JSON report from Cypress

* Updated lockfile
2020-05-25 15:07:28 -04:00
Andrew Burian
a0e5f51d05 Alerting: Remove message from PagerDuty summary field (#24813)
closes #16930
2020-05-25 21:01:29 +02:00
Marcus Efraimsson
374fbdf9b6 Docker: Fix nightly vulnerability scan (#25083)
* Run each trivy scan as a separate step

* Fail build only on high and critical vulnerability

* Remove temporary job to use nightly schedule only
2020-05-25 18:56:35 +02:00
Lukas Siatka
7bf5b395b6 Chore: fixes throwing errors on 200 response with influxdb datasource (#24848)
* Chore: fixes throwing errors on 200 response with influxdb datasource

* Chore: changes influxdb error prefix from error to influxdb error
2020-05-25 17:56:16 +02:00
Sofia Papagiannaki
1e4e2642bf Fix AWS WAF and AWS DDoSProtection metrics (#25071) 2020-05-25 18:14:28 +03:00
kay delaney
f5a9b23d83 Explore/Table: Keep existing field types if possible (#24944)
* Explore/Table: Keep existing field types if possible
2020-05-25 15:54:24 +01:00
Hugo Häggmark
83d933d010 DashboardLinks: variables are resolved and limits to 100 (#25076) 2020-05-25 15:47:11 +02:00
ilyastoli
6a7cbd968f CloudWatch: Added AWS DataSync metrics and dimensions (#25054)
* CloudWatch: Added AWS DataSync metrics and dimensions
2020-05-25 16:05:52 +03:00
Peter Holmberg
0da72131b9 Table: Make last cell value visible when right aligned (#24921)
* add some padding to accommodate for vertical scrollbar

* use theme spacing

* Move padding to inner div and make it use actual scrollbar width

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-05-25 14:26:44 +02:00
Peter Holmberg
880a11773b Transform: Display correct field name when using reduce transformation (#25068)
* fix field names

* add dataframes argument and fix tests
2020-05-25 14:26:03 +02:00
Torkel Ödegaard
923faf78f1 PanelEditor: Overrides name matcher still show all original field names even after Field default display name is specified (#24933)
* FieldConfigOverrides: Should not apply defaults in override UI options

* Missed change
2020-05-25 14:05:43 +02:00
Torkel Ödegaard
3a469f6ca2 MoveDashboard: Fix for moving dashboard caused all variables to be lost (#25005)
* MoveDashboard: Fix moving caused all variables to be lost

* fix typescript issue
2020-05-25 13:33:44 +02:00
Lukas Siatka
60e7b63c33 Loki/Prometheus: updates addLabelToQuery method to prevent it from adding labels outside of selector when using Loki datasource (#25059)
* Chore: updates add label to query method in prometheus datasource to fix loki label insert

* Chore: adds addLabelToQuery test covering differences between adding label to loki vs non-loki queries

* Chore: adds an additional comment to addLabelToQuery

* Chore: renames isLokiDatasource to hasNoMetrics in addLabelToQuery
2020-05-25 12:23:35 +02:00
Dominik Prokop
9a59f387d9 Organize transformer: Use display name in field order comparer (#24984)
* Use display name in field order comparer

* Post review
2020-05-25 11:54:33 +02:00
Dominik Prokop
10041bca99 Chore: Add frontend platform ownership (#25066) 2020-05-25 11:42:43 +02:00
Zoltán Bedi
dca03a3b4a Explore: fix word break in type head info (#25014)
fixes #24154
2020-05-25 11:38:50 +02:00
Sofia Papagiannaki
a1ee62877e Stackdriver: Fix creating Service Level Objectives (SLO) datasource query variable (#25023)
* Fetch SLOs on SLO service change

* Prevent querying for SLOs if SLO service is empty

Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
2020-05-25 12:34:44 +03:00
Ryan McKinley
81d1f6653f Download CSV: format the dates (#24992)
* export formatted dates

* remove if(true)

* display processor
2020-05-25 11:12:53 +02:00
Dominik Prokop
ad870c07cf DataLinks: Bring back variables interpolation in title (#24970) 2020-05-25 10:24:50 +02:00
Lukas Siatka
8c1307e704 Explore: refactors LogRowContextProvider to get rid of unnecessary dimensions (#24899)
* Chore: refactors LogRowContextProvider to get rid of unnecessary array dimensions

* Chore: removes unnecessary array dimensions from LogRowContextProvider test

* Chore: changes LogRowContextProvider test to use jest mock

* Chore: updates LogRowContextProvider test

* Chore: removes unnecessary wrapper variable in LogRowContextProvider test
2020-05-25 03:44:37 +02:00
Ron Klein
57273a8d0c typo (#25050)
ENABLE_UPD_LISTENER ==> ENABLE_UDP_LISTENER
2020-05-24 18:18:03 +02:00
Chad
4b8c4b2826 Fix URL of CLA in CONTRIBUTING doc (#24962) 2020-05-23 12:46:20 +02:00
Josh Soref
a5deabbe53 Chore: spelling - grafana-data (#24436) 2020-05-22 20:06:39 +02:00
Tobias Skarhed
5f4526ca64 PanelMenu: Make menu disappear on button press (#25015)
* Fix button press outside

* Add a prop to toggle button press

* Add comments

* Remove public
2020-05-22 16:20:48 +02:00
Tobias Skarhed
84031649e3 LoginPage: Fix hover color for service buttons (#25009)
* Set explicit hover color

* Use cx
2020-05-22 16:20:28 +02:00
Carl Bergquist
b5bf54f5ac updates broken link to time range docs (#25008) 2020-05-22 15:17:19 +02:00
Ivana Huckova
4d18bda2e1 Prometheus: Fix recording rules expansion (#24977)
* First pass solution

* Refactor solution

* Add test coverage, update tests

* Fix behaviour for multiple labels, add test for this

* Add recordin rules to devenv prometheus

* Update devenv/prometheus2 instead of devenv/prometheus

* Add newlines

* Fix label matching if labels include comma, add test coverage

* Refactor

* Refactor, simplify
2020-05-22 15:16:01 +02:00
kay delaney
4f1bbdfc0a Chore: Add IAM to list of ignored terms for codespell (#25013) 2020-05-22 10:56:11 +01:00
Stephanie Closson
b7d5912ca8 Chore: Toolkit fixes to use toolkit for release (#24951)
* Various fixes and requests for toolkit:
1) Added toolkit to the alpine docker image, so we can get latest fixes without having to re-release
2) Removed cp from e2d docker image
3) Change github client to allow to specify an owner so it's not "grafana" only
4) Toolkit refers to grafana-ui and grafana-data "next", rather than canary

* added toolkit to e2e docker image

* Added tools to the e2e image for building/deploying oracle

* added shasum

* removing toolkit from images
2020-05-21 09:41:15 -06:00
Diana Payton
ff465396ab Docs: added content to _index.md pages (#24949) 2020-05-21 08:31:06 -07:00
Diana Payton
a85e05cc23 Docs: Fixed broken links (#24946)
* fixed links

* Update menu.yaml
2020-05-21 07:19:35 -07:00
kay delaney
e1f4287f70 Datasource/CloudWatch: Better handling of stats grouping (#24789)
* Datasource/CloudWatch: Better handling of stats grouping
2020-05-21 15:18:09 +01:00
Ivana Huckova
44ca05272a Query history: Add keyboard shortcut support for commenting (#24736)
* Shorten filter history label

* Add keyboard shortcuts for update comment in Query history

* Add test coverage for new keyboard shortcuts

* Update changed aria-label in tests

* Add test scenario for enter and ctr key
2020-05-21 14:51:18 +02:00
Arve Knudsen
21425f7e26 CircleCI: Fix typos (#24976)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-21 13:28:36 +02:00
Andrej Ocenas
8b267c94ec CloudWatch: Add docs for Logs (#23651)
* First draft

* Update docs/sources/features/datasources/cloudwatch.md

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

* Update docs/sources/features/datasources/cloudwatch.md

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

* Update docs/sources/features/datasources/cloudwatch.md

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

* Update docs/sources/features/datasources/cloudwatch.md

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

* Apply suggestions from code review

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

* More additions and changes to CloudWatch docs

* Branding changes

* Update documentation references

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: kay delaney <kay@grafana.com>
2020-05-21 10:40:38 +02:00
Arve Knudsen
d4d9af9c96 CircleCI: Upgrade build pipeline tool (#24968)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-21 10:26:16 +02:00
Zoltán Bedi
77633db00e Dashboard: Render PanelChrome on refresh (#24940)
Fixes #23306
2020-05-21 09:55:58 +02:00
d10n
0681729e92 Docs: Fix grammar where your should be you're (#24966) 2020-05-21 09:43:31 +02:00
Steven Vachon
4c62689bc2 @grafana/e2e: fixes (#24960)
* Resolve Cypress bin path

... instead of expecting it to be in a place that it may not be, depending on de-duping/flattening of nested dependencies

* Remove dashboard before removing datasource

... it makes more sense and it fixes random issues, perhaps something to do with how the backend is implemented.

* Updated lockfile
2020-05-20 20:49:36 -04:00
Ryan McKinley
9edd8b7c7e Toolkit: update the artifact download calculation (#24828) 2020-05-20 15:59:25 -07:00
Torkel Ödegaard
8aedf81133 Graph: Legend decimals now work as expected (#24931)
* Graph: Legend decimals now work as expected

* removed new test that I could not get green
2020-05-20 17:28:41 +02:00
Mohit Nain
6099398c37 Docs: Improve wording in field configuration options docs (#24909)
* Update docs/sources/panels/field-configuration-options.md

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-20 16:53:43 +02:00
Mohit Nain
25bdadab04 Fix language in docs/sources/panels/queries.md
* Update docs/sources/panels/queries.md

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-20 16:52:49 +02:00
Hugo Häggmark
0b5d818771 PanelInspector: hides unsupported data display options for Panel type (#24918) 2020-05-20 14:15:06 +02:00
Hugo Häggmark
460847f3ed Panel: shows correct panel menu items in view mode (#24912) 2020-05-20 13:56:28 +02:00
Dominik Prokop
bb099cb141 PanelEditor Fix missing labels and description if there is only single option in category (#24905) 2020-05-20 13:54:42 +02:00
kay delaney
0f174de760 Datasource/CloudWatch: Field suggestions no longer limited to prefix-only (#24855) 2020-05-20 12:25:21 +01:00
Ivana Huckova
966b0a97b1 Explore: Fix wrap lines toggle for results of queries with filter expression (#24915)
* Add pre-wrap to highlighter only for wrapped lines option

* Remove duplicated styling
2020-05-20 13:18:24 +02:00
Henry Muru Paenga
01de35d4db Jaeger datasource typo (#24920) 2020-05-20 13:14:17 +02:00
Marcus Andersson
731deb9628 Fix: adding missing icons in the elastic query editor and the single stat editor. (#24914)
* fixed issue that the icon was missing in es group by.

* fixed missing icon in the single stat value mappings.
2020-05-20 12:04:48 +02:00
Ivana Huckova
4f6fb2d46e LogsPanel: Fix scrollbar (#24850)
* Fix scrolling, besides context (wip)

* Remove autoHide

* Revert "Remove autoHide"

This reverts commit 3572718cab.

* Revert "Fix scrolling, besides context (wip)"

This reverts commit 8e11d89612.

* Fix scrolling in Logs Panel

* Rename passed prop to disableCustomHorizontalScroll
2020-05-20 11:20:45 +02:00
Lukas Siatka
de46dc7af0 Explore: adds an ability to exit log row context with ESC key (#24205)
* Chore: adds event listeners allowing to exit log row context with ESC key

* Chore: updates LogRows styles to prevent it from rendering context provider inappropriately

* Revert "Chore: updates LogRows styles to prevent it from rendering context provider inappropriately"

This reverts commit 59b06424c4.
2020-05-20 10:42:35 +02:00
Hugo Häggmark
5a6026a8c0 PanelInspect: makes sure Data display options are shown (#24902) 2020-05-20 10:07:35 +02:00
Alcarin
ad589c3201 Docs: InfluxDB variable in query (#24861)
First example of the use of a variable in influxdb query should not use a regex query but a simple one. A first time influxdb user (like me) could think that the proper way to use variable in a dashboard template is to use regex query, but it's not true. Also "=~ /$region/" may be erroniously thought identical to "= '$region'" while instead "=~ /^$region$/" is identical to "= '$region'", and for that type of query is useless (if not slower) use a regex query.
2020-05-20 10:03:08 +02:00
Mohit Nain
ead259f26d Docs: Couple of minor tweaks for better readability (#24908) 2020-05-20 10:01:25 +02:00
Kamal Galrani
e2368e623e Dashboard/Links: Fixes dashboard links by tags not working (#24773)
* Fixes dashboard links by tags not working

* removes code duplication
2020-05-20 09:54:04 +02:00
Ryan McKinley
793299af14 Transformations: Allow numbers (#24752) 2020-05-20 09:31:00 +02:00
Ivana Huckova
2f28823a42 Docs: Remove beta text from What is new in Grafana 7 (#24860)
* Remove beta text from What is new in Grafana 7

* Update docs/sources/guides/whats-new-in-v7-0.md

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

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-20 09:16:15 +02:00
Richard Hartmann
ec08881e81 GOVERNANCE.md: Fix broken links, add more links (#24817)
Signed-off-by: Richard Hartmann <richih@richih.org>
2020-05-20 09:16:00 +02:00
Diana Payton
95fdae6499 Docs: Update transformations.md (#24869) 2020-05-20 09:14:37 +02:00
Caleb Collins-Parks
5d23f0a295 Docs: fix order of arguments (#24888) 2020-05-20 09:13:51 +02:00
Diana Payton
a677cac74f Docs: Update index.md (#24887) 2020-05-20 09:13:24 +02:00
Diana Payton
22f2961cfd Docs: Update menu.yaml (#24867) 2020-05-20 09:12:56 +02:00
Victor Coutellier
3a0f2dc160 Alerting: Adds support for multiple URLs in Alertmanager notifier (#24196)
* Alerting: Adds support for multiple URLs in Alertmanager notifier

Adds support for multiple URLs in Alertmanager notifier following
alertmanager documentation for high availability setup.
Update the documentation for alertmanager notifier.

Closes #24195

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: bergquist <carl.bergquist@gmail.com>
2020-05-20 08:49:53 +02:00
crazyscience
50b2f26d80 Fixed grammar error (#24903) 2020-05-20 08:17:27 +02:00
john159753
71271ea5f4 Docs: The URL variables url returned a 404 on Data Links page (#24870)
* The URL variables link returned a 404

Im not quite sure if what i put down is the right syntax - but im trying to help and get that link updated to 
https://grafana.com/docs/grafana/latest/variables/url-variables/

* Update docs/sources/linking/data-links.md

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

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-19 13:18:58 -07:00
Diana Payton
37ae7c3af1 Docs: Update thresholds.md (#24826) 2020-05-19 07:08:24 -07:00
Zoltán Bedi
29afc2feb8 Explore: fix undo in query editor (#24797)
* Explore: fix undo in query editor

* Add e2e test for regression
2020-05-19 15:41:52 +02:00
Carl Bergquist
c62591e77b Provisioning: Makes file the default dashboard provisioner type (#24856)
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-19 15:01:04 +02:00
kay delaney
2f01f1320f Datasource/CloudWatch: Makes CloudWatch Logs query history more readable (#24795)
Now just displays query expression rather than stringified JSON
2020-05-19 11:43:43 +01:00
Pandelis Zembashis
cbf68c8ecc awsie -> advise (#24846) 2020-05-19 12:40:25 +02:00
Andrej Ocenas
220590cb54 Docs: Trace view, jaeger and zipkin (#24297)
* Add docs for trace view, jaeger and zipkin

* Update docs/sources/features/datasources/jaeger.md

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

* Update docs/sources/features/datasources/jaeger.md

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

* Update docs/sources/features/datasources/jaeger.md

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

* Update docs/sources/features/datasources/zipkin.md

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

* Update docs/sources/features/datasources/zipkin.md

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

* Update docs/sources/features/datasources/zipkin.md

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

* Update docs/sources/features/datasources/zipkin.md

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

* Update data source docs

* Update docs/sources/features/explore/index.md

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

* Split trace UI description across multiple sections

* Update docs/sources/features/datasources/jaeger.md

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

* Update docs/sources/features/datasources/jaeger.md

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

* Add screenshots

* Fix image params

* Fix params

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-19 12:26:09 +02:00
Rob Russo
9fa551cc32 Alerting: updating the victorops alerter to handle the no_data alert type (#23761) 2020-05-19 09:58:57 +02:00
Tobias Skarhed
54ee4f4f72 Migration: Select org (#24739)
* Add SelectoOrgPage

* Remove old code

* Remove import
2020-05-19 09:55:04 +02:00
Ivana Huckova
f0a161807a Docs: Remove beta info from what's new in 6.7 (#24787)
* Remove beta info from what's new in 6.7

* Remove white space edits
2020-05-19 09:53:03 +02:00
Torkel Ödegaard
b709f6ad71 TablePanel: Adding sort order persistance (#24705)
* TablePanel: Adding sort order persistance

* adds panel test dashboard for table panel
2020-05-19 09:23:25 +02:00
Marcus Olsson
6b29c11776 Add guide for streaming data sources (#24786) 2020-05-19 09:05:48 +02:00
Marcus Olsson
c5950d6380 Update plugin metadata (#24791) 2020-05-19 09:05:38 +02:00
Agnès Toulet
e79b2a3f66 Core: add location option to parse timerange (#24796)
* Core: add location option to parse timerange

* Extensions: add go-datemath to not break Enterprise
2020-05-19 08:52:43 +02:00
Sofia Papagiannaki
a40760a434 Fix spelling (#24838) 2020-05-19 09:50:55 +03:00
Andrew Rodgers
ce7b142d64 Toolkit: Update tsconfig to clear linter errors (#24824) 2020-05-18 16:00:02 -07:00
Amal
820eb5c80e Docs: Correcting abbreviations (#24748)
* Correction in abbreviation

* Minor correction in abbreviation

* Correcting abbreviation

* Correction in abbreviation

* Correcting abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Update stack_guide_graphite.md

* Update whats-new-in-v4-6.md

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Update ldap.md

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Correction in abbreviation

* Update docs/sources/guides/whats-new-in-v5.md

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

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-18 13:56:23 -07:00
Diana Payton
62a233c9bf Docs: Add 7.0 topics to menu (#24805)
* Update menu.yaml

* Update menu.yaml

* Update whats-new-in-v7-0.md

* Revert "Update whats-new-in-v7-0.md"

This reverts commit ca7a0e5a16.

* Update menu.yaml

* fixing links

* added data-links to menu, deleted old topic

* Update docs/sources/menu.yaml

Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>

* Update menu.yaml

* Update menu.yaml

* Delete links.md

Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>
2020-05-18 12:56:18 -07:00
Daniel Lee
6aeb00a859 docs: fixes ambiguous links (#24811) 2020-05-18 20:47:31 +02:00
Arve Knudsen
157c79872d Update latest.json (#24804)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-18 20:34:20 +02:00
Julien Pivotto
d4d51db21b Governance: Move projects to a sub-list (#24809)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-05-18 20:06:48 +02:00
Richard Hartmann
9f019d5603 Give Grafana a public governance (#24802)
Signed-off-by: Richard Hartmann <richih@richih.org>
2020-05-18 19:26:35 +02:00
Boyko
1e74037eae React: refactor away from unsafe lifecycle methods (#21291)
* refactor aliasBy and PopoverCtrl components

* refactor Aggregations component

* refactor MetricSelect component

* refactor UserProvider

* popoverCtr: remove redundant logic

* simplified the MetricsSelect a bit.

* skipping testing of internal component logic.

* changed to componentWillMount.

* changed elapsed time to a functional component.

* rewrote the tests.

* fixed missing test title.

* fixed a tiny issue with elapsed time.

* rename of field.

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2020-05-18 18:03:29 +02:00
Marcus Efraimsson
44fae66bc0 Grafana v7.0 changelog update (#24737)
* Grafana v7.0 changelog update

* enterprise changelog

* docs: white-labeling login title and subtitle

* Add backend plugins breaking change regarding plugin signing

* Update CHANGELOG.md

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

* Update docs/sources/installation/upgrading.md

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

* Update docs/sources/installation/upgrading.md

Co-authored-by: Leonard Gram <leo@xlson.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2020-05-18 17:52:59 +02:00
Marcus Andersson
cadadb6290 Docs: fixing link issue with time range controls in "what's new". (#24794) 2020-05-18 17:17:59 +02:00
Marcus Efraimsson
23610fbc3b Docs: Update index page with link to What's new in v7.0 (#24793) 2020-05-18 17:15:28 +02:00
Diana Payton
3818e521f1 Docs: Update menu.yaml (#24792) 2020-05-18 17:14:48 +02:00
Josh Soref
4db782fd5b ci-build: spelling (#24386) 2020-05-18 16:41:06 +03:00
zhulongcheng
9ccdd4b824 TSDB: show influxdb error message (#24393)
Closes #21647

Signed-off-by: zhulongcheng <zhulongcheng.dev@gmail.com>
2020-05-18 13:56:23 +02:00
Arve Knudsen
cc6df0ac6b CloudWatch: Clean up code (#24666)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-18 12:25:58 +02:00
Alex Khomenko
7b6deef46d Search: make anchor full-height (#24783) 2020-05-18 11:31:10 +03:00
Rydez
de1ce049e8 Docs: Align naming with Grafana.com (#24745)
* Rename to Grafana Cloud Account

* Rename 'hosted x'
2020-05-18 10:23:12 +02:00
Šimon Podlipský
9106f2f68a Makefile: Build should build bundled plugins 2020-05-18 10:22:45 +02:00
Ryan McKinley
9622536a98 Dashboard: Remove isTimezoneUtc (#24754) 2020-05-18 10:21:21 +02:00
Daniel Lee
2b23f81929 docs: add links and updates to whats new 7.0 (#24715)
* docs: add links and updates to whats new 7.0

* Apply suggestions from code review

Co-authored-by: Jessica <4947705+jessabe@users.noreply.github.com>
Co-authored-by: Carl Bergquist <carl@grafana.com>

* Update docs/sources/guides/whats-new-in-v7-0.md

Co-authored-by: Jessica <4947705+jessabe@users.noreply.github.com>

* docs: link for time zones in what's new

* Backend plugins update

Co-authored-by: Jessica <4947705+jessabe@users.noreply.github.com>
Co-authored-by: Carl Bergquist <carl@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-05-18 09:44:54 +02:00
Kamal Galrani
7b18b101b4 Dashboard/Links: Fixes open in new window for dashboard link (#24772)
* fixes target in dashboard link

* Update DashboardLinks.tsx

* Revert "Update DashboardLinks.tsx"

This reverts commit 2b23db8dc4.
2020-05-18 09:36:31 +02:00
Kamal Galrani
319051c70e Capitalize Grafana in test email notification (#24770) 2020-05-17 13:57:43 +02:00
Diana Payton
150d9b2a77 Docs: fixing links (#24757) 2020-05-15 14:33:37 -07:00
Diana Payton
0e53b15375 Docs: Update links for 7.0 (#24751)
* update menu

* updated alert list

* Update alert-list-panel.md

* Update alert-list-panel.md

* Update bar-gauge-panel.md

* Delete bar_gauge.md

* Delete dashlist.md

* Update dashboard-list-panel.md

* deleted old panels

* Update gauge-panel.md

* Update graph-panel.md

* Update heatmap.md

* Update logs-panel.md

* Update news-panel.md

* Updated stat panel

* Update table-panel.md

* Update text-panel.md

* Fixed broken links

* Update _index.md

* Update alerts-overview.md

* Update add-a-panel.md

* Update field-configuration-options.md

* removed beta text

* Update inspect-panel.md

* Update panel-editor.md

* Update thresholds.md

* Update transformations.md

* Update _index.md

* Update _index.md

* Update _index.md

* Update _index.md

* Update _index.md

* Update transformations.md
2020-05-15 13:58:39 -07:00
Diana Payton
26964b383f Docs: Update time range controls (#24709)
* moved file and updated menu

* Delete timerange.md

* Update menu.yaml

* Update time-range-controls.md

* fixed links

* Update time-range-controls.md

* content updates

* Update time-range-controls.md

* Apply suggestions from code review

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

* Update docs/sources/dashboards/time-range-controls.md

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

* Update time-range-controls.md

* Update docs/sources/dashboards/time-range-controls.md

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

* Update docs/sources/dashboards/time-range-controls.md

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

* Update docs/sources/dashboards/time-range-controls.md

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

* Update time-range-controls.md

Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2020-05-15 09:53:51 -07:00
Diana Payton
f8801952bf Docs: New panel editor documentation (#24711)
* Create panel-editor.md

* content updates

* Update panels-overview.md

* Update panel-editor.md

* Update panel-editor.md

* Update menu.yaml

* Update whats-new-in-v7-0.md

* Update docs/sources/panels/panel-editor.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/panel-editor.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/panel-editor.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/panel-editor.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/panel-editor.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/panel-editor.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update _index.md

* Update docs/sources/panels/panel-editor.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/panel-editor.md

Co-authored-by: sarlinska <sarlinska@gmail.com>

* Update docs/sources/panels/panel-editor.md

Co-authored-by: sarlinska <sarlinska@gmail.com>

* Update docs/sources/panels/panel-editor.md

Co-authored-by: sarlinska <sarlinska@gmail.com>

* Update docs/sources/panels/panel-editor.md

Co-authored-by: sarlinska <sarlinska@gmail.com>

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: sarlinska <sarlinska@gmail.com>
2020-05-15 09:49:30 -07:00
Diana Payton
2a54398e43 Docs : Add heatmap visualization topic (#24456)
* Create heatmap.md

* Update heatmap.md

* Docs: add missing heatmap fields description.

* Update heatmap.md

Co-authored-by: Alexander Zobnin <alexanderzobnin@gmail.com>
2020-05-15 09:06:55 -07:00
Diana Payton
5a5575ef38 Docs: Create gauge-panel.md (#24698)
* Create gauge-panel.md

* Create field-configuration-options.md

* Revert "Create field-configuration-options.md"

This reverts commit 65e62d8d1f.

* Update gauge-panel.md

Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
2020-05-15 08:36:08 -07:00
fuku
5ddc72fb95 Docs: fix using oauth login with OneLogin (#24722) 2020-05-15 08:25:58 -07:00
Arve Knudsen
e598664be1 CircleCI: Upgrade build pipeline tool (#24740)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-15 17:16:04 +02:00
Ivana Huckova
3cdbeffdce Add displayname to TextArea component (#24734) 2020-05-15 16:20:19 +02:00
Alexander Zobnin
0fc9ad1d67 Docs: guide how to set up SAML with Okta (#24613)
* Docs: Okta SAML guide

* Apply suggestions from code review

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

* Docs: review fixes

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-15 16:37:35 +03:00
Arve Knudsen
7a44034d1c CircleCI: Upgrade build pipeline tool (#24732)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-15 14:15:09 +02:00
Arve Knudsen
bd42407620 CircleCI: Fix test release pipeline (#24701)
* CircleCI: Fix test release pipeline
* CircleCI: Ensure that we don't release NPM packages when testing
2020-05-15 10:02:50 +02:00
Torkel Ödegaard
7fcf2615e1 Metrictank: Fixed updated schema and dedupe strategy (#24685)
* Metrictank: Fixed updated schema and dedupe strategy

* revert schema change

* fix
2020-05-15 07:42:29 +02:00
Ryan McKinley
b73d237bf8 Query: do not require datasource name and id (#24718) 2020-05-14 20:05:16 -07:00
Marcus Andersson
6a0abf895e Docs: generated a 7.0 version of the packages reference docs. (#24708)
* fixes so we match the transformer based on name properly.

* changed the signature on the FieldMatcher.

* introduced a names option so you can filter in name specificly.

* changed so the matcher UI uses the new options format.

* moved the exported functions together.

* changing editors a bit.

* made the filter by name work with both regex and name filtering.

* fixed failing tests and make sure we always parse regex the same way.

* removed unused code.

* simplified to make the existing field overrides still working.

* fixed issue reported by hugo.

* added tests for the name matcher.

* added tests for filter by name.

* added more tests.

* generated new version of the packages docs.

* fixed spelling error.

* regenerated the docs.
2020-05-14 21:34:59 +02:00
Diana Payton
713fe39b1f Docs: Add graph panel (#24460)
* Create graph-panel.md

* Update _index.md

* Create panels-overview.md

* Update graph-panel.md

* Applied Torkel's edits

* Update graph-panel.md

* Update panels-overview.md

* Update _index.md

* Update graph-panel.md

* Create add-a-panel.md

* Update add-a-panel.md

* Update add-a-panel.md

* Revert "Update add-a-panel.md"

This reverts commit 6d51ee8712.

* Update add-a-panel.md

* Update graph-panel.md
2020-05-14 12:24:26 -07:00
Marcus Andersson
98d5633601 Fix: changing so we are using date/time values in UTC during test. (#24707) 2020-05-14 20:59:42 +02:00
Marcus Andersson
96f26cbd5b Transform: fixes so we match the field based on the proper name. (#24659)
* fixes so we match the transformer based on name properly.

* changed the signature on the FieldMatcher.

* introduced a names option so you can filter in name specificly.

* changed so the matcher UI uses the new options format.

* moved the exported functions together.

* changing editors a bit.

* made the filter by name work with both regex and name filtering.

* fixed failing tests and make sure we always parse regex the same way.

* removed unused code.

* simplified to make the existing field overrides still working.

* fixed issue reported by hugo.

* added tests for the name matcher.

* added tests for filter by name.

* added more tests.
2020-05-14 20:48:43 +02:00
kay delaney
0e8638ec92 Datasource/CloudWatch: Allows a user to search for log groups that aren't there initially (#24695)
Closes #24554
2020-05-14 19:41:38 +01:00
Andrej Ocenas
bc8c05137b CloudWatch/Logs: Fix query error when results are sparse (#24702) 2020-05-14 20:36:06 +02:00
Peter Holmberg
bf1e5aa16c PanelInspect: Make header names reflect the field name in the exported CSV file (#24624)
* fix header names and filename

* use panel title as filename

* add frame argument

* escaping double quotes

* wrapping header name in  quotes

* Fix replace

* Add test for csv double quotes escaping

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-14 20:14:23 +02:00
Robby Milo
ce8b5030c1 Docs: fix links (#24704)
* fix broken links

* fix another link
2020-05-14 20:08:32 +02:00
kay delaney
1b29d3460e Datasource/CloudWatch: Handle invalidation of log groups when switching datasources (#24703) 2020-05-14 20:06:20 +02:00
Lukas Siatka
d3a8f6d026 Explore: fixes loading more logs in logs context view (#24135) 2020-05-14 18:55:30 +02:00
Tobias Skarhed
e4cbeb5cb3 Docs: Panel inspector release highlights (#24686)
* Add Panel inspector highlight

* Update CHANGELOG.md

* Update CHANGELOG.md

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

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-14 18:23:17 +02:00
Diana Payton
59ffe4f413 Docs: Rewrite alerting docs (#24653)
* updated menu and added alerts-overview.md

* Delete metrics.md

* Update menu.yaml

* changed file name and updated menu

* Update create-alerts.md

* added file and link

* Create view-alerts.md

* added content and links

* Update pause-an-alert.md

* added content and links

* edited notification content

* updated link

* Update docs/sources/alerting/create-alerts.md

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

* Applied marcus e. edits

* Update docs/sources/alerting/alerts-overview.md

Co-authored-by: Carl Bergquist <carl@grafana.com>

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Carl Bergquist <carl@grafana.com>
2020-05-14 09:19:15 -07:00
Diana Payton
28344c145f Docs: Add field config documentation (#24647)
* Create field-config.md

* Update field-config.md

* updated intros

* Update field-config.md

* changed file name

* Update whats-new-in-v7-0.md

* added links and content

* Update docs/sources/panels/field-configuration-options.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/field-configuration-options.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/field-configuration-options.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/field-configuration-options.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/field-configuration-options.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update field-configuration-options.md

* Update field-configuration-options.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-14 09:18:56 -07:00
Marcus Olsson
6efa3f95ae Add warning about plugin.json docs being auto-generated (#24692) 2020-05-14 17:52:13 +02:00
Lukas Siatka
ee12f5e742 Strict null fixes: updates return type of getMessageFromError, fixes QueryOperationAction props (#24690)
* Chore: updates getMessageFromError return type

* Chore: updates the position of incorrectly placed bang operator

* Chore: updates typing on dropdown typeahead directive

* Chore: updates QueryOperationAction props to require title

* Revert "Chore: updates QueryOperationAction props to require title"
2020-05-14 17:08:52 +02:00
David
25e1238022 Logs: Fix total bytes process calculation (#24691)
- log stats for Loki are per query
- this change tracks the query stats by refId, preventing the summing of
    the same stats across multiple series of the same response.
2020-05-14 16:27:26 +02:00
Jess
405145fdd3 @grafana/ui: Checkbox docs (#23141)
* Add "When to use" info to Checkbox.mdx

Added info about how checkboxes generally work and when to use another component instead.

* Replaced words with proper component names

* Update Checkbox.mdx

Elaborate on explanations. Add examples for how to use checkboxes the user-friendliest way.

* Apply suggestions from code review

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-14 16:17:34 +02:00
Agnès Toulet
7fbed90b89 Datasources: fix pre styles (#24687) 2020-05-14 16:04:53 +02:00
Torkel Ödegaard
c59f5436c0 TablePanel: Do not include angular options in options when switching from angular panel (#24684) 2020-05-14 16:03:27 +02:00
Andrej Ocenas
2b9cc8ba30 CloudWatch/Logs: Fix autocomplete after by keyword (#24644) 2020-05-14 15:52:47 +02:00
Marcus Efraimsson
0c8ee5b2c9 Add deprecation note about the unofficial first version of backend plugins (#24675) 2020-05-14 15:37:44 +02:00
David
01bbcf4eea Editor: New line on Enter, run query on Shift+Enter (#24654)
* Editor: New line on Enter, run query on Shift+Enter

- default Enter behavior on query editor fields should be a new line
- special behavior should require a special key: running a query is now
done on Shift-Enter
- Plugins order had to be changed because when typeahead is shown, Enter
is accepting the suggestion

* Run with ctrl-enter, hint in query placeholder

* Fix Kusto field behavior for Enter

* Fix Kusto field behavior for default suggestion
2020-05-14 15:13:45 +02:00
Lukas Siatka
e11504dcd2 Datasources: fixes async mount errors (#24579)
* Chore: updates Elasticsearch DataLinks test async wrapper mount

* Chore: updates Loki DervidedFields test async wrapper mount

* Chore: fixes typecheck issues

* Chore: small strict-null fix
2020-05-14 14:25:52 +02:00
Marcus Olsson
b4044e3e51 Docs: Update Explore plugin docs (#24667)
* Update Explore plugin docs

* Fix review comment
2020-05-14 14:15:18 +02:00
Andrej Ocenas
e754bcdcf9 CloudWatch: Unify look of query mode select between dashboard and explore (#24648) 2020-05-14 14:12:11 +02:00
Peter Holmberg
abfa1b5d74 Docs: Updated instructions on screens for Dashboard Import (#24584)
* change text and image links

* Review feedback

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

* uppercase JSON

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-14 14:10:57 +02:00
Andrej Ocenas
c60765a178 CloudWatch/Logs: Fix panic on multiple aggregations queries (#24683) 2020-05-14 14:10:23 +02:00
Marcus Olsson
141c21c906 Docs: Clean up plugin.json schema (#24682) 2020-05-14 14:05:08 +02:00
Hugo Häggmark
51509bb2ff Units: adds scale symbol for currencies with suffixed symbol (#24678) 2020-05-14 13:49:21 +02:00
Dominik Prokop
cfac591234 SaveDashboard: Allow editing provisioned dashboard JSON and add confirmation when JSON is copied to dashboard (#24680) 2020-05-14 13:45:26 +02:00
Zoltán Bedi
660f2b4e99 Fallback to process.cwd() when PWD is not present (#24677)
Fixes #24582 - Error running yarn dev command
2020-05-14 13:36:25 +02:00
Marcus Efraimsson
77148ef616 Docs: Backend plugins conceptual overview (first iteration) (#24668)
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Marcus Olsson <accounts+github@marcus.se.net>
2020-05-14 13:21:26 +02:00
Carl Bergquist
7610d5717a Provisioning: Use proxy as default access mode in provisioning (#24669)
fixes #24591
fixes #19501
2020-05-14 12:40:00 +02:00
Torkel Ödegaard
2f22781cd8 Orgs: Add future deprecation notice (#24502)
* Orgs: Fist draft of orgs deprecation infobox

* adds warning about potentially deprecating orgs (#24512)

* Updates

* Fixed ts issue

Co-authored-by: Carl Bergquist <carl@grafana.com>
2020-05-14 12:16:26 +02:00
Tobias Skarhed
85ae144a87 Changelog and Readme: Update packages to beta and add Select breaking change (#24670) 2020-05-14 11:58:26 +02:00
Hugo Häggmark
9481b7bcf2 Datasource Config: adds back correct styles for autofill fields (#24671) 2020-05-14 11:56:00 +02:00
Jess
54a90166a5 @grafana/ui: Buttons documentation (#23144)
* Add info: when to use which and how to mix buttons

* Update description for Button.mdx

- add note about scenario without primary action
- add note about secondary button being the default

* Refine docs info for secondary and destructive

Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
2020-05-14 11:39:34 +02:00
Marcus Olsson
e323f7be51 Update plugin metadata (#24633) 2020-05-14 11:21:31 +02:00
Tobias Skarhed
37a2ac20c3 Search: Fix select item pressing enter 404 (#24634)
* Remove appSubUrl for navigation

* stripBaseFromUrl

* Remove unused imports
2020-05-14 11:17:09 +02:00
Jess
f1386c7892 @grafana/ui: Update RadioButtonGroup documentation (#23143)
* Add "When to use" info to RadioButtonGroup.mdx

* Clarify more clearly when to use 'Select' instead

* Update RadioButtonGroup.mdx

Add line explaining why we want select for more than four options instead of a radio button group

* Update RadioButtonGroup.mdx

remove part about when elements are triggering changes.

Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
2020-05-14 10:51:14 +02:00
Leonard Gram
c066c6047e Docs: adds SAML and Okta to What's new in 7.0 (#24629)
* Docs: adds SAML and Octa to What's new in 7.0

* Update docs/sources/guides/whats-new-in-v7-0.md

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

* Update docs/sources/guides/whats-new-in-v7-0.md

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* Docs: review fixes

* Docs: review feedback

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2020-05-14 10:47:24 +02:00
Dominik Prokop
f769ed035d PanelEdit: Make sure side pane is displayed with tabs by default (#24636)
* Make sure side pane is displayed with tabs by default

* Update e2e tests for
2020-05-14 09:55:40 +02:00
Hugo Häggmark
083a2ce220 Templating: fixes filtering options with more than 1000 entries (#24614)
* Templating: fixes filtering options with more then 1000 entries

* Chore: reduces strict null errors by 2
2020-05-14 08:09:21 +02:00
Hugo Häggmark
622246d56d Templating: fixes so Textbox variables get value from url (#24623) 2020-05-14 07:41:42 +02:00
Diana Payton
f97d021c58 Docs: Create table-panel.md (#24457)
* Create table-panel.md

* Update docs/sources/panels/visualizations/table-panel.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/visualizations/table-panel.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update table-panel.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-13 16:30:49 -07:00
Amal
6c32a5b9bc Docs: Minor typo correction (#24649) 2020-05-13 14:34:10 -07:00
Amal
033e5e53da Docs: Grammatical corrections (#24646)
* Grammatical corrections

* Grammatical correction
2020-05-13 14:33:37 -07:00
Arve Knudsen
0860dfe45d CloudWatch: Fix variable naming (#24650)
* CloudWatch: Fix variable naming
2020-05-13 21:17:06 +02:00
Dan Bond
792e99918c tsdb/cloudwatch: always return underlying metrics query errors (#24632)
* tsdb/cloudwatch: always return underlying errors
2020-05-13 20:36:01 +02:00
Andrej Ocenas
0f964c0214 Zipkin: Fix error when span contains remoteEndpoint (#24524) 2020-05-13 19:32:45 +02:00
Arve Knudsen
8e5a3a578a CloudWatch: Don't assume that errors are awserr.Error instances (#24641)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-13 18:57:23 +02:00
Diana Payton
4cdd8bd933 Docs: Add transformations documentation (#24597)
* Create transformations.md

* Update transformations.md

* Create calculations-list.md

* Update transformations.md

* Update menu.yaml

* Update transformations.md

* Update calculations-list.md

* updated menu

* Delete text.md

Deleted old text panel topic

* Update transformations.md

* added content

* Update transformations.md

* Update whats-new-in-v7-0.md

* Update transformations.md

* Update docs/sources/panels/transformations.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/transformations.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/transformations.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/calculations-list.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/transformations.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update transformations.md

* fixed broken links

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-13 08:29:49 -07:00
thameezb
16297da298 Email Notifications: Add StartTLSPolicy config flag (#24574) 2020-05-13 16:33:40 +02:00
Ivana Huckova
285ea7595d Explore: Fix rendering of react query editors (#24593)
* Fix rendering of react query editors

* Refactor solution for improved readability

* Update

* Add test coverage

* Refactor
2020-05-13 15:56:22 +02:00
Diana Payton
f29b70b442 Docs: Create add-a-panel.md (#24598)
* Create add-a-panel.md

* Update add-a-panel.md
2020-05-13 06:52:12 -07:00
Amal
8e0ba46d50 Typo correction in docs (#24551)
* Typo correction in docs

* Minor typo correction
2020-05-13 15:47:45 +02:00
Amal
c075576f3a Minor correction in documentation (#24472) 2020-05-13 15:46:27 +02:00
Amal
c8bae5fd3a Minor change in docs (#24471) 2020-05-13 15:45:11 +02:00
Amal
cfaf3e309c Minor typo correction (#24552) 2020-05-13 15:43:56 +02:00
Amal
85add88b8d Grammatical correction (#24550) 2020-05-13 15:42:54 +02:00
kay delaney
bfd337dd00 Datasource/CloudWatch: Correctly interpolate variables in CloudWatch Logs queries (#24619)
Closes #24603
2020-05-13 14:38:42 +01:00
kay delaney
277aee8642 Datasource/CloudWatch: Prevents hidden dataframe fields from displaying in tables (#24580)
* Datasource/CloudWatch: Prevents hidden dataframe fields from displaying in tables
2020-05-13 14:34:23 +01:00
Agnès Toulet
cd9cbe5e16 SharedPreferences: fixes so UI Theme can be set back to Default (#24628) 2020-05-13 15:08:49 +02:00
Diana Payton
c1b057a57d Docs: Add linking topics (#24408)
* Create _index.md

* Create linking-overview

* Create dashboard-links

* Update linking-overview

* Added content, renamed files

* Moved and renamed files

* renamed file

* Update link-panels.md

* Added URL variables and changed content

* Delete links.md

Content moved to other files

* Update menu.yaml

* Delete timerange.md

Content moved to URL variables

* content updates

* updated links

* Revert "Delete timerange.md"

This reverts commit 662672c03b.

* Create data-links.md

* Revert "Delete links.md"

This reverts commit c83ba7eed3.

* content updates

* Added data links topic

* Update _index.md

* Update _index.md

* Update docs/sources/linking/data-links.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update data-links.md

* Update data-links.md

Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-13 06:08:11 -07:00
Emil Tullstedt
87c2e58dfd Reporting: Update docs to link to API where mentioned (#24621) 2020-05-13 13:58:55 +02:00
Marcus Efraimsson
aa63404211 Docs: Add scale query string parameter to share panel (#24599)
Document the new scale query string parameter introduced in #23625.

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-13 13:39:24 +02:00
Ryan McKinley
97e2837d7c Transformers: fix binary operation (#24604)
* check the display name

* remove unchanged line

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-13 13:12:08 +02:00
Torkel Ödegaard
f23ecc40b4 Inspect: Allow showing data without transformations and field config is applied (#24314)
* Inspect: Should not subscribe to transformed data

* PQR- allow controll whether or not field overrides and transformations should be applied

* UI for inspector data options

* fix

* Null check fix

* Update public/app/features/dashboard/components/Inspector/InspectDataTab.tsx

* Update public/app/features/dashboard/components/Inspector/InspectDataTab.tsx

* Apply transformations by default

* Update panel inspect docs

* Fix apply overrides

* Apply time formatting in panel inspect

* fix ts

* Post review update

* Update docs/sources/panels/inspect-panel.md

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

* lazy numbering

* fix ts

* Renames

* Renames 2

* Layout update

* Run shared request without field config

* Minor details

* fix ts

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-13 13:03:34 +02:00
Dominik Prokop
9e24c0944f Transformations: Make transform dropdowns not cropped (#24615) 2020-05-13 13:01:10 +02:00
Emil Tullstedt
ab12c908d8 Reporting: Document layouts (#24338) 2020-05-13 11:50:43 +02:00
Agnès Toulet
8e8aae06a3 Docs: Enterprise improvements (#24395)
* Docs: fix LDAP link

* Docs: add License Expiration behavior for usage insights

* Docs: update auth overview with a features matrix

* Docs: refactor Enterprise overview

* Docs: updates team sync supported providers

* Docs: add auth feature matrix missing versions

* Docs: fix license expiration indent

* Docs: small improvements

* Docs: apply PR feedbacks

* Docs: fix typo

* Docs: fix typo Oauth -> OAuth
2020-05-13 11:23:01 +02:00
Alex Khomenko
04c75265b5 Fix Safari Icon alignment (#24610) 2020-05-13 11:08:19 +02:00
Arve Knudsen
03940c8471 CircleCI: Upgrade grabpl in order to fix package publishing (#24609)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-13 10:46:29 +02:00
Peter Holmberg
1848900070 Chore: Fix strict null errors on getting started (#24605)
* fix strict nulls

* fix typings
2020-05-13 10:02:20 +02:00
Amal
5f45a039b2 Grammatical correction (#24592) 2020-05-13 09:45:03 +02:00
Peter Holmberg
36fa54a288 Onboarding: New getting started panel (#23826)
* image and card component

* change height of getting started panel

* progress

* setup basic step

* advanced steps

* step forward and backward

* do checks

* fix button size

* minor styling on butttons

* add correct links

* save tutorial click in localstorage

* types and gradients

* fix gradients

* use spacing variable

* lots of responsiveness

* add links to help

* Getting started work

* redo according to split panel design

* minor touch ups

* new background images

* split up docs card to different hrefs

* welcome bar touch ups

* hide icon on small screens

* transparent false on welcome banner

* fix urls

* source tag in welcome urls

* move images to panel dir, removed unused images

* Nicer loading message

* make the cards look nicer on wide screens

* append utm tag on render instead

* replace width with margin

* new background image for light

* remove target on a element

* removing buttonselect, add tag to href

* more polishing

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2020-05-13 08:00:40 +02:00
Marcus Andersson
cab066f8ce TimePicker: some fixes and polish after testing feedback (#24585)
* make sure we render the delaynow value from dashboard to the time picker settings.

* Added the time zone in the tooltip.
2020-05-13 07:26:03 +02:00
Hugo Häggmark
2d19c046f2 Table: fixes Cannot read property subRows of null (#24578) 2020-05-13 05:46:05 +02:00
Andrej Ocenas
5feef22034 CloudWatch/Logs: Make stats hint show consistently (#24392) 2020-05-13 00:13:16 +02:00
Marcus Olsson
75de6165fc Docs: Add guides to plugin overview (#24560)
* Add guides to plugin overview

* Update docs/sources/developers/plugins/_index.md

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

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-12 23:31:36 +02:00
Arve Knudsen
824eb94efe CircleCI: Update grabpl to 0.4.5 in order to include manifest with GEL (#24577)
* CircleCI: Update grabpl to 0.4.5
* GEL: Upgrade version
2020-05-12 21:06:24 +02:00
Alex Malott
846142eebd Emails: Fixed a (very small) typo (#24586) 2020-05-12 18:09:24 +02:00
kay delaney
c1919944ea Datasource/CloudWatch: Fixes various autocomplete issues (#24583) 2020-05-12 16:32:48 +01:00
Andrej Ocenas
a50cb6aa1f Loki: Allow multiple derived fields with the same name (#24437) 2020-05-12 17:20:00 +02:00
Marcus Olsson
0ac006edf5 Docs: Add Explore guide for plugins (#24547)
* Add Explore guide for plugins

* Fix review comments
2020-05-12 17:06:14 +02:00
Tobias Skarhed
0c1f1dd8fd OrgUsersTable: Fix width when there are long cells in table (#24533)
* Set width for cells and text overflow

* Add title and update snapshot
2020-05-12 16:47:38 +02:00
Alex Khomenko
15ac76a47b Search: Safari UI fixes (#24567)
* Search: Add height: 100% to page containers

* Search: Reset TagOption display to block

* Search: Add title to result list

* Search: Use flex-basis vs height

* Search: Remove IconButton

* Search: Do not shrink select options

* Search: Fix hasEditPermissionInFolders

* Search: Update tests

* Search: Fix prop

* Remove select wrapper class

* Update snapshot
2020-05-12 17:10:48 +03:00
Arve Knudsen
892f9f789c Plugins: Fix manifest verification (#24573) 2020-05-12 15:48:24 +02:00
Andrej Ocenas
20f0ee2f22 Do not set insertText if the same as label (#24581) 2020-05-12 14:23:10 +01:00
Torkel Ödegaard
8de10a8b9f Field: UI & Code consistency Title -> Display name (#24507)
* Field: Change getFieldTitle to getFieldDisplayNamne and change the NAME of the title field config from Title to Display name

* Review feedback

* fixed unit tests

* Rename fieldConfig.title to displayName

* Fixed tests

* Added migration

* Renamed getFrameDisplayTitle to getFrameDisplayName
2020-05-12 13:52:53 +02:00
Rotem Reiss
125ba95686 Security: Tag value sanitization fix in OpenTSDB data source (#24539)
Adds HTML sanitization to the tag value of the OpenTSDB datasource.

Fixes #24537
2020-05-12 13:19:00 +02:00
Arve Knudsen
164242f5fd Data sources: Don't fail if URL doesn't specify protocol (#24497) 2020-05-12 13:04:18 +02:00
Arve Knudsen
0475f96347 CircleCI: Speed up by testing and building in parallel (#24575) 2020-05-12 12:55:42 +02:00
Alex Khomenko
0396b220a3 Search: Save folder expanded state (#24496)
* Search: Save folder expanded state

* Search: Remember expanded state on search close
2020-05-12 13:51:00 +03:00
Hugo Häggmark
7d800e7318 e2e: adds verify release (#24568) 2020-05-12 12:48:26 +02:00
Dominik Prokop
bffa0fa4f6 UI spelling: use US form of visualization (#24558) 2020-05-12 11:11:54 +02:00
Zoltán Bedi
67dab0b767 Update light variable theme for dropdown (#24566) 2020-05-12 11:11:24 +02:00
Hugo Häggmark
74ddfe07a2 Admin Settings: makes long settings line break (#24559) 2020-05-12 10:54:25 +02:00
Marcus Andersson
28f54bc2f7 TimePicker: fixed so you can enter a relative range in the time picker without being converted to absolute range (#24534)
* fixed so you can enter a relative date in the time range form.

* did some small adjustments to make sure proper value is stored.
2020-05-12 09:47:50 +02:00
Daniel Lee
64046e9a27 azuremonitor: limit macro regex to known macros (#24528) 2020-05-12 08:52:42 +02:00
Hugo Häggmark
7992f8bfbc Graphite: makes query annotations work again (#24556) 2020-05-12 08:33:45 +02:00
Marcus Andersson
cb4266bae0 PanelEditor: Fix so defaults is selected when datasource can't be found. (#24526) 2020-05-12 08:03:52 +02:00
Diana Payton
ffda007415 Docs: Add queries.md (#24363)
* Create queries.md

* Delete mixed.md

* Update _index.md

* Update menu.yaml

* Update queries.md

* Update menu.yaml

* Update queries.md

* Update queries.md

* Update queries.md

* Update docs/sources/panels/queries.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/queries.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update docs/sources/panels/queries.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

* Update queries.md

* Update queries.md

* Update queries.md

* Update queries.md

* Update queries.md

* Update queries.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-11 14:52:31 -07:00
Marcus Olsson
8fee956ce8 Docs: Add docs for variable interpolation in plugins (#24446)
* Add docs for variable interpolation in plugins

* Fix review comments
2020-05-11 23:26:10 +02:00
Ivana Huckova
143a26769b Prometheus: Show results of instant queries only in table (#24508)
* Show results of instant queries only in table, remove them from graph

* Update table model
2020-05-11 22:47:15 +02:00
Ryan McKinley
c8d3d15292 LabelsToFields: avoid MutableDataFrame (#24493) 2020-05-11 13:41:33 -07:00
Marcus Olsson
1ece878037 Docs: Add annotations guide for data source plugins (#24432)
* Add annotations guide for data source plugins

* Fix review comments
2020-05-11 22:03:53 +02:00
Torkel Ödegaard
5caf7f59e6 PanelEditor: Fixed issue changing a panel from transparent back to normal (#24483)
* PanelModel: Fixed issues with persisting some changes

* Fixed other issues
2020-05-11 22:03:43 +02:00
Amal
3f31028bf8 Refactoring one of the statement (#24542) 2020-05-11 21:39:38 +02:00
Amal
be2f932cac Minor correction in docs (#24545) 2020-05-11 21:37:50 +02:00
Diana Payton
6883626834 Docs: Add dashboard list (#24452)
* Create _index.md

* Create dashboard-list-panel.md

* Update dashboard-list-panel.md
2020-05-11 12:12:15 -07:00
Diana Payton
cde86ff567 Docs: Added Alert list visualization (#24453)
* added alert list panel topic

* Update alert-list-panel.md
2020-05-11 12:12:04 -07:00
Marcus Olsson
b8bc10018a Docs: Add logs data source guide (#24423) 2020-05-11 20:15:22 +02:00
Amal
444058a569 Minor change in docs (#24543) 2020-05-11 20:11:10 +02:00
kay delaney
db91961405 Datasource/CloudWatch: Results of CloudWatch Logs stats queries are now grouped (#24396)
* Datasource/CloudWatch: Results of CloudWatch Logs stats queries are now grouped
2020-05-11 18:52:15 +01:00
Diana Payton
98de101bd8 Docs: Add Logs panel visualization (#24450)
* added log topic

* added logs-panel.md

* Update docs/sources/panels/visualizations/logs-panel.md

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2020-05-11 10:24:42 -07:00
Daniel Lee
67ed579647 azuremonitor: Deep linking from Log Analytic queries to the Azure Portal (#24417)
* azuremonitor: add gzipped and base64 encoded query to metadata

for Azure Log Analytic query responses

* azure monitor: add fields to metadata for log analytics

* azuremonitor: correction to text in query editor

* azuremonitor: adds subscription id to result metadata

* azuremonitor: build deep link url for Log Analytics

Most of the information needed for building the url
comes from the backend. The workspace friendly name
and the resource group that the workspace belongs
to are fetched in a separate API call. This call is
cached otherwise there would be a workspaces call
per query on the dashboard.

* docs: azure log analytics deep linking

* Apply suggestions from code review

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

* docs: fixing review comments for azure monitor

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-11 19:11:03 +02:00
kay delaney
ae7f0aeb7a Datasource/CloudWatch: Switch to metrics mode, logs API, when choosing stats query from cheatsheet (#24398)
* Datasource/CloudWatch: Switch to metrics mode, logs API, when choosing stats query from cheatsheet
2020-05-11 17:43:53 +01:00
Andrej Ocenas
55533d12fd CloudWatch/Logs: Fix fields not being refetched when log group changed (#24529) 2020-05-11 18:09:14 +02:00
Tobias Skarhed
cb74bc6828 GraphLegend: Only display scrollbar if necessary (#24527) 2020-05-11 17:56:32 +02:00
Steven Vachon
b2f8f25995 @grafana/e2e: support regex for addDataSource (#24461) 2020-05-11 10:51:59 -04:00
Diana Payton
d5991a4b88 Docs: Create bar-gauge-panel.md (#24458) 2020-05-11 07:32:09 -07:00
Diana Payton
d5e7a253b3 Docs: Add stat panel (#24459)
* Create stat-panel.md

* Update stat-panel.md
2020-05-11 07:31:31 -07:00
Andrej Ocenas
2d29997bda CloudWatch/Logs: Fix suggestions of fields after comma (#24520) 2020-05-11 16:10:49 +02:00
Diana Payton
9dd68dae36 added text panel to visualizations (#24454) 2020-05-11 15:46:43 +02:00
kay delaney
c26374b0b2 Datasource/CloudWatch: Usability improvements (#24447)
* Datasource/CloudWatch: Improve handling of long-running queries

* Datasource/CloudWatch: Make order of dataframe fields consistent
2020-05-11 14:44:13 +01:00
Andrej Ocenas
876011d931 CloudWatch/Logs: Language provider refactor and test (#24425) 2020-05-11 15:00:20 +02:00
Dominik Prokop
2e69b86990 PluginsList: Remove unused panel options (#24501)
* Remove unused panel options

* satisfy ts
2020-05-11 14:26:25 +02:00
Torkel Ödegaard
f13a15ae48 TablePanel: Fixed persisting column resize time series fields (#24505) 2020-05-11 14:25:26 +02:00
David
34f61934a1 Editor: No default suggestion selected (#24479)
* QueryField: No default suggestion selected

It's been a long-standing issue that careless typing lead to unwanted
tab completion insertions. With this change the completion item list no
longer selects the first item by default. The user has to actively click
ArrowDown to select the first one.

* Added type export

* Remove width limit of typeahead list
2020-05-11 14:01:35 +02:00
Andrej Ocenas
b16202acc2 CloudWatch/Log: Fix field autocomplete suggestions inside function (#24406)
* Fix autocomplete inside function

* Remove debug log

* Add comment and return type
2020-05-11 12:56:32 +02:00
Andrej Ocenas
d385045d16 CloudWatch/Logs: Add error message when log groups are not selected (#24361)
* Add error message

* Fix empty check
2020-05-11 12:53:42 +02:00
Marcus Andersson
a521a39ebf TimeZone: added e2e tests for the custom time zone support. (#24442) 2020-05-11 11:46:57 +02:00
Hugo Häggmark
e341d4b26f Reduce Transform: sort order is preserved as entered by user (#24494) 2020-05-11 10:47:05 +02:00
Diana Payton
c3b6ee1456 added news panel topic (#24451) 2020-05-11 10:42:49 +02:00
Dominik Prokop
c5fc18ac02 grafana/toolkit: Support paging in cherrypick task (#24402)
* Support paging in cherrypick task

* Update packages/grafana-toolkit/src/cli/tasks/cherrypick.ts

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

* Update packages/grafana-toolkit/src/cli/tasks/cherrypick.ts

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

* Do not cherry pick closed PRs

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-11 10:24:06 +02:00
Dominik Prokop
2f5003ebf1 Packages: Fix cross dependencies version for canary releases (#24489) 2020-05-11 08:20:13 +02:00
Torkel Ödegaard
352f22042c StatPanels: Hide calc option if all values is selected (#24416) 2020-05-11 08:10:24 +02:00
Richlv
367501eeab Packaging: Fix systemd service consistency (#24466)
Fix double "then".
As previous systemd commands do not include ".service" postfix, remove it also for the "enable" command.
2020-05-10 21:10:01 +02:00
Amal
75e2da0c1d Docs: Replacing a word for better readability (#24475) 2020-05-10 21:09:25 +02:00
Peter Holmberg
c671fdbbf8 Buttons: Use text color (#24439) 2020-05-10 21:06:25 +02:00
Rotem Reiss
96cb6d668f Admin: Cleanup old admin users edit page, see #19139 (#24463) 2020-05-10 21:05:02 +02:00
Torkel Ödegaard
e333d61b97 OldTable: Make old table options align & look better (#24485) 2020-05-10 17:11:51 +02:00
Yazdan
1fafcd1562 Docs: add disable_brute_force_login_protection to configuration document (#24448) 2020-05-10 13:41:33 +02:00
Amal
482886279c Minor change in Grafana docs (#24476) 2020-05-09 19:52:44 +02:00
Amal
694bc4b1ed Correction in documentation (#24474) 2020-05-09 19:11:26 +02:00
Amal
aa4366e6ca Minor change in docs (#24473)
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-09 19:10:48 +02:00
Amal
8694970538 Minor correction in documentation (#24469) 2020-05-09 15:00:33 +02:00
Amal
e8cd094f01 Minor grammatical correction in docs (#24468) 2020-05-09 15:00:07 +02:00
kay delaney
a655aa1ca8 Datasource/CloudWatch: Add data links to CloudWatch logs for deep linking to AWS (#24334)
* Datasource/CloudWatch: Fix encoding of CloudWatch Logs deep link URL

* Adds data links to cloudwatch logs responses for deep linking to aws console

* Implements PR feedback
2020-05-08 17:03:15 +01:00
kay delaney
35c097e475 Logs: Clicking "Load more" from context overlay doesn't expand log row (#24299)
Closes #24184
2020-05-08 17:02:23 +01:00
Andreas Opferkuch
221042c293 Explore: Revert QueryRows refactor (#24444)
While query fields should not rely on getting unmounted when the data source changes (and instead react to that change in e.g. componentDidUpdate()), query fields other than PromQueryField still rely on this.
2020-05-08 17:49:47 +02:00
Marcus Olsson
a9f39a4149 Add docs for user management (#24277)
* Add docs for user management

* WIP
2020-05-08 17:33:59 +02:00
Alexander Zobnin
7e6ac12b9a Chore: move dataFramesReceived event to @grafana/data (#24443) 2020-05-08 17:33:36 +03:00
Tobias Skarhed
8257633b1d Storybook: Position panel to right (#24429) 2020-05-08 15:57:40 +02:00
Alexander Zobnin
d7a5f3ef80 Docs: SAML role and team sync (#23986)
* SAML: add docs for config options

* SAML: role and org mapping docs

* SAML: team sync docs

* Docs: add SAML to the team sync providers list

* Apply suggestions from code review

Co-Authored-By: Leonard Gram <leo@xlson.com>

* SAML: add `assertion_attribute_org` option to the org mapping example config

* SAML: write config sections as steb-by-step tasks

* SAML: docs tweaks

* SAML docs: minor style fixes

* SAML docs: update availability note

* Docs: add enterprise config page

* Docs: link saml options to the config page

* Apply suggestions from code review

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

* Docs: rename configuration to enterprise-configuration

* Docs: user's -> user

Co-authored-by: Leonard Gram <leo@xlson.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-05-08 16:10:33 +03:00
Carl Bergquist
bd3ca55117 Docs: Updates transform names and descriptions in whats new blogpost. (#24428)
* updates transform names and descriptions

* typo
2020-05-08 14:21:39 +02:00
Leonard Gram
de8c1b9ad7 Reporting: tzdata is needed for reporting (#24422) 2020-05-08 14:17:12 +02:00
Arve Knudsen
c6bba9019d Chore: Update latest.json (#24424)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-05-08 12:50:44 +02:00
Dominik Prokop
63d25944c4 Minor UI touches (#24371)
* Justify to alignment in stat

* No stats label in inspect

* Use sentence case in panel names

* typos

* typo

* Typo

* Query -> query options

* prettier

* Transformer -> transform data

* Do not show deprecated plugins in the viz picker

* Update viz picker layout
2020-05-08 12:40:42 +02:00
Arve Knudsen
a86639356e Chore: Update changelog (#24421)
* Update changelog
Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
2020-05-08 12:28:18 +02:00
Tobias Skarhed
f714357fbf TablePanel: Fix JSON tooltip positioning (#24420)
* Fix block element and overflow

* Width not needed

* Add to styles file
2020-05-08 12:11:41 +02:00
Torkel Ödegaard
243fa5ea63 Prometheus: Fix for prometheus legend formats for instant time series queries (#24407)
* Prometheus: Fix for prometheus legend formats for instance time series queries

* correct old test
2020-05-08 07:59:35 +02:00
Steven Vachon
648dda96e9 @grafana/e2e: only skip password reset on local tests (#24411) 2020-05-07 20:06:10 -04:00
Ivana Huckova
f37c64c80c Elastic: Fix building of raw document queries resulting in error Unknown BaseAggregationBuilder error (#24403)
* Fix building of elastic document query

* Update comments
2020-05-07 21:43:41 +02:00
Tobias Skarhed
5e50409000 Forms: Remove Forms namespace [BREAKING] (#24378)
* Remove index and export

* Fix Forms import
2020-05-07 21:41:26 +02:00
Dominik Prokop
62aa15f760 PanelEdit: Field Config options Fix numeric option bug (#24397) 2020-05-07 21:40:23 +02:00
Ryan McKinley
e36a6ac476 TransformersUI: move transformer ui to grafana app (#24360) 2020-05-07 10:53:58 -07:00
Amal
a3ffbd9a70 Docs: Minor correction in documentation (#24259) 2020-05-07 10:14:32 -07:00
Amal
948cdf835d Docs: Minor correction in documentation (#24306) 2020-05-07 10:11:45 -07:00
Amal
e07fdbd881 Docs: Grammatical correction (#24248) 2020-05-07 10:07:37 -07:00
Marcus Olsson
fc0c717bfb Restructure plugin docs (#24381) 2020-05-07 18:45:52 +02:00
1575 changed files with 42740 additions and 21992 deletions

View File

@@ -35,13 +35,13 @@ executors:
- image: cimg/base:stable
node:
docker:
- image: cimg/node:12.16
- image: cimg/node:12.18
go:
docker:
- image: cimg/go:1.14
grafana-build:
docker:
- image: grafana/build-container:1.2.16
- image: grafana/build-container:1.2.20
grafana-publish:
docker:
- image: grafana/grafana-ci-deploy:1.2.5
@@ -56,7 +56,7 @@ commands:
- run:
name: "Install Grafana build pipeline tool"
command: |
VERSION=0.4.9
VERSION=0.4.19
curl -fLO https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v${VERSION}/grabpl
chmod +x grabpl
mv grabpl /tmp
@@ -74,7 +74,7 @@ jobs:
- run:
name: Exit if enterprise and forked PR
command: |
if [[ "<< parameters.edition >>" == "enterprise" && -n "$CIRCLE_PR_NUMBER" ]]; then
if [[ "<< parameters.edition >>" == "enterprise" && -n "$CIRCLE_PR_NUMBER" ]]; then
echo "Nothing to do for forked PRs, so marking this step successful"
circleci step halt
fi
@@ -88,15 +88,15 @@ jobs:
command: |
if [[ -n $CIRCLE_TAG ]]; then
# A release build
/tmp/grabpl build-backend --edition << parameters.edition >> \
/tmp/grabpl build-backend --github-token "${GITHUB_GRAFANABOT_TOKEN}" --edition << parameters.edition >> \
--variants << parameters.variant >> $CIRCLE_TAG
elif [[ $CIRCLE_BRANCH == "chore/test-release-pipeline" ]]; then
# We're testing the release pipeline
/tmp/grabpl build-backend --edition << parameters.edition >> \
/tmp/grabpl build-backend --github-token "${GITHUB_GRAFANABOT_TOKEN}" --edition << parameters.edition >> \
--variants << parameters.variant >> v7.0.0-test
else
# A master or PR build
/tmp/grabpl build-backend --edition << parameters.edition >> \
/tmp/grabpl build-backend --github-token "${GITHUB_GRAFANABOT_TOKEN}" --edition << parameters.edition >> \
--variants << parameters.variant >> --build-id $CIRCLE_WORKFLOW_ID
fi
- run:
@@ -126,7 +126,7 @@ jobs:
- run:
name: Exit if enterprise and forked PR
command: |
if [[ "<< parameters.edition >>" == "enterprise" && -n "$CIRCLE_PR_NUMBER" ]]; then
if [[ "<< parameters.edition >>" == "enterprise" && -n "$CIRCLE_PR_NUMBER" ]]; then
echo "Nothing to do for forked PRs, so marking this step successful"
circleci step halt
fi
@@ -158,13 +158,13 @@ jobs:
command: |
if [[ -n $CIRCLE_TAG ]]; then
# A release build
/tmp/grabpl build-frontend --edition << parameters.edition >> $CIRCLE_TAG
/tmp/grabpl build-frontend --github-token "${GITHUB_GRAFANABOT_TOKEN}" --edition << parameters.edition >> $CIRCLE_TAG
elif [[ $CIRCLE_BRANCH == "chore/test-release-pipeline" ]]; then
# We're testing the release pipeline
/tmp/grabpl build-frontend --edition << parameters.edition >> 7.0.0-test
/tmp/grabpl build-frontend --github-token "${GITHUB_GRAFANABOT_TOKEN}" --edition << parameters.edition >> 7.0.0-test
else
# A master or PR build
/tmp/grabpl build-frontend --edition << parameters.edition >> --build-id $CIRCLE_WORKFLOW_ID
/tmp/grabpl build-frontend --github-token "${GITHUB_GRAFANABOT_TOKEN}" --edition << parameters.edition >> --build-id $CIRCLE_WORKFLOW_ID
fi
- run:
name: Move artifacts
@@ -192,7 +192,7 @@ jobs:
- run:
name: Exit if enterprise and forked PR
command: |
if [[ "<< parameters.edition >>" == "enterprise" && -n "$CIRCLE_PR_NUMBER" ]]; then
if [[ "<< parameters.edition >>" == "enterprise" && -n "$CIRCLE_PR_NUMBER" ]]; then
echo "Nothing to do for forked PRs, so marking this step successful"
circleci step halt
fi
@@ -414,20 +414,20 @@ jobs:
export GRAFANA_API_KEY=$GRAFANA_COM_API_KEY
if [[ -n $CIRCLE_TAG ]]; then
# A release build
/tmp/grabpl package --jobs 2 --edition oss --sign $CIRCLE_TAG
/tmp/grabpl package --github-token "${GITHUB_GRAFANABOT_TOKEN}" --jobs 2 --edition oss --sign $CIRCLE_TAG
elif [[ $CIRCLE_BRANCH == "chore/test-release-pipeline" ]]; then
# We're testing the release pipeline
/tmp/grabpl package --jobs 2 --edition oss --sign v7.0.0-test
/tmp/grabpl package --github-token "${GITHUB_GRAFANABOT_TOKEN}" --jobs 2 --edition oss --sign v7.0.0-test
elif [[ $CIRCLE_BRANCH == "master" ]]; then
# A master build
/tmp/grabpl package --jobs 2 --edition oss --sign --build-id $CIRCLE_WORKFLOW_ID
/tmp/grabpl package --github-token "${GITHUB_GRAFANABOT_TOKEN}" --jobs 2 --edition oss --sign --build-id $CIRCLE_WORKFLOW_ID
elif [[ -n "$CIRCLE_PR_NUMBER" ]]; then
# A forked PR build, don't sign as it requires an API secret
/tmp/grabpl package --jobs 2 --edition oss --build-id $CIRCLE_WORKFLOW_ID --variants \
/tmp/grabpl package --github-token "${GITHUB_GRAFANABOT_TOKEN}" --jobs 2 --edition oss --build-id $CIRCLE_WORKFLOW_ID --variants \
linux-x64,linux-x64-musl,osx64,win64
else
# A non-forked PR build
/tmp/grabpl package --jobs 2 --edition oss --sign --build-id $CIRCLE_WORKFLOW_ID --variants \
/tmp/grabpl package --github-token "${GITHUB_GRAFANABOT_TOKEN}" --jobs 2 --edition oss --sign --build-id $CIRCLE_WORKFLOW_ID --variants \
linux-x64,linux-x64-musl,osx64,win64
fi
- run:
@@ -476,20 +476,20 @@ jobs:
if [[ -n $CIRCLE_TAG ]]; then
# A release build
/tmp/grabpl package --jobs 2 --edition enterprise --sign $CIRCLE_TAG
/tmp/grabpl package --github-token "${GITHUB_GRAFANABOT_TOKEN}" --jobs 2 --edition enterprise --sign $CIRCLE_TAG
elif [[ $CIRCLE_BRANCH == "chore/test-release-pipeline" ]]; then
# We're testing the release pipeline
/tmp/grabpl package --jobs 2 --edition enterprise --sign v7.0.0-test
/tmp/grabpl package --github-token "${GITHUB_GRAFANABOT_TOKEN}" --jobs 2 --edition enterprise --sign v7.0.0-test
elif [[ $CIRCLE_BRANCH == "master" ]]; then
# A master build
/tmp/grabpl package --jobs 2 --edition enterprise --sign --build-id $CIRCLE_WORKFLOW_ID
/tmp/grabpl package --github-token "${GITHUB_GRAFANABOT_TOKEN}" --jobs 2 --edition enterprise --sign --build-id $CIRCLE_WORKFLOW_ID
elif [[ -n "$CIRCLE_PR_NUMBER" ]]; then
# A forked PR build, don't sign as it requires an API secret
/tmp/grabpl package --jobs 2 --edition enterprise --build-id $CIRCLE_WORKFLOW_ID --variants \
/tmp/grabpl package --github-token "${GITHUB_GRAFANABOT_TOKEN}" --jobs 2 --edition enterprise --build-id $CIRCLE_WORKFLOW_ID --variants \
linux-x64,linux-x64-musl,osx64,win64
else
# A PR build
/tmp/grabpl package --jobs 2 --edition enterprise --sign --build-id $CIRCLE_WORKFLOW_ID --variants \
/tmp/grabpl package --github-token "${GITHUB_GRAFANABOT_TOKEN}" --jobs 2 --edition enterprise --sign --build-id $CIRCLE_WORKFLOW_ID --variants \
linux-x64,linux-x64-musl,osx64,win64
fi
- run:
@@ -608,7 +608,7 @@ jobs:
- run:
name: Exit if enterprise and forked PR
command: |
if [[ "<< parameters.edition >>" == "enterprise" && -n "$CIRCLE_PR_NUMBER" ]]; then
if [[ "<< parameters.edition >>" == "enterprise" && -n "$CIRCLE_PR_NUMBER" ]]; then
echo "Nothing to do for forked PRs, so marking this step successful"
circleci step halt
fi
@@ -625,11 +625,12 @@ jobs:
- run:
name: Install gcloud SDK
command: |
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | \
sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install google-cloud-sdk
VERSION=298.0.0
curl -fLO https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${VERSION}-linux-x86_64.tar.gz
echo 0d58f451331abf43d080fa997c8e580d64897627e30be74f6d8f983ccfabef1e \
google-cloud-sdk-${VERSION}-linux-x86_64.tar.gz | sha256sum --check --strict --status
tar xf google-cloud-sdk-${VERSION}-linux-x86_64.tar.gz
./google-cloud-sdk/install.sh -q
# XXX: Is this necessary?
- run: docker run --privileged linuxkit/binfmt:v0.6
- run:
@@ -639,6 +640,7 @@ jobs:
- run:
name: Build Docker images
command: |
source google-cloud-sdk/path.bash.inc
if [[ -n $CIRCLE_TAG || $CIRCLE_BRANCH == "chore/test-release-pipeline" || $CIRCLE_BRANCH == "master" ]]; then
# It's a full build
/tmp/grabpl build-docker --jobs 4 --edition << parameters.edition >> \
@@ -811,29 +813,31 @@ jobs:
name: Install Go linters
command: |
pushd /tmp
curl -fLO https://github.com/golangci/golangci-lint/releases/download/v1.24.0/golangci-lint-1.24.0-linux-amd64.tar.gz
echo 241ca454102e909de04957ff8a5754c757cefa255758b3e1fba8a4533d19d179 \
golangci-lint-1.24.0-linux-amd64.tar.gz | sha256sum --check --strict --status
tar -xf golangci-lint-1.24.0-linux-amd64.tar.gz
sudo mv golangci-lint-1.24.0-linux-amd64/golangci-lint /usr/local/bin/
VERSION=1.27.0
curl -fLO https://github.com/golangci/golangci-lint/releases/download/v${VERSION}/golangci-lint-${VERSION}-linux-amd64.tar.gz
echo 8d345e4e88520e21c113d81978e89ad77fc5b13bfdf20e5bca86b83fc4261272 \
golangci-lint-${VERSION}-linux-amd64.tar.gz | sha256sum --check --strict --status
tar -xf golangci-lint-${VERSION}-linux-amd64.tar.gz
sudo mv golangci-lint-${VERSION}-linux-amd64/golangci-lint /usr/local/bin/
popd
make scripts/go/bin/revive scripts/go/bin/gosec
make scripts/go/bin/revive
- run:
name: Lint Go
command: |
go vet ./pkg/...
golangci-lint run -v -j 4 --config scripts/go/configs/ci/.golangci.yml -E deadcode -E gofmt \
-E gosimple -E ineffassign -E structcheck -E typecheck ./pkg/...
golangci-lint run -v -j 4 --config scripts/go/configs/ci/.golangci.yml -E unconvert -E unused \
-E varcheck -E goconst -E errcheck -E staticcheck ./pkg/...
# To save memory, run in two batches
golangci-lint run -v -j 4 --config scripts/go/configs/ci/.golangci.toml -E deadcode -E depguard -E dogsled \
-E errcheck -E goconst -E golint -E gosec -E gosimple -E govet -E scopelint ./pkg/...
golangci-lint run -v -j 4 --config scripts/go/configs/ci/.golangci.toml -E ineffassign \
-E rowserrcheck -E staticcheck -E structcheck -E typecheck -E unconvert -E unused -E varcheck ./pkg/...
./scripts/go/bin/revive -formatter stylish -config ./scripts/go/configs/revive.toml ./pkg/...
./scripts/go/bin/revive -formatter stylish -config ./scripts/go/configs/revive-strict.toml \
-exclude ./pkg/plugins/backendplugin/pluginextensionv2/... \
./pkg/services/alerting/... \
./pkg/services/provisioning/datasources/... \
./pkg/services/provisioning/dashboards/...
./scripts/go/bin/gosec -quiet -exclude=G104,G107,G108,G201,G202,G204,G301,G304,G401,G402,G501 \
-conf=./scripts/go/configs/gosec.json ./pkg/...
./pkg/services/provisioning/dashboards/... \
./pkg/services/provisioning/notifiers/... \
./pkg/services/provisioning/values/... \
./pkg/plugins/backendplugin/...
test-frontend:
executor: node
@@ -889,18 +893,13 @@ jobs:
when: on_success
build-docs-website:
executor: grafana-build
executor: base
steps:
- checkout
- setup_remote_docker
- run:
name: CI job started
command: "./scripts/ci-job-started.sh"
- run:
name: Install docker
command: |
apt-get update
apt-get install -y docker.io
- run:
name: Build Grafana docs website
command: |
@@ -972,7 +971,13 @@ jobs:
command: "./scripts/ci-job-succeeded.sh"
when: on_success
scan-docker-images:
scan-docker-image:
description: "Scans a docker image for vulnerabilities using trivy"
parameters:
image:
type: string
tag:
type: string
docker:
- image: circleci/buildpack-deps:stretch
steps:
@@ -995,29 +1000,11 @@ jobs:
name: Clear trivy cache
command: trivy --clear-cache
- run:
name: Scan grafana/grafana:master
command: trivy --exit-code 1 grafana/grafana:master
name: Scan Docker image for unkown/low/medium vulnerabilities
command: trivy --exit-code 0 --severity UNKNOWN,LOW,MEDIUM << parameters.image >>:<< parameters.tag >>
- run:
name: Scan grafana/grafana:master-ubuntu
command: trivy --exit-code 1 grafana/grafana:master-ubuntu
- run:
name: Scan grafana/grafana-enterprise:master
command: trivy --exit-code 1 grafana/grafana-enterprise:master
- run:
name: Scan grafana/grafana-enterprise:master-ubuntu
command: trivy --exit-code 1 grafana/grafana-enterprise:master-ubuntu
- run:
name: Scan grafana/grafana:latest
command: trivy --exit-code 1 grafana/grafana:latest
- run:
name: Scan grafana/grafana:latest-ubuntu
command: trivy --exit-code 1 grafana/grafana:latest-ubuntu
- run:
name: Scan grafana/grafana-enterprise:latest
command: trivy --exit-code 1 grafana/grafana-enterprise:latest
- run:
name: Scan grafana/grafana-enterprise:latest-ubuntu
command: trivy --exit-code 1 grafana/grafana-enterprise:latest-ubuntu
name: Scan Docker image for high/critical vulnerabilities
command: trivy --exit-code 1 --severity HIGH,CRITICAL << parameters.image >>:<< parameters.tag >>
- save_cache:
key: vulnerability-db
paths:
@@ -1343,4 +1330,8 @@ workflows:
cron: "0 0 * * *"
filters: *filter-only-master
jobs:
- scan-docker-images
- scan-docker-image:
matrix:
parameters:
image: [grafana/grafana, grafana/grafana-enterprise]
tag: [latest, master, latest-ubuntu, master-ubuntu]

41
.github/CODEOWNERS vendored
View File

@@ -14,10 +14,47 @@
# Documentation owner: Diana Payton
/docs/ @oddlittlebird
/contribute/ @oddlittlebird @marcusolsson
# @grafana/ui component documentation
*.mdx @marcusolsson @jessover9000
# Backend code
*.go @grafana/backend-platform
go.mod @grafana/backend-platform
go.sum @grafana/backend-platform
/e2e @grafana/grafana-frontend-platform
/packages @grafana/grafana-frontend-platform
/plugins-bundled @grafana/grafana-frontend-platform
/public @grafana/grafana-frontend-platform
/scripts/build/release-packages.sh @grafana/grafana-frontend-platform
/scripts/circle-release-next-packages.sh @grafana/grafana-frontend-platform
/scripts/ci-frontend-metrics.sh @grafana/grafana-frontend-platform
/scripts/grunt @grafana/grafana-frontend-platform
/scripts/webpack @grafana/grafana-frontend-platform
package.json @grafana/grafana-frontend-platform
tsconfig.json @grafana/grafana-frontend-platform
lerna.json @grafana/grafana-frontend-platform
.babelrc @grafana/grafana-frontend-platform
.prettierrc.js @grafana/grafana-frontend-platform
.eslintrc @grafana/grafana-frontend-platform
# @grafana/ui component documentation
*.mdx @marcusolsson @jessover9000 @grafana/grafana-frontend-platform
/public/app/features/explore/ @grafana/observability-squad
/packages/jaeger-ui-components/ @grafana/observability-squad
# Core datasources
/public/app/plugins/datasource/cloudwatch @grafana/backend-platform @grafana/observability-squad
/public/app/plugins/datasource/elasticsearch @grafana/observability-squad
/public/app/plugins/datasource/grafana-azure-monitor-datasource @grafana/backend-platform
/public/app/plugins/datasource/graphite @grafana/observability-squad
/public/app/plugins/datasource/influxdb @grafana/observability-squad
/public/app/plugins/datasource/jaeger @grafana/observability-squad
/public/app/plugins/datasource/loki @grafana/observability-squad
/public/app/plugins/datasource/mssql @grafana/backend-platform
/public/app/plugins/datasource/mysql @grafana/backend-platform
/public/app/plugins/datasource/opentsdb @grafana/backend-platform
/public/app/plugins/datasource/postgres @grafana/backend-platform
/public/app/plugins/datasource/prometheus @grafana/observability-squad
/public/app/plugins/datasource/cloud-monitoring @grafana/backend-platform
/public/app/plugins/datasource/zipkin @grafana/observability-squad

View File

@@ -5,9 +5,13 @@ labels: 'type: bug'
---
<!--
Please use this template while reporting a bug and provide as much info as possible.
Questions should be posted to https://community.grafana.com
Use query inspector to troubleshoot issues: https://community.grafana.com/t/using-grafanas-query-inspector-to-troubleshoot-issues/2630
Please use this template to create your bug report. By providing as much info as possible you help us understand the issue, reproduce it and resolve it for you quicker. Therefor take a couple of extra minutes to make sure you have provided all info needed.
PROTIP: record your screen and attach it as a gif to showcase the issue.
* Questions should be posted to: https://community.grafana.com
* Use query inspector to troubleshoot issues: https://bit.ly/2XNF6YS
* How to record and attach gif: https://bit.ly/2Mi8T6K
-->
**What happened**:

View File

@@ -0,0 +1,39 @@
---
name: '@grafana/ui component request'
about: Suggest a component for the @grafana/ui package
labels: 'area/grafana/ui'
---
<!--
By using this template you will make it easier for us to make sure that documentation and implementation stays up to date for every component in @grafana/ui
Thank you!
-->
**Why is this component needed**:
<!-- Explain your use case -->
___
- [ ] Is/could it be used in more than one place in Grafana?
**Where is/could it be used?**:
___
- [ ] Post screenshots possible.
- [ ] It has a single use case.
- [ ] It is/could be used in multiple places.
**Implementation** (Checklist meant for the person implementing the component)
- [ ] Component has a story in Storybook.
- [ ] Props and naming follows [our style guide](https://github.com/grafana/grafana/blob/master/contribute/style-guides/frontend.md).
- [ ] It is extendable (rest props are spread, styles with className work, and so on).
- [ ] Uses [theme for spacing, colors, and so on](https://github.com/grafana/grafana/blob/master/contribute/style-guides/themes.md).
- [ ] Works with both light and dark theme.
**Documentation**
- [ ] Properties are documented.
- [ ] Use cases are described.
- [ ] Code examples for the different use cases.
- [ ] Dos and don'ts.
- [ ] Styling guidelines, specific color usage (if applicable).

4
.gitignore vendored
View File

@@ -15,6 +15,7 @@ awsconfig
.yarnrc
.yarn/
vendor/
.eslintcache
# Enterprise emails
/emails/templates/enterprise_*
@@ -46,6 +47,7 @@ public/css/*.min.css
.DS_Store
.vscode/
.vs/
.eslintcache
/data/*
/bin/*
@@ -112,7 +114,7 @@ compilation-stats.json
/packages/grafana-e2e/cypress/logs
/e2e/server.log
/e2e/**/screenshots
!/e2e/**/screenshots/expeced/*
!/e2e/**/screenshots/expected/*
/e2e/**/videos/*
# report dumping the whole system env

View File

@@ -1,14 +1,100 @@
# 7.0.0 (unreleased)
# 7.0.5 (2020-06-30)
### Bug Fixes
- **Datasource**: Make sure data proxy timeout applies to HTTP client. [#25865](https://github.com/grafana/grafana/pull/25865), [@marefr](https://github.com/marefr)
- **Graphite**: Fix tag value dropdowns not showing in query editor. [#25889](https://github.com/grafana/grafana/pull/25889), [@torkelo](https://github.com/torkelo)
# 7.0.4 (2020-06-25)
### Features / Enhancements
- **Dashboard**: Redirects for old (pre 7.0) edit & view panel urls. [#25653](https://github.com/grafana/grafana/pull/25653), [@torkelo](https://github.com/torkelo)
- **Stackdriver**: Use default project name if project name isn't set on the query. [#25413](https://github.com/grafana/grafana/pull/25413), [@alexashley](https://github.com/alexashley)
- **TablePanel**: Sort numbers correctly. [#25421](https://github.com/grafana/grafana/pull/25421), [@speakyourcode](https://github.com/speakyourcode)
- **Update Bitcoin currency to use proper symbol, add mBTC and μBTC**. [#24182](https://github.com/grafana/grafana/pull/24182), [@overcookedpanda](https://github.com/overcookedpanda)
- **Variables**: Links that update variables on current dashboard does not trigger refresh / update. [#25192](https://github.com/grafana/grafana/pull/25192), [@torkelo](https://github.com/torkelo)
### Bug Fixes
- **Azure Monitor**: fixes undefined is not iterable. [#25586](https://github.com/grafana/grafana/pull/25586), [@hugohaggmark](https://github.com/hugohaggmark)
- **Datasources**: Handle URL parsing error. [#25742](https://github.com/grafana/grafana/pull/25742), [@marefr](https://github.com/marefr)
- **InfluxDB**: Fix invalid memory address or nil pointer dereference when schema is missing in URL. [#25565](https://github.com/grafana/grafana/pull/25565), [@marefr](https://github.com/marefr)
- **Security**: Use Header.Set and Header.Del for X-Grafana-User header. [#25495](https://github.com/grafana/grafana/pull/25495), [@beardhatcode](https://github.com/beardhatcode)
- **Stackdriver**: Fix creating Label Values datasource query variable. [#25633](https://github.com/grafana/grafana/pull/25633), [@papagian](https://github.com/papagian)
- **Table**: Support custom date formats via custom unit. [#25195](https://github.com/grafana/grafana/pull/25195), [@torkelo](https://github.com/torkelo)
- **Templating**: Fixes query variable with \${\_\_searchFilter} value selection not causing refresh & url update. [#25770](https://github.com/grafana/grafana/pull/25770), [@torkelo](https://github.com/torkelo)
# 7.0.3 (2020-06-03)
### Features / Enhancements
- **Stats**: include all fields. [#24829](https://github.com/grafana/grafana/pull/24829), [@ryantxu](https://github.com/ryantxu)
- **Variables**: change VariableEditorList row action Icon to IconButton. [#25217](https://github.com/grafana/grafana/pull/25217), [@hshoff](https://github.com/hshoff)
### Bug Fixes
- **Cloudwatch**: Fix dimensions of DDoSProtection. [#25317](https://github.com/grafana/grafana/pull/25317), [@papagian](https://github.com/papagian)
- **Configuration**: Fix env var override of sections containing hyphen. [#25178](https://github.com/grafana/grafana/pull/25178), [@marefr](https://github.com/marefr)
- **Dashboard**: Get panels in collapsed rows. [#25079](https://github.com/grafana/grafana/pull/25079), [@peterholmberg](https://github.com/peterholmberg)
- **Do not show alerts tab when alerting is disabled**. [#25285](https://github.com/grafana/grafana/pull/25285), [@dprokop](https://github.com/dprokop)
- **Jaeger**: fixes cascader option label duration value. [#25129](https://github.com/grafana/grafana/pull/25129), [@Estrax](https://github.com/Estrax)
- **Transformations**: Fixed Transform tab crash & no update after adding first transform. [#25152](https://github.com/grafana/grafana/pull/25152), [@torkelo](https://github.com/torkelo)
# 7.0.2 (2020-06-03)
- **Security**: Urgent security patch release. Please read more in our [blog](https://grafana.com/blog/2020/06/03/grafana-6.7.4-and-7.0.2-released-with-important-security-fix/)
# 7.0.1 (2020-05-26)
### Features / Enhancements
- **Datasource/CloudWatch**: Makes CloudWatch Logs query history more readable. [#24795](https://github.com/grafana/grafana/pull/24795), [@kaydelaney](https://github.com/kaydelaney)
- **Download CSV**: Add date and time formatting. [#24992](https://github.com/grafana/grafana/pull/24992), [@ryantxu](https://github.com/ryantxu)
- **Table**: Make last cell value visible when right aligned. [#24921](https://github.com/grafana/grafana/pull/24921), [@peterholmberg](https://github.com/peterholmberg)
- **TablePanel**: Adding sort order persistance. [#24705](https://github.com/grafana/grafana/pull/24705), [@torkelo](https://github.com/torkelo)
- **Transformations**: Display correct field name when using reduce transformation. [#25068](https://github.com/grafana/grafana/pull/25068), [@peterholmberg](https://github.com/peterholmberg)
- **Transformations**: Allow custom number input for binary operations. [#24752](https://github.com/grafana/grafana/pull/24752), [@ryantxu](https://github.com/ryantxu)
### Bug Fixes
- **Cloudwatch**: Fix AWS WAF and AWS DDoSProtection metrics. [#25071](https://github.com/grafana/grafana/pull/25071), [@papagian](https://github.com/papagian)
- **Dashboard/Links**: Fixes dashboard links by tags not working. [#24773](https://github.com/grafana/grafana/pull/24773), [@KamalGalrani](https://github.com/KamalGalrani)
- **Dashboard/Links**: Fixes open in new window for dashboard link. [#24772](https://github.com/grafana/grafana/pull/24772), [@KamalGalrani](https://github.com/KamalGalrani)
- **Dashboard/Links**: Variables are resolved and limits to 100. [#25076](https://github.com/grafana/grafana/pull/25076), [@hugohaggmark](https://github.com/hugohaggmark)
- **DataLinks**: Bring back variables interpolation in title. [#24970](https://github.com/grafana/grafana/pull/24970), [@dprokop](https://github.com/dprokop)
- **Datasource/CloudWatch**: Field suggestions no longer limited to prefix-only. [#24855](https://github.com/grafana/grafana/pull/24855), [@kaydelaney](https://github.com/kaydelaney)
- **Explore/Table**: Keep existing field types if possible. [#24944](https://github.com/grafana/grafana/pull/24944), [@kaydelaney](https://github.com/kaydelaney)
- **Explore**: Fix wrap lines toggle for results of queries with filter expression. [#24915](https://github.com/grafana/grafana/pull/24915), [@ivanahuckova](https://github.com/ivanahuckova)
- **Explore**: fix undo in query editor. [#24797](https://github.com/grafana/grafana/pull/24797), [@zoltanbedi](https://github.com/zoltanbedi)
- **Explore**: fix word break in type head info. [#25014](https://github.com/grafana/grafana/pull/25014), [@zoltanbedi](https://github.com/zoltanbedi)
- **Graph**: Legend decimals now work as expected. [#24931](https://github.com/grafana/grafana/pull/24931), [@torkelo](https://github.com/torkelo)
- **LoginPage**: Fix hover color for service buttons. [#25009](https://github.com/grafana/grafana/pull/25009), [@tskarhed](https://github.com/tskarhed)
- **LogsPanel**: Fix scrollbar. [#24850](https://github.com/grafana/grafana/pull/24850), [@ivanahuckova](https://github.com/ivanahuckova)
- **MoveDashboard**: Fix for moving dashboard caused all variables to be lost. [#25005](https://github.com/grafana/grafana/pull/25005), [@torkelo](https://github.com/torkelo)
- **Organize transformer**: Use display name in field order comparer. [#24984](https://github.com/grafana/grafana/pull/24984), [@dprokop](https://github.com/dprokop)
- **Panel**: shows correct panel menu items in view mode. [#24912](https://github.com/grafana/grafana/pull/24912), [@hugohaggmark](https://github.com/hugohaggmark)
- **PanelEditor Fix missing labels and description if there is only single option in category**. [#24905](https://github.com/grafana/grafana/pull/24905), [@dprokop](https://github.com/dprokop)
- **PanelEditor**: Overrides name matcher still show all original field names even after Field default display name is specified. [#24933](https://github.com/grafana/grafana/pull/24933), [@torkelo](https://github.com/torkelo)
- **PanelInspector**: Makes sure Data display options are visible. [#24902](https://github.com/grafana/grafana/pull/24902), [@hugohaggmark](https://github.com/hugohaggmark)
- **PanelInspector**: Hides unsupported data display options for Panel type. [#24918](https://github.com/grafana/grafana/pull/24918), [@hugohaggmark](https://github.com/hugohaggmark)
- **PanelMenu**: Make menu disappear on button press. [#25015](https://github.com/grafana/grafana/pull/25015), [@tskarhed](https://github.com/tskarhed)
- **Postgres**: Fix add button. [#25087](https://github.com/grafana/grafana/pull/25087), [@phemmer](https://github.com/phemmer)
- **Prometheus**: Fix recording rules expansion. [#24977](https://github.com/grafana/grafana/pull/24977), [@ivanahuckova](https://github.com/ivanahuckova)
- **Stackdriver**: Fix creating Service Level Objectives (SLO) datasource query variable. [#25023](https://github.com/grafana/grafana/pull/25023), [@papagian](https://github.com/papagian)
# 7.0.0 (2020-05-18)
## Breaking changes
- **Removed PhantomJS**: PhantomJS was deprecated in [Grafana v6.4](https://grafana.com/docs/grafana/latest/guides/whats-new-in-v6-4/#phantomjs-deprecation) and starting from Grafana v7.0.0, all PhantomJS support has been removed. This means that Grafana no longer ships with a built-in image renderer, and we advise you to install the [Grafana Image Renderer plugin](https://grafana.com/grafana/plugins/grafana-image-renderer).
- **Docker**: Our Ubuntu based images have been upgraded to Ubuntu [20.04 LTS](https://releases.ubuntu.com/20.04/).
- **Dashboard**: A global minimum dashboard refresh interval is now enforced and defaults to 5 seconds.
- **@grafana/ui**: Forms migration notice, see [@grafana/ui changelog](https://github.com/grafana/grafana/blob/master/packages/grafana-ui/CHANGELOG.md)
- **@grafana/ui**: Select API change for creating custom values, see [@grafana/ui changelog](https://github.com/grafana/grafana/blob/master/packages/grafana-ui/CHANGELOG.md)
- **Interval calculation**: There is now a new option `Max data points` that controls the auto interval `$__interval` calculation. Interval was previously calculated by dividing the panel width by the time range. With the new max data points option it is now easy to set `$__interval` to a dynamic value that is time range agnostic. For example if you set `Max data points` to 10 Grafana will dynamically set `$__interval` by dividing the current time range by 10.
- **Datasource/Loki**: Support for [deprecated Loki endpoints](https://github.com/grafana/loki/blob/master/docs/api.md#lokis-http-api) has been removed.
- **Backend plugins**: Grafana now requires backend plugins to be signed, otherwise Grafana will not load/start them. This is an additional security measure to make sure backend plugin binaries and files haven't been tampered with. Refer to [Upgrade Grafana](https://grafana.com/docs/grafana/latest/installation/upgrading/#upgrading-to-v7-0) for more information.
- **Docker**: Our Ubuntu based images have been upgraded to Ubuntu [20.04 LTS](https://releases.ubuntu.com/20.04/).
- **@grafana/ui**: Forms migration notice, see [@grafana/ui changelog](https://github.com/grafana/grafana/blob/master/packages/grafana-ui/CHANGELOG.md)
- **@grafana/ui**: Select API change for creating custom values, see [@grafana/ui changelog](https://github.com/grafana/grafana/blob/master/packages/grafana-ui/CHANGELOG.md)
**Deprecation warnings**
@@ -51,7 +137,7 @@ Grafana 7.0 comes with a new table panel (and deprecates the old one). This new
### Panel inspector
The panel inspector is a feature that every panel will support, including internal as well as external community plugins. In this new panel inspector, you can view the raw data in a table format, apply some pre-defined transformations, and download as CSV. You can find the __Inspect__ setting in the panel menu. Use the keyboard shortcut `i` when hovering over a panel to get the panel inspector to appear.
The panel inspector is a feature that every panel will support, including internal as well as external community plugins. In this new panel inspector, you can view the raw data in a table format, apply some pre-defined transformations, and download as CSV. You can find the **Inspect** setting in the panel menu. Use the keyboard shortcut `i` when hovering over a panel to get the panel inspector to appear.
### Improved time zone support
@@ -61,6 +147,73 @@ With this feature, you can specify the local time zone of the service or system
We have also extended the time zone options so you can select any of the standard [ISO 8601 time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
### Features / Enhancements
- **Azure Monitor**: Deep linking from Log Analytic queries to the Azure Portal. [#24417](https://github.com/grafana/grafana/pull/24417), [@daniellee](https://github.com/daniellee)
- **Backend plugins**: Log deprecation warning when using the unofficial first version of backend plugins. [#24675](https://github.com/grafana/grafana/pull/24675), [@marefr](https://github.com/marefr)
- **CloudWatch/Logs**: Add data links to CloudWatch logs for deep linking to AWS. [#24334](https://github.com/grafana/grafana/pull/24334), [@kaydelaney](https://github.com/kaydelaney)
- **CloudWatch**: Unify look of query mode select between dashboard and explore. [#24648](https://github.com/grafana/grafana/pull/24648), [@aocenas](https://github.com/aocenas)
- **Docker**: Adds tzdata package to Ubuntu image. [#24422](https://github.com/grafana/grafana/pull/24422), [@xlson](https://github.com/xlson)
- **Editor**: New line on Enter, run query on Shift+Enter. [#24654](https://github.com/grafana/grafana/pull/24654), [@davkal](https://github.com/davkal)
- **Loki**: Allow multiple derived fields with the same name. [#24437](https://github.com/grafana/grafana/pull/24437), [@aocenas](https://github.com/aocenas)
- **Orgs**: Add future deprecation notice. [#24502](https://github.com/grafana/grafana/pull/24502), [@torkelo](https://github.com/torkelo)
### Bug Fixes
- **@grafana/toolkit**: Use process.cwd() instead of PWD to get directory. [#24677](https://github.com/grafana/grafana/pull/24677), [@zoltanbedi](https://github.com/zoltanbedi)
- **Admin**: Makes long settings values line break in settings page. [#24559](https://github.com/grafana/grafana/pull/24559), [@hugohaggmark](https://github.com/hugohaggmark)
- **Azure Monitor**: Fix failure when using table join in Log Analytics queries. [#24528](https://github.com/grafana/grafana/pull/24528), [@daniellee](https://github.com/daniellee)
- **CloudWatch/Logs**: Add error message when log groups are not selected. [#24361](https://github.com/grafana/grafana/pull/24361), [@aocenas](https://github.com/aocenas)
- **CloudWatch/Logs**: Allows a user to search for log groups that aren't there initially. [#24695](https://github.com/grafana/grafana/pull/24695), [@kaydelaney](https://github.com/kaydelaney)
- **CloudWatch/Logs**: Correctly interpolate variables in logs queries. [#24619](https://github.com/grafana/grafana/pull/24619), [@kaydelaney](https://github.com/kaydelaney)
- **CloudWatch/Logs**: Fix autocomplete after by keyword. [#24644](https://github.com/grafana/grafana/pull/24644), [@aocenas](https://github.com/aocenas)
- **CloudWatch/Logs**: Fix field autocomplete suggestions inside function. [#24406](https://github.com/grafana/grafana/pull/24406), [@aocenas](https://github.com/aocenas)
- **CloudWatch/Logs**: Fix fields not being refetched when log group changed. [#24529](https://github.com/grafana/grafana/pull/24529), [@aocenas](https://github.com/aocenas)
- **CloudWatch/Logs**: Fix panic on multiple aggregations queries. [#24683](https://github.com/grafana/grafana/pull/24683), [@aocenas](https://github.com/aocenas)
- **CloudWatch/Logs**: Fix query error when results were sparse. [#24702](https://github.com/grafana/grafana/pull/24702), [@aocenas](https://github.com/aocenas)
- **CloudWatch/Logs**: Fix suggestion for already inserted field. [#24581](https://github.com/grafana/grafana/pull/24581), [@aocenas](https://github.com/aocenas)
- **CloudWatch/Logs**: Fix suggestions of fields after comma. [#24520](https://github.com/grafana/grafana/pull/24520), [@aocenas](https://github.com/aocenas)
- **CloudWatch/Logs**: Fixes various autocomplete issues. [#24583](https://github.com/grafana/grafana/pull/24583), [@kaydelaney](https://github.com/kaydelaney)
- **CloudWatch/Logs**: Handle errors that are not awserr.Error instances. [#24641](https://github.com/grafana/grafana/pull/24641), [@aknuds1](https://github.com/aknuds1)
- **CloudWatch/Logs**: Handle invalidation of log groups when switching data source. [#24703](https://github.com/grafana/grafana/pull/24703), [@kaydelaney](https://github.com/kaydelaney)
- **CloudWatch/Logs**: Make stats hint show consistently. [#24392](https://github.com/grafana/grafana/pull/24392), [@aocenas](https://github.com/aocenas)
- **CloudWatch/Logs**: Prevents hidden data frame fields from displaying in tables. [#24580](https://github.com/grafana/grafana/pull/24580), [@kaydelaney](https://github.com/kaydelaney)
- **CloudWatch/Logs**: Results of stats queries are now grouped. [#24396](https://github.com/grafana/grafana/pull/24396), [@kaydelaney](https://github.com/kaydelaney)
- **CloudWatch/Logs**: Usability improvements. [#24447](https://github.com/grafana/grafana/pull/24447), [@kaydelaney](https://github.com/kaydelaney)
- **Dashboard**: Allow editing provisioned dashboard JSON and add confirmation when JSON is copied to dashboard. [#24680](https://github.com/grafana/grafana/pull/24680), [@dprokop](https://github.com/dprokop)
- **Dashboard**: Fix for strange "dashboard not found" errors when opening links in dashboard settings. [#24416](https://github.com/grafana/grafana/pull/24416), [@torkelo](https://github.com/torkelo)
- **Dashboard**: Fix so default data source is selected when data source can't be found in panel editor. [#24526](https://github.com/grafana/grafana/pull/24526), [@mckn](https://github.com/mckn)
- **Dashboard**: Fixed issue changing a panel from transparent back to normal in panel editor. [#24483](https://github.com/grafana/grafana/pull/24483), [@torkelo](https://github.com/torkelo)
- **Dashboard**: Make header names reflect the field name when exporting to CSV file from the the panel inspector. [#24624](https://github.com/grafana/grafana/pull/24624), [@peterholmberg](https://github.com/peterholmberg)
- **Dashboard**: Make sure side pane is displayed with tabs by default in panel editor. [#24636](https://github.com/grafana/grafana/pull/24636), [@dprokop](https://github.com/dprokop)
- **Data source**: Fix query/annotation help content formatting. [#24687](https://github.com/grafana/grafana/pull/24687), [@AgnesToulet](https://github.com/AgnesToulet)
- **Data source**: Fixes async mount errors. [#24579](https://github.com/grafana/grafana/pull/24579), [@Estrax](https://github.com/Estrax)
- **Data source**: Fixes saving a data source without failure when URL doesn't specify a protocol. [#24497](https://github.com/grafana/grafana/pull/24497), [@aknuds1](https://github.com/aknuds1)
- **Explore/Prometheus**: Show results of instant queries only in table. [#24508](https://github.com/grafana/grafana/pull/24508), [@ivanahuckova](https://github.com/ivanahuckova)
- **Explore**: Fix rendering of react query editors. [#24593](https://github.com/grafana/grafana/pull/24593), [@ivanahuckova](https://github.com/ivanahuckova)
- **Explore**: Fixes loading more logs in logs context view. [#24135](https://github.com/grafana/grafana/pull/24135), [@Estrax](https://github.com/Estrax)
- **Graphite**: Fix schema and dedupe strategy in rollup indicators for Metrictank queries. [#24685](https://github.com/grafana/grafana/pull/24685), [@torkelo](https://github.com/torkelo)
- **Graphite**: Makes query annotations work again. [#24556](https://github.com/grafana/grafana/pull/24556), [@hugohaggmark](https://github.com/hugohaggmark)
- **Logs**: Clicking "Load more" from context overlay doesn't expand log row. [#24299](https://github.com/grafana/grafana/pull/24299), [@kaydelaney](https://github.com/kaydelaney)
- **Logs**: Fix total bytes process calculation. [#24691](https://github.com/grafana/grafana/pull/24691), [@davkal](https://github.com/davkal)
- **Org/user/team preferences**: Fixes so UI Theme can be set back to Default. [#24628](https://github.com/grafana/grafana/pull/24628), [@AgnesToulet](https://github.com/AgnesToulet)
- **Plugins**: Fix manifest validation. [#24573](https://github.com/grafana/grafana/pull/24573), [@aknuds1](https://github.com/aknuds1)
- **Provisioning**: Use proxy as default access mode in provisioning. [#24669](https://github.com/grafana/grafana/pull/24669), [@bergquist](https://github.com/bergquist)
- **Search**: Fix select item when pressing enter and Grafana is served using a sub path. [#24634](https://github.com/grafana/grafana/pull/24634), [@tskarhed](https://github.com/tskarhed)
- **Search**: Save folder expanded state. [#24496](https://github.com/grafana/grafana/pull/24496), [@Clarity-89](https://github.com/Clarity-89)
- **Security**: Tag value sanitization fix in OpenTSDB data source. [#24539](https://github.com/grafana/grafana/pull/24539), [@rotemreiss](https://github.com/rotemreiss)
- **Table**: Do not include angular options in options when switching from angular panel. [#24684](https://github.com/grafana/grafana/pull/24684), [@torkelo](https://github.com/torkelo)
- **Table**: Fixed persisting column resize for time series fields. [#24505](https://github.com/grafana/grafana/pull/24505), [@torkelo](https://github.com/torkelo)
- **Table**: Fixes Cannot read property subRows of null. [#24578](https://github.com/grafana/grafana/pull/24578), [@hugohaggmark](https://github.com/hugohaggmark)
- **Time picker**: Fixed so you can enter a relative range in the time picker without being converted to absolute range. [#24534](https://github.com/grafana/grafana/pull/24534), [@mckn](https://github.com/mckn)
- **Transformations**: Make transform dropdowns not cropped. [#24615](https://github.com/grafana/grafana/pull/24615), [@dprokop](https://github.com/dprokop)
- **Transformations**: Sort order should be preserved as entered by user when using the reduce transformation. [#24494](https://github.com/grafana/grafana/pull/24494), [@hugohaggmark](https://github.com/hugohaggmark)
- **Units**: Adds scale symbol for currencies with suffixed symbol. [#24678](https://github.com/grafana/grafana/pull/24678), [@hugohaggmark](https://github.com/hugohaggmark)
- **Variables**: Fixes filtering options with more than 1000 entries. [#24614](https://github.com/grafana/grafana/pull/24614), [@hugohaggmark](https://github.com/hugohaggmark)
- **Variables**: Fixes so Textbox variables read value from url. [#24623](https://github.com/grafana/grafana/pull/24623), [@hugohaggmark](https://github.com/hugohaggmark)
- **Zipkin**: Fix error when span contains remoteEndpoint. [#24524](https://github.com/grafana/grafana/pull/24524), [@aocenas](https://github.com/aocenas)
- **SAML**: Switch from email to login for user login attribute mapping (Enterprise)
# 7.0.0-beta3 (2020-05-08)
### Features / Enhancements
@@ -127,6 +280,7 @@ We have also extended the time zone options so you can select any of the standar
- **Tracing**: Fix view bounds after trace change. [#23994](https://github.com/grafana/grafana/pull/23994), [@aocenas](https://github.com/aocenas)
- **Variables**: Migrates old tags format for consistency. [#24276](https://github.com/grafana/grafana/pull/24276), [@hugohaggmark](https://github.com/hugohaggmark)
- **Reporting**: Update report schedule as soon as a report is updated (Enterprise)
- **White-labeling**: Makes login title and subtitle configurable (Enterprise)
# 7.0.0-beta1 (2020-04-28)
@@ -258,6 +412,10 @@ We have also extended the time zone options so you can select any of the standar
- **Rich history**: Fix create url and run query for various datasources. [#23627](https://github.com/grafana/grafana/pull/23627), [@ivanahuckova](https://github.com/ivanahuckova)
- **Security**: Fix XSS vulnerability in table panel. [#23816](https://github.com/grafana/grafana/pull/23816), [@torkelo](https://github.com/torkelo)
# 6.7.4 (2020-06-03)
- **Security**: Urgent security patch release. Please read more in our [blog](https://grafana.com/blog/2020/06/03/grafana-6.7.4-and-7.0.2-released-with-important-security-fix/)
# 6.7.3 (2020-04-23)
### Bug Fixes

View File

@@ -58,10 +58,10 @@ When you're ready to contribute, it's time to [Create a pull request](/contribut
#### Contributor License Agreement (CLA)
Before we can accept your pull request, you need to [sign our CLA](https://grafana.com/docs/contribute/cla/). If you haven't, our CLA assistant prompts you to when you create your pull request.
Before we can accept your pull request, you need to [sign our CLA](https://grafana.com/docs/grafana/latest/developers/cla/). If you haven't, our CLA assistant prompts you to when you create your pull request.
## Where do I go from here?
- Set up your [development environment](contribute/developer-guide.md).
- Learn how to [contribute documentation](contribute/documentation.md).
- Get started [developing plugins](https://grafana.com/docs/plugins/developing/development/) for Grafana.
- Get started [developing plugins](https://grafana.com/docs/grafana/latest/developers/plugins/) for Grafana.

View File

@@ -1,4 +1,4 @@
FROM node:12.16.3-alpine3.11 as js-builder
FROM node:12.18.1-alpine3.12 as js-builder
WORKDIR /usr/src/app/
@@ -16,7 +16,7 @@ COPY emails emails
ENV NODE_ENV production
RUN ./node_modules/.bin/grunt build
FROM golang:1.14.2-alpine3.11 as go-builder
FROM golang:1.14.4-alpine3.12 as go-builder
RUN apk add --no-cache gcc g++
@@ -32,7 +32,7 @@ COPY build.go package.json ./
RUN go run build.go build
# Final stage
FROM alpine:3.11
FROM alpine:3.12
LABEL maintainer="Grafana team <hello@grafana.com>"

203
GOVERNANCE.md Normal file
View File

@@ -0,0 +1,203 @@
# Governance
This document describes the rules and governance of the project. It is meant to be followed by all the developers of the project and the Grafana community. Common terminology used in this governance document are listed below:
- **Team members**: Any members of the private [grafana-team][team] Google group.
- **Maintainers**: Maintainers lead an individual project or parts thereof ([`MAINTAINERS.md`][maintainers]).
- **Projects**: A single repository in the Grafana GitHub organization and listed below is referred to as a project:
- clock-panel
- devtools
- gel-app
- grafana
- grafana-github-datasource
- grafana-image-renderer
- grafana-kiosk
- grafana-plugin-sdk-go
- grafana-polystat-panel
- grafonnet-lib
- kairosdb-datasource
- piechart-panel
- simple-angular-panel
- simple-app-plugin
- simple-datasource
- simple-datasource-backend
- simple-json-backend-datasource
- simple-json-datasource
- simple-react-panel
- strava-datasource
- tutorials
- worldmap-panel
- **The Grafana project**: The sum of all activities performed under this governance, concerning one or more repositories or the community.
## Values
The Grafana developers and community are expected to follow the values defined in the Grafana Code of Conduct. Furthermore, the Grafana community strives for kindness, giving feedback effectively, and building a welcoming environment. The Grafana developers generally decide by consensus and only resort to conflict resolution by a majority vote if consensus cannot be reached.
## Projects
Each project must have a [`MAINTAINERS.md`][maintainers] file with at least one maintainer. Where a project has a release process, access and documentation should be such that more than one person can perform a release. Releases should be announced on the Grafana Labs blog. Any new projects should be first proposed on the [team mailing list][team] following the voting procedures listed below.
## Decision making
### Team members
Team member status may be given to those who have made ongoing contributions to the Grafana project for at least 3 months. This is usually in the form of code improvements and/or notable work on documentation, but organizing events or user support could also be taken into account.
New members may be proposed by any existing member by email to [grafana-team][team]. It is highly desirable to reach consensus about acceptance of a new member. However, the proposal is ultimately voted on by a formal [supermajority vote](#supermajority-vote).
If the new member proposal is accepted, the proposed team member should be contacted privately via email to confirm or deny their acceptance of team membership. This email will also be CC'd to [grafana-team][team] for record-keeping purposes.
If they choose to accept, the [onboarding](#onboarding) procedure is followed.
Team members may retire at any time by emailing [the team][team].
Team members can be removed by [supermajority vote](#supermajority-vote) on [the team mailing list][team].
For this vote, the member in question is not eligible to vote and does not count towards the quorum.
Any removal vote can cover only one single person.
Upon death of a member, they leave the team automatically.
In case a member leaves, the [offboarding](#offboarding) procedure is applied.
The current team members are:
- Alexander Zobnin ([Grafana Labs](https://grafana.com/))
- Andrej Ocenas ([Grafana Labs](https://grafana.com/))
- Arve Knudsen ([Grafana Labs](https://grafana.com/))
- Brian Gann ([Grafana Labs](https://grafana.com/))
- Carl Bergquist ([Grafana Labs](https://grafana.com/))
- Chris Trott ([Grafana Labs](https://grafana.com/))
- Daniel Lee ([Grafana Labs](https://grafana.com/))
- David Kaltschmidt ([Grafana Labs](https://grafana.com/))
- Diana Payton ([Grafana Labs](https://grafana.com/))
- Diana Sarlinska ([Grafana Labs](https://grafana.com/))
- Dominik Prokop ([Grafana Labs](https://grafana.com/))
- Emil Tullstedt ([Grafana Labs](https://grafana.com/))
- Hugo Häggmark ([Grafana Labs](https://grafana.com/))
- Ivana Huckova ([Grafana Labs](https://grafana.com/))
- Jeroen Op 't Eynde ([Grafana Labs](https://grafana.com/))
- Jessica Müller ([Grafana Labs](https://grafana.com/))
- Julien Pivotto ([Inuits](https://inuits.eu/))
- Kay Delaney ([Grafana Labs](https://grafana.com/))
- Kyle Brandt ([Grafana Labs](https://grafana.com/))
- Leonard Gram ([Grafana Labs](https://grafana.com/))
- Lukas Siatka ([Grafana Labs](https://grafana.com/))
- Malcolm Holmes ([Grafana Labs](https://grafana.com/))
- Marcus Andersson ([Grafana Labs](https://grafana.com/))
- Marcus Efraimsson ([Grafana Labs](https://grafana.com/))
- Marcus Olsson ([Grafana Labs](https://grafana.com/))
- Mitsuhiro Tanda ([GREE](https://corp.gree.net/jp/en/))
- Patrick OCarroll ([Grafana Labs](https://grafana.com/))
- Peter Holmberg ([Grafana Labs](https://grafana.com/))
- Richard Hartmann ([Grafana Labs](https://grafana.com/))
- Ryan McKinley ([Grafana Labs](https://grafana.com/))
- Sofia Papagiannaki ([Grafana Labs](https://grafana.com/))
- Stephanie Closson ([Grafana Labs](https://grafana.com/))
- Tobias Skarhed ([Grafana Labs](https://grafana.com/))
- Torkel Ödegaard ([Grafana Labs](https://grafana.com/))
- Utkarsh Bhatnagar ([Tinder](https://www.tinder.com/))
### Maintainers
Maintainers lead one or more project(s) or parts thereof and serve as a point of conflict resolution amongst the contributors to this project. Ideally, maintainers are also team members, but exceptions are possible for suitable maintainers that, for whatever reason, are not yet team members.
Changes in maintainership have to be announced on the [developers mailing list][devs]. They are decided by [rough consensus](#consensus) and formalized by changing the [`MAINTAINERS.md`][maintainers] file of the respective repository.
Maintainers are granted commit rights to all projects covered by this governance.
A maintainer or committer may resign by notifying the [team mailing list][team]. A maintainer with no project activity for a year is considered to have resigned. Maintainers that wish to resign are encouraged to propose another team member to take over the project.
A project may have multiple maintainers, as long as the responsibilities are clearly agreed upon between them. This includes coordinating who handles which issues and pull requests.
### Technical decisions
Technical decisions that only affect a single project are made informally by the maintainer of this project, and [rough consensus](#consensus) is assumed. Technical decisions that span multiple parts of the Grafana project should be discussed and made on the [Grafana developer mailing list][devs].
Decisions are usually made by [rough consensus](#consensus). If no consensus can be reached, the matter may be resolved by [majority vote](#majority-vote).
### Governance changes
Changes to this document are made by Grafana Labs.
### Other matters
Any matter that needs a decision may be called to a vote by any member if they deem it necessary. For private or personnel matters, discussion and voting takes place on the [team mailing list][team], otherwise on the [developer mailing list][devs].
## Voting
The Grafana project usually runs by informal consensus, however sometimes a formal decision must be made.
Depending on the subject matter, as laid out [above](#decision-making), different methods of voting are used.
For all votes, voting must be open for at least one week. The end date should be clearly stated in the call to vote. A vote may be called and closed early if enough votes have come in one way so that further votes cannot change the final decision.
In all cases, all and only [team members](#team-members) are eligible to vote, with the sole exception of the forced removal of a team member, in which said member is not eligible to vote.
Discussion and votes on personnel matters (including but not limited to team membership and maintainership) are held in private on the [team mailing list][team]. All other discussion and votes are held in public on the [developer mailing list][devs].
For public discussions, anyone interested is encouraged to participate. Formal power to object or vote is limited to [team members](#team-members).
### Consensus
The default decision making mechanism for the Grafana project is [rough][rough] consensus. This means that any decision on technical issues is considered supported by the [team][team] as long as nobody objects or the objection has been considered but not necessarily accommodated.
Silence on any consensus decision is implicit agreement and equivalent to explicit agreement. Explicit agreement may be stated at will. Decisions may, but do not need to be called out and put up for decision on the [developers mailing list][devs] at any time and by anyone.
Consensus decisions can never override or go against the spirit of an earlier explicit vote.
If any [team member](#team-members) raises objections, the team members work together towards a solution that all involved can accept. This solution is again subject to rough consensus.
In case no consensus can be found, but a decision one way or the other must be made, any [team member](#team-members) may call a formal [majority vote](#majority-vote).
### Majority vote
Majority votes must be called explicitly in a separate thread on the appropriate mailing list. The subject must be prefixed with `[VOTE]`. In the body, the call to vote must state the proposal being voted on. It should reference any discussion leading up to this point.
Votes may take the form of a single proposal, with the option to vote yes or no, or the form of multiple alternatives.
A vote on a single proposal is considered successful if more vote in favor than against.
If there are multiple alternatives, members may vote for one or more alternatives, or vote “no” to object to all alternatives. It is not possible to cast an “abstain” vote. A vote on multiple alternatives is considered decided in favor of one alternative if it has received the most votes in favor, and a vote from more than half of those voting. Should no alternative reach this quorum, another vote on a reduced number of options may be called separately.
### Supermajority vote
Supermajority votes must be called explicitly in a separate thread on the appropriate mailing list. The subject must be prefixed with `[VOTE]`. In the body, the call to vote must state the proposal being voted on. It should reference any discussion leading up to this point.
Votes may take the form of a single proposal, with the option to vote yes or no, or the form of multiple alternatives.
A vote on a single proposal is considered successful if at least two thirds of those eligible to vote vote in favor.
If there are multiple alternatives, members may vote for one or more alternatives, or vote “no” to object to all alternatives. A vote on multiple alternatives is considered decided in favor of one alternative if it has received the most votes in favor, and a vote from at least two thirds of those eligible to vote. Should no alternative reach this quorum, another vote on a reduced number of options may be called separately.
## On- / Offboarding
### Onboarding
The new member is
- added to the list of [team members](#team-members). Ideally by sending a PR of their own, at least approving said PR.
- announced on the [developers mailing list][devs] by an existing team member. Ideally, the new member replies in this thread, acknowledging team membership.
- added to the projects with commit rights.
- added to the [team mailing list][team].
### Offboarding
The ex-member is
- removed from the list of [team members](#team-members). Ideally by sending a PR of their own, at least approving said PR. In case of forced removal, no approval is needed.
- removed from the projects. Optionally, they can retain maintainership of one or more repositories if the [team](#team-members) agrees.
- removed from the team mailing list and demoted to a normal member of the other mailing lists.
- not allowed to call themselves an active team member any more, nor allowed to imply this to be the case.
- added to a list of previous members if they so choose.
If needed, we reserve the right to publicly announce removal.
[coc]: https://github.com/grafana/grafana/blob/master/CODE_OF_CONDUCT.md
[devs]: https://groups.google.com/forum/#!forum/grafana-developers
[maintainers]: https://github.com/grafana/grafana/blob/master/MAINTAINERS.md
[rough]: https://tools.ietf.org/html/rfc7282
[team]: https://groups.google.com/forum/#!forum/grafana-team

View File

@@ -143,7 +143,7 @@ Label | Description
`type/feature-request` | Request for a new feature or enhancement.
`type/docs` | Documentation problem or enhancement.
`type/accessibility` | Accessibility problem or enhancement.
`type/question` | Issue is or perceived as a question.
`type/question` | Issue is a question or is perceived as such.
`type/duplicate` | An existing issue of the same subject/request have already been reported.
`type/works-as-intended` | A reported bug works as intended/by design.
`type/build-packaging` | Build or packaging problem or enhancement.
@@ -152,7 +152,7 @@ Label | Description
### Duplicate issue?
Make sure that it's not a duplicate by searching existing issues using related terms from the issue title and description. If you think you know there are an existing issue, but can't find it please reach out to one of the maintainers and ask for help. If you identify that the issue is a duplicate of an existing issue:
Make sure it's not a duplicate by searching existing issues using related terms from the issue title and description. If you think you know there is an existing issue, but can't find it, please reach out to one of the maintainers and ask for help. If you identify that the issue is a duplicate of an existing issue:
1. Add a comment `Duplicate of #<issue number>`. GitHub will recognize this and add some additional context to the issue activity.
2. Close the issue and label it with `type/duplicate`.
@@ -188,8 +188,8 @@ If it's not perfectly clear that it's an actual bug, quickly try to reproduce it
First, evaluate if the documentation makes sense to be included in the Grafana project:
- Is this something we want/can maintain as a project?
- Is this referring to usage of some specific integration/tool and in that case are those a popular use case in combination with Grafana?
- If unsure, kindly and politely add a comment explaining that we would need [upvotes](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments) to identify that lots of other users wants/needs this.
- Is this referring to usage of some specific integration/tool and in that case is that a popular use case in combination with Grafana?
- If unsure, kindly and politely add a comment explaining that we would need [upvotes](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments) to identify that lots of other users want/need this.
Second, label the issue `type/docs` and at least one `area/*` or `datasource/*` label.
@@ -219,9 +219,9 @@ In general bugs and enhancement issues should be labeled with a priority.
This is the most difficult thing with triaging issues since it requires a lot of knowledge, context and experience before being able to think of and start feel comfortable adding a certain priority label.
The key here is asking for help and discuss issues to understand how more experienced project members thinks and reason. By doing that you learn more and eventually be more and more comfortable with prioritizing issues.
The key here is asking for help and discuss issues to understand how more experienced project members think and reason. By doing that you learn more and eventually be more and more comfortable with prioritizing issues.
In any case there are uncertainty around the priorization of an issue, please ask the maintainers for help.
In case there is an uncertainty around the prioritization of an issue, please ask the maintainers for help.
Label | Description
------- | --------
@@ -235,7 +235,7 @@ Label | Description
**Critical bug?**
1. If a bug have been categorized and any of the following problems applies the bug should be labeled as critical and must be actively worked on as someone's top priority right now.
1. If a bug has been categorized and any of the following criteria apply, the bug should be labeled as critical and must be actively worked on as someone's top priority right now.
- Results in any data loss
- Critical security or performance issues
@@ -273,9 +273,9 @@ Label | Description
## 5. Requesting help from the community
Depending on the issue and/or priority, it's always a good idea to consider signalling to the community that help from community is appreciated and needed in case an issue is not prioritized to be worked on by maintainers. Use your best judgement. In general, when requesting help from the community it means a contribution has a good chance of getting accepted and merged.
Depending on the issue and/or priority, it's always a good idea to consider signalling to the community that help from community is appreciated and needed in case an issue is not prioritized to be worked on by maintainers. Use your best judgement. In general, requesting help from the community means that a contribution has a good chance of getting accepted and merged.
In many cases the issue author or community as a whole is more suitable to contribute changes since they're experts in their domain. It's also quite common that someone has tried to get something to work using the documentation without success and made an effort to get it to work and/or reached out to the [community site](https://community.grafana.com/) to get the missing information. In especially these areas it's more likely that there exists experts in their own domain and usually a good idea to request help from contributors:
In many cases the issue author or community as a whole is more suitable to contribute changes since they're experts in their domain. It's also quite common that someone has tried to get something to work using the documentation without success and made an effort to get it to work and/or reached out to the [community site](https://community.grafana.com/) to get the missing information. Particularly in these areas it's more likely that there exist experts in their own domain and it is usually a good idea to request help from contributors:
- Database setups
- Authentication like OAuth providers and LDAP setups
@@ -292,11 +292,11 @@ In many cases the issue author or community as a whole is more suitable to contr
## Investigation of issues
When an issue has all basic information provided, but the triage responsible haven't been able to reproduce the reported problem at a first glance, the issue is labeled [Needs investigation](https://github.com/grafana/grafana/labels/needs%20investigation). Depending of the perceived severity and/or number of [upvotes](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments), the investigation will either be delegated to another maintainer for further investigation or either put on hold until someone else (maintainer or contributor) picks it up and eventually start investigating it.
When an issue has all basic information provided, but the triage responsible haven't been able to reproduce the reported problem at a first glance, the issue is labeled [Needs investigation](https://github.com/grafana/grafana/labels/needs%20investigation). Depending on the perceived severity and/or number of [upvotes](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments), the investigation will either be delegated to another maintainer for further investigation or put on hold until someone else (maintainer or contributor) picks it up and eventually starts investigating it.
Investigating issues can be a very time consuming task, especially for the maintainers given the huge number of combinations of plugins, data sources, platforms, databases, browsers, tools, hardware, integrations, versions and cloud services etc that are being used with Grafana. There are a certain amount of combinations that are more common than others and these are in general easier for maintainers to investigate.
Investigating issues can be a very time consuming task, especially for the maintainers, given the huge number of combinations of plugins, data sources, platforms, databases, browsers, tools, hardware, integrations, versions and cloud services, etc that are being used with Grafana. There is a certain number of combinations that are more common than others, and these are in general easier for maintainers to investigate.
For some other combinations there may not be possible at all for a maintainer to setup a proper test environment for being able to investigate. In these cases we really appreciate any help we can get from the community. Otherwise the issue is highly likely to be closed.
For some other combinations it may not be possible at all for a maintainer to setup a proper test environment to investigate the issue. In these cases we really appreciate any help we can get from the community. Otherwise the issue is highly likely to be closed.
Even if you don't have the time or knowledge to investigate an issue we highly recommend that you [upvote](https://help.github.com/en/articles/about-conversations-on-github#reacting-to-ideas-in-comments) the issue if you happen to have the same problem. If you have further details that may help investigating the issue please provide as much information as possible.
@@ -306,14 +306,14 @@ Part of issue triage should also be triaging of external PRs. Main goal should b
1. Check new external PRs which do not have a reviewer.
1. Check if there is a link to an existing issue.
1. If not and you know which issue it is solving add the link yourself, otherwise ask the author to link the issue or create one.
1. If not and you know which issue it is solving, add the link yourself, otherwise ask the author to link the issue or create one.
1. Assign a reviewer based on who was handling the linked issue or what code or feature does the PR touches (look at who was the last to make changes there if all else fails).
## Appendix
### Setting up Gmail filters
If you're using Gmail it's highly recommened that you setup filters to automatically remove email from the inbox and label them accordingly to make it easy for you to understand when you need to act upon a notification or process all incoming issues that haven't been triaged.
If you're using Gmail it's highly recommended that you setup filters to automatically remove email from the inbox and label them accordingly to make it easy for you to understand when you need to act upon a notification or process all incoming issues that haven't been triaged.
This may be setup by personal preference, but here's a working configuration for reference.
1. Follow instructions in [gist](https://gist.github.com/marefr/9167c2e31466f6316c1cba118874e74f)
@@ -335,6 +335,6 @@ This will give you a structure of labels in the sidebar similar to the following
- Grafana
```
* All notifications youll need to read/take action on shows up as unread in Github (mine) and its sub-labels.
* All other notifications you dont need to take action on shows up as unread in Github (other) and its sub-labels
* All notifications youll need to read/take action on show up as unread in Github (mine) and its sub-labels.
* All other notifications you dont need to take action on show up as unread in Github (other) and its sub-labels
* This is convenient for issue triage and to follow the activity in the Grafana project.

8
MAINTAINERS.md Normal file
View File

@@ -0,0 +1,8 @@
@torkelo is the main/default maintainer, some parts of the codebase have other maintainers:
* Backend:
* @bergquist
* Plugins:
* @ryantxu
* UX/UI:
* @davkal

View File

@@ -4,7 +4,7 @@
-include local/Makefile
.PHONY: all deps-go deps-js deps build-go build-server build-cli build-js build build-docker-dev build-docker-full lint-go gosec revive golangci-lint go-vet test-go test-js test run run-frontend clean devenv devenv-down revive-alerting protobuf 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 revive golangci-lint test-go test-js test run run-frontend clean devenv devenv-down revive-strict protobuf help
GO = GO111MODULE=on go
GO_FILES ?= ./pkg/...
@@ -42,6 +42,7 @@ build-cli: ## Build Grafana CLI application.
build-js: ## Build frontend assets.
@echo "build frontend"
yarn run build
yarn run plugins:build-bundled
build: build-go build-js ## Build backend and frontend.
@@ -80,14 +81,18 @@ revive: scripts/go/bin/revive
-config ./scripts/go/configs/revive.toml \
$(GO_FILES)
revive-alerting: scripts/go/bin/revive
@echo "lint alerting via revive"
revive-strict: scripts/go/bin/revive
@echo "lint via revive (strict)"
@scripts/go/bin/revive \
-formatter stylish \
-config ./scripts/go/configs/revive-strict.toml \
-exclude ./pkg/plugins/backendplugin/pluginextensionv2/... \
./pkg/services/alerting/... \
./pkg/services/provisioning/datasources/... \
./pkg/services/provisioning/dashboards/...
./pkg/services/provisioning/dashboards/... \
./pkg/services/provisioning/notifiers/... \
./pkg/services/provisioning/values/... \
./pkg/plugins/backendplugin/...
scripts/go/bin/golangci-lint: scripts/go/go.mod
@cd scripts/go; \
@@ -96,26 +101,10 @@ scripts/go/bin/golangci-lint: scripts/go/go.mod
golangci-lint: scripts/go/bin/golangci-lint
@echo "lint via golangci-lint"
@scripts/go/bin/golangci-lint run \
--config ./scripts/go/configs/.golangci.yml \
--config ./scripts/go/configs/.golangci.toml \
$(GO_FILES)
scripts/go/bin/gosec: scripts/go/go.mod
@cd scripts/go; \
$(GO) build -o ./bin/gosec github.com/securego/gosec/cmd/gosec
# TODO recheck the rules and leave only necessary exclusions
gosec: scripts/go/bin/gosec
@echo "lint via gosec"
@scripts/go/bin/gosec -quiet \
-exclude=G104,G107,G108,G201,G202,G204,G301,G304,G401,G402,G501 \
-conf=./scripts/go/configs/gosec.json \
$(GO_FILES)
go-vet:
@echo "lint via go vet"
@$(GO) vet $(GO_FILES)
lint-go: go-vet golangci-lint revive revive-alerting gosec ## Run all code checks for backend.
lint-go: golangci-lint revive revive-strict # Run all code checks for backend.
# with disabled SC1071 we are ignored some TCL,Expect `/usr/bin/env expect` scripts
shellcheck: $(SH_FILES) ## Run checks for shell scripts.

View File

@@ -15,15 +15,6 @@ Grafana allows you to query, visualize, alert on and understand your metrics no
- **Alerting:** Visually define alert rules for your most important metrics. Grafana will continuously evaluate and send notifications to systems like Slack, PagerDuty, VictorOps, OpsGenie.
- **Mixed Data Sources:** Mix different data sources in the same graph! You can specify a data source on a per-query basis. This works for even custom datasources.
### Grafana 7.0 and GrafanaCONline
- Grafana 7.0 Beta is [available for download](https://grafana.com/grafana/download).
- Read [what's is new](https://grafana.com/docs/grafana/latest/guides/whats-new-in-v7-0/).
Want to learn more about Grafana 7 and more? Sign up for our online conference!
[![GrafanaCONline](public/img/grafanaconline.png)](https://grafana.com/about/events/grafanacon/2020/?source=grafana-readme)
## Get started
- [Get Grafana](https://grafana.com/get)

View File

@@ -6,7 +6,7 @@ Please encrypt your message to us; please use our PGP key. The key fingerprint i
F988 7BEA 027A 049F AE8E 5CAA D125 8932 BE24 C5CA
The key is available from [pgp.mit.edu](https://pgp.mit.edu/pks/lookup?op=get&search=0xF9887BEA027A049FAE8E5CAAD1258932BE24C5CA) by searching for [grafana](https://pgp.mit.edu/pks/lookup?search=grafana&op=index).
The key is available from [keyserver.ubuntu.com](https://keyserver.ubuntu.com/pks/lookup?search=0xF9887BEA027A049FAE8E5CAAD1258932BE24C5CA&fingerprint=on&op=index).
Grafana Labs will send you a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.

73
WORKFLOW.md Normal file
View File

@@ -0,0 +1,73 @@
# Grafana workflow
This document is based on [GOVERNANCE.md](GOVERNANCE.md). We assume good faith and intend to keep all processes as lightweight as possible but as specific as required. In case of disagreements about anything in this document, GOVERNANCE.md applies.
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in [RFC2119](http://tools.ietf.org/html/rfc2119).
Git and [GitHub terminology](https://help.github.com/en/github/getting-started-with-github/github-glossary) are used throughout this document.
Team members and their access to repositories is maintained through [GitHub teams](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams). Team maintainers add and remove team members as outlined in GOVERNANCE.md.
# Code changes
## Proposing changes
Examples of proposed changes are overarching architecture, component design, and specific code or graphical elements. Proposed changes SHOULD cover the big picture and intention, but individual parts SHOULD be split into the smallest possible changes. Changes SHOULD be based on and target the master branch. Depending on size of the proposed change, each change SHOULD be discussed, in increasing order of change size and complexity:
* Directly in a RR (Pull Request) - this MAY be done, but SHOULD not be the common case.
* Issue
* Developer mailing list
* Design document, shared via Google Docs, accessible to at least all team members.
Significant changes MUST be discussed and agreed upon with the relevant subsystem maintainers.
## Merging PRs (Pull Requests)
Depending on the size and complexity of a PR, different requirements MUST be applied. Any team member contributing substantially to a PR MUST NOT count against review requirements.
Commits MUST be merged into master using PRs. They MUST NOT be merged into master directly.
* Every merge MUST be approved by at least one team member.
* Non-trivial changes MUST be approved by at least
* two team members, or
* one subsystem maintainer.
* Significant changes MUST be approved by at least
* two team members, AND
* the relevant subsystem maintainer.
PRs MUST be [reviewed](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/reviewing-changes-in-pull-requests) and [approved](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/approving-a-pull-request-with-required-reviews) via GitHubs review system.
* Reviewers MAY write comments if approving
* Reviewers MUST write comments if rejecting a PR or if requesting changes.
Once a PR is approved as per above, any team member MAY merge the PR.
# Release workflow
## Branch structure
Grafana uses trunk-based development.
In particular, we found that the following principles match how we work:
* Master and release branches MUST always build without failure.
* Branches SHOULD be merged often. Larger changes SHOULD be activated with feature flags until they are ready. Long-lived development branches SHOULD be avoided.
* Changes MAY be enabled by default once they are in a complete state
* Changes which span multiple PRs MUST be described in an overarching issue or Google Doc.
## Releases
Releases MUST follow [Semantic Versioning](https://semver.org/) in naming and SHOULD follow Semantic Versioning as closely as reasonably possible for non-library software.
Release branches MUST be split from the following branches.
* MAJOR release branches MUST be based on master.
* MINOR release branches MUST be based on master.
* PATCH release branches MUST be split from the relevant MINOR release branchs most current PATCH
Security releases follow the same process but MUST be prepared in secret. Security releases MUST NOT include changes which are not related to the security fix. Normal release processes MUST accommodate the security release process. SECURITY.md MUST be followed.
PRs intended for inclusion in the next PATCH release MUST be labeled with `cherry-pick-needed` so they can be picked up by automated release tooling.
Releases follow the following cadence
* MAJOR: Yearly
* MINOR: Every 4-6 weeks
* PATCH: As needed
Releases SHOULD NOT be delayed by pending changes.
Releases MUST be coordinated with the relevant subsystem maintainers.

View File

@@ -9,6 +9,7 @@ import (
"encoding/json"
"flag"
"fmt"
"go/build"
"io"
"io/ioutil"
"log"
@@ -57,8 +58,6 @@ func main() {
log.SetOutput(os.Stdout)
log.SetFlags(0)
ensureGoPath()
var buildIdRaw string
flag.StringVar(&goarch, "goarch", runtime.GOARCH, "GOARCH")
@@ -106,16 +105,16 @@ func main() {
case "build-srv", "build-server":
clean()
build("grafana-server", "./pkg/cmd/grafana-server", []string{})
doBuild("grafana-server", "./pkg/cmd/grafana-server", []string{})
case "build-cli":
clean()
build("grafana-cli", "./pkg/cmd/grafana-cli", []string{})
doBuild("grafana-cli", "./pkg/cmd/grafana-cli", []string{})
case "build":
//clean()
for _, binary := range binaries {
build(binary, "./pkg/cmd/"+binary, []string{})
doBuild(binary, "./pkg/cmd/"+binary, []string{})
}
case "build-frontend":
@@ -417,18 +416,6 @@ func createPackage(options linuxPackageOptions) {
runPrint("fpm", append([]string{"-t", options.packageType}, args...)...)
}
func ensureGoPath() {
if os.Getenv("GOPATH") == "" {
cwd, err := os.Getwd()
if err != nil {
log.Fatal(err)
}
gopath := filepath.Clean(filepath.Join(cwd, "../../../../"))
log.Println("GOPATH is", gopath)
os.Setenv("GOPATH", gopath)
}
}
func grunt(params ...string) {
if runtime.GOOS == windows {
runPrint(`.\node_modules\.bin\grunt`, params...)
@@ -476,7 +463,7 @@ func test(pkg string) {
runPrint("go", "test", "-short", "-timeout", "60s", pkg)
}
func build(binaryName, pkg string, tags []string) {
func doBuild(binaryName, pkg string, tags []string) {
libcPart := ""
if libc != "" {
libcPart = fmt.Sprintf("-%s", libc)
@@ -554,7 +541,7 @@ func clean() {
rmr("dist")
rmr("tmp")
rmr(filepath.Join(os.Getenv("GOPATH"), fmt.Sprintf("pkg/%s_%s/github.com/grafana", goos, goarch)))
rmr(filepath.Join(build.Default.GOPATH, fmt.Sprintf("pkg/%s_%s/github.com/grafana", goos, goarch)))
}
func setBuildEnv() {

View File

@@ -126,7 +126,8 @@ connstr =
# This enables data proxy logging, default is false
logging = false
# How long the data proxy should wait before timing out default is 30 (seconds)
# How long the data proxy waits before timing out, default is 30 seconds.
# This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set.
timeout = 30
# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false.
@@ -188,7 +189,6 @@ allow_embedding = false
# Set to true if you want to enable http strict transport security (HSTS) response header.
# This is only sent when HTTPS is enabled in this configuration.
# HSTS tells browsers that the site should only be accessed using HTTPS.
# The default will change to true in the next minor release, 6.3.
strict_transport_security = false
# Sets how long a browser should cache HSTS. Only applied if strict_transport_security is enabled.
@@ -202,12 +202,12 @@ strict_transport_security_subdomains = false
# Set to true to enable the X-Content-Type-Options response header.
# The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised
# in the Content-Type headers should not be changed and be followed. The default will change to true in the next minor release, 6.3.
x_content_type_options = false
# in the Content-Type headers should not be changed and be followed.
x_content_type_options = true
# Set to true to enable the X-XSS-Protection header, which tells browsers to stop pages from loading
# when they detect reflected cross-site scripting (XSS) attacks. The default will change to true in the next minor release, 6.3.
x_xss_protection = false
# when they detect reflected cross-site scripting (XSS) attacks.
x_xss_protection = true
#################################### Snapshots ###########################
@@ -234,6 +234,9 @@ versions_to_keep = 20
# 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_refresh_interval = 5s
# Path to the default home dashboard. If this value is empty, then Grafana uses StaticRootPath + "dashboards/home.json"
default_home_dashboard_path =
#################################### Users ###############################
[users]
# disable user signup / registration
@@ -315,6 +318,9 @@ org_name = Main Org.
# specify role for unauthenticated users
org_role = Viewer
# mask the Grafana version number for unauthenticated users
hide_version = false
#################################### Github Auth #########################
[auth.github]
enabled = false
@@ -464,6 +470,7 @@ skip_verify = false
from_address = admin@grafana.localhost
from_name = Grafana
ehlo_identity =
startTLS_policy =
[emails]
welcome_email_on_sign_up = false
@@ -748,7 +755,7 @@ rendering_clustering_mode =
# When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently..
rendering_clustering_max_concurrency =
# Limit the maxiumum viewport width, height and device scale factor that can be requested.
# Limit the maximum viewport width, height and device scale factor that can be requested.
rendering_viewport_max_width =
rendering_viewport_max_height =
rendering_viewport_max_device_scale_factor =

View File

@@ -0,0 +1,11 @@
# # config file version
apiVersion: 1
# apps:
# - type: grafana-example-app
# org_name: Main Org.
# disabled: true
# - type: raintank-worldping-app
# org_id: 1
# jsonData:
# apiKey: "API KEY"

View File

@@ -127,7 +127,8 @@
# This enables data proxy logging, default is false
;logging = false
# How long the data proxy should wait before timing out default is 30 (seconds)
# How long the data proxy waits before timing out, default is 30 seconds.
# This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set.
;timeout = 30
# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false.
@@ -142,7 +143,7 @@
;reporting_enabled = true
# Set to false to disable all checks to https://grafana.net
# for new vesions (grafana itself and plugins), check is used
# for new versions (grafana itself and plugins), check is used
# in some UI views to notify that grafana or plugin update exists
# This option does not cause any auto updates, nor send any information
# only a GET request to http://grafana.com to get latest versions
@@ -189,7 +190,6 @@
# Set to true if you want to enable http strict transport security (HSTS) response header.
# This is only sent when HTTPS is enabled in this configuration.
# HSTS tells browsers that the site should only be accessed using HTTPS.
# The default version will change to true in the next minor release, 6.3.
;strict_transport_security = false
# Sets how long a browser should cache HSTS. Only applied if strict_transport_security is enabled.
@@ -203,12 +203,12 @@
# Set to true to enable the X-Content-Type-Options response header.
# The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised
# in the Content-Type headers should not be changed and be followed. The default will change to true in the next minor release, 6.3.
;x_content_type_options = false
# in the Content-Type headers should not be changed and be followed.
;x_content_type_options = true
# Set to true to enable the X-XSS-Protection header, which tells browsers to stop pages from loading
# when they detect reflected cross-site scripting (XSS) attacks. The default will change to true in the next minor release, 6.3.
;x_xss_protection = false
# when they detect reflected cross-site scripting (XSS) attacks.
;x_xss_protection = true
#################################### Snapshots ###########################
[snapshots]
@@ -233,6 +233,9 @@
# 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_refresh_interval = 5s
# Path to the default home dashboard. If this value is empty, then Grafana uses StaticRootPath + "dashboards/home.json"
;default_home_dashboard_path =
#################################### Users ###############################
[users]
# disable user signup / registration
@@ -314,6 +317,9 @@
# specify role for unauthenticated users
;org_role = Viewer
# mask the Grafana version number for unauthenticated users
;hide_version = false
#################################### Github Auth ##########################
[auth.github]
;enabled = false
@@ -454,6 +460,8 @@
;from_name = Grafana
# EHLO identity in SMTP dialog (defaults to instance_name)
;ehlo_identity = dashboard.example.com
# SMTP startTLS policy (defaults to 'OpportunisticStartTLS')
;startTLS_policy = NoStartTLS
[emails]
;welcome_email_on_sign_up = false
@@ -737,7 +745,7 @@
# When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently..
;rendering_clustering_max_concurrency =
# Limit the maxiumum viewport width, height and device scale factor that can be requested.
# Limit the maximum viewport width, height and device scale factor that can be requested.
;rendering_viewport_max_width =
;rendering_viewport_max_height =
;rendering_viewport_max_device_scale_factor =

View File

@@ -225,7 +225,7 @@ For some people, typically using the bash shell, ulimit fails with an error simi
ulimit: open files: cannot modify limit: Operation not permitted
```
If that happens to you, chances are you've already set a lower limit and your shell won't let you set a higher one. Try looking in your shell initalization files (~/.bashrc typically), if there's already a ulimit command that you can tweak.
If that happens to you, chances are you've already set a lower limit and your shell won't let you set a higher one. Try looking in your shell initialization files (~/.bashrc typically), if there's already a ulimit command that you can tweak.
## Next steps

View File

@@ -25,7 +25,7 @@ All `exported` apis from the package should have a release tag to indicate its s
- [`@alpha`](https://api-extractor.com/pages/tsdoc/tag_alpha/) - early draft of api and will probably change.
- [`@beta`](https://api-extractor.com/pages/tsdoc/tag_beta/) - close to being stable but might change.
- [`@public`](https://api-extractor.com/pages/tsdoc/tag_public/) - ready for useage in production.
- [`@public`](https://api-extractor.com/pages/tsdoc/tag_public/) - ready for usage in production.
- [`@internal`](https://api-extractor.com/pages/tsdoc/tag_internal/) - for internal use only.
### Main stability of APIs
@@ -139,7 +139,7 @@ This attribute can be skipped if the type provided by `typescript` and the funct
```typescript
/**
* Will help to create a resource resovler depending
* Will help to create a resource resolver depending
* on the current execution context.
*
* @param context - The current execution context.
@@ -179,7 +179,7 @@ This attribute can be skipped if the type provided by `typescript` and the funct
```typescript
/**
* Will help to create a resource resovler depending
* Will help to create a resource resolver depending
* on the current execution context.
*
* @param context - The current execution context.
@@ -206,4 +206,4 @@ export const factory = (context: Context): IResolver => {
export const isEqual = (x: number, y: number): boolean => {
return x === y;
}
```
```

View File

@@ -18,6 +18,32 @@ For all items not covered in this guide, refer to the [Microsoft Style Guide](ht
The [codespell](https://github.com/codespell-project/codespell) tool is run for every change to catch common misspellings.
## Inclusive language
This section provides guidelines on how to avoid using charged language in documentation.
### Allowing and blocking
Don't use "whitelist" or "blacklist" when referring to allowing or blocking content or traffic.
* When used as a noun, use "allowlist" or "blocklist".
* When used as a verb, use "allow" or "block"
Example: _To **allow** outgoing traffic, add the IP to the **allowlist**._
### Leader and follower
Don't use "master" or "slave" to describe relationships between nodes or processes.
* Use "leader", "main" or "primary," instead of "master."
* Use "follower" or "secondary," instead of "slave."
### Exceptions
When referring to a configuration or settings used by third-party libraries och technologies outside the Grafana project, prefer the original name to avoid confusion.
For example, use "master" when referring to the default Git branch.
## Grafana-specific style
The following sections provide general guidelines on topics specific to Grafana documentation. Note that for the most part, these are *guidelines*, not rigid rules. If you have questions, ask in the #docs channel of Grafana Slack.
@@ -31,7 +57,7 @@ The following sections provide general guidelines on topics specific to Grafana
* Write in present tense.
- Not: The panel will open.
- Use: The panel opens. Grafana opens the panel.
* Do not use an ampersand (&) as an abbreviation for "and."
* Do not use an ampersand (&) as an abbreviation for "and."
- **Exceptions:** If an ampersand is used in the Grafana UI, then match the UI.
* Avoid using internal slang and jargon in technical documentation.
@@ -156,7 +182,7 @@ One word, not two.
#### open source, open-source
Do not hyphenate when used as an adjective unless the lack of hyphen would cause confusion. For example: _Open source software design is the most open open-source system I can imagine._
Do not hyphenate when used as an adjective unless the lack of hyphen would cause confusion. For example: _Open source software design is the most open open-source system I can imagine._
Do not hyphenate when it is used as a noun. For example: _Open source is the best way to develop software._

View File

@@ -15,6 +15,8 @@ Generally we follow the Airbnb [React Style Guide](https://github.com/airbnb/jav
- [React](#react)
- [Props](#props)
- [State management](#state-management)
- [Proposal for removing or replacing Angular dependencies](https://github.com/grafana/grafana/pull/23048)
## Basic rules
@@ -107,7 +109,7 @@ class DateCalculator {
}
class DateCalculator {
// bad
calculate_timee_range () {...}
calculate_time_range () {...}
}
class DateCalculator {
@@ -147,7 +149,7 @@ interface ModalState {
```typescript
const getStyles = = () => ({
// bad
ElementWraper: css`...`,
ElementWrapper: css`...`,
// bad
["element-wrapper"]: css`...`,
@@ -324,6 +326,6 @@ static defaultProps: Partial<Props> = { ... }
## State management
- Don't mutate state in reducers or thunks.
- Use helpers `actionCreatorFactory` and `reducerFactory` instead of traditional `switch statement` reducers in Redux. See [Redux framework](redux.md) for more details.
- Use `createSlice`. See [Redux Toolkit](https://redux-toolkit.js.org/) for more details.
- Use `reducerTester` to test reducers. See [Redux framework](redux.md) for more details.
- Use state selectors to access state instead of accessing state directly.

View File

@@ -23,6 +23,27 @@ const ComponentA = () => (
);
```
### Styling with theme
To access the theme in your styles, use the `useStyles` hook. It provides basic memoization and access to the theme object.
```tsx
import React, { FC } from 'react';
import { GrafanaTheme } from '@grafana/data';
import { useStyles } from '@grafana/ui';
import { css } from 'emotion';
const getComponentStyles = (theme: GrafanaTheme) => css`
padding: ${theme.spacing.md};
`;
const Foo: FC<FooProps> = () => {
const styles = useStyles(getComponentsStyles);
// Use styles with className
};
```
### Styling complex components
In more complex cases, especially when you need to style multiple DOM elements in one component, or when using styles that depend on properties and/or state, you should create a helper function that returns an object of styles. This function should also be wrapped in the `stylesFactory` helper function, which will provide basic memoization.
@@ -36,10 +57,7 @@ import { GrafanaTheme } from '@grafana/data';
import { selectThemeVariant, stylesFactory, useTheme } from '@grafana/ui';
const getStyles = stylesFactory((theme: GrafanaTheme) => {
const backgroundColor = selectThemeVariant(
{ light: theme.colors.red, dark: theme.colors.blue },
theme.type
);
const backgroundColor = selectThemeVariant({ light: theme.colors.red, dark: theme.colors.blue }, theme.type);
return {
wrapper: css`

View File

@@ -18,6 +18,40 @@ This section provides usage guidelines.
Here's how to use Grafana themes in React components.
#### useStyles hook
`useStyles` memoizes the function and provides access to the theme.
```tsx
import React, { FC } from 'react';
import { GrafanaTheme } from '@grafana/data';
import { useStyles } from '@grafana/ui';
import { css } from 'emotion';
const getComponentStyles = (theme: GrafanaTheme) => css`
padding: ${theme.spacing.md};
`;
const Foo: FC<FooProps> = () => {
const styles = useStyles(getComponentsStyles);
// Use styles with className
};
```
#### Get the theme object
```tsx
import React, { FC } from 'react';
import { useTheme } from '@grafana/ui';
const Foo: FC<FooProps> = () => {
const theme = useTheme();
// Your component has access to the theme variables now
};
```
#### Using `ThemeContext` directly
```tsx
@@ -26,19 +60,6 @@ import { ThemeContext } from '@grafana/ui';
<ThemeContext.Consumer>{theme => <Foo theme={theme} />}</ThemeContext.Consumer>;
```
or
```tsx
import React, { useContext } from 'react';
import { ThemeContext } from '@grafana/ui';
const Foo: React.FunctionComponent<FooProps> = () => {
const theme = useContext(ThemeContext);
// Your component has access to the theme variables now
}
```
#### Using `withTheme` higher-order component (HOC)
With this method your component will be automatically wrapped in `ThemeContext.Consumer` and provided with current theme via `theme` prop. Components used with `withTheme` must implement the `Themeable` interface.
@@ -76,69 +97,38 @@ describe('MyComponent', () => {
restoreThemeContext();
});
it('renders correctyl', () => {
it('renders correctly', () => {
const wrapper = mount(<MyComponent />)
expect(wrapper).toMatchSnapshot();
});
});
```
### Using themes in [Storybook](https://storybook.js.org/)
All stories are wrapped with `ThemeContext.Provider` using a global decorator. To render a `Themeable` component that isn't wrapped by a `withTheme` HOC, either create a new component in your story, or use the `renderComponentWithTheme` helper.
#### Create a new component:
```tsx
// Foo.story.tsx
const FooWithTheme = withTheme(Foo);
FooStories.add('Story' () => {
return <FooWithTheme />
});
```
#### Use `renderComponentWithTheme` helper:
```tsx
// Bar.story.tsx
BarStories.add('Story' () => {
return renderComponentWithTheme(Bar, /* pass props here */)
});
```
### Using themes in Angular code
There should be very few cases where a theme would be used in an Angular context. For this purpose, there is a function available that retrieves the current theme:
```ts
import { getCurrentTheme } from app/core/utils/ConfigProvider
```
Angular components should be migrated to React, or if that's not possible at the moment, styled using Sass.
## FAQ
This section provides insight into frequently-asked questions.
### How can I modify Sass variable files?
**If possible, migrate styles to Emotion**
> For the following to apply you need to run `yarn dev` task.
`[_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 a *Sass variable value* you need to modify the corresponding Typescript file that is the source of the variables:
#### 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:
#### 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.

View File

@@ -454,7 +454,7 @@
"yaxes": [
{
"format": "percent",
"label": "Perecent",
"label": "Percent",
"logBase": 1,
"max": null,
"min": null,
@@ -1632,10 +1632,7 @@
"revision": 8,
"schemaVersion": 16,
"style": "dark",
"tags": [
"gdev",
"panel-tests"
],
"tags": ["gdev", "panel-tests"],
"templating": {
"list": []
},
@@ -1644,29 +1641,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": "browser",
"title": "Panel Tests - Graph",

View File

@@ -428,6 +428,14 @@
{
"text": "Bitcoin (฿)",
"value": "currencyBTC"
},
{
"text": "Milli Bitcoin (mBTC)",
"value": "currencymBTC"
},
{
"text": "Micro Bitcoin (μBTC)",
"value": "currencyμBTC"
}
],
"text": "currency"

View File

@@ -28,7 +28,7 @@
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"iteration": 1554310942895,
"iteration": 1591027568655,
"links": [
{
"asDropdown": true,
@@ -47,7 +47,14 @@
"datasource": "gdev-elasticsearch-v2-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 7,
@@ -55,6 +62,7 @@
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 1,
"legend": {
"alignAsTable": true,
@@ -71,6 +79,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -170,7 +181,14 @@
"datasource": "gdev-elasticsearch-v2-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 6,
@@ -178,6 +196,7 @@
"x": 0,
"y": 7
},
"hiddenSeries": false,
"id": 2,
"legend": {
"alignAsTable": true,
@@ -194,6 +213,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -292,7 +314,14 @@
"datasource": "gdev-elasticsearch-v2-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 6,
@@ -300,6 +329,7 @@
"x": 12,
"y": 7
},
"hiddenSeries": false,
"id": 3,
"legend": {
"alignAsTable": true,
@@ -316,6 +346,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -427,6 +460,12 @@
"datasource": "gdev-elasticsearch-v2-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fontSize": "100%",
"gridPos": {
"h": 7,
@@ -445,11 +484,13 @@
},
"styles": [
{
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "@timestamp",
"type": "date"
},
{
"align": "auto",
"colorMode": null,
"colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
@@ -505,7 +546,7 @@
],
"title": "ES Metrics",
"transform": "table",
"type": "table"
"type": "table-old"
},
{
"columns": [
@@ -529,6 +570,12 @@
"datasource": "gdev-elasticsearch-v2-logs",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fontSize": "100%",
"gridPos": {
"h": 7,
@@ -547,6 +594,7 @@
},
"styles": [
{
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "@timestamp",
"type": "date"
@@ -574,7 +622,7 @@
],
"title": "ES Log query",
"transform": "json",
"type": "table"
"type": "table-old"
},
{
"circleMaxSize": 30,
@@ -584,6 +632,12 @@
"decimals": 0,
"esGeoPoint": "@location",
"esMetric": "Average",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
@@ -645,7 +699,7 @@
"valueName": "total"
}
],
"schemaVersion": 18,
"schemaVersion": 25,
"style": "dark",
"tags": ["elasticsearch", "gdev", "datasource-test"],
"templating": {
@@ -678,5 +732,5 @@
"timezone": "browser",
"title": "Datasource tests - Elasticsearch v2",
"uid": "RlqLq2fiz",
"version": 5
"version": 1
}

View File

@@ -28,7 +28,7 @@
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"iteration": 1554310560048,
"iteration": 1591027589702,
"links": [
{
"asDropdown": true,
@@ -47,7 +47,14 @@
"datasource": "gdev-elasticsearch-v5-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 7,
@@ -55,6 +62,7 @@
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 1,
"legend": {
"alignAsTable": true,
@@ -71,6 +79,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -170,7 +181,14 @@
"datasource": "gdev-elasticsearch-v5-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 6,
@@ -178,6 +196,7 @@
"x": 0,
"y": 7
},
"hiddenSeries": false,
"id": 2,
"legend": {
"alignAsTable": true,
@@ -194,6 +213,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -292,7 +314,14 @@
"datasource": "gdev-elasticsearch-v5-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 6,
@@ -300,6 +329,7 @@
"x": 12,
"y": 7
},
"hiddenSeries": false,
"id": 3,
"legend": {
"alignAsTable": true,
@@ -316,6 +346,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -427,6 +460,12 @@
"datasource": "gdev-elasticsearch-v5-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fontSize": "100%",
"gridPos": {
"h": 7,
@@ -445,11 +484,13 @@
},
"styles": [
{
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "@timestamp",
"type": "date"
},
{
"align": "auto",
"colorMode": null,
"colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
@@ -505,7 +546,7 @@
],
"title": "ES Metrics",
"transform": "table",
"type": "table"
"type": "table-old"
},
{
"columns": [
@@ -529,6 +570,12 @@
"datasource": "gdev-elasticsearch-v5-logs",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fontSize": "100%",
"gridPos": {
"h": 7,
@@ -547,6 +594,7 @@
},
"styles": [
{
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "@timestamp",
"type": "date"
@@ -574,7 +622,7 @@
],
"title": "ES Log query",
"transform": "json",
"type": "table"
"type": "table-old"
},
{
"circleMaxSize": 30,
@@ -585,6 +633,12 @@
"esGeoPoint": "@location",
"esLocationName": "",
"esMetric": "Average",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
@@ -646,7 +700,7 @@
"valueName": "total"
}
],
"schemaVersion": 18,
"schemaVersion": 25,
"style": "dark",
"tags": ["elasticsearch", "gdev", "datasource-test"],
"templating": {
@@ -679,5 +733,5 @@
"timezone": "browser",
"title": "Datasource tests - Elasticsearch v5",
"uid": "8HjT32Bmz",
"version": 5
"version": 1
}

View File

@@ -28,7 +28,7 @@
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"iteration": 1554310839317,
"iteration": 1591027529668,
"links": [
{
"asDropdown": true,
@@ -47,7 +47,14 @@
"datasource": "gdev-elasticsearch-v6-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 7,
@@ -55,6 +62,7 @@
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 1,
"legend": {
"alignAsTable": true,
@@ -71,6 +79,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -170,7 +181,14 @@
"datasource": "gdev-elasticsearch-v6-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 6,
@@ -178,6 +196,7 @@
"x": 0,
"y": 7
},
"hiddenSeries": false,
"id": 2,
"legend": {
"alignAsTable": true,
@@ -194,6 +213,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -292,7 +314,14 @@
"datasource": "gdev-elasticsearch-v6-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 6,
@@ -300,6 +329,7 @@
"x": 12,
"y": 7
},
"hiddenSeries": false,
"id": 3,
"legend": {
"alignAsTable": true,
@@ -316,6 +346,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -427,6 +460,12 @@
"datasource": "gdev-elasticsearch-v6-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fontSize": "100%",
"gridPos": {
"h": 7,
@@ -445,11 +484,13 @@
},
"styles": [
{
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "@timestamp",
"type": "date"
},
{
"align": "auto",
"colorMode": null,
"colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
@@ -505,7 +546,7 @@
],
"title": "ES Metrics",
"transform": "table",
"type": "table"
"type": "table-old"
},
{
"columns": [
@@ -529,6 +570,12 @@
"datasource": "gdev-elasticsearch-v6-logs",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fontSize": "100%",
"gridPos": {
"h": 7,
@@ -547,6 +594,7 @@
},
"styles": [
{
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "@timestamp",
"type": "date"
@@ -574,7 +622,7 @@
],
"title": "ES Log query",
"transform": "json",
"type": "table"
"type": "table-old"
},
{
"circleMaxSize": 30,
@@ -584,6 +632,12 @@
"decimals": 0,
"esGeoPoint": "@location",
"esMetric": "Average",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
@@ -645,7 +699,8 @@
"valueName": "total"
}
],
"schemaVersion": 18,
"refresh": false,
"schemaVersion": 25,
"style": "dark",
"tags": ["elasticsearch", "gdev", "datasource-test"],
"templating": {
@@ -662,7 +717,7 @@
]
},
"time": {
"from": "now-30m",
"from": "now-1h",
"to": "now"
},
"timepicker": {
@@ -678,5 +733,5 @@
"timezone": "browser",
"title": "Datasource tests - Elasticsearch v6",
"uid": "NF8Pq2Biz",
"version": 5
"version": 1
}

View File

@@ -15,7 +15,7 @@
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"iteration": 1554902936982,
"iteration": 1591027621672,
"links": [
{
"asDropdown": true,
@@ -34,13 +34,21 @@
"dashLength": 10,
"dashes": false,
"datasource": "gdev-elasticsearch-v6-filebeat",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 4,
"legend": {
"avg": false,
@@ -54,6 +62,9 @@
"lines": false,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
@@ -142,22 +153,13 @@
}
},
{
"columns": [
{
"text": "@timestamp",
"value": "@timestamp"
},
{
"text": "fields.level",
"value": "fields.level"
},
{
"text": "message",
"value": "message"
}
],
"datasource": "gdev-elasticsearch-v6-filebeat",
"fontSize": "100%",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"gridPos": {
"h": 22,
"w": 24,
@@ -166,58 +168,35 @@
},
"id": 2,
"links": [],
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 0,
"desc": true
"options": {
"showLabels": false,
"showTime": true,
"sortOrder": "Descending",
"wrapLogMessage": true
},
"styles": [
{
"alias": "Time",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "@timestamp",
"type": "date"
},
{
"alias": "Level",
"colorMode": null,
"colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "fields.level",
"thresholds": [""],
"type": "string",
"unit": "short",
"valueMaps": []
},
{
"alias": "Message",
"colorMode": null,
"colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
"decimals": 2,
"pattern": "message",
"preserveFormat": false,
"sanitize": false,
"thresholds": [],
"type": "string",
"unit": "short"
}
],
"targets": [
{
"bucketAggs": [],
"bucketAggs": [
{
"$$hashKey": "object:394",
"field": "@timestamp",
"id": "2",
"settings": {
"interval": "auto",
"min_doc_count": 0,
"trimEdges": 0
},
"type": "date_histogram"
}
],
"metrics": [
{
"$$hashKey": "object:359",
"field": "select field",
"id": "1",
"meta": {},
"settings": {
"size": 500
},
"type": "raw_document"
"settings": {},
"type": "logs"
}
],
"query": "fields.app:grafana",
@@ -228,11 +207,10 @@
"timeFrom": null,
"timeShift": null,
"title": "Panel Title",
"transform": "json",
"type": "table"
"type": "logs"
}
],
"schemaVersion": 18,
"schemaVersion": 25,
"style": "dark",
"tags": ["gdev", "elasticsearch", "datasource-test"],
"templating": {
@@ -249,7 +227,7 @@
]
},
"time": {
"from": "now-1h",
"from": "now-30m",
"to": "now"
},
"timepicker": {
@@ -259,5 +237,5 @@
"timezone": "",
"title": "Datasource tests - Elasticsearch v6 Filebeat",
"uid": "06tPt4gZz",
"version": 8
"version": 1
}

View File

@@ -28,8 +28,7 @@
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 2342,
"iteration": 1555593977614,
"iteration": 1591027717495,
"links": [
{
"asDropdown": true,
@@ -48,7 +47,14 @@
"datasource": "gdev-elasticsearch-v7-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 7,
@@ -56,6 +62,7 @@
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 1,
"legend": {
"alignAsTable": true,
@@ -72,6 +79,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -171,7 +181,14 @@
"datasource": "gdev-elasticsearch-v7-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 6,
@@ -179,6 +196,7 @@
"x": 0,
"y": 7
},
"hiddenSeries": false,
"id": 2,
"legend": {
"alignAsTable": true,
@@ -195,6 +213,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -293,7 +314,14 @@
"datasource": "gdev-elasticsearch-v7-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 6,
@@ -301,6 +329,7 @@
"x": 12,
"y": 7
},
"hiddenSeries": false,
"id": 3,
"legend": {
"alignAsTable": true,
@@ -317,6 +346,9 @@
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 5,
"points": false,
@@ -428,6 +460,12 @@
"datasource": "gdev-elasticsearch-v7-metrics",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fontSize": "100%",
"gridPos": {
"h": 7,
@@ -446,11 +484,13 @@
},
"styles": [
{
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "@timestamp",
"type": "date"
},
{
"align": "auto",
"colorMode": null,
"colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
@@ -506,7 +546,7 @@
],
"title": "ES Metrics",
"transform": "table",
"type": "table"
"type": "table-old"
},
{
"columns": [
@@ -530,6 +570,12 @@
"datasource": "gdev-elasticsearch-v7-logs",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fontSize": "100%",
"gridPos": {
"h": 7,
@@ -548,6 +594,7 @@
},
"styles": [
{
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "@timestamp",
"type": "date"
@@ -575,7 +622,7 @@
],
"title": "ES Log query",
"transform": "json",
"type": "table"
"type": "table-old"
},
{
"circleMaxSize": 30,
@@ -585,6 +632,12 @@
"decimals": 0,
"esGeoPoint": "@location",
"esMetric": "Average",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"gridPos": {
"h": 12,
"w": 24,
@@ -646,7 +699,7 @@
"valueName": "total"
}
],
"schemaVersion": 18,
"schemaVersion": 25,
"style": "dark",
"tags": ["elasticsearch", "gdev", "datasource-test"],
"templating": {

View File

@@ -15,8 +15,7 @@
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 2341,
"iteration": 1555591591930,
"iteration": 1591027736516,
"links": [
{
"asDropdown": true,
@@ -35,13 +34,21 @@
"dashLength": 10,
"dashes": false,
"datasource": "gdev-elasticsearch-v7-filebeat",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 4,
"legend": {
"avg": false,
@@ -55,6 +62,9 @@
"lines": false,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
@@ -143,22 +153,13 @@
}
},
{
"columns": [
{
"text": "@timestamp",
"value": "@timestamp"
},
{
"text": "fields.level",
"value": "fields.level"
},
{
"text": "message",
"value": "message"
}
],
"datasource": "gdev-elasticsearch-v7-filebeat",
"fontSize": "100%",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"gridPos": {
"h": 22,
"w": 24,
@@ -167,58 +168,35 @@
},
"id": 2,
"links": [],
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 0,
"desc": true
"options": {
"showLabels": false,
"showTime": true,
"sortOrder": "Descending",
"wrapLogMessage": true
},
"styles": [
{
"alias": "Time",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "@timestamp",
"type": "date"
},
{
"alias": "Level",
"colorMode": null,
"colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "fields.level",
"thresholds": [""],
"type": "string",
"unit": "short",
"valueMaps": []
},
{
"alias": "Message",
"colorMode": null,
"colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
"decimals": 2,
"pattern": "message",
"preserveFormat": false,
"sanitize": false,
"thresholds": [],
"type": "string",
"unit": "short"
}
],
"targets": [
{
"bucketAggs": [],
"bucketAggs": [
{
"$$hashKey": "object:522",
"field": "@timestamp",
"id": "2",
"settings": {
"interval": "auto",
"min_doc_count": 0,
"trimEdges": 0
},
"type": "date_histogram"
}
],
"metrics": [
{
"$$hashKey": "object:484",
"field": "select field",
"id": "1",
"meta": {},
"settings": {
"size": 500
},
"type": "raw_document"
"settings": {},
"type": "logs"
}
],
"query": "fields.app:grafana",
@@ -229,11 +207,10 @@
"timeFrom": null,
"timeShift": null,
"title": "Panel Title",
"transform": "json",
"type": "table"
"type": "logs"
}
],
"schemaVersion": 18,
"schemaVersion": 25,
"style": "dark",
"tags": ["elasticsearch", "gdev", "datasource-test"],
"templating": {

View File

@@ -15,12 +15,18 @@
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 13844,
"iteration": 1566896059256,
"iteration": 1590677937026,
"links": [],
"panels": [
{
"content": "## Data center = $datacenter\n\n### server = $server\n\n#### pod = $pod",
"datasource": null,
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
@@ -29,7 +35,6 @@
},
"id": 4,
"mode": "markdown",
"options": {},
"targets": [
{
"refId": "A",
@@ -47,6 +52,12 @@
"colorValue": false,
"colors": ["#299c46", "rgba(237, 129, 40, 0.89)", "#d44a3a"],
"datasource": "gdev-testdata",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"format": "none",
"gauge": {
"maxValue": 100,
@@ -75,7 +86,6 @@
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"options": {},
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
@@ -119,6 +129,41 @@
},
{
"cacheTimeout": null,
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"links": [
{
"targetBlank": true,
"title": "Go to drilldown",
"url": "/d/O6GmNPvWk/dashboard-tests-nested-template-variables-drilldown?orgId=1&${__all_variables}&${__url_time_range}"
}
],
"mappings": [],
"max": 100,
"min": 0,
"nullValueMode": "connected",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 4,
@@ -128,40 +173,15 @@
"id": 8,
"links": [],
"options": {
"fieldOptions": {
"orientation": "horizontal",
"reduceOptions": {
"calcs": ["mean"],
"defaults": {
"links": [
{
"targetBlank": true,
"title": "Go to drilldown",
"url": "/d/O6GmNPvWk/dashboard-tests-nested-template-variables-drilldown?orgId=1&${__all_variables}&${__url_time_range}"
}
],
"mappings": [],
"max": 100,
"min": 0,
"nullValueMode": "connected",
"thresholds": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
],
"unit": "none"
},
"override": {},
"values": false
},
"orientation": "horizontal",
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "6.4.0-pre",
"pluginVersion": "7.1.0-pre",
"targets": [
{
"refId": "A",
@@ -175,6 +195,41 @@
},
{
"cacheTimeout": null,
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"links": [
{
"targetBlank": true,
"title": "Go to drilldown",
"url": "/d/O6GmNPvWk/dashboard-tests-nested-template-variables-drilldown?orgId=1&${__all_variables}&${__url_time_range}"
}
],
"mappings": [],
"max": 100,
"min": 0,
"nullValueMode": "connected",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 4,
@@ -185,38 +240,14 @@
"links": [],
"options": {
"displayMode": "basic",
"fieldOptions": {
"orientation": "vertical",
"reduceOptions": {
"calcs": ["mean"],
"defaults": {
"links": [
{
"targetBlank": true,
"title": "Go to drilldown",
"url": "/d/O6GmNPvWk/dashboard-tests-nested-template-variables-drilldown?orgId=1&${__all_variables}&${__url_time_range}"
}
],
"mappings": [],
"max": 100,
"min": 0,
"nullValueMode": "connected",
"thresholds": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
],
"unit": "none"
},
"override": {},
"values": false
},
"orientation": "vertical"
"showUnfilled": true
},
"pluginVersion": "6.4.0-pre",
"pluginVersion": "7.1.0-pre",
"targets": [
{
"refId": "A",
@@ -228,20 +259,108 @@
"title": "React gauge datalink",
"type": "bargauge"
},
{
"datasource": "CsvData",
"fieldConfig": {
"defaults": {
"custom": {
"align": null
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "server"
},
"properties": [
{
"id": "links",
"value": [
{
"title": "filter",
"url": "http://localhost:3000/d/-Y-tnEDWk/templating-nested-template-variables?var-datacenter=${__data.fields[datacenter]}&var-server=${__value.raw}"
}
]
}
]
}
]
},
"gridPos": {
"h": 6,
"w": 24,
"x": 0,
"y": 9
},
"id": 11,
"options": {
"showHeader": true
},
"pluginVersion": "7.1.0-pre",
"targets": [
{
"data": [
{
"fields": [
{
"config": {},
"name": "datacenter",
"type": "string",
"values": ["A", "B", "C"]
},
{
"config": {},
"name": "server",
"type": "string",
"values": ["AA", "BB", "CC"]
}
]
}
],
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Data links that filter update variables on current dashboard",
"type": "table"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "gdev-testdata",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 13,
"w": 24,
"x": 0,
"y": 9
"y": 15
},
"hiddenSeries": false,
"id": 2,
"legend": {
"avg": false,
@@ -316,7 +435,7 @@
}
],
"refresh": false,
"schemaVersion": 19,
"schemaVersion": 25,
"style": "dark",
"tags": ["gdev", "templating"],
"templating": {
@@ -324,6 +443,7 @@
{
"allValue": null,
"current": {
"selected": true,
"text": "A",
"value": ["A"]
},
@@ -349,6 +469,7 @@
{
"allValue": null,
"current": {
"selected": true,
"text": "AA",
"value": ["AA"]
},
@@ -374,6 +495,7 @@
{
"allValue": null,
"current": {
"selected": true,
"text": "All",
"value": ["$__all"]
},
@@ -403,7 +525,7 @@
"to": "now"
},
"timepicker": {
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"]
"refresh_intervals": ["10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"]
},
"timezone": "",
"title": "Templating - Nested Template Variables",

View File

@@ -155,7 +155,7 @@
],
"timeFrom": null,
"timeShift": null,
"title": "Last non nulll",
"title": "Last non-null",
"type": "gauge"
},
{

View File

@@ -454,7 +454,7 @@
"yaxes": [
{
"format": "percent",
"label": "Perecent",
"label": "Percent",
"logBase": 1,
"max": null,
"min": null,

View File

@@ -428,6 +428,14 @@
{
"text": "Bitcoin (฿)",
"value": "currencyBTC"
},
{
"text": "Milli Bitcoin (mBTC)",
"value": "currencymBTC"
},
{
"text": "Micro Bitcoin (μBTC)",
"value": "currencyμBTC"
}
],
"text": "currency"

View File

@@ -85,7 +85,7 @@
}
],
"thresholds": "5,10",
"title": "prefix 3 ms (green) postfixt + sparkline",
"title": "prefix 3 ms (green) postfix + sparkline",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [

View File

@@ -19,6 +19,42 @@
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": []
},
"gridPos": {
"h": 3,
"w": 24,
@@ -29,51 +65,20 @@
"interval": "6m",
"options": {
"colorMode": "background",
"fieldOptions": {
"calcs": ["mean"],
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": [],
"values": false
},
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": ["mean"],
"fields": "",
"values": false
},
"sparkline": {
"show": true
}
},
"textMode": "auto"
},
"pluginVersion": "6.6.0-pre",
"pluginVersion": "7.1.0-pre",
"targets": [
{
"alias": "__house_locations",
@@ -93,6 +98,42 @@
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 24,
@@ -103,51 +144,20 @@
"interval": "7m",
"options": {
"colorMode": "background",
"fieldOptions": {
"calcs": ["mean"],
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": [],
"values": false
},
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": ["mean"],
"fields": "",
"values": false
},
"sparkline": {
"show": true
}
},
"textMode": "auto"
},
"pluginVersion": "6.6.0-pre",
"pluginVersion": "7.1.0-pre",
"targets": [
{
"alias": "__house_locations",
@@ -166,6 +176,42 @@
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 24,
@@ -176,51 +222,20 @@
"interval": "7m",
"options": {
"colorMode": "value",
"fieldOptions": {
"calcs": ["mean"],
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": [],
"values": false
},
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": ["mean"],
"fields": "",
"values": false
},
"sparkline": {
"show": true
}
},
"textMode": "auto"
},
"pluginVersion": "6.6.0-pre",
"pluginVersion": "7.1.0-pre",
"targets": [
{
"alias": "__house_locations",
@@ -239,8 +254,44 @@
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": []
},
"gridPos": {
"h": 14,
"h": 18,
"w": 6,
"x": 0,
"y": 15
@@ -249,51 +300,20 @@
"interval": "5m",
"options": {
"colorMode": "background",
"fieldOptions": {
"calcs": ["mean"],
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": [],
"values": false
},
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": ["mean"],
"fields": "",
"values": false
},
"sparkline": {
"show": true
}
},
"textMode": "auto"
},
"pluginVersion": "6.6.0-pre",
"pluginVersion": "7.1.0-pre",
"targets": [
{
"alias": "__server_names",
@@ -306,13 +326,49 @@
],
"timeFrom": null,
"timeShift": null,
"title": "Panel Title",
"title": "Horizontal with graph",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": []
},
"gridPos": {
"h": 11,
"h": 9,
"w": 4,
"x": 6,
"y": 15
@@ -321,51 +377,20 @@
"interval": "10m",
"options": {
"colorMode": "background",
"fieldOptions": {
"calcs": ["mean"],
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": [],
"values": false
},
"graphMode": "line",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": ["mean"],
"fields": "",
"values": false
},
"sparkline": {
"show": true
}
},
"textMode": "auto"
},
"pluginVersion": "6.6.0-pre",
"pluginVersion": "7.1.0-pre",
"targets": [
{
"refId": "A",
@@ -398,14 +423,50 @@
],
"timeFrom": null,
"timeShift": null,
"title": "Panel Title",
"title": "Auto grid",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 8,
"w": 6,
"x": 10,
"y": 15
},
@@ -413,51 +474,20 @@
"interval": "10m",
"options": {
"colorMode": "background",
"fieldOptions": {
"calcs": ["mean"],
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": [],
"values": false
},
"graphMode": "line",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": ["mean"],
"fields": "",
"values": false
},
"sparkline": {
"show": true
}
},
"textMode": "auto"
},
"pluginVersion": "6.6.0-pre",
"pluginVersion": "7.1.0-pre",
"targets": [
{
"refId": "A",
@@ -490,11 +520,257 @@
],
"timeFrom": null,
"timeShift": null,
"title": "Panel Title",
"title": "Horizontal",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"mappings": [],
"max": 200,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 8,
"x": 16,
"y": 15
},
"id": 15,
"interval": "5m",
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": ["mean"],
"fields": "",
"values": false
},
"sparkline": {
"show": true
},
"textMode": "name"
},
"pluginVersion": "7.1.0-pre",
"targets": [
{
"alias": "__server_names",
"max": 200,
"min": 0,
"noise": 5,
"refId": "A",
"scenarioId": "random_walk",
"seriesCount": 7,
"spread": 20,
"startValue": 0
}
],
"timeFrom": null,
"timeShift": null,
"title": "Text mode name",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"mappings": [],
"max": 200,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 18,
"x": 6,
"y": 24
},
"id": 16,
"interval": "5m",
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": ["mean"],
"fields": "",
"values": false
},
"sparkline": {
"show": true
},
"textMode": "value"
},
"pluginVersion": "7.1.0-pre",
"targets": [
{
"alias": "__server_names",
"max": 200,
"min": 0,
"noise": 15,
"refId": "A",
"scenarioId": "random_walk",
"seriesCount": 45,
"spread": 1,
"startValue": 0
}
],
"timeFrom": null,
"timeShift": null,
"title": "Value only",
"type": "stat"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"mappings": [],
"max": 200,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "blue",
"value": null
},
{
"color": "green",
"value": 10
},
{
"color": "purple",
"value": 20
},
{
"color": "orange",
"value": 40
},
{
"color": "red",
"value": 80
}
]
},
"unit": "areaM2"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 33
},
"id": 17,
"interval": "5m",
"options": {
"colorMode": "background",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": ["mean"],
"fields": "",
"values": false
},
"sparkline": {
"show": true
},
"textMode": "none"
},
"pluginVersion": "7.1.0-pre",
"targets": [
{
"alias": "__server_names",
"max": 200,
"min": 0,
"noise": 15,
"refId": "A",
"scenarioId": "random_walk",
"seriesCount": 200,
"spread": 1,
"startValue": 0
}
],
"timeFrom": null,
"timeShift": null,
"title": "No text",
"type": "stat"
}
],
"schemaVersion": 22,
"schemaVersion": 26,
"style": "dark",
"tags": ["gdev", "panel-tests"],
"templating": {
@@ -508,5 +784,7 @@
"refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"]
},
"timezone": "",
"title": "Panel Tests - Stat"
"title": "Panel Tests - Stat",
"uid": "EJ8_d9jZk",
"version": 1
}

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# When not limiting the open file descritors limit, the memory consumption of
# When not limiting the open file descriptors limit, the memory consumption of
# slapd is absurdly high. See https://github.com/docker/docker/issues/8231
ulimit -n 8192

View File

@@ -1,6 +1,6 @@
#!/bin/bash
# When not limiting the open file descritors limit, the memory consumption of
# When not limiting the open file descriptors limit, the memory consumption of
# slapd is absurdly high. See https://github.com/docker/docker/issues/8231
ulimit -n 8192

View File

@@ -59,7 +59,7 @@ usage() {
echo "Usage:"
echo " bulk-dashboards - create and provisioning 400 dashboards"
echo " bulk-alerting-dashboards - create and provisioning 400 dashboards with alerts"
echo " no args - provisiong core datasources and dev dashboards"
echo " no args - provisioning core datasources and dev dashboards"
}
main() {

View File

@@ -53,7 +53,7 @@ aliases = ["/docs/grafana/v1.1", "/docs/grafana/latest/guides/reference/admin",
<h4>Getting started</h4>
<p>Learn the basics of using Grafana.</p>
</a>
<a href="{{< relref "installation/configuration.md" >}}" class="nav-cards__item nav-cards__item--guide">
<a href="{{< relref "administration/configuration.md" >}}" class="nav-cards__item nav-cards__item--guide">
<h4>Configure Grafana</h4>
<p>Review the configuration and setup options.</p>
</a>
@@ -65,8 +65,8 @@ aliases = ["/docs/grafana/v1.1", "/docs/grafana/latest/guides/reference/admin",
<h4>Provisioning</h4>
<p>Learn how to automate your Grafana configuration.</p>
</a>
<a href="{{< relref "guides/whats-new-in-v6-6.md" >}}" class="nav-cards__item nav-cards__item--guide">
<h4>What's new in v6.6</h4>
<a href="{{< relref "guides/whats-new-in-v7-0.md" >}}" class="nav-cards__item nav-cards__item--guide">
<h4>What's new in v7.0</h4>
<p>Explore the features and enhancements in the latest release.</p>
</a>
@@ -91,9 +91,9 @@ aliases = ["/docs/grafana/v1.1", "/docs/grafana/latest/guides/reference/admin",
<img src="/img/docs/logos/icon_prometheus.svg" >
<h5>Prometheus</h5>
</a>
<a href="{{< relref "features/datasources/stackdriver.md" >}}" class="nav-cards__item nav-cards__item--ds">
<img src="/img/docs/logos/icon_stackdriver.svg">
<h5>Google Stackdriver</h5>
<a href="{{< relref "features/datasources/cloudmonitoring.md" >}}" class="nav-cards__item nav-cards__item--ds">
<img src="/img/docs/logos/icon_cloudmonitoring.svg">
<h5>Google Cloud Monitoring</h5>
</a>
<a href="{{< relref "features/datasources/cloudwatch.md" >}}" class="nav-cards__item nav-cards__item--ds">
<img src="/img/docs/logos/icon_cloudwatch.svg">

View File

@@ -8,4 +8,6 @@ identifier = "admin"
weight = 2
+++
# Administration
This section provides resources for Grafana administrators.

View File

@@ -23,7 +23,7 @@ grafana-cli -h
Some commands, such as installing or removing plugins, require `sudo` in order to run.
**Windows users**
Some commands, such as installing or removing plugins, require you to run Windows PowerShell as Administrator.
Some commands, such as installing or removing plugins, require you to run Windows PowerShell as Administrator.
Before you enter commands, `cd` into the Grafana bin directory. The default path is:
```
@@ -101,40 +101,40 @@ grafana-cli --insecure --pluginUrl https://company.com/grafana/plugins/<plugin-i
### Enable debug logging
`--debug` or `-d` enables debug logging. Debug output is returned and shown in the terminal.
`--debug` or `-d` enables debug logging. Debug output is returned and shown in the terminal.
**Example:**
```bash
grafana-cli --debug plugins install <plugin-id>
```
### Override a configuration setting
### Override a configuration setting
`--configOverrides` is a command line argument that acts like an environmental variable override.
For example, you can use it to redirect logging to another file (maybe to log plugin installations in a service like Hosted Grafana) or when resetting the admin password and you have non-default values for some important config value (like where the database is located).
For example, you can use it to redirect logging to another file (maybe to log plugin installations in Grafana Cloud) or when resetting the admin password and you have non-default values for some important config value (like where the database is located).
**Example:**
```bash
grafana-cli --configOverrides cfg:default.paths.log=/dev/null plugins install <plugin-id>
```
### Override homepath value
### Override homepath value
Sets the path for the Grafana install/home path, defaults to working directory. You do not need to use this if you are in the Grafana installation directory when using the CLI.
**Example:**
```bash
grafana-cli --homepath "c:\Program Files\grafana" admin reset-admin-password mynewpassword
```
### Override config file
### Override config file
`--config value` overrides the default location where Grafana expects the configuration file. Refer to [Configuration]({{< relref "../installation/configuration.md" >}}) for more information about configuring Grafana and default configuration file locations.
`--config value` overrides the default location where Grafana expects the configuration file. Refer to [Configuration]({{< relref "../administration/configuration.md" >}}) for more information about configuring Grafana and default configuration file locations.
**Example:**
```bash
grafana-cli admin reset-admin-password --config "/etc/configuration/" mynewpassword
grafana-cli --config "/etc/configuration/" admin reset-admin-password mynewpassword
```
## Plugins commands
@@ -200,7 +200,7 @@ grafana-cli admin
If there are two flags being used to set the homepath and the config file path, then running the command returns this error:
> Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath
> Could not find config defaults, make sure homepath command line parameter is set or working directory is homepath
To correct this, use the `--homepath` global option to specify the Grafana default homepath for this command:

View File

@@ -14,7 +14,7 @@ Grafana supports automatic rendering of panels and dashboards as PNG images. Thi
While an image is being rendered, the PNG image is temporarily written to the file system. When the image is rendered, the PNG image is temporarily written to the `png` folder in the Grafana `data` folder.
A background job runs every 10 minutes and removes temporary images. You can configure how long an image should be stored before being removed by configuring the [temp-data-lifetime]({{< relref "../installation/configuration/#temp-data-lifetime" >}}) setting.
A background job runs every 10 minutes and removes temporary images. You can configure how long an image should be stored before being removed by configuring the [temp-data-lifetime]({{< relref "../administration/configuration/#temp-data-lifetime" >}}) setting.
You can also render a PNG by clicking the dropdown arrow next to a panel title, then clicking **Share > Direct link rendered image**.
@@ -26,7 +26,7 @@ Rendering images can require a lot of memory, mainly because Grafana creates bro
## Alerting and render limits
Alert notifications can include images, but rendering many images at the same time can overload the server where the renderer is running. For instructions of how to configure this, see [concurrent_render_limit]({{< relref "../installation/configuration/#concurrent_render_limit" >}}).
Alert notifications can include images, but rendering many images at the same time can overload the server where the renderer is running. For instructions of how to configure this, see [concurrent_render_limit]({{< relref "../administration/configuration/#concurrent_render_limit" >}}).
## Install Grafana Image Renderer plugin
@@ -154,6 +154,14 @@ On Ubuntu 18.10 the following dependencies have been confirmed as needed for the
libx11-6 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrender1 libxtst6 libglib2.0-0 libnss3 libcups2 libdbus-1-3 libxss1 libxrandr2 libgtk-3-0 libgtk-3-0 libasound2
```
**Debian:**
On Debian 9 (Stretch) the following dependencies have been confirmed as needed for the image rendering to function.
```bash
libx11 libcairo bcairo2 libcairo2 libxtst6 libxcomposite1 libx11-xcb1 libxcursor1 libxdamage1 libnss3 libcups libcups2 libXss libXss1 libxss1 libxrandr2 libasound2 libatk1.0-0 libatk-bridge2.0-0 libpangocairo-1.0-0 libgtk-3-0
```
**Centos:**
On a minimal Centos installation, the following dependencies have been confirmed as needed for the image rendering to function:

View File

@@ -12,7 +12,7 @@ weight = 8
Grafana collects some metrics about itself internally. Grafana supports pushing metrics to Graphite or exposing them to be scraped by Prometheus.
For more information about configuration options related to Grafana metrics, refer to [metrics]({{< relref "../installation/configuration/#metrics" >}}) and [metrics.graphite]({{< relref "../installation/configuration/#metrics-graphite" >}}) in [Configuration]({{< relref "../installation/configuration.md" >}}).
For more information about configuration options related to Grafana metrics, refer to [metrics]({{< relref "../administration/configuration/#metrics" >}}) and [metrics.graphite]({{< relref "../administration/configuration/#metrics-graphite" >}}) in [Configuration]({{< relref "../administration/configuration.md" >}}).
## Available metrics

453
docs/sources/administration/provisioning.md Executable file → Normal file
View File

@@ -15,7 +15,7 @@ In previous versions of Grafana, you could only use the API for provisioning dat
## Config File
Check out the [configuration]({{< relref "../installation/configuration" >}}) page for more information on what you can configure in `grafana.ini`
Check out the [configuration]({{< relref "configuration.md" >}}) page for more information on what you can configure in `grafana.ini`
### Config File Locations
@@ -38,11 +38,11 @@ Example:
```yaml
datasources:
- name: Graphite
url: http://localhost:$PORT
user: $USER
secureJsonData:
password: $PASSWORD
- name: Graphite
url: http://localhost:$PORT
user: $USER
secureJsonData:
password: $PASSWORD
```
If you have a literal `$` in your value and want to avoid interpolation, `$$` can be used.
@@ -53,25 +53,25 @@ If you have a literal `$` in your value and want to avoid interpolation, `$$` ca
Currently we do not provide any scripts/manifests for configuring Grafana. Rather than spending time learning and creating scripts/manifests for each tool, we think our time is better spent making Grafana easier to provision. Therefore, we heavily rely on the expertise of the community.
Tool | Project
-----|------------
Puppet | [https://forge.puppet.com/puppet/grafana](https://forge.puppet.com/puppet/grafana)
Ansible | [https://github.com/cloudalchemy/ansible-grafana](https://github.com/cloudalchemy/ansible-grafana)
Chef | [https://github.com/JonathanTron/chef-grafana](https://github.com/JonathanTron/chef-grafana)
Saltstack | [https://github.com/salt-formulas/salt-formula-grafana](https://github.com/salt-formulas/salt-formula-grafana)
Jsonnet | [https://github.com/grafana/grafonnet-lib/](https://github.com/grafana/grafonnet-lib/)
| Tool | Project |
| --------- | -------------------------------------------------------------------------------------------------------------- |
| Puppet | [https://forge.puppet.com/puppet/grafana](https://forge.puppet.com/puppet/grafana) |
| Ansible | [https://github.com/cloudalchemy/ansible-grafana](https://github.com/cloudalchemy/ansible-grafana) |
| Chef | [https://github.com/JonathanTron/chef-grafana](https://github.com/JonathanTron/chef-grafana) |
| Saltstack | [https://github.com/salt-formulas/salt-formula-grafana](https://github.com/salt-formulas/salt-formula-grafana) |
| Jsonnet | [https://github.com/grafana/grafonnet-lib/](https://github.com/grafana/grafonnet-lib/) |
## Datasources
## Data sources
> This feature is available from v5.0
It's possible to manage datasources in Grafana by adding one or more yaml config files in the [`provisioning/datasources`](/installation/configuration/#provisioning) directory. Each config file can contain a list of `datasources` that will be added or updated during start up. If the datasource already exists, Grafana will update it to match the configuration file. The config file can also contain a list of datasources that should be deleted. That list is called `deleteDatasources`. Grafana will delete datasources listed in `deleteDatasources` before inserting/updating those in the `datasource` list.
It's possible to manage data sources in Grafana by adding one or more yaml config files in the [`provisioning/datasources`](/administration/configuration/#provisioning) directory. Each config file can contain a list of `datasources` that will be added or updated during start up. If the data source already exists, then Grafana updates it to match the configuration file. The config file can also contain a list of data sources that should be deleted. That list is called `deleteDatasources`. Grafana will delete data sources listed in `deleteDatasources` before inserting/updating those in the `datasource` list.
### Running Multiple Grafana Instances
If you are running multiple instances of Grafana you might run into problems if they have different versions of the `datasource.yaml` configuration file. The best way to solve this problem is to add a version number to each datasource in the configuration and increase it when you update the config. Grafana will only update datasources with the same or lower version number than specified in the config. That way, old configs cannot overwrite newer configs if they restart at the same time.
### Example Datasource Config File
### Example data source Config File
```yaml
# config file version
@@ -86,110 +86,112 @@ deleteDatasources:
# what's available in the database
datasources:
# <string, required> name of the datasource. Required
- name: Graphite
# <string, required> datasource type. Required
type: graphite
# <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
access: proxy
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string> custom UID which can be used to reference this datasource in other parts of the configuration, if not specified will be generated automatically
uid: my_unique_uid
# <string> url
url: http://localhost:8080
# <string> Deprecated, use secureJsonData.password
password:
# <string> database user, if used
user:
# <string> database name, if used
database:
# <bool> enable/disable basic auth
basicAuth:
# <string> basic auth username
basicAuthUser:
# <string> Deprecated, use secureJsonData.basicAuthPassword
basicAuthPassword:
# <bool> enable/disable with credentials headers
withCredentials:
# <bool> mark as default datasource. Max one per org
isDefault:
# <map> fields that will be converted to json and stored in jsonData
jsonData:
graphiteVersion: "1.1"
tlsAuth: true
tlsAuthWithCACert: true
# <string> json object of data that will be encrypted.
secureJsonData:
tlsCACert: "..."
tlsClientCert: "..."
tlsClientKey: "..."
# <string> database password, if used
- name: Graphite
# <string, required> datasource type. Required
type: graphite
# <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
access: proxy
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string> custom UID which can be used to reference this datasource in other parts of the configuration, if not specified will be generated automatically
uid: my_unique_uid
# <string> url
url: http://localhost:8080
# <string> Deprecated, use secureJsonData.password
password:
# <string> basic auth password
# <string> database user, if used
user:
# <string> database name, if used
database:
# <bool> enable/disable basic auth
basicAuth:
# <string> basic auth username
basicAuthUser:
# <string> Deprecated, use secureJsonData.basicAuthPassword
basicAuthPassword:
version: 1
# <bool> allow users to edit datasources from the UI.
editable: false
# <bool> enable/disable with credentials headers
withCredentials:
# <bool> mark as default datasource. Max one per org
isDefault:
# <map> fields that will be converted to json and stored in jsonData
jsonData:
graphiteVersion: '1.1'
tlsAuth: true
tlsAuthWithCACert: true
# <string> json object of data that will be encrypted.
secureJsonData:
tlsCACert: '...'
tlsClientCert: '...'
tlsClientKey: '...'
# <string> database password, if used
password:
# <string> basic auth password
basicAuthPassword:
version: 1
# <bool> allow users to edit datasources from the UI.
editable: false
```
#### Custom Settings per Datasource
Please refer to each datasource documentation for specific provisioning examples.
| Datasource | Misc |
| ---- | ---- |
| Datasource | Misc |
| ------------- | ---------------------------------------------------------------------------------- |
| Elasticsearch | Elasticsearch uses the `database` property to configure the index for a datasource |
#### Json Data
Since not all datasources have the same configuration settings we only have the most common ones as fields. The rest should be stored as a json blob in the `jsonData` field. Here are the most common settings that the core datasources use.
| Name | Type | Datasource | Description |
| ---- | ---- | ---- | ---- |
| tlsAuth | boolean | *All* | Enable TLS authentication using client cert configured in secure json data |
| tlsAuthWithCACert | boolean | *All* | Enable TLS authentication using CA cert |
| tlsSkipVerify | boolean | *All* | Controls whether a client verifies the server's certificate chain and host name. |
| graphiteVersion | string | Graphite | Graphite version |
| timeInterval | string | Prometheus, Elasticsearch, InfluxDB, MySQL, PostgreSQL and MSSQL | Lowest interval/step value that should be used for this data source |
| esVersion | number | Elasticsearch | Elasticsearch version as a number (2/5/56/60/70) |
| timeField | string | Elasticsearch | Which field that should be used as timestamp |
| interval | string | Elasticsearch | Index date time format. nil(No Pattern), 'Hourly', 'Daily', 'Weekly', 'Monthly' or 'Yearly' |
| logMessageField | string | Elasticsearch | Which field should be used as the log message |
| logLevelField | string | Elasticsearch | Which field should be used to indicate the priority of the log message |
| authType | string | Cloudwatch | Auth provider. keys/credentials/arn |
| assumeRoleArn | string | Cloudwatch | ARN of Assume Role |
| defaultRegion | string | Cloudwatch | AWS region |
| customMetricsNamespaces | string | Cloudwatch | Namespaces of Custom Metrics |
| tsdbVersion | string | OpenTSDB | Version |
| tsdbResolution | string | OpenTSDB | Resolution |
| sslmode | string | PostgreSQL | SSLmode. 'disable', 'require', 'verify-ca' or 'verify-full' |
| sslRootCertFile | string | PostgreSQL | SSL server root certificate file, must be readable by the Grafana user |
| sslCertFile | string | PostgreSQL | SSL client certificate file, must be readable by the Grafana user |
| sslKeyFile | string | PostgreSQL | SSL client key file, must be readable by *only* the Grafana user |
| encrypt | string | MSSQL | Connection SSL encryption handling. 'disable', 'false' or 'true' |
| postgresVersion | number | PostgreSQL | Postgres version as a number (903/904/905/906/1000) meaning v9.3, v9.4, ..., v10 |
| timescaledb | boolean | PostgreSQL | Enable usage of TimescaleDB extension |
| maxOpenConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of open connections to the database (Grafana v5.4+) |
| maxIdleConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of connections in the idle connection pool (Grafana v5.4+) |
| connMaxLifetime | number | MySQL, PostgreSQL and MSSQL | Maximum amount of time in seconds a connection may be reused (Grafana v5.4+) |
| Name | Type | Datasource | Description |
| ----------------------- | ------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| tlsAuth | boolean | _All_ | Enable TLS authentication using client cert configured in secure json data |
| tlsAuthWithCACert | boolean | _All_ | Enable TLS authentication using CA cert |
| tlsSkipVerify | boolean | _All_ | Controls whether a client verifies the server's certificate chain and host name. |
| graphiteVersion | string | Graphite | Graphite version |
| timeInterval | string | Prometheus, Elasticsearch, InfluxDB, MySQL, PostgreSQL and MSSQL | Lowest interval/step value that should be used for this data source |
| esVersion | number | Elasticsearch | Elasticsearch version as a number (2/5/56/60/70) |
| timeField | string | Elasticsearch | Which field that should be used as timestamp |
| interval | string | Elasticsearch | Index date time format. nil(No Pattern), 'Hourly', 'Daily', 'Weekly', 'Monthly' or 'Yearly' |
| logMessageField | string | Elasticsearch | Which field should be used as the log message |
| logLevelField | string | Elasticsearch | Which field should be used to indicate the priority of the log message |
| authType | string | Cloudwatch | Auth provider. keys/credentials/arn |
| assumeRoleArn | string | Cloudwatch | ARN of Assume Role |
| defaultRegion | string | Cloudwatch | AWS region |
| customMetricsNamespaces | string | Cloudwatch | Namespaces of Custom Metrics |
| tsdbVersion | string | OpenTSDB | Version |
| tsdbResolution | string | OpenTSDB | Resolution |
| sslmode | string | PostgreSQL | SSLmode. 'disable', 'require', 'verify-ca' or 'verify-full' |
| sslRootCertFile | string | PostgreSQL | SSL server root certificate file, must be readable by the Grafana user |
| sslCertFile | string | PostgreSQL | SSL client certificate file, must be readable by the Grafana user |
| sslKeyFile | string | PostgreSQL | SSL client key file, must be readable by _only_ the Grafana user |
| encrypt | string | MSSQL | Connection SSL encryption handling. 'disable', 'false' or 'true' |
| postgresVersion | number | PostgreSQL | Postgres version as a number (903/904/905/906/1000) meaning v9.3, v9.4, ..., v10 |
| timescaledb | boolean | PostgreSQL | Enable usage of TimescaleDB extension |
| maxOpenConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of open connections to the database (Grafana v5.4+) |
| maxIdleConns | number | MySQL, PostgreSQL and MSSQL | Maximum number of connections in the idle connection pool (Grafana v5.4+) |
| connMaxLifetime | number | MySQL, PostgreSQL and MSSQL | Maximum amount of time in seconds a connection may be reused (Grafana v5.4+) |
#### Secure Json Data
`{"authType":"keys","defaultRegion":"us-west-2","timeField":"@timestamp"}`
Secure json data is a map of settings that will be encrypted with [secret key]({{< relref "../installation/configuration/#secret-key" >}}) from the Grafana config. The purpose of this is only to hide content from the users of the application. This should be used for storing TLS Cert and password that Grafana will append to the request on the server side. All of these settings are optional.
Secure json data is a map of settings that will be encrypted with [secret key]({{< relref "configuration.md#secret-key" >}}) from the Grafana config. The purpose of this is only to hide content from the users of the application. This should be used for storing TLS Cert and password that Grafana will append to the request on the server side. All of these settings are optional.
| Name | Type | Datasource | Description |
| ----| ---- | ---- | --- |
| tlsCACert | string | *All* |CA cert for out going requests |
| tlsClientCert | string | *All* |TLS Client cert for outgoing requests |
| tlsClientKey | string | *All* |TLS Client key for outgoing requests |
| password | string | *All* | password |
| basicAuthPassword | string | *All* | password for basic authentication |
| accessKey | string | Cloudwatch | Access key for connecting to Cloudwatch |
| secretKey | string | Cloudwatch | Secret key for connecting to Cloudwatch |
| Name | Type | Datasource | Description |
| ----------------- | ------ | ---------- | --------------------------------------- |
| tlsCACert | string | _All_ | CA cert for out going requests |
| tlsClientCert | string | _All_ | TLS Client cert for outgoing requests |
| tlsClientKey | string | _All_ | TLS Client key for outgoing requests |
| password | string | _All_ | password |
| basicAuthPassword | string | _All_ | password for basic authentication |
| accessKey | string | Cloudwatch | Access key for connecting to Cloudwatch |
| secretKey | string | Cloudwatch | Secret key for connecting to Cloudwatch |
#### Custom HTTP headers for datasources
Datasources managed by Grafanas provisioning can be configured to add HTTP headers to all requests
Data sources managed by Grafanas provisioning can be configured to add HTTP headers to all requests
going to that datasource. The header name is configured in the `jsonData` field and the header value should be
configured in `secureJsonData`.
@@ -197,18 +199,48 @@ configured in `secureJsonData`.
apiVersion: 1
datasources:
- name: Graphite
jsonData:
httpHeaderName1: "HeaderName"
httpHeaderName2: "Authorization"
secureJsonData:
httpHeaderValue1: "HeaderValue"
httpHeaderValue2: "Bearer XXXXXXXXX"
- name: Graphite
jsonData:
httpHeaderName1: 'HeaderName'
httpHeaderName2: 'Authorization'
secureJsonData:
httpHeaderValue1: 'HeaderValue'
httpHeaderValue2: 'Bearer XXXXXXXXX'
```
## Plugins
> This feature is available from v7.1
You can manage plugins in Grafana by adding one or more YAML config files in the [`provisioning/plugins`]({{< relref "configuration.md#provisioning" >}}) directory. Each config file can contain a list of `apps` that will be updated during start up. Grafana updates each app to match the configuration file.
### Example plugin configuration file
```yaml
apiVersion: 1
apps:
# <string> the type of app, plugin identifier. Required
- type: raintank-worldping-app
# <int> Org ID. Default to 1, unless org_name is specified
org_id: 1
# <string> Org name. Overrides org_id unless org_id not specified
org_name: Main Org.
# <bool> disable the app. Default to false.
disabled: false
# <map> fields that will be converted to json and stored in jsonData. Custom per app.
jsonData:
# key/value pairs of string to object
key: value
# <map> fields that will be converted to json, encrypted and stored in secureJsonData. Custom per app.
secureJsonData:
# key/value pairs of string to string
key: value
```
## Dashboards
It's possible to manage dashboards in Grafana by adding one or more yaml config files in the [`provisioning/dashboards`]({{< relref "../installation/configuration.md" >}}) directory. Each config file can contain a list of `dashboards providers` that will load dashboards into Grafana from the local filesystem.
You can manage dashboards in Grafana by adding one or more YAML config files in the [`provisioning/dashboards`]({{< relref "configuration.md" >}}) directory. Each config file can contain a list of `dashboards providers` that load dashboards into Grafana from the local filesystem.
The dashboard provider config file looks somewhat like this:
@@ -216,32 +248,35 @@ The dashboard provider config file looks somewhat like this:
apiVersion: 1
providers:
# <string> an unique provider name
- name: 'a unique provider name'
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string, required> name of the dashboard folder. Required
folder: ''
# <string> folder UID. will be automatically generated if not specified
folderUid: ''
# <string, required> provider type. Required
type: file
# <bool> disable dashboard deletion
disableDeletion: false
# <bool> enable dashboard editing
editable: true
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 10
# <bool> allow updating provisioned dashboards from the UI
allowUiUpdates: false
options:
# <string, required> path to dashboard files on disk. Required
path: /var/lib/grafana/dashboards
# <string> an unique provider name. Required
- name: 'a unique provider name'
# <int> Org id. Default to 1
orgId: 1
# <string> name of the dashboard folder.
folder: ''
# <string> folder UID. will be automatically generated if not specified
folderUid: ''
# <string> provider type. Default to 'file'
type: file
# <bool> disable dashboard deletion
disableDeletion: false
# <bool> enable dashboard editing
editable: true
# <int> how often Grafana will scan for changed dashboards
updateIntervalSeconds: 10
# <bool> allow updating provisioned dashboards from the UI
allowUiUpdates: false
options:
# <string, required> path to dashboard files on disk. Required when using the 'file' type
path: /var/lib/grafana/dashboards
# <bool> use folder names from filesystem to create folders in Grafana
foldersFromFilesStructure: true
```
When Grafana starts, it will update/insert all dashboards available in the configured path. Then later on poll that path every **updateIntervalSeconds** and look for updated json files and update/insert those into the database.
#### Making changes to a provisioned dashboard
It's possible to make changes to a provisioned dashboard in the Grafana UI. However, it is not possible to automatically save the changes back to the provisioning source.
If `allowUiUpdates` is set to `true` and you make changes to a provisioned dashboard, you can `Save` the dashboard then changes will be persisted to the Grafana database.
@@ -250,7 +285,7 @@ If `allowUiUpdates` is set to `true` and you make changes to a provisioned dashb
>
> If a provisioned dashboard is saved from the UI and the source is removed, the dashboard stored in the database will be deleted unless the configuration option `disableDeletion` is set to true.
If `allowUiUpdates` is configured to `false`, you are not able to make changes to a provisioned dashboard. When you click `Save`, Grafana brings up a *Cannot save provisioned dashboard* dialog. The screenshot below illustrates this behavior.
If `allowUiUpdates` is configured to `false`, you are not able to make changes to a provisioned dashboard. When you click `Save`, Grafana brings up a _Cannot save provisioned dashboard_ dialog. The screenshot below illustrates this behavior.
Grafana offers options to export the JSON definition of a dashboard. Either `Copy JSON to Clipboard` or `Save JSON to file` can help you synchronize your dashboard changes back to the provisioning source.
@@ -269,11 +304,41 @@ By default Grafana will delete dashboards in the database if the file is removed
> Be careful not to re-use the same `title` multiple times within a folder
> or `uid` within the same installation as this will cause weird behaviors.
### Provision folders structure from filesystem to Grafana
If you already store your dashboards using folders in a git repo or on a filesystem, and also you want to have the same folder names in the Grafana menu, you can use `foldersFromFilesStructure` option.
For example, to replicate these dashboards structure from the filesystem to Grafana,
```
/etc/dashboards
├── /server
│ ├── /common_dashboard.json
│ └── /network_dashboard.json
└── /application
├── /requests_dashboard.json
└── /resources_dashboard.json
```
you need to specify just this short provision configuration file.
```yaml
apiVersion: 1
providers:
- name: dashboards
type: file
updateIntervalSeconds: 30
options:
path: /etc/dashboards
foldersFromFileStructure: true
```
`server` and `application` will become new folders in Grafana menu.
> **Note.** `folder` and `folderUid` options should be empty or missing to make `foldersFromFileStructure` works.
## Alert Notification Channels
Alert Notification Channels can be provisioned by adding one or more yaml config files in the [`provisioning/notifiers`](/installation/configuration/#provisioning) directory.
Alert Notification Channels can be provisioned by adding one or more yaml config files in the [`provisioning/notifiers`](/administration/configuration/#provisioning) directory.
Each config file can contain the following top-level fields:
- `notifiers`, a list of alert notifications that will be added or updated during start up. If the notification channel already exists, Grafana will update it to match the configuration file.
- `delete_notifiers`, a list of alert notifications to be deleted before inserting/updating those in the `notifiers` list.
@@ -316,8 +381,8 @@ notifiers:
# See `Supported Settings` section for settings supporter for each
# alert notification type.
settings:
recipient: "XXX"
token: "xoxb"
recipient: 'XXX'
token: 'xoxb'
uploadImage: true
url: https://slack.com
@@ -338,131 +403,131 @@ The following sections detail the supported settings for each alert notification
#### Alert notification `pushover`
| Name |
| ---- |
| Name |
| -------- |
| apiToken |
| userKey |
| device |
| retry |
| expire |
| userKey |
| device |
| retry |
| expire |
#### Alert notification `slack`
| Name |
| ---- |
| url |
| recipient |
| username |
| icon_emoji |
| icon_url |
| uploadImage |
| mentionUsers |
| mentionGroups |
| Name |
| -------------- |
| url |
| recipient |
| username |
| icon_emoji |
| icon_url |
| uploadImage |
| mentionUsers |
| mentionGroups |
| mentionChannel |
| token |
| token |
#### Alert notification `victorops`
| Name |
| ---- |
| url |
| Name |
| ----------- |
| url |
| autoResolve |
#### Alert notification `kafka`
| Name |
| ---- |
| Name |
| -------------- |
| kafkaRestProxy |
| kafkaTopic |
| kafkaTopic |
#### Alert notification `LINE`
| Name |
| ---- |
| Name |
| ----- |
| token |
#### Alert notification `pagerduty`
| Name |
| ---- |
| Name |
| -------------- |
| integrationKey |
| autoResolve |
| autoResolve |
#### Alert notification `sensu`
| Name |
| ---- |
| url |
| source |
| handler |
| Name |
| -------- |
| url |
| source |
| handler |
| username |
| password |
#### Alert notification `prometheus-alertmanager`
| Name |
| ---- |
| url |
| basicAuthUser |
| Name |
| ----------------- |
| url |
| basicAuthUser |
| basicAuthPassword |
#### Alert notification `teams`
| Name |
| ---- |
| url |
| url |
#### Alert notification `dingding`
| Name |
| ---- |
| url |
| url |
#### Alert notification `email`
| Name |
| ---- |
| Name |
| ----------- |
| singleEmail |
| addresses |
| addresses |
#### Alert notification `hipchat`
| Name |
| ---- |
| url |
| Name |
| ------ |
| url |
| apikey |
| roomid |
#### Alert notification `opsgenie`
| Name |
| ---- |
| apiKey |
| apiUrl |
| autoClose |
| Name |
| ---------------- |
| apiKey |
| apiUrl |
| autoClose |
| overridePriority |
#### Alert notification `telegram`
| Name |
| ---- |
| bottoken |
| chatid |
| Name |
| ----------- |
| bottoken |
| chatid |
| uploadImage |
#### Alert notification `threema`
| Name |
| ---- |
| gateway_id |
| Name |
| ------------ |
| gateway_id |
| recipient_id |
| api_secret |
| api_secret |
#### Alert notification `webhook`
| Name |
| ---- |
| url |
| Name |
| -------- |
| url |
| username |
| password |
@@ -470,4 +535,4 @@ The following sections detail the supported settings for each alert notification
| Name |
| ---- |
| url |
| url |

View File

@@ -7,3 +7,51 @@ parent = "features"
weight = 6
+++
# Alerts overview
Alerts allow you to identify problems in your system moments after they occur. By quickly identifying unintended changes in your system, you can minimize disruptions to your services.
Alerts consists of two parts:
- Alert rules - When the alert is triggered. Alert rules are defined by one or more conditions that are regularly evaluated by Grafana.
- Notification channel - How the alert is delivered. When the conditions of an alert rule are met, the Grafana notifies the channels configured for that alert.
Currently only the graph panel visualization supports alerts.
## Alert tasks
You can perform the following tasks for alerts:
- [Add or edit an alert notification channel]({{< relref "notifications.md" >}})
- [Create an alert rule]({{< relref "create-alerts.md" >}})
- [View existing alert rules and their current state]({{< relref "view-alerts.md" >}})
- [Test alert rules and troubleshoot]({{< relref "troubleshoot-alerts.md" >}})
## Clustering
Currently alerting supports a limited form of high availability. Since v4.2.0 of Grafana, alert notifications are deduped when running multiple servers. This means all alerts are executed on every server but no duplicate alert notifications are sent due to the deduping logic. Proper load balancing of alerts will be introduced in the future.
## Notifications
You can also set alert rule notifications along with a detailed message about the alert rule. The message can contain anything: information about how you might solve the issue, link to runbook, and so on.
The actual notifications are configured and shared between multiple alerts.
## Alert execution
Alert rules are evaluated in the Grafana backend in a scheduler and query execution engine that is part
of core Grafana. Only some data sources are supported right now. They include `Graphite`, `Prometheus`, `InfluxDB`, `Elasticsearch`,
`Google Cloud Monitoring`, `Cloudwatch`, `Azure Monitor`, `MySQL`, `PostgreSQL`, `MSSQL`, `OpenTSDB`, `Oracle`, and `Azure Data Explorer`.
## Metrics from the alert engine
The alert engine publishes some internal metrics about itself. You can read more about how Grafana publishes [internal metrics]({{< relref "../administration/metrics/" >}}).
Description | Type | Metric name
---------- | ----------- | ----------
Total number of alerts | counter | `alerting.active_alerts`
Alert execution result | counter | `alerting.result`
Notifications sent counter | counter | `alerting.notifications_sent`
Alert execution timer | timer | `alerting.execution_time`

View File

@@ -0,0 +1,56 @@
+++
title = "Alerts overview"
type = "docs"
[menu.docs]
identifier = "alerting"
parent = "Alerting"
aliases = ["/docs/grafana/latest/alerting/rules/", "/docs/grafana/latest/alerting/metrics/", "/docs/grafana/latest/alerting/rules/#query-condition-example", "/docs/grafana/latest/alerting/rules/#for", "/docs/grafana/latest/alerting/rules/#rule-config"]
weight = 100
+++
# Alerts overview
Alerts allow you to identify problems in your system moments after they occur. By quickly identifying unintended changes in your system, you can minimize disruptions to your services.
Alerts consists of two parts:
- Alert rules - When the alert is triggered. Alert rules are defined by one or more conditions that are regularly evaluated by Grafana.
- Notification channel - How the alert is delivered. When the conditions of an alert rule are met, the Grafana notifies the channels configured for that alert.
Currently only the graph panel visualization supports alerts.
## Alert tasks
You can perform the following tasks for alerts:
- [Add or edit an alert notification channel]({{< relref "notifications.md" >}})
- [Create an alert rule]({{< relref "create-alerts.md" >}})
- [View existing alert rules and their current state]({{< relref "view-alerts.md" >}})
- [Test alert rules and troubleshoot]({{< relref "troubleshoot-alerts.md" >}})
## Clustering
Currently alerting supports a limited form of high availability. Since v4.2.0 of Grafana, alert notifications are deduped when running multiple servers. This means all alerts are executed on every server but no duplicate alert notifications are sent due to the deduping logic. Proper load balancing of alerts will be introduced in the future.
## Notifications
You can also set alert rule notifications along with a detailed message about the alert rule. The message can contain anything: information about how you might solve the issue, link to runbook, and so on.
The actual notifications are configured and shared between multiple alerts.
## Alert execution
Alert rules are evaluated in the Grafana backend in a scheduler and query execution engine that is part
of core Grafana. Only some data sources are supported right now. They include `Graphite`, `Prometheus`, `InfluxDB`, `Elasticsearch`,
`Google Cloud Monitoring`, `Cloudwatch`, `Azure Monitor`, `MySQL`, `PostgreSQL`, `MSSQL`, `OpenTSDB`, `Oracle`, and `Azure Data Explorer`.
## Metrics from the alert engine
The alert engine publishes some internal metrics about itself. You can read more about how Grafana publishes [internal metrics]({{< relref "../administration/metrics/" >}}).
Description | Type | Metric name
---------- | ----------- | ----------
Total number of alerts | counter | `alerting.active_alerts`
Alert execution result | counter | `alerting.result`
Notifications sent counter | counter | `alerting.notifications_sent`
Alert execution timer | timer | `alerting.execution_time`

View File

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

View File

@@ -1,21 +0,0 @@
+++
title = "Alerting Metrics"
description = "Alerting Metrics Guide"
keywords = ["Grafana", "alerting", "guide", "metrics"]
type = "docs"
[menu.docs]
name = "Metrics"
parent = "alerting"
weight = 2
+++
# Metrics from the alert engine
The alert engine publishes some internal metrics about itself. You can read more about how Grafana publishes [internal metrics]({{< relref "../administration/metrics/" >}}).
Description | Type | Metric name
---------- | ----------- | ----------
Total number of alerts | counter | `alerting.active_alerts`
Alert execution result | counter | `alerting.result`
Notifications sent counter | counter | `alerting.notifications_sent`
Alert execution timer | timer | `alerting.execution_time`

View File

@@ -1,46 +1,42 @@
+++
title = "Alerting Notifications"
description = "Alerting Notifications Guide"
title = "Alert notifications"
description = "Alerting notifications guide"
keywords = ["Grafana", "alerting", "guide", "notifications"]
type = "docs"
[menu.docs]
name = "Notifications"
parent = "alerting"
weight = 2
weight = 200
+++
# Alert Notifications
> Alerting is only available in Grafana v4.0 and above.
# Alert notifications
When an alert changes state, it sends out notifications. Each alert rule can have
multiple notifications. In order to add a notification to an alert rule you first need
to add and configure a `notification` channel (can be email, PagerDuty or other integration).
This is done from the Notification Channels page.
to add and configure a `notification` channel (can be email, PagerDuty, or other integration).
## Notification Channel Setup
This is done from the Notification channels page.
On the Notification Channels page hit the `New Channel` button to go the page where you
can configure and setup a new Notification Channel.
> **Note:** Alerting is only available in Grafana v4.0 and above.
You specify a name and a type, and type specific options. You can also test the notification to make
sure it's setup correctly.
## Add a notification channel
1. In the Grafana side bar, hover your cursor over the **Alerting** (bell) icon and then click **Notification channels**.
1. Click **Add channel**.
1. Fill out the fields or select options described below.
## New notification channel fields
### Default (send on all alerts)
When checked, this option will notify for all alert rules - existing and new.
- **Name -** Enter a name for this channel. It will be displayed when users add notifications to alert rules.
- **Type -** Select the channel type. Refer to the [List of supported notifiers](#list-of-supported-notifiers) for details.
- **Default (send on all alerts) -** When selected, this option sends a notification on this channel for all alert rules.
- **Include Image -** See [Enable images in notifications](#enable-images-in-notifications-external-image-store) for details.
- **Disable Resolve Message -** When selected, this option disables the resolve message [OK] that is sent when the alerting state returns to false.
- **Send reminders -** When this option is checked additional notifications (reminders) will be sent for triggered alerts. You can specify how often reminders should be sent using number of seconds (s), minutes (m) or hours (h), for example `30s`, `3m`, `5m` or `1h`.
### Send reminders
> Only available in Grafana v5.3 and above.
{{< docs-imagebox max-width="600px" img="/img/docs/v53/alerting_notification_reminders.png" class="docs-image--right" caption="Alerting notification reminders setup" >}}
When this option is checked additional notifications (reminders) will be sent for triggered alerts. You can specify how often reminders
should be sent using number of seconds (s), minutes (m) or hours (h), for example `30s`, `3m`, `5m` or `1h` etc.
**Important:** Alert reminders are sent after rules are evaluated. Therefore a reminder can never be sent more frequently than a configured [alert rule evaluation interval]({{< relref "rules/#name-evaluation-interval" >}}).
**Important:** Alert reminders are sent after rules are evaluated. Therefore a reminder can never be sent more frequently than a configured alert rule evaluation interval.
These examples show how often and when reminders are sent for a triggered alert.
@@ -55,17 +51,32 @@ Alert rule evaluation interval | Send reminders every | Reminder sent every (aft
<div class="clearfix"></div>
### Disable resolve message
## List of supported notifiers
When checked, this option will disable resolve message [OK] that is sent when alerting state returns to false.
## Supported Notification Types
Grafana ships with the following set of notification types:
Name | Type | Supports images | Support alert rule tags
-----|------|---------------- | -----------------------
[DingDing](#dingdingdingtalk) | `dingding` | yes, external only | no
Discord | `discord` | yes | no
[Email](#email) | `email` | yes | no
[Google Hangouts Chat](#google-hangouts-chat) | `googlechat` | yes, external only | no
Hipchat | `hipchat` | yes, external only | no
[Kafka](#kafka) | `kafka` | yes, external only | no
Line | `line` | yes, external only | no
Microsoft Teams | `teams` | yes, external only | no
OpsGenie | `opsgenie` | yes, external only | yes
[Pagerduty](#pagerduty) | `pagerduty` | yes, external only | yes
Prometheus Alertmanager | `prometheus-alertmanager` | yes, external only | yes
Pushover | `pushover` | yes | no
Sensu | `sensu` | yes, external only | no
[Slack](#slack) | `slack` | yes | no
Telegram | `telegram` | yes | no
Threema | `threema` | yes, external only | no
VictorOps | `victorops` | yes, external only | no
[Webhook](#webhook) | `webhook` | yes, external only | yes
### Email
To enable email notifications you have to setup [SMTP settings]({{< relref "../installation/configuration/#smtp" >}})
To enable email notifications you have to setup [SMTP settings]({{< relref "../administration/configuration/#smtp" >}})
in the Grafana config. Email notifications will upload an image of the alert graph to an
external image destination if available or fallback to attaching the image to the email.
Be aware that if you use the `local` image storage email servers and clients might not be
@@ -83,20 +94,20 @@ Addresses | Email addresses to recipients. You can enter multiple email addresse
To set up Slack, you need to configure an incoming Slack webhook URL. You can follow
[Sending messages using Incoming Webhooks](https://api.slack.com/incoming-webhooks) on how to do that. If you want to include screenshots of the
firing alerts in the Slack messages you have to configure either the [external image destination](#external-image-store)
in Grafana or a bot integration via Slack Apps. Follow Slack's guide to set up a bot integration and use the token
provided (https://api.slack.com/bot-users), which starts with "xoxb".
in Grafana or a bot integration via Slack Apps. [Follow Slack's guide to set up a bot integration](https://api.slack.com/bot-users) and use the token
provided, which starts with "xoxb".
Setting | Description
---------- | -----------
Url | Slack incoming webhook URL.
Url | Slack incoming webhook URL, or eventually the [chat.postMessage](https://api.slack.com/methods/chat.postMessage) Slack API endpoint.
Username | Set the username for the bot's message.
Recipient | Allows you to override the Slack recipient. You must either provide a channel Slack ID, a user Slack ID, a username reference (@&lt;user&gt;, all lowercase, no whitespace), or a channel reference (#&lt;channel&gt;, all lowercase, no whitespace).
Recipient | Allows you to override the Slack recipient. You must either provide a channel Slack ID, a user Slack ID, a username reference (@&lt;user&gt;, all lowercase, no whitespace), or a channel reference (#&lt;channel&gt;, all lowercase, no whitespace). If you use the `chat.postMessage` Slack API endpoint, this is required.
Icon emoji | Provide an emoji to use as the icon for the bot's message. Ex :smile:
Icon URL | Provide a URL to an image to use as the icon for the bot's message.
Mention Users | Optionally mention one or more users in the Slack notification sent by Grafana. You have to refer to users, comma-separated, via their corresponding Slack IDs (which you can find by clicking the overflow button on each user's Slack profile).
Mention Groups | Optionally mention one or more groups in the Slack notification sent by Grafana. You have to refer to groups, comma-separated, via their corresponding Slack IDs (which you can get from each group's Slack profile URL).
Mention Channel | Optionally mention either all channel members or just active ones.
Token | If provided, Grafana will upload the generated image via Slack's file.upload API method, not the external image destination.
Token | If provided, Grafana will upload the generated image via Slack's file.upload API method, not the external image destination. If you use the `chat.postMessage` Slack API endpoint, this is required.
If you are using the token for a slack bot, then you have to invite the bot to the channel you want to send notifications and add the channel to the recipient field.
@@ -107,10 +118,16 @@ To set up PagerDuty, all you have to do is to provide an integration key.
Setting | Description
---------- | -----------
Integration Key | Integration key for PagerDuty.
Severity | Level for dynamic notifications, default is `critical`
Severity | Level for dynamic notifications, default is `critical` (1)
Auto resolve incidents | Resolve incidents in PagerDuty once the alert goes back to ok
Message in details | Removes the Alert message from the PD summary field and puts it into custom details instead (2)
**Note:** The tags `Severity`, `Class`, `Group`, and `Component` have special meaning in the [Pagerduty Common Event Format - PD-CEF](https://support.pagerduty.com/docs/pd-cef). If an alert panel defines these tag keys, then they are transposed to the root of the event sent to Pagerduty. This means they will be available within the Pagerduty UI and Filtering tools. A Severity tag set on an alert overrides the global Severity set on the notification channel if it's a valid level.
>**Note:** The tags `Severity`, `Class`, `Group`, and `Component` have special meaning in the [Pagerduty Common Event Format - PD-CEF](https://support.pagerduty.com/docs/pd-cef). If an alert panel defines these tag keys, then they are transposed to the root of the event sent to Pagerduty. This means they will be available within the Pagerduty UI and Filtering tools. A Severity tag set on an alert overrides the global Severity set on the notification channel if it's a valid level.
>Using Message In Details will change the structure of the `custom_details` field in the PagerDuty Event.
This might break custom event rules in your PagerDuty rules if you rely on the fields in `payload.custom_details`.
Move any existing rules using `custom_details.myMetric` to `custom_details.queries.myMetric`.
This behavior will become the default in a future version of Grafana.
### Webhook
@@ -185,52 +202,22 @@ Notifications can be sent by setting up an incoming webhook in Google Hangouts c
Squadcast helps you get alerted via Phone call, SMS, Email and Push notifications and lets you take actions on those alerts. Grafana notifications can be sent to Squadcast via a simple incoming webhook. Refer the official [Squadcast support documentation](https://support.squadcast.com/docs/grafana) for configuring these webhooks.
### All supported notifiers
### Prometheus Alertmanager
Name | Type | Supports images | Support alert rule tags
-----|------|---------------- | -----------------------
DingDing | `dingding` | yes, external only | no
Discord | `discord` | yes | no
Email | `email` | yes | no
Google Hangouts Chat | `googlechat` | yes, external only | no
Hipchat | `hipchat` | yes, external only | no
Kafka | `kafka` | yes, external only | no
Line | `line` | yes, external only | no
Microsoft Teams | `teams` | yes, external only | no
OpsGenie | `opsgenie` | yes, external only | yes
Pagerduty | `pagerduty` | yes, external only | yes
Prometheus Alertmanager | `prometheus-alertmanager` | yes, external only | yes
Pushover | `pushover` | yes | no
Sensu | `sensu` | yes, external only | no
Slack | `slack` | yes | no
Telegram | `telegram` | yes | no
Threema | `threema` | yes, external only | no
VictorOps | `victorops` | yes, external only | no
Webhook | `webhook` | yes, external only | yes
Alertmanager handles alerts sent by client applications such as Prometheus server or Grafana. It takes care of deduplicating, grouping, and routing them to the correct receiver. Grafana notifications can be sent to Alertmanager via a simple incoming webhook. Refer to the official [Prometheus Alertmanager documentation](https://prometheus.io/docs/alerting/alertmanager) for configuration information.
> **Caution:** In case of a high-availability setup, do not load balance traffic between Grafana and Alertmanagers to keep coherence between all your Alertmanager instances. Instead, point Grafana to a list of all Alertmanagers, by listing their URLs comma-separated in the notification channel configuration.
## Enable images in notifications {#external-image-store}
Grafana can render the panel associated with the alert rule as a PNG image and include that in the notification. Read more about the requirements and how to configure
[image rendering]({{< relref "../administration/image_rendering/" >}}).
Most Notification Channels require that this image be publicly accessible (Slack and PagerDuty for example). In order to include images in alert notifications, Grafana can upload the image to an image store. It currently supports
Amazon S3, Webdav, Google Cloud Storage and Azure Blob Storage. So to set that up you need to configure the [external image uploader]({{< relref "../installation/configuration/#external-image-storage" >}}) in your grafana-server ini config file.
Be aware that some notifiers require public access to the image to be able to include it in the notification. So make sure to enable public access to the images. If you're using local image uploader, your Grafana instance need to be accessible by the internet.
You must configure an [external image storage provider]({{< relref "../administration/configuration/#external-image-storage" >}}) in order to receive images in alert notifications. If your notification channel requires that the image be publicly accessible (e.g. Slack, PagerDuty), configure a provider which uploads the image to a remote image store like Amazon S3, Webdav, Google Cloud Storage, or Azure Blob Storage. Otherwise, the local provider can be used to serve the image directly from Grafana.
Notification services which need public image access are marked as 'external only'.
## Use alert rule tags in notifications {#alert-rule-tags}
> Only available in Grafana v6.3+.
Grafana can include a list of tags (key/value) in the notification.
It's called alert rule tags to contrast with tags parsed from timeseries.
It currently supports only the Prometheus Alertmanager notifier.
This is an optional feature. You can get notifications without using alert rule tags.
## Configure the link back to Grafana from alert notifications
All alert notifications contain a link back to the triggered alert in the Grafana instance.
This URL is based on the [domain]({{< relref "../installation/configuration/#domain" >}}) setting in Grafana.
This URL is based on the [domain]({{< relref "../administration/configuration/#domain" >}}) setting in Grafana.

View File

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

View File

@@ -1,174 +0,0 @@
+++
title = "Alerting Engine and Rules Guide"
description = "Configuring Alert Rules"
keywords = ["grafana", "alerting", "guide", "rules"]
type = "docs"
[menu.docs]
name = "Engine and Rules"
parent = "alerting"
weight = 1
+++
# Alerting Engine and Rules Guide
Alerting in Grafana allows you to attach rules to your dashboard panels. When you save the dashboard,
Grafana will extract the alert rules into a separate alert rule storage and schedule them for evaluation.
{{< imgbox max-width="40%" img="/img/docs/v4/drag_handles_gif.gif" caption="Alerting overview" >}}
In the alert tab of the graph panel you can configure how often the alert rule should be evaluated
and the conditions that need to be met for the alert to change state and trigger its
[notifications]({{< relref "notifications.md" >}}).
## Execution
The alert rules are evaluated in the Grafana backend in a scheduler and query execution engine that is part
of core Grafana. Only some data sources are supported right now. They include `Graphite`, `Prometheus`, `InfluxDB`, `Elasticsearch`,
`Stackdriver`, `Cloudwatch`, `Azure Monitor`, `MySQL`, `PostgreSQL`, `MSSQL`, `OpenTSDB`, `Oracle`, and `Azure Data Explorer`.
## Clustering
Currently alerting supports a limited form of high availability. Since v4.2.0 of Grafana, alert notifications are deduped when running multiple servers. This means all alerts are executed on every server but no duplicate alert notifications are sent due to the deduping logic. Proper load balancing of alerts will be introduced in the future.
<div class="clearfix"></div>
## Rule Config
Currently only the graph panel supports alert rules.
### Name and Evaluation interval
Here you can specify the name of the alert rule and how often the scheduler should evaluate the alert rule.
**Note:** You can set a minimum interval in the `alerting.min_interval_seconds` config field, to set a minimum time between evaluations. Check out the [[configuration]]({{< relref "../installation/configuration.md" >}}#min-interval-seconds) page for more information.
### For
> **Important note regarding No Data:**
>
> Do not use `For` with the `If no data or all values are null` setting set to `No Data`. The triggering of `No Data` will trigger instantly and not take `For` into consideration. This may also result in that an OK notification not being sent if alert transitions from `No Data -> Pending -> OK`.
If an alert rule has a configured `For` and the query violates the configured threshold it will first go from `OK` to `Pending`. Going from `OK` to `Pending` Grafana will not send any notifications. Once the alert rule has been firing for more than `For` duration, it will change to `Alerting` and send alert notifications.
Typically, it's always a good idea to use this setting since it's often worse to get false positive than wait a few minutes before the alert notification triggers. Looking at the `Alert list` or `Alert list panels` you will be able to see alerts in pending state.
Below you can see an example timeline of an alert using the `For` setting. At ~16:04 the alert state changes to `Pending` and after 4 minutes it changes to `Alerting` which is when alert notifications are sent. Once the series falls back to normal the alert rule goes back to `OK`.
{{< imgbox img="/img/docs/v54/alerting-for-dark-theme.png" caption="Alerting For" >}}
{{< imgbox max-width="40%" img="/img/docs/v4/alerting_conditions.png" caption="Alerting Conditions" >}}
### Conditions
Currently the only condition type that exists is a `Query` condition that allows you to
specify a query letter, time range and an aggregation function.
### Query condition example
```sql
avg() OF query(A, 15m, now) IS BELOW 14
```
- `avg()` Controls how the values for **each** series should be reduced to a value that can be compared against the threshold. Click on the function to change it to another aggregation function.
- `query(A, 15m, now)` The letter defines what query to execute from the **Metrics** tab. The second two parameters define the time range, `15m, now` means 15 minutes ago to now. You can also do `10m, now-2m` to define a time range that will be 10 minutes ago to 2 minutes ago. This is useful if you want to ignore the last 2 minutes of data.
- `IS BELOW 14` Defines the type of threshold and the threshold value. You can click on `IS BELOW` to change the type of threshold.
The query used in an alert rule cannot contain any template variables. Currently we only support `AND` and `OR` operators between conditions and they are executed serially.
For example, we have 3 conditions in the following order:
*condition:A(evaluates to: TRUE) OR condition:B(evaluates to: FALSE) AND condition:C(evaluates to: TRUE)*
so the result will be calculated as ((TRUE OR FALSE) AND TRUE) = TRUE.
We plan to add other condition types in the future, like `Other Alert`, where you can include the state
of another alert in your conditions, and `Time Of Day`.
#### Multiple Series
If a query returns multiple series then the aggregation function and threshold check will be evaluated for each series.
What Grafana does not do currently is track alert rule state **per series**. This has implications that are detailed
in the scenario below.
- Alert condition with query that returns 2 series: **server1** and **server2**
- **server1** series cause the alert rule to fire and switch to state `Alerting`
- Notifications are sent out with message: _load peaking (server1)_
- In a subsequence evaluation of the same alert rule the **server2** series also cause the alert rule to fire
- No new notifications are sent as the alert rule is already in state `Alerting`.
So as you can see from the above scenario Grafana will not send out notifications when other series cause the alert
to fire if the rule already is in state `Alerting`. To improve support for queries that return multiple series
we plan to track state **per series** in a future release.
> Starting with Grafana v5.3 you can configure reminders to be sent for triggered alerts. This will send additional notifications
> when an alert continues to fire. If other series (like server2 in the example above) also cause the alert rule to fire they will
> be included in the reminder notification. Depending on what notification channel you're using you may be able to take advantage
> of this feature for identifying new/existing series causing alert to fire. [Read more about notification reminders here]({{< relref "notifications/#send-reminders" >}}).
### No Data / Null values
Below your conditions you can configure how the rule evaluation engine should handle queries that return no data or only null values.
No Data Option | Description
------------ | -------------
NoData | Set alert rule state to `NoData`
Alerting | Set alert rule state to `Alerting`
Keep Last State | Keep the current alert rule state, what ever it is.
### Execution errors or timeouts
The last option tells how to handle execution or timeout errors.
Error or timeout option | Description
------------ | -------------
Alerting | Set alert rule state to `Alerting`
Keep Last State | Keep the current alert rule state, what ever it is.
If you have an unreliable time series store from which queries sometime timeout or fail randomly you can set this option
to `Keep Last State` in order to basically ignore them.
## Notifications
In alert tab you can also specify alert rule notifications along with a detailed message about the alert rule.
The message can contain anything, information about how you might solve the issue, link to runbook, etc.
The actual notifications are configured and shared between multiple alerts. Read the
[notifications]({{< relref "notifications.md" >}}) guide for how to configure and setup notifications.
## Alert State History and Annotations
Alert state changes are recorded in the internal annotation table in Grafana's database. The state changes
are visualized as annotations in the alert rule's graph panel. You can also go into the `State history`
submenu in the alert tab to view and clear state history.
## Troubleshooting
{{< imgbox max-width="40%" img="/img/docs/v4/alert_test_rule.png" caption="Test Rule" >}}
First level of troubleshooting you can do is hit the **Test Rule** button. You will get result back that you can expand
to the point where you can see the raw data that was returned from your query.
Further troubleshooting can also be done by inspecting the grafana-server log. If it's not an error or for some reason
the log does not say anything you can enable debug logging for some relevant components. This is done
in Grafana's ini config file.
Example showing loggers that could be relevant when troubleshooting alerting.
```ini
[log]
filters = alerting.scheduler:debug \
alerting.engine:debug \
alerting.resultHandler:debug \
alerting.evalHandler:debug \
alerting.evalContext:debug \
alerting.extractor:debug \
alerting.notifier:debug \
alerting.notifier.slack:debug \
alerting.notifier.pagerduty:debug \
alerting.notifier.email:debug \
alerting.notifier.webhook:debug \
tsdb.graphite:debug \
tsdb.prometheus:debug \
tsdb.opentsdb:debug \
tsdb.influxdb:debug \
tsdb.elasticsearch:debug \
tsdb.elasticsearch.client:debug \
```
If you want to log raw query sent to your TSDB and raw response in log you also have to set grafana.ini option `app_mode` to
`development`.

View File

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

View File

@@ -0,0 +1,23 @@
+++
title = "View alerts"
description = "View existing alert rules"
keywords = ["grafana", "alerting", "guide", "rules", "view"]
type = "docs"
[menu.docs]
name = "View alerts"
parent = "alerting"
weight = 400
+++
# View existing alert rules
Grafana stores individual alert rules in the panels where they are defined, but you can also view a list of all existing alert rules and their current state.
In the Grafana side bar, hover your cursor over the Alerting (bell) icon and then click **Alert Rules**. All configured alert rules are listed, along with their current state.
You can do several things while viewing alerts.
- **Filter alerts by name -** Type an alert name in the **Search alerts** field.
- **Filter alerts by state -** In **States**, select which alert states you want to see. All others will be hidden.
- **Pause or resume an alert -** Click the **Pause** or **Play** icon next to the alert to pause or resume evaluation. See [Pause an alert rule]({{< relref "pause-an-alert-rule.md" >}}) for more information.
- **Access alert rule settings -** Click the alert name or the **Edit alert rule** (gear) icon. Grafana opens the Alert tab of the panel where the alert rule is defined. This is helpful when an alert is firing but you don't know which panel it is defined in.

View File

@@ -9,4 +9,135 @@ parent = "admin"
weight = 3
+++
# User Authentication Overview
Grafana provides many ways to authenticate users. Some authentication integrations also enable syncing user permissions and org memberships.
Here is a table showing all supported authentication providers and the features available for them. [Team sync]({{< relref "../enterprise/team-sync.md" >}}) and [active sync]({{< relref "../enterprise/enhanced_ldap.md#active-ldap-synchronization" >}}) are only available in Grafana Enterprise.
Provider | Support | Role mapping | Team sync<br> *(Enterprise only)* | Active sync<br> *(Enterprise only)*
-------- | :-----: | :----------: | :-------: | :---------:
[Auth Proxy]({{< relref "auth-proxy.md" >}}) | v2.1+ | - | v6.3+ | -
[Azure AD OAuth]({{< relref "azuread.md" >}}) | v6.7+ | v6.7+ | v6.7+ | -
[Generic OAuth]({{< relref "generic-oauth.md" >}}) | v4.0+ | v6.5+ | - | -
[GitHub OAuth]({{< relref "github.md" >}}) | v2.0+ | - | v6.3+ | -
[GitLab OAuth]({{< relref "gitlab.md" >}}) | v5.3+ | - | v6.4+ | -
[Google OAuth]({{< relref "google.md" >}}) | v2.0+ | - | - | -
[LDAP]({{< relref "ldap.md" >}}) | v2.1+ | v2.1+ | v5.3+ | v6.3+
[Okta OAuth]({{< relref "okta.md" >}}) | v7.0+ | v7.0+ | v7.0+ | -
[SAML]({{< relref "../enterprise/saml.md" >}}) (Enterprise only) | v6.3+ | v7.0+ | v7.0+ | -
## Grafana Auth
Grafana of course has a built in user authentication system with password authentication enabled by default. You can
disable authentication by enabling anonymous access. You can also hide login form and only allow login through an auth
provider (listed above). There is also options for allowing self sign up.
### Login and short-lived tokens
> The following applies when using Grafana's built in user authentication, LDAP (without Auth proxy) or OAuth integration.
Grafana are using short-lived tokens as a mechanism for verifying authenticated users.
These short-lived tokens are rotated each `token_rotation_interval_minutes` for an active authenticated user.
An active authenticated user that gets it token rotated will extend the `login_maximum_inactive_lifetime_days` time from "now" that Grafana will remember the user.
This means that a user can close its browser and come back before `now + login_maximum_inactive_lifetime_days` and still being authenticated.
This is true as long as the time since user login is less than `login_maximum_lifetime_days`.
#### Remote logout
You can logout from other devices by removing login sessions from the bottom of your profile page. If you are
a Grafana admin user you can also do the same for any user from the Server Admin / Edit User view.
## Settings
Example:
```bash
[auth]
# Login cookie name
login_cookie_name = grafana_session
# The lifetime (days) an authenticated user can be inactive before being required to login at next visit. Default is 7 days.
login_maximum_inactive_lifetime_days = 7
# The maximum lifetime (days) an authenticated user can be logged in since login time before being required to login. Default is 30 days.
login_maximum_lifetime_days = 30
# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
token_rotation_interval_minutes = 10
# The maximum lifetime (seconds) an api key can be used. If it is set all the api keys should have limited lifetime that is lower than this value.
api_key_max_seconds_to_live = -1
```
### Anonymous authentication
You can make Grafana accessible without any login required by enabling anonymous access in the configuration file.
Example:
```bash
[auth.anonymous]
enabled = true
# Organization name that should be used for unauthenticated users
org_name = Main Org.
# Role for unauthenticated users, other valid values are `Editor` and `Admin`
org_role = Viewer
```
If you change your organization name in the Grafana UI this setting needs to be updated to match the new name.
### Basic authentication
Basic auth is enabled by default and works with the built in Grafana user password authentication system and LDAP
authentication integration.
To disable basic auth:
```bash
[auth.basic]
enabled = false
```
### Disable login form
You can hide the Grafana login form using the below configuration settings.
```bash
[auth]
disable_login_form = true
```
### Automatic OAuth login
Set to true to attempt login with OAuth automatically, skipping the login screen.
This setting is ignored if multiple OAuth providers are configured.
Defaults to `false`.
```bash
[auth]
oauth_auto_login = true
```
### Hide sign-out menu
Set the option detailed below to true to hide sign-out menu link. Useful if you use an auth proxy.
```bash
[auth]
disable_signout_menu = true
```
### URL redirect after signing out
URL to redirect the user to after signing out from Grafana. This can for example be used to enable signout from oauth provider.
```bash
[auth]
signout_redirect_url =
```

View File

@@ -30,8 +30,8 @@ To enable the Azure AD OAuth2 you must register your application with Azure AD.
1. Click the name of the new application to open the application details page.
1. Click **Endpoints**.
- Note down the **OAuth 2.0 authorization endpoint (v2)**, this will be the auth url.
- Note down the **OAuth 2.0 token endpoint (v2)**, this will be the token url.
- Note down the **OAuth 2.0 authorization endpoint (v2)**, this will be the auth URL.
- Note down the **OAuth 2.0 token endpoint (v2)**, this will be the token URL.
1. Close the Endpoints page to come back to the application details page.
@@ -92,9 +92,9 @@ To enable the Azure AD OAuth2 you must register your application with Azure AD.
1. Click on **Users and groups** and add Users/Groups to the Grafana roles by using **Add User**.
## Enable Azure AD Oauth in Grafana
## Enable Azure AD OAuth in Grafana
1. Add the following to the [Grafana configuration file]({{< relref "../installation/configuration.md#config-file-locations" >}}):
1. Add the following to the [Grafana configuration file]({{< relref "../administration/configuration.md#config-file-locations" >}}):
```ini
[auth.azuread]
@@ -110,7 +110,7 @@ allowed_domains =
allowed_groups =
```
> Note: Ensure that the [root_url]({{< relref "../installation/configuration/#root-url" >}}) in Grafana is set in your Azure Application Reply URLs (App -> Settings -> Reply URLs)
> Note: Ensure that the [root_url]({{< relref "../administration/configuration/#root-url" >}}) in Grafana is set in your Azure Application Reply URLs (App -> Settings -> Reply URLs)
### Configure allowed groups and domains

View File

@@ -12,6 +12,6 @@ weight = 3
# Enhanced LDAP integration
The enhanced LDAP integration adds additional functionality on top of the existing {LDAP integration]({{< relref "ldap.md" >}}).
The enhanced LDAP integration adds additional functionality on top of the existing [LDAP integration]({{< relref "ldap.md" >}}).
> Enhanced LDAP integration is only available in Grafana Enterprise. For more information, refer to [Enhanced LDAP integration]({{< relref "../enterprise/enhanced_ldap.md" >}}) in [Grafana Enterprise]({{< relref "../enterprise" >}}).

View File

@@ -12,7 +12,7 @@ weight = 3
# Generic OAuth Authentication
You can configure many different oauth2 authentication services with Grafana using the generic oauth2 feature. Below you
You can configure many different OAuth2 authentication services with Grafana using the generic OAuth2 feature. Below you
can find examples using Okta, BitBucket, OneLogin and Azure.
This callback URL must match the full HTTP address that you use in your browser to access Grafana, but with the prefix path of `/login/generic_oauth`.
@@ -99,9 +99,9 @@ allowed_organizations =
client_id = <client id>
client_secret = <client secret>
scopes = openid email name
auth_url = https://<onelogin domain>.onelogin.com/oidc/auth
token_url = https://<onelogin domain>.onelogin.com/oidc/token
api_url = https://<onelogin domain>.onelogin.com/oidc/me
auth_url = https://<onelogin domain>.onelogin.com/oidc/2/auth
token_url = https://<onelogin domain>.onelogin.com/oidc/2/token
api_url = https://<onelogin domain>.onelogin.com/oidc/2/me
team_ids =
allowed_organizations =
```
@@ -156,7 +156,7 @@ allowed_organizations =
enabled = true
allow_sign_up = true
client_id = <OpenID Connect Client ID from Centrify>
client_secret = <your generated OpenID Connect Client Sercret"
client_secret = <your generated OpenID Connect Client Secret"
scopes = openid profile email
auth_url = https://<your domain>.my.centrify.com/OAuth2/Authorize/<Application ID>
token_url = https://<your domain>.my.centrify.com/OAuth2/Token/<Application ID>

View File

@@ -25,7 +25,7 @@ http://<my_grafana_server_name_or_ip>:<grafana_server_port>/login/github
```
This callback URL must match the full HTTP address that you use in your
browser to access Grafana, but with the prefix path of `/login/github`.
browser to access Grafana, but with the suffix path of `/login/github`.
When the GitHub OAuth application is created you will get a Client ID and a
Client Secret. Specify these in the Grafana configuration file. For
example:

View File

@@ -5,14 +5,14 @@ keywords = ["grafana", "configuration", "documentation", "oauth"]
type = "docs"
[menu.docs]
name = "Google"
identifier = "ggogle_oauth2"
identifier = "google_oauth2"
parent = "authentication"
weight = 3
+++
# Google OAuth2 Authentication
To enable the Google OAuth2 you must register your application with Google. Google will generate a client ID and secret key for you to use.
To enable Google OAuth2 you must register your application with Google. Google will generate a client ID and secret key for you to use.
## Create Google OAuth keys
@@ -23,7 +23,7 @@ First, you need to create a Google OAuth Client:
3. Enter the following:
- Application Type: Web Application
- Name: Grafana
- Authorized Javascript Origins: https://grafana.mycompany.com
- Authorized JavaScript Origins: https://grafana.mycompany.com
- Authorized Redirect URLs: https://grafana.mycompany.com/login/google
- Replace https://grafana.mycompany.com with the URL of your Grafana instance.
4. Click Create
@@ -31,7 +31,7 @@ First, you need to create a Google OAuth Client:
## Enable Google OAuth in Grafana
Specify the Client ID and Secret in the [Grafana configuration file]({{< relref "../installation/configuration.md#config-file-locations" >}}). For example:
Specify the Client ID and Secret in the [Grafana configuration file]({{< relref "../administration/configuration.md#config-file-locations" >}}). For example:
```bash
[auth.google]

View File

@@ -26,7 +26,7 @@ This means that you should be able to configure LDAP integration using any compl
## Enable LDAP
In order to use LDAP integration you'll first need to enable LDAP in the [main config file]({{< relref "../installation/configuration.md" >}}) as well as specify the path to the LDAP
In order to use LDAP integration you'll first need to enable LDAP in the [main config file]({{< relref "../administration/configuration.md" >}}) as well as specify the path to the LDAP
specific configuration file (default: `/etc/grafana/ldap.toml`).
```bash
@@ -37,8 +37,8 @@ enabled = true
# Path to the LDAP specific configuration file (default: `/etc/grafana/ldap.toml`)
config_file = /etc/grafana/ldap.toml
# Allow sign up should almost always be true (default) to allow new Grafana users to be created (if ldap authentication is ok). If set to
# false only pre-existing Grafana users will be able to login (if ldap authentication is ok).
# Allow sign up should almost always be true (default) to allow new Grafana users to be created (if LDAP authentication is ok). If set to
# false only pre-existing Grafana users will be able to login (if LDAP authentication is ok).
allow_sign_up = true
```
@@ -54,11 +54,11 @@ See [configuration examples](#configuration-examples) for more information.
host = "127.0.0.1"
# Default port is 389 or 636 if use_ssl = true
port = 389
# Set to true if ldap server supports TLS
# Set to true if LDAP server supports TLS
use_ssl = false
# Set to true if connect ldap server with STARTTLS pattern (create connection in insecure, then upgrade to secure connection with TLS)
# Set to true if connect LDAP server with STARTTLS pattern (create connection in insecure, then upgrade to secure connection with TLS)
start_tls = false
# set to true if you want to skip ssl cert validation
# set to true if you want to skip SSL cert validation
ssl_skip_verify = false
# set to the path to your root CA certificate or leave unset to use system defaults
# root_ca_cert = "/path/to/certificate.crt"
@@ -83,7 +83,7 @@ search_base_dns = ["dc=grafana,dc=org"]
# group_search_filter_user_attribute = "distinguishedName"
# group_search_base_dns = ["ou=groups,dc=grafana,dc=org"]
# Specify names of the ldap attributes your ldap uses
# Specify names of the LDAP attributes your LDAP uses
[servers.attributes]
name = "givenName"
surname = "sn"
@@ -144,7 +144,7 @@ In this case you skip providing a `bind_password` and instead provide a `bind_dn
The search filter and search bases settings are still needed to perform the LDAP search to retrieve the other LDAP information (like LDAP groups and email).
### POSIX schema
If your ldap server does not support the memberOf attribute add these options:
If your LDAP server does not support the memberOf attribute add these options:
```bash
## Group search filter, to retrieve the groups of which the user is a member (only set if memberOf attribute is not available)
@@ -355,7 +355,7 @@ Please inspect your Active Directory configuration and documentation to find the
## Troubleshooting
To troubleshoot and get more log info enable ldap debug logging in the [main config file]({{< relref "../installation/configuration.md" >}}).
To troubleshoot and get more log info enable LDAP debug logging in the [main config file]({{< relref "../administration/configuration.md" >}}).
```bash
[log]

View File

@@ -36,9 +36,9 @@ Before you can sign a user in, you need to create an Okta application from the O
1. Click **Done** to finish creating the Okta application.
## Enable Okta Oauth in Grafana
## Enable Okta OAuth in Grafana
1. Add the following to the [Grafana configuration file]({{< relref "../installation/configuration.md#config-file-locations" >}}):
1. Add the following to the [Grafana configuration file]({{< relref "../administration/configuration.md#config-file-locations" >}}):
```ini
[auth.okta]

View File

@@ -11,24 +11,21 @@ weight = 1
# User Authentication Overview
Grafana provides many ways to authenticate users. Some authentication integrations also enable syncing user
permissions and org memberships.
Grafana provides many ways to authenticate users. Some authentication integrations also enable syncing user permissions and org memberships.
## OAuth Integrations
Here is a table showing all supported authentication providers and the features available for them. [Team sync]({{< relref "../enterprise/team-sync.md" >}}) and [active sync]({{< relref "../enterprise/enhanced_ldap.md#active-ldap-synchronization" >}}) are only available in Grafana Enterprise.
- [Google OAuth]({{< relref "google.md" >}})
- [GitHub OAuth]({{< relref "github.md" >}})
- [Gitlab OAuth]({{< relref "gitlab.md" >}})
- [Generic OAuth]({{< relref "generic-oauth.md" >}}) (Okta2, BitBucket, Azure, OneLogin, Auth0)
## LDAP integrations
- [LDAP Authentication]({{< relref "ldap.md" >}}) (OpenLDAP, ActiveDirectory, etc)
## Auth proxy
- [Auth Proxy]({{< relref "auth-proxy.md" >}}) If you want to handle authentication outside Grafana using a reverse
proxy.
Provider | Support | Role mapping | Team sync<br> *(Enterprise only)* | Active sync<br> *(Enterprise only)*
-------- | :-----: | :----------: | :-------: | :---------:
[Auth Proxy]({{< relref "auth-proxy.md" >}}) | v2.1+ | - | v6.3+ | -
[Azure AD OAuth]({{< relref "azuread.md" >}}) | v6.7+ | v6.7+ | v6.7+ | -
[Generic OAuth]({{< relref "generic-oauth.md" >}}) | v4.0+ | v6.5+ | - | -
[GitHub OAuth]({{< relref "github.md" >}}) | v2.0+ | - | v6.3+ | -
[GitLab OAuth]({{< relref "gitlab.md" >}}) | v5.3+ | - | v6.4+ | -
[Google OAuth]({{< relref "google.md" >}}) | v2.0+ | - | - | -
[LDAP]({{< relref "ldap.md" >}}) | v2.1+ | v2.1+ | v5.3+ | v6.3+
[Okta OAuth]({{< relref "okta.md" >}}) | v7.0+ | v7.0+ | v7.0+ | -
[SAML]({{< relref "../enterprise/saml.md" >}}) (Enterprise only) | v6.3+ | v7.0+ | v7.0+ | -
## Grafana Auth
@@ -71,7 +68,7 @@ login_maximum_lifetime_days = 30
# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes.
token_rotation_interval_minutes = 10
# The maximum lifetime (seconds) an api key can be used. If it is set all the api keys should have limited lifetime that is lower than this value.
# The maximum lifetime (seconds) an API key can be used. If it is set all the API keys should have limited lifetime that is lower than this value.
api_key_max_seconds_to_live = -1
```
@@ -137,7 +134,7 @@ disable_signout_menu = true
### URL redirect after signing out
URL to redirect the user to after signing out from Grafana. This can for example be used to enable signout from oauth provider.
URL to redirect the user to after signing out from Grafana. This can for example be used to enable signout from OAuth provider.
```bash
[auth]

View File

@@ -5,3 +5,7 @@ type = "docs"
identifier = "dashboards"
weight = 4
+++
# Dashboard overview
A *dashboard* is a set of one or more panels organized and arranged into one or more rows. Grafana ships with a variety of Panels. Grafana makes it easy to construct the right queries, and customize the display properties so that you can create the perfect dashboard for your need. Each panel can interact with data from any configured Grafana Data Source (currently Graphite, Prometheus, Elasticsearch, InfluxDB, OpenTSDB, MySQL, PostgreSQL, Microsoft SQL Server and AWS Cloudwatch).

View File

@@ -2,6 +2,7 @@
title = "Annotations"
keywords = ["grafana", "annotations", "documentation", "guide"]
type = "docs"
aliases = ["/docs/grafana/latest/reference/annotations/"]
[menu.docs]
name = "Annotations"
parent = "dashboard_features"
@@ -62,7 +63,7 @@ settings view. To create a new annotation query hit the `New` button.
Specify a name for the annotation query. This name is given to the toggle (checkbox) that will allow
you to enable/disable showing annotation events from this query. For example you might have two
annotation queries named `Deploys` and `Outages`. The toggles will allow you to decide what annotations
annotation queries named `Deploys` and `Outages`. The toggle will allow you to decide what annotations
to show.
### Annotation query details

View File

@@ -2,6 +2,7 @@
title = "Dashboard Folders"
keywords = ["grafana", "dashboard", "dashboard folders", "folder", "folders", "documentation", "guide"]
type = "docs"
aliases = ["/docs/grafana/latest/reference/dashboard_folders/"]
[menu.docs]
name = "Folders"
parent = "dashboard_features"

View File

@@ -2,6 +2,7 @@
title = "Dashboard Version History"
keywords = ["grafana", "dashboard", "documentation", "version", "history"]
type = "docs"
aliases = ["/docs/grafana/latest/reference/dashboard_history/"]
[menu.docs]
name = "Dashboard Version History"
parent = "dashboard_features"

View File

@@ -2,6 +2,7 @@
title = "Playlist"
keywords = ["grafana", "dashboard", "documentation", "playlist"]
type = "docs"
aliases = ["/docs/grafana/latest/reference/playlist/"]
[menu.docs]
parent = "dashboard_features"
identifier = "feature_playlist"
@@ -110,7 +111,7 @@ By default, each dashboard is displayed for the amount of time entered in the In
- The navbar, row and panel controls appear at the top of the screen.
- Enabled automatically after one minute of user inactivity.
- You can enable it manually using the `d v` sequence shortcut, or by appending the parameter `?inactive` to the dashboard URL.
- You can disable it with any mouse mouse movement or keyboard action.
- You can disable it with any mouse movement or keyboard action.
- **TV mode (with auto fit panels):**
- The side menu is hidden/removed.
- The navbar, row and panel controls appear at the top of the screen.

View File

@@ -2,6 +2,7 @@
title = "Search"
keywords = ["grafana", "dashboard", "documentation", "search"]
type = "docs"
aliases =["/docs/grafana/latest/reference/search/"]
[menu.docs]
parent = "dashboard_features"
weight = 5

View File

@@ -0,0 +1,118 @@
+++
title = "Time range controls"
keywords = ["grafana", "dashboard", "documentation", "time range"]
aliases = ["/docs/grafana/latest/reference/timerange/"]
type = "docs"
[menu.docs]
name = "Time range controls"
parent = "dashboards"
weight = 7
+++
# Time range controls
Grafana provides several ways to manage the time ranges of the data being visualized, both at the dashboard level and the panel level.
This page describes supported time units and relative ranges, the common time controls, dashboard-wide time settings, and panel-specific time settings.
## Time units and relative ranges
The following time units are supported: `s (seconds)`, `m (minutes)`, `h (hours)`, `d (days)`, `w (weeks)`, `M (months)`, and `y (years)`.
The minus operator allows you to step back in time, relative to now. If you wish to display the full period of the unit (day, week, month, etc...), append `/<time unit>` to the end.
The plus operator allows you to step forward in time relative to now. You might use this feature to look at predicted data in the future, for example.
Here are some examples:
| Example relative range | From: | To: |
| ---------------------- | ---------- | ---------- |
| Last 5 minutes | `now-5m` | `now` |
| The day so far | `now/d` | `now` |
| This week | `now/w` | `now/w` |
| Week to date | `now/w` | `now` |
| Previous Month | `now-1M/M` | `now-1M/M` |
## Common time range controls
The dashboard and panel time controls have a common user interface (UI).
<img class="no-shadow" src="/img/docs/time-range-controls/common-time-controls-7-0.png" max-width="700px">
The options are defined below.
### Current time range
The current time range, also called the _time picker_, shows the time range currently displayed in the dashboard or panel you are viewing.
Hover your cursor over the field to see the exact time stamps in the range and their source (such as the local browser).
<img class="no-shadow" src="/img/docs/time-range-controls/time-picker-7-0.png" max-width="300px">
Click on the current time range to change the time range. You can change the current time using a _relative time range_, such as the last 15 minutes, or an _absolute time range_, such as `2020-05-14 00:00:00 to 2020-05-15 23:59:59`.
<img class="no-shadow" src="/img/docs/time-range-controls/change-current-time-range-7-0.png" max-width="900px">
### Relative time range
Select the relative time range from the **Relative time ranges** list. Some examples of time ranges are:
- Last 30 minutes
- Last 12 hours
- Last 7 days
- Last 2 years
- Yesterday
- Day before yesterday
- This day last week
- Today so far
- This week so far
- This month so far
### Absolute time range
Set an absolute time range one of two ways:
- Type values into the **From** and **To** fields. You can type exact time values or relative values, such as `now-24h`, and then click **Apply time range**.
- Click in the **From** or **To** field. Grafana displays a calendar. Click the day or days you want to use as the current time range and then click **Apply time range**.
This section also displays recently used absolute ranges.
### Zoom out (Cmd+Z or Ctrl+Z)
Click the **Zoom out** icon to view a larger time range in the dashboard or panel visualization.
### Zoom in (only applicable to graph visualizations)
Click and drag to select the time range in the visualization that you want to view.
### Refresh dashboard
Click the **Refresh dashboard** icon to immediately run every query on the dashboard and refresh the visualizations.
By default, Grafana does not automatically refresh the dashboard. Queries run on their own schedule according to the panel settings. However, if you want to regularly refresh the dashboard, then click the down arrow next to the **Refresh dashboard** icon and then select a refresh interval.
## Dashboard time settings
Time settings are saved on a per-dashboard basis.
To access the dashboard time settings, click the **Dashboard settings** (gear) icon at the top of the screen. The settings are in the **Time Options** section of the General tab.
- **Timezone -** Specify the local time zone of the service or system that you are monitoring. This can be helpful when monitoring a system or service that operates across several time zones.
- **Default -** The default selected time zone for the user profile, team, or organization is used. If no time zone is specified for the user profile, a team the user is a member of, or the organization, then Grafana uses local browser time.
- **Local browser time -** The time zone configured for the viewing user browser is used. This is usually the same time zone as set on the computer.
- Standard [ISO 8601 time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), including UTC.
- **Auto-refresh -** Customize the options displayed for relative time and the auto-refresh options. Entries are comma separated and accept any valid time unit.
- **Now delay now- -** Override the `now` value by entering a time delay. Most commonly, this feature is used to accommodate known delays in data aggregation to avoid null values.
- **Hide time picker -** Select this option if you do not want Grafana to display the time picker.
## Panel time overrides and timeshift
In [Query options]({{< relref "../panels/queries.md#query-options" >}}), you can override the relative time range for individual panels, causing them to be different than what is selected in the dashboard time picker in the upper right. This allows you to show metrics from different time periods or days at the same time.
## Control the time range using a URL
Time range of a dashboard can be controlled by providing following query parameters in the dashboard URL:
- `from` - defines lower limit of the time range, specified in ms epoch or [relative time]({{< relref "#relative-time-range" >}})
- `to` - defines upper limit of the time range, specified in ms epoch or [relative time]({{< relref "#relative-time-range" >}})
- `time` and `time.window` - defines a time range from `time-time.window/2` to `time+time.window/2`. Both params should be specified in ms. For example `?time=1500000000000&time.window=10000` will result in 10s time range from 1499999995000 to 1500000005000

View File

@@ -2,3 +2,7 @@
title = "Developers"
type = "docs"
+++
# Developers
This section of the documentation contains pages with resources for Grafana developers.

View File

@@ -11,7 +11,7 @@ For more information on the types of plugins you can build, refer to the [Plugin
The easiest way to start developing Grafana plugins is to use the [Grafana Toolkit](https://www.npmjs.com/package/@grafana/toolkit).
Open the terminal, and run the following command in your [plugin directory]({{< relref "../../installation/configuration/_index.md#plugins" >}}):
Open the terminal, and run the following command in your [plugin directory]({{< relref "../../administration/configuration.md#plugins" >}}):
```bash
npx @grafana/toolkit plugin:create my-grafana-plugin
@@ -26,17 +26,6 @@ If you want a more guided introduction to plugin development, check out our tuto
Learn more about specific areas of plugin development.
### Concepts
Deepen your knowledge through a series of high-level overviews of plugin concepts.
- [Data frames]({{< relref "data-frames.md" >}})
- [Authentication for data source plugins]({{< relref "authentication.md" >}})
### UI library
Explore the many UI components in our [Grafana UI library](https://developers.grafana.com/ui).
### Tutorials
If you're looking to build your first plugin, check out these introductory tutorials:
@@ -48,6 +37,27 @@ Ready to learn more? Check out our other tutorials:
- [Build a panel plugin with D3.js]({{< relref "../../../../../tutorials/build-a-panel-plugin-with-d3.md" >}})
### Guides
Improve an existing plugin with one of our guides:
- [Add authentication for data source plugins]({{< relref "add-authentication-for-data-source-plugins" >}})
- [Add support for annotations]({{< relref "add-support-for-annotations.md" >}})
- [Add support for Explore queries]({{< relref "add-support-for-explore-queries.md" >}})
- [Add support for variables]({{< relref "add-support-for-variables.md" >}})
- [Build a logs data source plugin]({{< relref "build-a-logs-data-source-plugin.md" >}})
- [Build a streaming data source plugin]({{< relref "build-a-streaming-data-source-plugin.md" >}})
### Concepts
Deepen your knowledge through a series of high-level overviews of plugin concepts:
- [Data frames]({{< relref "data-frames.md" >}})
### UI library
Explore the many UI components in our [Grafana UI library](https://developers.grafana.com/ui).
### API reference
Learn more about Grafana options and packages.
@@ -64,4 +74,4 @@ Learn more about Grafana options and packages.
#### Go
- [Grafana Plugin SDK](https://pkg.go.dev/mod/github.com/grafana/grafana-plugin-sdk-go?tab=overview)
- [Grafana Plugin SDK for Go]({{< relref "backend/grafana-plugin-sdk-for-go" >}})

View File

@@ -0,0 +1,156 @@
+++
title = "Add authentication for data source plugins"
type = "docs"
aliases = ["/docs/grafana/latest/plugins/developing/auth-for-datasources/", "/docs/grafana/latest/developers/plugins/authentication/"]
+++
# Add authentication for data source plugins
This page explains how to use the Grafana data source proxy to authenticate against an third-party API from a data source plugin.
When a user saves a password or any other sensitive data as a data source option, Grafana encrypts the data and stores it in the Grafana database. Any encrypted data source options can only be decrypted on the Grafana server. This means that any data source that makes authenticated queries needs to request the decrypted data to be sent to the browser.
To minimize the amount of sensitive information sent to and from the browser, data source plugins can use the Grafana _data source proxy_. When using the data source proxy, any requests containing sensitive information go through the Grafana server. No sensitive data is sent to the browser after the data is saved.
Some data sources, like [Prometheus](https://grafana.com/docs/grafana/latest/features/datasources/prometheus/) and [InfluxDB](https://grafana.com/docs/grafana/latest/features/datasources/influxdb/), allow users to configure whether to use the data source proxy, through a setting called _access modes_.
## Add a proxy route to your plugin
To forward requests through the Grafana proxy, you need to configure one or more _routes_. A route specifies how the proxy transforms outgoing requests. All routes for a given plugin are defined in the [plugin.json]({{< relref "metadata.md" >}}) file.
Let's add a route to proxy requests to `https://api.example.com/foo/bar`.
1. Add the route to `plugin.json`. Note that you need to reload the Grafana server every time you make a change to your `plugin.json` file.
```json
"routes": [
{
"path": "example",
"url": "https://api.example.com"
}
]
```
1. In the `DataSource`, extract the proxy URL from `instanceSettings` to a class property called `url`.
```ts
export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
url?: string;
constructor(instanceSettings: DataSourceInstanceSettings<MyDataSourceOptions>) {
super(instanceSettings);
this.url = instanceSettings.url;
}
// ...
}
```
1. In the `query` method, make a request using [BackendSrv]({{< relref "../../packages_api/runtime/backendsrv.md" >}}).
```ts
const routePath = '/example';
getBackendSrv()
.datasourceRequest({
url: this.url + routePath + '/foo/bar',
method: 'GET',
});
```
## Add a dynamic proxy route to your plugin
In the example above, the URL stays the same for everyone using the plugin. Let's look at how you can create dynamic routes based on data source options that are provided by the user.
Many of the properties in the `route` object can use templates in the form of `{{ .JsonData.YOUR_OPTION_NAME }}`, where `YOUR_OPTION_NAME` is the name of a property in the `jsonData` object.
```json
"routes": [
{
"path": "example",
"url": "https://api.example.com/projects/{{ .JsonData.projectId }}"
}
]
```
You can also access sensitive data in your route configuration by changing `.JsonData` into `.SecureJsonData`.
```json
"routes": [
{
"path": "example",
"url": "https://{{ .JsonData.username }}:{{ .SecureJsonData.password }}@api.example.com"
}
]
```
Now you know how to define routes for your data source plugin. Next, let's look at how to authenticate requests for your routes.
## Configure the authentication method for a route
The Grafana proxy supports a number of different authentication methods. For more information on how to configure each authentication method, refer to [plugin.json]({{< relref "metadata.md" >}}).
For any sensitive data, make sure that you encrypt data source options, and that you use `{{ .SecureJsonData.YOUR_OPTION_NAME }}` when using sensitive data source options in your routes.
### Add HTTP header
To add HTTP headers to proxied requests, use the `headers` property.
```json
"routes": [
{
"path": "example",
"url": "https://api.example.com",
"headers": [
{
"name": "Authorization",
"content": "Bearer {{ .SecureJsonData.apiToken }}"
}
]
}
]
```
### Add URL parameters
To add URL parameters to proxied requests, use the `urlParams` property.
```json
"routes": [
{
"path": "example",
"url": "http://api.example.com",
"urlParams": [
{
"name": "apiKey",
"content": "{{ .SecureJsonData.apiKey }}"
}
]
}
]
```
### Enable token authentication
To enable token-based authentication for proxied requests, use the `tokenAuth` property.
Grafana automatically renews the token when it expires.
```json
"routes": [
{
"path": "example",
"url": "https://api.example.com",
"tokenAuth": {
"url": "https://login.example.com/oauth2/token",
"params": {
"grant_type": "client_credentials",
"client_id": "{{ .JsonData.clientId }}",
"client_secret": "{{ .SecureJsonData.clientSecret }}"
}
}
}
]
```

View File

@@ -0,0 +1,148 @@
+++
title = "Add support for annotations"
type = "docs"
+++
# Add support for annotations
This guide explains how to add support for [annotations]({{< relref "../../dashboards/annotations.md" >}}) to an existing data source plugin.
This guide assumes that you're already familiar with how to [Build a data source plugin]({{< relref "../../../../../tutorials/build-a-data-source-plugin.md" >}}).
Data sources in Grafana can support [Annotations]({{< relref "../../dashboards/annotations.md" >}}) by handling _annotation queries_.
Handling annotation queries is similar to how you'd handle a metrics query. The difference is that instead of returning [data frames]({{< relref "data-frames.md" >}}), an annotation query returns _annotation events_.
## Add annotations support to your data source
To add logs support to an existing data source, you need to:
- Enable annotations support
- Override the `annotationQuery` method
- Construct annotation events
### Enable annotations support
Tell Grafana that your data source plugin can return annotations events by adding `"annotations": true` to the [plugin.json]({{< relref "metadata.md" >}}) file.
```json
{
"annotations": true
}
```
### Override the `annotationQuery` method
In `DataSource.ts`, override the `annotationQuery` method from `DataSourceApi`.
```ts
async annotationQuery(options: AnnotationQueryRequest<MyQuery>): Promise<AnnotationEvent[]> {
return [];
}
```
### Construct annotation events
Return an array of [AnnotationEvent]({{< relref "../../packages_api/data/annotationevent.md" >}}).
```ts
async annotationQuery(options: AnnotationQueryRequest<MyQuery>): Promise<AnnotationEvent[]> {
const events: AnnotationEvent[] = [];
const date = new Date();
const event: AnnotationEvent = {
time: date.valueOf(),
text: 'foo',
tags: ['bar'],
};
events.push(event);
return events;
}
```
## Region annotations
[Region annotations]({{< relref "../../dashboards/annotations.md#adding-regions-events" >}}) have a start and end time. This can for example be used to annotate maintenance windows or downtime.
To return a region annotation, set the `timeEnd`, and `isRegion` properties.
```ts
const regionEvent: AnnotationEvent = {
time: startDate.valueOf(),
timeEnd: endDate.valueOf(),
isRegion: true,
text: 'foo',
tags: ['bar'],
};
```
## Build a annotation query editor
Let users write custom annotation queries to only display the annotation events they care about, by adding a _query editor_.
> **Note**: Annotation query editors have yet to receive support for React. The instructions here are given for Angular. Fortunately, you can run Angular even in a plugin otherwise written using React. This section will be updated once React support for annotation queries editors is available.
1. Create a file called `AnnotationQueryEditor.ts` in the plugin root directory, with the following content.
```ts
export class AnnotationQueryEditor {
static templateUrl = 'partials/annotations.editor.html';
annotation: any;
constructor() {
this.annotation.rawQuery = this.annotation.rawQuery || '';
}
}
```
1. Create a directory called `partials` in the plugin root directory.
1. Create a file called `annotations.editor.html` in the `partials` directory you just created, with the following content.
```html
<div class="gf-form-group">
<div class="gf-form-inline">
<div class="gf-form gf-form--grow">
<input
class="gf-form-input"
placeholder="query expression"
ng-model="ctrl.annotation.queryText"
></input>
</div>
</div>
</div>
```
1. In your data source query—the one that extends [DataQuery]({{< relref "../../packages_api/data/dataquery.md" >}})—add the `queryText` property. The name of the property needs to correspond to the text in `ng-model`, e.g. `ctrl.annotation.<propertyName>`.
```ts
export interface MyQuery extends DataQuery {
// ...
queryText?: string;
}
```
1. In `module.ts`, add the annotation query editor to the plugin.
```ts
import { AnnotationQueryEditor } from './AnnotationQueryEditor';
export const plugin = new DataSourcePlugin<DataSource, MyQuery, MyDataSourceOptions>(DataSource)
.setConfigEditor(ConfigEditor)
.setQueryEditor(QueryEditor)
.setAnnotationQueryCtrl(AnnotationQueryEditor);
```
The `queryText` property is now available on the `options` object in the `annotationQuery` method:
```ts
async annotationQuery(options: AnnotationQueryRequest<MyQuery>): Promise<AnnotationEvent[]> {
const expression = options.annotation.queryText;
// ...
}
```

View File

@@ -0,0 +1,183 @@
+++
title = "Add support for Explore queries"
type = "docs"
+++
# Add support for Explore queries
This guide explains how to improve support for [Explore]({{< relref "../../features/explore/index.md" >}}) to an existing data source plugin.
This guide assumes that you're already familiar with how to [Build a data source plugin]({{< relref "../../../../../tutorials/build-a-data-source-plugin.md" >}}).
With Explore, users can make ad-hoc queries without the use of a dashboard. This is useful when users want to troubleshoot or to learn more about the data.
Your data source already supports Explore by default, and will use the existing query editor for the data source. If you want to offer extended Explore functionality for your data source however, you can define a Explore-specific query editor. Optionally, your plugin can also define a _start page_ for Explore.
## Add a query editor for Explore
The query editor for Explore is similar to the query editor for the data source itself. In fact, you'll probably reuse the same components for both query editors.
1. Create a file `ExploreQueryEditor.tsx` in the `src` directory of your plugin, with the following content:
```ts
import React from 'react';
import { ExploreQueryFieldProps } from '@grafana/data';
import { QueryField } from '@grafana/ui';
import { DataSource } from './DataSource';
import { MyQuery, MyDataSourceOptions } from './types';
export type Props = ExploreQueryFieldProps<DataSource, MyQuery, MyDataSourceOptions>;
export default (props: Props) => {
return (
<h2>My query editor</h2>
);
};
```
1. Configure the plugin to use the `ExploreQueryEditor`.
```ts
import ExploreQueryEditor from './ExploreQueryEditor';
```
```ts
export const plugin = new DataSourcePlugin<DataSource, MyQuery, MyDataSourceOptions>(DataSource)
.setConfigEditor(ConfigEditor)
.setQueryEditor(QueryEditor)
.setExploreQueryField(ExploreQueryEditor);
```
1. Add a [QueryField]({{< relref "../../packages_api/ui/queryfield.md" >}}) to `ExploreQueryEditor`.
```ts
import { QueryField } from '@grafana/ui';
```
```ts
export default (props: Props) => {
const { query } = props;
const onQueryChange = (value: string, override?: boolean) => {
const { query, onChange, onRunQuery } = props;
if (onChange) {
// Update the query whenever the query field changes.
onChange({ ...query, queryText: value });
// Run the query on Enter.
if (override && onRunQuery) {
onRunQuery();
}
}
};
return (
<QueryField
portalOrigin="mock-origin"
onChange={onQueryChange}
onRunQuery={props.onRunQuery}
onBlur={props.onBlur}
query={query.queryText || ''}
placeholder="Enter a query"
/>
);
};
```
## Add a start page for Explore
By adding an Explore start page for your plugin, you can for example create "cheat sheets" with commonly used queries. When the user clicks on one of the examples, it automatically updates the query editor, and runs the query. It's a great way to increase productivity for your users.
1. Create a file `ExploreStartPage.tsx` in the `src` directory of your plugin, with the following content:
```ts
import React from 'react';
import { ExploreStartPageProps } from '@grafana/data';
export default (props: ExploreStartPageProps) => {
return (
<h2>My start page</h2>
);
};
```
1. Configure the plugin to use the `ExploreStartPage`.
```ts
import ExploreStartPage from './ExploreStartPage';
```
```ts
export const plugin = new DataSourcePlugin<DataSource, MyQuery, MyDataSourceOptions>(DataSource)
.setConfigEditor(ConfigEditor)
.setQueryEditor(QueryEditor)
.setExploreQueryField(ExploreQueryEditor)
.setExploreStartPage(ExploreStartPage);
```
1. Create a few examples.
```ts
import React from 'react';
import { ExploreStartPageProps, DataQuery } from '@grafana/data';
const examples = [
{
title: 'Addition',
expression: '1 + 2',
label: 'Add two integers',
},
{
title: 'Subtraction',
expression: '2 - 1',
label: 'Subtract an integer from another',
},
];
export default (props: ExploreStartPageProps) => {
return (
<div>
<h2>Cheat Sheet</h2>
{examples.map((item, index) => (
<div className="cheat-sheet-item" key={index}>
<div className="cheat-sheet-item__title">{item.title}</div>
{item.expression ? (
<div
className="cheat-sheet-item__example"
onClick={e => props.onClickExample({ refId: 'A', queryText: item.expression } as DataQuery)}
>
<code>{item.expression}</code>
</div>
) : null}
<div className="cheat-sheet-item__label">{item.label}</div>
</div>
))}
</div>
);
};
```
## Support multiple Explore modes
Explore lets you query any data source, regardless of whether it returns metrics or logs. You can change which type of query you want to make, by setting the _Explore mode_.
The query modes that the plugin supports are defined in the [plugin.json]({{< relref "metadata.md" >}}) file.
The query mode is available on the `props` object for both the query editor and the start page. For example, here's how you can change the query editor based on the currently selected mode:
```
export default (props: Props) => {
const { query, exploreMode } = props;
switch (exploreMode) {
case ExploreMode.Metrics:
return <MetricsQueryField query={query} />;
case ExploreMode.Logs:
return <LogsQueryField query={query} />;
default:
return <p>Unsupported mode</p>;
}
}
```

View File

@@ -0,0 +1,60 @@
+++
title = "Add support for variables in plugins"
type = "docs"
+++
# Add support for variables in plugins
Variables are placeholders for values, and can be used to create things like templated queries and dashboard or panel links. For more information on variables, refer to [Templates and variables]({{< relref "../../variables/templates-and-variables.md" >}}).
This guide explains how to leverage template variables in your panel plugins and data source plugins.
We'll see how you can turn a string like this:
```sql
SELECT * FROM services WHERE id = "$service"
```
into
```sql
SELECT * FROM services WHERE id = "auth-api"
```
Grafana provides a couple of helper functions to interpolate variables in a string template. Let's see how you can use them in your plugin.
## Interpolate variables in panel plugins
For panels, the [replaceVariables]({{< relref "../../packages_api/data/panelprops.md#replacevariables-property" >}}) function is available in the [PanelProps]({{< relref "../../packages_api/data/panelprops.md" >}}).
Add `replaceVariables` to the argument list, and pass it a user-defined template string.
```ts
export const SimplePanel: React.FC<Props> = ({ options, data, width, height, replaceVariables }) => {
const query = replaceVariables('Now displaying $service')
return <div>{ query }</div>
}
```
## Interpolate variables in data source plugins
For data sources, you need to use the [getTemplateSrv]({{< relref "../../packages_api/runtime/gettemplatesrv.md" >}}), which returns an instance of [TemplateSrv]({{< relref "../../packages_api/runtime/templatesrv.md" >}}).
1. Import `getTemplateSrv` from the `runtime` package.
```ts
import { getTemplateSrv } from '@grafana/runtime';
```
1. In your `query` method, call the `replace` method with a user-defined template string.
```ts
async query(options: DataQueryRequest<MyQuery>): Promise<DataQueryResponse> {
const query = getTemplateSrv().replace('SELECT * FROM services WHERE id = "$service"'), options.scopedVars);
const data = makeDbQuery(query);
return { data };
}
```

View File

@@ -1,137 +0,0 @@
+++
title = "Authentication for data source plugins"
type = "docs"
aliases = ["/docs/grafana/latest/plugins/developing/auth-for-datasources/"]
+++
# Authentication for data source plugins
Grafana has a proxy feature that proxies all data requests through the Grafana backend. The main benefit of using the proxy is secure handling of credentials when authenticating against an external/third-party API. The Grafana proxy also adds [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) headers to the proxied requests.
The proxy supports:
- [authentication with HTTP Headers]({{< relref "#api-key-http-header-authentication" >}}).
- [token authentication]({{< relref "#how-token-authentication-works" >}}) and can automatically renew a token for the user when the token expires.
## How the proxy works
The user saves the API key/password on the plugin config page and it is encrypted (using the `secureJsonData` feature) and saved in the Grafana database. When a request from the data source is made, the Grafana proxy will:
1. Intercept the original request sent from the data source plugin.
1. Load the `secureJsonData` data from the database and decrypt the API key or password on the Grafana backend.
1. If using token authentication, carry out authentication and generate an OAuth token that will be added as an `Authorization` HTTP header to the requests (or alternatively it will add a HTTP header with the API key).
1. Renew the token if it has expired.
1. After adding CORS headers and authorization headers, forward the request to the external API.
This means that users that access the data source config page cannot access the API key or password after they have saved it the first time and that no secret keys are sent in plain text through the browser where they can be spied on.
For backend authentication to work, the external/third-party API must either have an OAuth endpoint or that the API accepts an API key as a HTTP header for authentication.
## Encrypting sensitive data
When a user saves a password or secret with your data source plugin's Config page, then you can save data in an encrypted blob in the Grafana database called `secureJsonData`. Any data saved in the blob is encrypted by Grafana and can only be decrypted by the Grafana server on the backend. This means once a password is saved, no sensitive data is sent to the browser. If the password is saved in the `jsonData` blob or the `password` field then it is unencrypted and anyone with Admin access (with the help of Chrome Developer Tools) can read it.
This is an example of using the `secureJsonData` blob to save a property called `password` in a html input:
```html
<input type="password" class="gf-form-input" ng-model="ctrl.current.secureJsonData.password" placeholder="password" />
```
## Plugin routes
A plugin route describes where the intercepted request should be forwarded to and how to authenticate for the external API. You can define multiple routes that can match multiple external API endpoints.
You specify routes in the `plugin.json` file for your data source plugin. [Here is an example](https://github.com/grafana/azure-monitor-datasource/blob/d74c82145c0a4af07a7e96cc8dde231bfd449bd9/src/plugin.json#L30-L95) with lots of routes (though most plugins will just have one route).
When you build your URL to the third-party API in your data source class, the URL should start with the text specified in the path field for a route. The proxy will strip out the path text and replace it with the value in the URL field.
### Simple plugin route example
- If my code makes a call to URL `azuremonitor/foo/bar` with this code:
```js
this.backendSrv.datasourceRequest({
url: url,
method: "GET",
});
```
- and the plugin has this route:
```json
"routes": [{
"path": "azuremonitor",
"method": "GET",
"url": "https://management.azure.com"
}]
```
- then the Grafana proxy will transform the URL from the original request into `https://management.azure.com/foo/bar`
- finally, it will add CORS headers and forward the request to the new URL. This example does not do any authentication.
The `method` parameter is optional. It can be set to a specific HTTP verb to provide more fine-grained control. For example you might have two plugin routes, one for GET requests and one for POST requests.
### Dynamic routes
When using routes, you can also reference a variable stored in JsonData or SecureJsonData which is interpolated (replacing the variable text with a value) when the data source makes a request to the proxy. These are variables that were entered by the user on the data source configuration page and saved in the Grafana database.
In this example, the value for `dynamicUrl` comes from the JsonData blob and the api key's value is set from the SecureJsonData blob. The `urlParams` field is for query string parameters for HTTP GET requests.
```json
"routes": [
{
"path": "custom/api/v5/*",
"method": "GET",
"url": "{{.JsonData.dynamicUrl}}",
"urlParams": [
{"name": "apiKey", "content": "{{.SecureJsonData.apiKey}}"}
]
}
]
```
Given that:
- `JsonData.dynamicUrl` has the value `http://example.com/api`
- `SecureJsonData.apiKey` has the value `secretKey`
a call to the URL: `custom/api/v5/some/path`
will be proxied to the following URL: `http://example.com/api/some/path?apiKey=secretKey`
An app using this feature can be found [here](https://github.com/grafana/kentik-app).
## API key/HTTP header authentication
Some third-party API's accept a HTTP Header for authentication. The [example](https://github.com/grafana/azure-monitor-datasource/blob/d74c82145c0a4af07a7e96cc8dde231bfd449bd9/src/plugin.json#L91-L93) below has a `headers` section that defines the name of the HTTP Header that the API expects and it uses the `SecureJSONData` blob to fetch an encrypted API key. The Grafana server proxy will decrypt the key, add the `X-API-Key` header to the request and forward it to the third-party API.
```json
{
"path": "appinsights",
"method": "GET",
"url": "https://api.applicationinsights.io",
"headers": [{ "name": "X-API-Key", "content": "{{.SecureJsonData.appInsightsApiKey}}" }]
}
```
## How token authentication works
The token auth section in the `plugin.json` file looks like this:
```json
"tokenAuth": {
"url": "https://login.microsoftonline.com/{{.JsonData.tenantId}}/oauth2/token",
"params": {
"grant_type": "client_credentials",
"client_id": "{{.JsonData.clientId}}",
"client_secret": "{{.SecureJsonData.clientSecret}}",
"resource": "https://management.azure.com/"
}
}
```
This interpolates in data from both `jsonData` and `secureJsonData` to generate the token request to the third-party API. It is common for tokens to have a short expiry period (30 minutes). The Grafana proxy automatically renews the token if it has expired.
## Always restart the Grafana server after route changes
The plugin.json files are only loaded when the Grafana server starts so when a route is added or changed then the Grafana server has to be restarted for the changes to take effect.

View File

@@ -1,285 +0,0 @@
+++
title = "Backend plugins"
keywords = ["grafana", "plugins", "backend", "plugin", "backend-plugins", "documentation"]
type = "docs"
aliases = ["/docs/grafana/latest/plugins/developing/backend-plugins-guide/"]
+++
# Backend plugins
Grafana added support for plugins in Grafana 3.0 and this enabled the Grafana community to create panel plugins and data source plugins. It was wildly successful and has made Grafana much more useful as you can integrate it with anything and do any type of custom visualization that you want. However, these plugin hooks are on the frontend only and we also want to provide hooks into the Grafana backend to allow the community to extend and improve Grafana in new ways.
Once Grafana introduced the alerting feature, external data source plugins needed a backend component for the Grafana server to execute queries for evaluating alert rules (as the alerting engine cannot call frontend JavaScript code). So the obvious first backend plugin type is the **Datasource backend plugin** and it is a new component for an existing data source plugin. This new plugin type will enable alerting for external data source plugins but can also be used for achieving different goals such as query caching, request proxying, custom authentication methods, and more.
## Grafana's Backend Plugin System
The backend plugin feature is implemented with the [HashiCorp plugin system](https://github.com/hashicorp/go-plugin) which is a Go plugin system over RPC. Grafana server launches each plugin as a subprocess and communicates with it over RPC. This approach has a number of benefits:
- Plugins can't crash your grafana process: a panic in a plugin doesn't panic the server.
- Plugins are easy to develop: just write a Go application and `go build` (or use any other language which supports gRPC).
- Plugins can be relatively secure: The plugin only has access to the interfaces and args given to it, not to the entire memory space of the process.
## Data source plugin interface
The plugin interface is very simple and described as a Go interface type in [Grafana](https://github.com/grafana/grafana/blob/6724aaeff9a332dc73b4ee0f8abe0621f7253142/pkg/tsdb/query_endpoint.go#L10-L12) and as a general [RPC service](https://github.com/grafana/grafana-plugin-model/blob/84176c64269d8060f99e750ee8aba6f062753336/datasource.proto#L96-L98) in the corresponding `.proto` (protocol buffer file):
```go
type TsdbQueryEndpoint interface {
Query(ctx context.Context, ds *models.DataSource, query *TsdbQuery) (*Response, error)
}
```
```protobuf
service DatasourcePlugin {
rpc Query(DatasourceRequest) returns (DatasourceResponse);
}
```
Thus, a datasource plugin should only implement the `Query()` method.
## Introduction to building a backend component for a plugin
The [Simple JSON backend](https://github.com/grafana/simple-json-backend-datasource) data source is a good example of writing a simple backend plugin in Go. Let's take a look at some key points.
### Metadata
The plugin needs to know it has a backend component, this is done in the `plugin.json` file by setting two fields: `backend` and `executable`. If you want to enable alerting for your data source, set the `alerting` field to `true` as well.
```json
{
"id": "grafana-simple-json-backend-datasource",
"name": "Simple Json backend",
"type": "datasource",
"metrics": true,
"annotations": true,
"backend": true,
"alerting": true,
"executable": "simple-json-plugin",
...
}
```
`executable` should be the the the first part of the binary filename. The actual binary filename has 3 possible endings:
- \_linux_amd64
- \_darwin_amd64
- \_windows_amd64.exe
When Grafana loads the plugin binary, it uses the executable field plus the current OS (Grafana knows which OS it is running on) to load in the correct version of the plugin. So in Simple JSON the executable field is `simple-json-plugin` and the 3 binaries are named:
- `simple-json-plugin_darwin_amd64`
- `simple-json-plugin_linux_amd64`
- `simple-json-plugin_windows_amd64.exe`
The resulting plugin directory will look like this:
```text
simple-json-backend-datasource/
|-- dist/
| |-- partials/
| |-- module.js
| |-- plugin.json
| |-- simple-json-plugin_linux_amd64
| |-- simple-json-plugin_darwin_amd64
| |-- simple-json-plugin_windows_amd64.exe
...
```
### Plugin code
A `pkg/` directory contains three `.go` files:
- `plugin.go` - an entry point of the plugin. This file would be very similar for your data source - you just need to change some details like the plugin name etc.
- `datasource.go` - contains `Query()` method implementation and other plugin logic.
- `models.go` - types for request and response specific to your data source.
The data source type is declared in [`datasource.go`](https://github.com/grafana/simple-json-backend-datasource/blob/7927ff0db60c3402dbf954a454f19d7230e18deb/pkg/datasource.go#L21-L24):
```go
package main
import (
plugin "github.com/hashicorp/go-plugin"
)
type JsonDatasource struct {
plugin.NetRPCUnsupportedPlugin
}
```
The only requirement for the plugin type is that it should extend `plugin.NetRPCUnsupportedPlugin`. You can include more fields into your struct if you want to add some data source-specific features, like logging, cache etc:
```go
type JsonDatasource struct {
plugin.NetRPCUnsupportedPlugin
logger hclog.Logger
}
```
The main method you should implement is the [`Query()`](https://github.com/grafana/simple-json-backend-datasource/blob/7927ff0db60c3402dbf954a454f19d7230e18deb/pkg/datasource.go#L26):
```go
func (t *JsonDatasource) Query(ctx context.Context, tsdbReq *datasource.DatasourceRequest) (*datasource.DatasourceResponse, error) {
...
```
#### Request format
In order to call this method from the [frontend part of your data source](https://github.com/grafana/simple-json-backend-datasource/blob/7927ff0db60c3402dbf954a454f19d7230e18deb/src/datasource.ts#L116), use the `/api/tsdb/query` endpoint:
```js
class SimpleJSONDatasource {
...
doTsdbRequest(options) {
const tsdbRequest = {
from: options.range.from.valueOf().toString(),
to: options.range.to.valueOf().toString(),
queries: options.targets,
};
return this.backendSrv.datasourceRequest({
url: '/api/tsdb/query',
method: 'POST',
data: tsdbRequest
});
}
}
```
This endpoint gets data in the following format (see [pkg/api/metrics.go](https://github.com/grafana/grafana/blob/7b63913dc1d79da07f0329cf19dc4c2704ec488f/pkg/api/metrics.go#L16) and [pkg/api/dtos/models.go](https://github.com/grafana/grafana/blob/7b63913dc1d79da07f0329cf19dc4c2704ec488f/pkg/api/dtos/models.go#L43-L47)):
```js
{
from: "1555324640782", // Optional, time range from
to: "1555328240782", // Optional, time range to
queries: [
{
datasourceId: 42, // Required
refId: "A", // Optional, default is "A"
maxDataPoints: 100, // Optional, default is 100
intervalMs: 1000, // Optional, default is 1000
myFieldFoo: "bar", // Any other fields,
myFieldBar: "baz", // defined by user
...
},
...
]
}
```
There is only one query function but it is possible to move all your queries to the backend. In order to achieve this, you could add a kind of `queryType` field to your query model and check this type in the backend code. The Stackdriver and Cloudwatch core plugins have examples of supporting multiple types of queries if you need/want to do this:
- Stackdriver: [pkg/tsdb/stackdriver/stackdriver.go](https://github.com/grafana/grafana/blob/6724aaeff9a332dc73b4ee0f8abe0621f7253142/pkg/tsdb/stackdriver/stackdriver.go#L75-L88)
- Cloudwatch: [pkg/tsdb/cloudwatch/cloudwatch.go](https://github.com/grafana/grafana/blob/7b63913dc1d79da07f0329cf19dc4c2704ec488f/pkg/tsdb/cloudwatch/cloudwatch.go#L62-L74)
#### Response format
Go types for the query response can be found in Grafana tsdb models ([pkg/tsdb/models.go](https://github.com/grafana/grafana/blob/7b63913dc1d79da07f0329cf19dc4c2704ec488f/pkg/tsdb/models.go#L22-L34)) or in the corresponding protocol buffer file ([datasource.proto](https://github.com/grafana/grafana-plugin-model/blob/84176c64269d8060f99e750ee8aba6f062753336/datasource.proto#L26-L36))
```protobuf
// datasource.proto
message DatasourceResponse {
repeated QueryResult results = 1;
}
message QueryResult {
string error = 1;
string refId = 2;
string metaJson = 3;
repeated TimeSeries series = 4;
repeated Table tables = 5;
}
```
```go
// pkg/tsdb/models.go
type Response struct {
Results map[string]*QueryResult `json:"results"`
Message string `json:"message,omitempty"`
}
type QueryResult struct {
Error error `json:"-"`
ErrorString string `json:"error,omitempty"`
RefId string `json:"refId"`
Meta *simplejson.Json `json:"meta,omitempty"`
Series TimeSeriesSlice `json:"series"`
Tables []*Table `json:"tables"`
}
```
The resulting JSON response which the frontend will receive looks like this:
```js
results: {
A: {
refId: "A",
series: [
{ name: "series_1", points: [...] },
{ name: "series_2", points: [...] },
...
],
tables: null,
// Request metadata (any arbitrary JSON).
// Optional, empty field will be omitted.
meta: {},
// Error message. Optional, empty field will be omitted.
error: "Request failed",
}
}
```
### Logging
Logs from the plugin will be automatically sent to the Grafana server and will appear in its log flow. Grafana server reads logs from the plugin's `stderr` stream, so with the standard `log` package you have to set output to `os.Stderr` first:
```go
func main() {
log.SetOutput(os.Stderr)
log.Println("from plugin!")
...
}
```
Another option for logging - using [go-hclog](https://github.com/hashicorp/go-hclog) package:
```go
package main
import (
hclog "github.com/hashicorp/go-hclog"
)
var pluginLogger = hclog.New(&hclog.LoggerOptions{
Name: "simple-json-backend-datasource",
Level: hclog.LevelFromString("DEBUG"),
})
func main() {
pluginLogger.Debug("Running Simple JSON backend datasource")
...
}
```
### Building the backend binary
Building the binary depends on which OS you are using.
For a Linux distro, the build command would be:
```sh
go build -o ./dist/simple-json-plugin_linux_amd64 ./pkg
```
On Windows, the command would be:
```sh
go build -o ./dist/simple-json-plugin_windows_amd64.exe ./pkg
```
Restart your Grafana server and then check the Grafana logs to make sure your plugin is loaded properly.

View File

@@ -0,0 +1,69 @@
+++
title = "Backend plugins"
keywords = ["grafana", "plugins", "backend", "plugin", "backend-plugins", "documentation"]
type = "docs"
aliases = ["/docs/grafana/latest/plugins/developing/backend-plugins-guide/"]
+++
# Backend plugins
Grafana added support for plugins in version 3.0 and this enabled the Grafana community to create panel plugins and data source plugins. It was wildly successful and has made Grafana much more useful as you can integrate it with anything and do any type of custom visualization that you want.
However, one limitation with these plugins are that they execute on the client-side (in the browser) which makes it hard to support certain use cases/features, e.g. enable Grafana Alerting for data sources. Grafana v7.0 adds official support for backend plugins which removes this limitation. At the same time it gives plugin developers the possibility to extend Grafana in new and interesting ways, with code running in the backend (server side).
We use the term _backend plugin_ to denote that a plugin has a backend component. Still, normally a backend plugin requires frontend components as well. This is for example true for backend data source plugins which normally need configuration and query editor components implemented for the frontend.
Data source plugins can be extended with a backend component. In the future we plan to support additional types and possibly new kinds of plugins, such as [notifiers for Grafana Alerting]({{< relref "../../../alerting/notifications.md" >}}) and custom authentication to name a few.
## Use cases for implementing a backend plugin
The following examples gives you an idea of why you'd consider implementing a backend plugin:
- Enable [Grafana Alerting]({{< relref "../../../alerting" >}}) for data sources.
- Connect to non-HTTP services that normally can't be connected to from a web browser, e.g. SQL database servers.
- Keep state between users, e.g. query caching for data sources.
- Use custom authentication methods and/or authorization checks that aren't supported in Grafana.
- Use a custom data source request proxy, see [Resources]({{< relref "#resources" >}}).
## Grafanas backend plugin system
The Grafana backend plugin system is based on the [go-plugin library by HashiCorp](https://github.com/hashicorp/go-plugin). The Grafana server launches each backend plugin as a subprocess and communicates with it over [gRPC](https://grpc.io/). This approach has a number of benefits:
- Plugins cant crash your grafana process: a panic in a plugin doesnt panic the server.
- Plugins are easy to develop: just write a Go application and run `go build` (or use any other language which supports gRPC).
- Plugins can be relatively secure: The plugin only has access to the interfaces and arguments that are given to it, not to the entire memory space of the process.
Grafana's backend plugin system exposes a couple of different capabilities, or building blocks, that a backend plugin can implement:
- Query data
- Resources
- Health checks
- Collect metrics
### Query data
The query data capability allows a backend plugin to handle data source queries that are submitted from a [dashboard]({{< relref "../../../features/dashboard/dashboards.md" >}}), [Explore]({{< relref "../../../features/explore/index.md" >}}) or [Grafana Alerting]({{< relref "../../../alerting" >}}). The response contains [data frames]({{< relref "../data-frames.md" >}}), which are used to visualize metrics, logs, and traces. The query data capability is required to implement for a backend data source plugin.
### Resources
The resources capability allows a backend plugin to handle custom HTTP requests sent to the Grafana HTTP API and respond with custom HTTP responses. Here, the request and response formats can vary, e.g. JSON, plain text, HTML or static resources (files, images) etc. Compared to the query data capability where the response contains data frames, resources give the plugin developer a lot of flexibility for extending and open up Grafana for new and interesting use cases.
Examples of use cases for implementing resources:
- Implement a custom data source proxy in case certain authentication/authorization or other requirements are required/needed that are not supported in Grafana's [built-in data proxy](https://grafana.com/docs/grafana/latest/http_api/data_source/#data-source-proxy-calls).
- Return data or information in a format suitable to use within a data source query editor to provide auto-complete functionality.
- Return static resources, such as images or files.
- Send a command to a device, such as a micro controller or IOT device.
- Request information from a device, such as a micro controller or IOT device.
- Extend Grafana's HTTP API with custom resources, methods and actions.
- Use [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding) to return large data responses in chunks or to enable "basic" streaming capabilities.
### Health checks
The health checks capability allows a backend plugin to return the status of the plugin. For data source backend plugins the health check will automatically be called when you do _Save & Test_ in the UI when editing a data source. A plugin's health check endpoint is exposed in the Grafana HTTP API and allows external systems to continuously poll the plugin's health to make sure it's running and working as expected.
### Collect metrics
A backend plugin can collect and return runtime, process and custom metrics using the text-based Prometheus [exposition format](https://prometheus.io/docs/instrumenting/exposition_formats/). If youre using the [Grafana Plugin SDK for Go]({{< relref "grafana-plugin-sdk-for-go.md" >}}) to implement your backend plugin, then the [Prometheus instrumentation library for Go applications](https://github.com/prometheus/client_golang) is built-in, and gives you Go runtime metrics and process metrics out of the box. By using the [Prometheus instrumentation library](https://github.com/prometheus/client_golang) you can add custom metrics to instrument your backend plugin.
A metrics endpoint (`/api/plugins/<plugin id>/metrics`) for a plugin is available in the Grafana HTTP API and allows a Prometheus instance to be configured to scrape the metrics.

View File

@@ -0,0 +1,20 @@
+++
title = "Grafana Plugin SDK for Go"
keywords = ["grafana", "plugins", "backend", "plugin", "backend-plugins", "sdk", "documentation"]
type = "docs"
+++
# Grafana plugin SDK for Go
The Grafana plugin SDK for Go enables building Grafana backend plugins using [Go](https://golang.org/). The SDK provides a high-level framework with APIs, utilities and tooling that abstract away the details of the [plugin protocol]({{< relref "plugin-protocol.md" >}}) and RPC communication so plugin developers do not need to manage either.
The [github.com/grafana/grafana-plugin-sdk-go](https://pkg.go.dev/mod/github.com/grafana/grafana-plugin-sdk-go?tab=overview) is a Go module that provides a set of [Go packages](https://pkg.go.dev/mod/github.com/grafana/grafana-plugin-sdk-go?tab=packages) that can be used to implement a backend plugin.
## Versioning
The SDK is still in development. The [plugin protocol]({{< relref "plugin-protocol.md" >}}) between Grafana and the plugin SDK is versioned separately and considered stable. However, there might be breaking changes introduced in the SDK. This means that plugins using an older version of the SDK should still work with Grafana, but might lose out on new features and capabilities introduced in the SDK.
## See also
- [Source code](https://github.com/grafana/grafana-plugin-sdk-go)
- [Go reference documentation](https://pkg.go.dev/github.com/grafana/grafana-plugin-sdk-go)

View File

@@ -0,0 +1,28 @@
+++
title = "Plugin protocol"
keywords = ["grafana", "plugins", "backend", "plugin", "backend-plugins", "documentation"]
type = "docs"
+++
# Plugin protocol
Theres a physical wire protocol that Grafana server uses to communicate with backend plugins. This is the contract between Grafana and backend plugins, that must be agreed upon for Grafana and a backend plugin to be able to communicate with each other. The plugin protocol is built on [gRPC](https://grpc.io/) and is defined in [Protocol Buffers (a.k.a., protobuf)](https://developers.google.com/protocol-buffers).
We adwise for backend plugins to not be implemented directly against this protocol. Instead, prefer to use the [Grafana Plugin SDK for Go]({{< relref "grafana-plugin-sdk-for-go.md" >}}) that implements this protocol and provides higher level APIs.
The plugin protocol is available in the [GitHub repository](https://github.com/grafana/grafana-plugin-sdk-go/blob/master/proto/backend.proto). The plugin protocol lives in the [Grafana Plugin SDK for Go]({{< relref "grafana-plugin-sdk-for-go.md" >}}) since Grafana itself uses parts of the SDK as a dependency.
## Versioning
Additions of services, messages and fields in the latest version of the plugin protocol are expected to happen, but should not introduce any breaking changes. If breaking changes to the plugin protocol is needed, a new major version of the plugin protocol will be created and released together with a new major Grafana release. Grafana will then support both the old and the new plugin protocol for some time to make sure existing backend plugins continue to work.
Because Grafana maintains the plugin protocol, the plugin protocol attempts to follow Grafana's versioning, However, that doesn't automatically mean that a new major version of the plugin protocol is created when a new major release of Grafana is released.
## Writing plugins without Go
In case you want to write a backend plugin in another language than Go its possible as long as the language supports [gRPC](https://grpc.io/). However, writing a plugin in Go is recommended and has several advantages that should be carefully taken into account before proceeding:
- There's an official [SDK]({{< relref "grafana-plugin-sdk-for-go.md" >}}) available.
- Single binary as the compiled output.
- Building and compiling for multiple platforms is easy.
- A statically compiled binary (in most cases) doesn't require any additional dependencies installed on the target platform enabling it to run “everywhere”.
- Small footprint in regards to binary size and resource usage.

View File

@@ -0,0 +1,122 @@
+++
title = "Build a logs data source plugin"
type = "docs"
+++
# Build a logs data source plugin
This guide explains how to build a logs data source plugin.
Data sources in Grafana supports both metrics and log data. The steps to build a logs data source plugin are largely the same as for a metrics data source. This guide assumes that you're already familiar with how to [Build a data source plugin]({{< relref "../../../../../tutorials/build-a-data-source-plugin.md" >}}) for metrics.
## Add logs support to your data source
To add logs support to an existing data source, you need to:
- Enable logs support
- Construct the log data
### Enable logs support
Tell Grafana that your data source plugin can return log data, by adding `"logs": true` to the [plugin.json]({{< relref "metadata.md" >}}) file.
```json
{
"logs": true
}
```
### Construct the log data
Just like for metrics data, Grafana expects your plugin to return log data as a [data frame]({{< relref "data-frames.md" >}}).
To return log data, return a data frame with at least one time field and one text field from the data source's `query` method.
**Example:**
```ts
const frame = new MutableDataFrame({
refId: query.refId,
fields: [
{ name: 'time', type: FieldType.time },
{ name: 'content', type: FieldType.string },
],
});
frame.add({ time: 1589189388597, content: 'user registered' });
frame.add({ time: 1589189406480, content: 'user logged in' });
```
That's all you need to start returning log data from your data source. Go ahead and try it out in [Explore]({{< relref "../../features/explore/index.md" >}}) or by adding a [Logs panel]({{< relref "../../panels/visualizations/logs-panel.md" >}}).
Congratulations, you just wrote your first logs data source plugin! Next, let's look at a couple of features that can further improve the experience for the user.
## Add labels to your logs
To help filter log lines, many log systems let you query logs based on metadata, or _labels_.
You can add labels to a stream of logs by setting the [labels](../../packages_api/data/field.md#labels-property) property on the [Field]({{< relref "../../packages_api/data/field.md" >}}).
**Example**:
```ts
const frame = new MutableDataFrame({
refId: query.refId,
fields: [
{ name: 'time', type: FieldType.time },
{ name: 'content', type: FieldType.string, labels: { filename: 'file.txt' } },
],
});
frame.add({ time: 1589189388597, content: 'user registered' });
frame.add({ time: 1589189406480, content: 'user logged in' });
```
## Extract parsed fields from your logs
You can add additional information about each log line by adding more data frame fields.
If a data frame has more than one text field, then Grafana assumes the first field in the data frame to be the actual log line. Any subsequent text fields are treated as [parsed fields]({{< relref "../../features/explore/index.md#labels-and-parsed-fields" >}}).
While you can add any number of custom fields to your data frame, Grafana comes with a couple of dedicated fields: `levels` and `id`. Let's have a closer look at each one.
### Levels
To set the level for each log line, add a `level` field.
**Example:**
```ts
const frame = new MutableDataFrame({
refId: query.refId,
fields: [
{ name: 'time', type: FieldType.time },
{ name: 'content', type: FieldType.string, labels: { filename: 'file.txt' } },
{ name: 'level', type: FieldType.string },
],
});
frame.add({ time: 1589189388597, content: 'user registered', level: 'info' });
frame.add({ time: 1589189406480, content: 'unknown error', level: 'error' });
```
### Unique log lines
By default, Grafana offers basic support for deduplicating log lines. You can improve the support by adding an `id` field to explicitly assign identifiers to each log line.
**Example:**
```ts
const frame = new MutableDataFrame({
refId: query.refId,
fields: [
{ name: 'time', type: FieldType.time },
{ name: 'content', type: FieldType.string, labels: { filename: 'file.txt' } },
{ name: 'level', type: FieldType.string },
{ name: 'id', type: FieldType.string },
],
});
frame.add({ time: 1589189388597, content: 'user registered', level: 'info', id: 'd3b07384d113edec49eaa6238ad5ff00' });
frame.add({ time: 1589189406480, content: 'unknown error', level: 'error', id: 'c157a79031e1c40f85931829bc5fc552' });
```

View File

@@ -0,0 +1,132 @@
+++
title = "Build a streaming data source plugin"
type = "docs"
+++
# Build a streaming data source plugin
This guide explains how to build a streaming data source plugin.
This guide assumes that you're already familiar with how to [Build a data source plugin]({{< relref "../../../../../tutorials/build-a-data-source-plugin.md" >}}).
When monitoring critical applications, you want your dashboard to refresh as soon as your data does. In Grafana, you can set your dashboards to automatically refresh at a certain interval, no matter what data source you use. Unfortunately, this means that your queries are requesting all the data to be sent again, regardless of whether the data has actually changed.
By enabling _streaming_ for your data source plugin, you can update your dashboard as soon as new data becomes available.
For example, a streaming data source plugin can connect to a websocket, or subscribe to a message bus, and update the visualization whenever a new message is available.
Let's see how you can add streaming to an existing data source!
Grafana uses [RxJS](https://rxjs.dev/) to continuously send data from a data source to a panel visualization. There's a lot more to RxJS than what's covered in this guide. If you want to learn more, check out the [RxJS documentation](https://rxjs.dev/guide/overview).
1. Enable streaming for your data source in the `plugin.json` file.
```json
{
"streaming": true
}
```
1. Change the signature of the `query` method to return an `Observable` from the `rxjs` package. Make sure you remove the `async` keyword.
```ts
import { Observable } from 'rxjs';
```
```ts
query(options: DataQueryRequest<MyQuery>): Observable<DataQueryResponse> {
// ...
}
```
1. Create an `Observable` for each query, and then combine them all using the `merge` function from the `rxjs` package.
```ts
import { Observable, merge } from 'rxjs';
```
```ts
const observables = options.targets.map(target => {
return new Observable<DataQueryResponse>(subscriber => {
// ...
});
});
return merge(...observables);
```
1. In the `subscribe` function, create a `CircularDataFrame`.
```ts
import { CircularDataFrame } from '@grafana/data';
```
```ts
const frame = new CircularDataFrame({
append: 'tail',
capacity: 1000,
});
frame.refId = query.refId;
frame.addField({ name: 'time', type: FieldType.time });
frame.addField({ name: 'value', type: FieldType.number });
```
Circular data frames have a limited capacity. When a circular data frame reaches its capacity, the oldest data point is removed.
1. Use `subscriber.next()` to send the updated data frame whenever you receive new updates.
```ts
const intervalId = setInterval(() => {
frame.add({ time: Date.now(), value: Math.random() });
subscriber.next({
data: [frame],
key: query.refId,
});
}, 500);
return () => {
clearInterval(intervalId);
};
```
> **Note:** In practice, you'd call `subscriber.next` as soon as you receive new data from a websocket or a message bus. The example above simulates data being received every 500 milliseconds.
Here's the final `query` method.
```ts
query(options: DataQueryRequest<MyQuery>): Observable<DataQueryResponse> {
const streams = options.targets.map(target => {
const query = defaults(target, defaultQuery);
return new Observable<DataQueryResponse>(subscriber => {
const frame = new CircularDataFrame({
append: 'tail',
capacity: 1000,
});
frame.refId = query.refId;
frame.addField({ name: 'time', type: FieldType.time });
frame.addField({ name: 'value', type: FieldType.number });
const intervalId = setInterval(() => {
frame.add({ time: Date.now(), value: Math.random() });
subscriber.next({
data: [frame],
key: query.refId,
});
}, 100);
return () => {
clearInterval(intervalId);
};
});
});
return merge(...streams);
}
```
One limitation with this example is that the panel visualization is cleared every time you update the dashboard. If you have access to historical data, you can add, or _backfill_, it to the data frame before the first call to `subscriber.next()`.

View File

@@ -65,7 +65,7 @@ By adding field configurations to a data frame, Grafana can configure visualizat
## Transformations
Along with the type information, field configs enables _data transformations_ within Grafana.
Along with the type information, field configs enable _data transformations_ within Grafana.
A data transformation is any function that accepts a data frame as input, and returns another data frame as output. By using data frames in your plugin, you get a range of transformations for free.
@@ -73,7 +73,7 @@ A data transformation is any function that accepts a data frame as input, and re
A data frame with at least one time field is considered a _time series_.
For more information on time series, refer to our [Introduction to time series](https://grafana.com/docs/grafana/latest/guides/timeseries/).
For more information on time series, refer to our [Introduction to time series]({{< relref "../../getting-started/timeseries.md" >}}).
### Wide format

View File

@@ -15,7 +15,7 @@ Grafana already has a strong community of contributors and plugin developers. By
## Short version
1. [Set up Grafana](https://github.com/grafana/grafana/blob/master/contribute/developer-guide.md)
2. Clone an example plugin into ```/var/lib/grafana/plugins``` or `data/plugins` (relative to grafana git repo if you're running development version from source dir)
2. Clone an example plugin into `/var/lib/grafana/plugins` or `data/plugins` (relative to grafana git repo if you're running development version from source dir)
3. Use one of our example plugins as a starting point
Example plugins
@@ -36,7 +36,7 @@ Since everything turns into JavaScript, it's up to you to choose which language
## Buildscript
You can use any build system that supports systemjs. All the built content should end up in a folder named ```dist``` and be committed to the repository. By committing the dist folder, the person who installs your plugin does not have to run any build script. All of our example plugins have a build script configured.
You can use any build system that supports systemjs. All the built content should end up in a folder named `dist` and be committed to the repository. By committing the dist folder, the person who installs your plugin does not have to run any build script. All of our example plugins have a build script configured.
## Keep your plugin up to date
@@ -63,35 +63,31 @@ The SDK contains three different plugin classes: PanelCtrl, MetricsPanelCtrl and
Example:
```javascript
import {ClockCtrl} from './clock_ctrl';
import { ClockCtrl } from './clock_ctrl';
export {
ClockCtrl as PanelCtrl
};
export { ClockCtrl as PanelCtrl };
```
The module class is also where css for the dark and light themes is imported:
```javascript
import {loadPluginCss} from 'app/plugins/sdk';
import { loadPluginCss } from 'app/plugins/sdk';
import WorldmapCtrl from './worldmap_ctrl';
loadPluginCss({
dark: 'plugins/grafana-worldmap-panel/css/worldmap.dark.css',
light: 'plugins/grafana-worldmap-panel/css/worldmap.light.css'
light: 'plugins/grafana-worldmap-panel/css/worldmap.light.css',
});
export {
WorldmapCtrl as PanelCtrl
};
export { WorldmapCtrl as PanelCtrl };
```
## Start developing your plugin
There are three ways that you can start developing a Grafana plugin.
1. Set up a Grafana development environment. [(described here)](https://github.com/grafana/grafana/blob/master/contribute/developer-guide.md) and place your plugin in the ```data/plugins``` folder.
2. Install Grafana and place your plugin in the plugins directory which is set in your [config file](/installation/configuration). By default this is `/var/lib/grafana/plugins` on Linux systems.
1. Set up a Grafana development environment. [(described here)](https://github.com/grafana/grafana/blob/master/contribute/developer-guide.md) and place your plugin in the `data/plugins` folder.
2. Install Grafana and place your plugin in the plugins directory which is set in your [config file](/administration/configuration). By default this is `/var/lib/grafana/plugins` on Linux systems.
3. Place your plugin directory anywhere you like and specify it grafana.ini.
We encourage people to set up the full Grafana environment so that you can get inspiration from the rest of the Grafana code base.
@@ -116,11 +112,11 @@ If a panel receives data and hooks into the `data-received` event then it should
We have three different examples that you can fork/download to get started developing your Grafana plugin.
- [simple-json-datasource](https://github.com/grafana/simple-json-datasource) (small data source plugin for querying json data from backends)
- [simple-app-plugin](https://github.com/grafana/simple-app-plugin)
- [clock-panel](https://github.com/grafana/clock-panel)
- [singlestat-panel](https://github.com/grafana/grafana/tree/master/public/app/plugins/panel/singlestat)
- [piechart-panel](https://github.com/grafana/piechart-panel)
- [simple-json-datasource](https://github.com/grafana/simple-json-datasource) (small data source plugin for querying json data from backends)
- [simple-app-plugin](https://github.com/grafana/simple-app-plugin)
- [clock-panel](https://github.com/grafana/clock-panel)
- [singlestat-panel](https://github.com/grafana/grafana/tree/master/public/app/plugins/panel/singlestat)
- [piechart-panel](https://github.com/grafana/piechart-panel)
## Other Articles
@@ -129,4 +125,4 @@ We have three different examples that you can fork/download to get started devel
- [Grafana Plugin Code Styleguide]({{< relref "style-guide.md" >}})
- [Grafana Apps]({{< relref "apps.md" >}})
- [Grafana Data Sources]({{< relref "data-sources.md" >}})
- [plugin.json Schema]({{< relref "metadata.md" >}})
- [plugin.json Schema]({{< relref "../metadata.md" >}})

View File

@@ -7,7 +7,7 @@ aliases = ["/docs/grafana/latest/plugins/developing/apps/"]
# Legacy app plugins
App plugins are a Grafana plugin that can bundle data source and panel plugins within one package. They also enable the plugin author to create custom pages within Grafana. The custom pages enable the plugin author to include things like documentation, sign-up forms, or to control other services with HTTP requests.
App plugins are Grafana plugins that can bundle data source and panel plugins within one package. They also enable the plugin author to create custom pages within Grafana. The custom pages enable the plugin author to include things like documentation, sign-up forms, or to control other services with HTTP requests.
Data source and panel plugins will show up like normal plugins. The app pages will be available in the main menu.

View File

@@ -154,7 +154,7 @@ A basic guide for data sources can be found [here](http://docs.grafana.org/plugi
If possible, any passwords or secrets should be be saved in the `secureJsonData` blob. To encrypt sensitive data, the Grafana server's proxy feature must be used. The Grafana server has support for token authentication (OAuth) and HTTP Header authentication. If the calls have to be sent directly from the browser to a third-party API, this will not be possible and sensitive data will not be encrypted.
Read more here about how [authentication for data sources]({{< relref "../authentication.md" >}}) works.
Read more here about how [authentication for data sources]({{< relref "../add-authentication-for-data-source-plugins.md" >}}) works.
If using the proxy feature, the Config page should use the `secureJsonData` blob like this:

View File

@@ -27,7 +27,7 @@ grafana-piechart-panel
mtanda-histogram-panel
```
The full file format for plugin.json is described [here]({{< relref "metadata.md" >}}).
The full file format for plugin.json is described [here]({{< relref "../metadata.md" >}}).
Minimal plugin.json:
@@ -110,11 +110,23 @@ Below is a minimal example of an editor row with one form group and two fields,
<div class="gf-form">
<label class="gf-form-label width-10">Label1</label>
<div class="gf-form-select-wrapper max-width-10">
<select class="input-small gf-form-input" ng-model="ctrl.panel.mySelectProperty" ng-options="t for t in ['option1', 'option2', 'option3']" ng-change="ctrl.onSelectChange()"></select>
<select
class="input-small gf-form-input"
ng-model="ctrl.panel.mySelectProperty"
ng-options="t for t in ['option1', 'option2', 'option3']"
ng-change="ctrl.onSelectChange()"
></select>
</div>
<div class="gf-form">
<label class="gf-form-label width-10">Label2</label>
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.myProperty" ng-change="ctrl.onFieldChange()" placeholder="suggestion for user" ng-model-onblur />
<input
type="text"
class="input-small gf-form-input width-10"
ng-model="ctrl.panel.myProperty"
ng-change="ctrl.onFieldChange()"
placeholder="suggestion for user"
ng-model-onblur
/>
</div>
</div>
</div>
@@ -137,43 +149,45 @@ We recommend that you use a linter for your JavaScript. For ES6, the standard li
2. Prefer to use `let` instead `var` ([Exploring ES6](http://exploringjs.com/es6/ch_core-features.html#_from-var-to-letconst))
3. Use arrow functions, which dont shadow `this` ([Exploring ES6](http://exploringjs.com/es6/ch_core-features.html#_from-function-expressions-to-arrow-functions)):
```js
testDatasource() {
return this.getServerStatus()
.then(status => {
return this.doSomething(status);
})
}
```
```js
testDatasource() {
return this.getServerStatus()
.then(status => {
return this.doSomething(status);
})
}
```
better than
better than
```js
testDatasource() {
var self = this;
return this.getServerStatus()
.then(function(status) {
return self.doSomething(status);
})
}
```
```js
testDatasource() {
var self = this;
return this.getServerStatus()
.then(function(status) {
return self.doSomething(status);
})
}
```
4. Use native _Promise_ object:
```js
metricFindQuery(query) {
if (!query) {
return Promise.resolve([]);
}
}
```
```js
metricFindQuery(query) {
if (!query) {
return Promise.resolve([]);
}
}
```
better than
better than
```js
metricFindQuery(query) {
if (!query) {
return this.$q.when([]);
}
}
```
```js
metricFindQuery(query) {
if (!query) {
return this.$q.when([]);
}
}
```
5. If using Lodash, then be consistent and prefer that to the native ES6 array functions.

View File

@@ -1,4 +1,7 @@
+++
# -------------------------------------------------------------------------
# Do not edit this file. It is automatically generated by json-schema-docs.
# -------------------------------------------------------------------------
title = "plugin.json"
keywords = ["grafana", "plugins", "documentation"]
type = "docs"
@@ -7,30 +10,177 @@ aliases = ["/docs/grafana/latest/plugins/developing/plugin.json/"]
# plugin.json
The plugin.json file is mandatory for all plugins. When Grafana starts it will scan the plugin folders and mount every folder that contains a plugin.json file unless the folder contains a subfolder named `dist`. In that case grafana will mount the `dist` folder instead.
The plugin.json file is required for all plugins. When Grafana starts, it scans the plugin folders and mounts every folder that contains a plugin.json file unless the folder contains a subfolder named dist. In that case, Grafana mounts the dist folder instead.
## Schema
## Properties
| Property | Description |
|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| id | Unique name of the plugin. |
| type | One of `app`, `datasource`, `panel` |
| name | Human-readable name of the plugin |
| dependencies.grafanaVersion | Required Grafana version for this plugin |
| dependencies.plugins | An array of required plugins on which this plugin depends |
| info.author.name | Author's name |
| info.author.url | Link to author's website |
| info.description | Description of plugin. Used for search on grafana.com |
| info.keywords | Array of plugin keywords. Used for search on grafana.com |
| info.links | An array of link objects to be displayed on this plugin's project page in the form `{name: 'foo', url: 'http://example.com'}` |
| info.logos.small | Link to the "small" version of the plugin logo, which must be an SVG image. "Large" and "small" logos can be the same image. |
| info.logos.large | Link to the "large" version of the plugin logo, which must be an SVG image. "Large" and "small" logos can be the same image. |
| info.screenshots | An array of screenshot objects in the form `{name: 'bar', path: 'img/screenshot.png'}` |
| info.updated | Date when this plugin was built. Use `%TODAY%` for Grafana to autopopulate this value. |
| info.version | Project version of this commit. Use `%VERSION%` for Grafana to autopopulate this value. |
| Property | Type | Required | Description |
|-----------------|-------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dependencies` | [object](#dependencies) | **Yes** | Plugin dependencies. |
| `id` | string | **Yes** | Unique name of the plugin. If the plugin is published on grafana.com, then the plugin id has to follow the naming conventions. |
| `info` | [object](#info) | **Yes** | Metadata for the plugin. Some fields are used on the plugins page in Grafana and others on grafana.com if the plugin is published. |
| `name` | string | **Yes** | Human-readable name of the plugin that is shown to the user in the UI. |
| `type` | string | **Yes** | Plugin type. Possible values are `app`, `datasource`, and `panel`. |
| `alerting` | boolean | No | For data source plugins. If the plugin supports alerting. |
| `annotations` | boolean | No | For data source plugins. If the plugin supports annotation queries. |
| `backend` | boolean | No | If the plugin has a backend component. |
| `category` | string | No | Plugin category used on the Add data source page. Possible values are: `tsdb`, `logging`, `cloud`, `tracing`, and `sql`. |
| `executable` | string | No | The first part of the file name of the backend component executable. There can be multiple executables built for different operating system and architecture. Grafana will check for executables named `<executable>_<$GOOS>_<lower case $GOARCH><.exe for Windows>`, e.g. `plugin_linux_amd64`. Combination of $GOOS and $GOARCH can be found here: https://golang.org/doc/install/source#environment. |
| `hiddenQueries` | boolean | No | |
| `includes` | [object](#includes)[] | No | |
| `logs` | boolean | No | For data source plugins. If the plugin supports logs. |
| `metrics` | boolean | No | For data source plugins. If the plugin supports metric queries. Used in the Explore feature. |
| `mixed` | boolean | No | Not to be used by external plugins. Special property for the built-in mixed plugin. |
| `module` | string | No | |
| `partials` | [object](#partials) | No | |
| `queryOptions` | [object](#queryoptions) | No | For data source plugins. There is a query options section in the plugin's query editor and these options can be turned on if needed. |
| `routes` | [object](#routes)[] | No | For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Authentication for data source plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/). |
| `sort` | number | No | Internal property for sorting. Cannot be used as will be overwritten by Grafana. |
| `staticRoot` | string | No | |
| `streaming` | boolean | No | For data source plugins. If the plugin supports streaming. |
| `tables` | boolean | No | |
| `tracing` | boolean | No | For data source plugins. If the plugin supports tracing. |
## Plugin.json Example
## dependencies
Plugin dependencies.
### Properties
| Property | Type | Required | Description |
|------------------|----------|----------|------------------------------------------------------------------------------------------------------------------|
| `grafanaVersion` | string | **Yes** | Required Grafana version for this plugin, e.g. `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or v7.x.x. |
| `plugins` | string[] | No | An array of required plugins on which this plugin depends. |
## includes
### Properties
| Property | Type | Required | Description |
|--------------|---------|----------|-------------|
| `addToNav` | boolean | No | |
| `component` | string | No | |
| `defaultNav` | boolean | No | |
| `name` | string | No | |
| `role` | string | No | |
| `type` | string | No | |
## info
Metadata for the plugin. Some fields are used on the plugins page in Grafana and others on grafana.com if the plugin is published.
### Properties
| Property | Type | Required | Description |
|---------------|--------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------|
| `logos` | [object](#logos) | **Yes** | SVG images that are used as plugin icons. |
| `updated` | string | **Yes** | Date when this plugin was built. |
| `version` | string | **Yes** | Project version of this commit, e.g. `6.7.x`. |
| `author` | [object](#author) | No | Information about the plugin author. |
| `description` | string | No | Description of plugin. Used on the plugins page in Grafana and for search on grafana.com. |
| `keywords` | string[] | No | Array of plugin keywords. Used for search on grafana.com. |
| `links` | [object](#links)[] | No | An array of link objects to be displayed on this plugin's project page in the form `{name: 'foo', url: 'http://example.com'}` |
| `screenshots` | [object](#screenshots)[] | No | An array of screenshot objects in the form `{name: 'bar', path: 'img/screenshot.png'}` |
### author
Information about the plugin author.
#### Properties
| Property | Type | Required | Description |
|----------|--------|----------|---------------------------|
| `email` | string | No | Author's name. |
| `name` | string | No | Author's name. |
| `url` | string | No | Link to author's website. |
### links
#### Properties
| Property | Type | Required | Description |
|----------|--------|----------|-------------|
| `name` | string | No | |
| `url` | string | No | |
### logos
SVG images that are used as plugin icons.
#### Properties
| Property | Type | Required | Description |
|----------|--------|----------|------------------------------------------------------------------------------------------------------------------------------|
| `large` | string | **Yes** | Link to the "large" version of the plugin logo, which must be an SVG image. "Large" and "small" logos can be the same image. |
| `small` | string | **Yes** | Link to the "small" version of the plugin logo, which must be an SVG image. "Large" and "small" logos can be the same image. |
### screenshots
#### Properties
| Property | Type | Required | Description |
|----------|--------|----------|-------------|
| `name` | string | No | |
| `path` | string | No | |
## partials
### Properties
| Property | Type | Required | Description |
|----------|--------|----------|-------------|
| `config` | string | No | |
## queryOptions
For data source plugins. There is a query options section in the plugin's query editor and these options can be turned on if needed.
### Properties
| Property | Type | Required | Description |
|-----------------|---------|----------|----------------------------------------------------------------------------------------------------------------------------|
| `cacheTimeout` | boolean | No | For data source plugins. If the `cache timeout` option should be shown in the query options section in the query editor. |
| `maxDataPoints` | boolean | No | For data source plugins. If the `max data points` option should be shown in the query options section in the query editor. |
| `minInterval` | boolean | No | For data source plugins. If the `min interval` option should be shown in the query options section in the query editor. |
## routes
For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Authentication for data source plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/).
### Properties
| Property | Type | Required | Description |
|---------------|----------------------|----------|---------------------------------------------------------------------------------------------------------|
| `headers` | array | No | For data source plugins. Route headers adds HTTP headers to the proxied request. |
| `method` | string | No | For data source plugins. Route method matches the HTTP verb like GET or POST. |
| `path` | string | No | For data source plugins. The route path that is replaced by the route URL field when proxying the call. |
| `reqRole` | string | No | |
| `reqSignedIn` | boolean | No | |
| `tokenAuth` | [object](#tokenauth) | No | For data source plugins. Token authentication section used with an OAuth API. |
| `url` | string | No | For data source plugins. Route URL is where the request is proxied to. |
### tokenAuth
For data source plugins. Token authentication section used with an OAuth API.
#### Properties
| Property | Type | Required | Description |
|----------|-------------------|----------|---------------------------------------------------------------------------|
| `params` | [object](#params) | No | For data source plugins. Parameters for the token authentication request. |
| `url` | string | No | For data source plugins. URL to fetch the authentication token. |
#### params
For data source plugins. Parameters for the token authentication request.
##### Properties
| Property | Type | Required | Description |
|-----------------|--------|----------|--------------------------------------------------------------------------------------------------------------------|
| `client_id` | string | No | For data source plugins. OAuth client id. |
| `client_secret` | string | No | For data source plugins. OAuth client secret. Usually populated by decrypting the secret from the SecureJson blob. |
| `grant_type` | string | No | For data source plugins. OAuth grant type. |
| `resource` | string | No | For data source plugins. OAuth resource. |
Here's an example of an up-to-date plugin.json file:
https://github.com/grafana/clock-panel/blob/master/src/plugin.json

View File

@@ -0,0 +1,11 @@
+++
# -------------------------------------------------------------------------
# Do not edit this file. It is automatically generated by json-schema-docs.
# -------------------------------------------------------------------------
title = "plugin.json"
keywords = ["grafana", "plugins", "documentation"]
type = "docs"
aliases = ["/docs/grafana/latest/plugins/developing/plugin.json/"]
+++
{{ .Markdown 1 }}

View File

@@ -0,0 +1,325 @@
{
"$id": "https://grafana.com/plugin-metadata",
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"title": "plugin.json",
"description": "The plugin.json file is required for all plugins. When Grafana starts, it scans the plugin folders and mounts every folder that contains a plugin.json file unless the folder contains a subfolder named dist. In that case, Grafana mounts the dist folder instead.",
"required": ["type", "name", "id", "info", "dependencies"],
"additionalProperties": false,
"properties": {
"id": {
"type": "string",
"description": "Unique name of the plugin. If the plugin is published on grafana.com, then the plugin id has to follow the naming conventions.",
"pattern": "^[0-9a-z\\-]+$"
},
"type": {
"type": "string",
"description": "Plugin type. Possible values are `app`, `datasource`, and `panel`.",
"enum": ["app", "datasource", "panel"]
},
"name": {
"type": "string",
"description": "Human-readable name of the plugin that is shown to the user in the UI."
},
"category": {
"type": "string",
"description": "Plugin category used on the Add data source page. Possible values are: `tsdb`, `logging`, `cloud`, `tracing`, and `sql`.",
"enum": ["tsdb", "logging", "cloud", "tracing", "sql"]
},
"annotations": {
"type": "boolean",
"description": "For data source plugins. If the plugin supports annotation queries."
},
"alerting": {
"type": "boolean",
"description": "For data source plugins. If the plugin supports alerting."
},
"backend": {
"type": "boolean",
"description": "If the plugin has a backend component."
},
"executable": {
"type": "string",
"description": "The first part of the file name of the backend component executable. There can be multiple executables built for different operating system and architecture. Grafana will check for executables named `<executable>_<$GOOS>_<lower case $GOARCH><.exe for Windows>`, e.g. `plugin_linux_amd64`. Combination of $GOOS and $GOARCH can be found here: https://golang.org/doc/install/source#environment."
},
"includes": {
"type": "array",
"items": {
"type": "object",
"additionalItems": false,
"properties": {
"type": {
"type": "string"
},
"name": {
"type": "string"
},
"component": {
"type": "string"
},
"role": {
"type": "string"
},
"addToNav": {
"type": "boolean"
},
"defaultNav": {
"type": "boolean"
}
}
}
},
"logs": {
"type": "boolean",
"description": "For data source plugins. If the plugin supports logs."
},
"partials": {
"type": "object",
"additionalItems": false,
"properties": {
"config": {
"type": "string"
}
}
},
"metrics": {
"type": "boolean",
"description": "For data source plugins. If the plugin supports metric queries. Used in the Explore feature."
},
"mixed": {
"type": "boolean",
"description": "Not to be used by external plugins. Special property for the built-in mixed plugin."
},
"module": {
"type": "string"
},
"sort": {
"type": "number",
"description": "Internal property for sorting. Cannot be used as will be overwritten by Grafana."
},
"staticRoot": {
"type": "string"
},
"streaming": {
"type": "boolean",
"description": "For data source plugins. If the plugin supports streaming."
},
"tables": {
"type": "boolean"
},
"tracing": {
"type": "boolean",
"description": "For data source plugins. If the plugin supports tracing."
},
"hiddenQueries": {
"type": "boolean"
},
"dependencies": {
"type": "object",
"description": "Plugin dependencies.",
"required": ["grafanaVersion"],
"additionalProperties": false,
"properties": {
"grafanaVersion": {
"type": "string",
"description": "Required Grafana version for this plugin, e.g. `6.x.x 7.x.x` to denote plugin requires Grafana v6.x.x or v7.x.x.",
"pattern": "^([0-9x]+\\.[0-9x]+\\.*[0-9x]*\\s*)+$"
},
"plugins": {
"type": "array",
"description": "An array of required plugins on which this plugin depends.",
"items": {
"type": "string"
}
}
}
},
"info": {
"type": "object",
"description": "Metadata for the plugin. Some fields are used on the plugins page in Grafana and others on grafana.com if the plugin is published.",
"required": ["logos", "version", "updated"],
"additionalProperties": false,
"properties": {
"author": {
"type": "object",
"description": "Information about the plugin author.",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "Author's name."
},
"email": {
"type": "string",
"description": "Author's name.",
"format": "email"
},
"url": {
"type": "string",
"description": "Link to author's website.",
"format": "uri"
}
}
},
"description": {
"type": "string",
"description": "Description of plugin. Used on the plugins page in Grafana and for search on grafana.com."
},
"keywords": {
"type": "array",
"description": "Array of plugin keywords. Used for search on grafana.com.",
"items": {
"type": "string"
}
},
"links": {
"type": "array",
"description": "An array of link objects to be displayed on this plugin's project page in the form `{name: 'foo', url: 'http://example.com'}`",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
}
}
}
},
"logos": {
"type": "object",
"description": "SVG images that are used as plugin icons.",
"required": ["small", "large"],
"additionalProperties": false,
"properties": {
"small": {
"type": "string",
"description": "Link to the \"small\" version of the plugin logo, which must be an SVG image. \"Large\" and \"small\" logos can be the same image."
},
"large": {
"type": "string",
"description": "Link to the \"large\" version of the plugin logo, which must be an SVG image. \"Large\" and \"small\" logos can be the same image."
}
}
},
"screenshots": {
"type": "array",
"description": "An array of screenshot objects in the form `{name: 'bar', path: 'img/screenshot.png'}`",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"path": {
"type": "string"
}
}
}
},
"updated": {
"type": "string",
"description": "Date when this plugin was built.",
"pattern": "^(\\d{4}-\\d{2}-\\d{2}|\\%TODAY\\%)$"
},
"version": {
"type": "string",
"description": "Project version of this commit, e.g. `6.7.x`.",
"pattern": "^([0-9x]+\\.[0-9x]+\\.*[0-9x]*$|\\%VERSION\\%)"
}
}
},
"queryOptions": {
"type": "object",
"description": "For data source plugins. There is a query options section in the plugin's query editor and these options can be turned on if needed.",
"additionalProperties": false,
"properties": {
"maxDataPoints": {
"type": "boolean",
"description": "For data source plugins. If the `max data points` option should be shown in the query options section in the query editor."
},
"minInterval": {
"type": "boolean",
"description": "For data source plugins. If the `min interval` option should be shown in the query options section in the query editor."
},
"cacheTimeout": {
"type": "boolean",
"description": "For data source plugins. If the `cache timeout` option should be shown in the query options section in the query editor."
}
}
},
"routes": {
"type": "array",
"description": "For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Authentication for data source plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/).",
"items": {
"type": "object",
"description": "For data source plugins. Proxy routes used for plugin authentication and adding headers to HTTP requests made by the plugin. For more information, refer to [Authentication for data source plugins](https://grafana.com/docs/grafana/latest/developers/plugins/authentication/).",
"additionalProperties": false,
"properties": {
"path": {
"type": "string",
"description": "For data source plugins. The route path that is replaced by the route URL field when proxying the call."
},
"method": {
"type": "string",
"description": "For data source plugins. Route method matches the HTTP verb like GET or POST."
},
"url": {
"type": "string",
"description": "For data source plugins. Route URL is where the request is proxied to.",
"format": "uri"
},
"reqSignedIn": {
"type": "boolean"
},
"reqRole": {
"type": "string"
},
"headers": {
"type": "array",
"description": "For data source plugins. Route headers adds HTTP headers to the proxied request."
},
"tokenAuth": {
"type": "object",
"description": "For data source plugins. Token authentication section used with an OAuth API.",
"additionalProperties": false,
"properties": {
"url": {
"type": "string",
"description": "For data source plugins. URL to fetch the authentication token.",
"format": "uri"
},
"params": {
"type": "object",
"description": "For data source plugins. Parameters for the token authentication request.",
"additionalProperties": false,
"properties": {
"grant_type": {
"type": "string",
"description": "For data source plugins. OAuth grant type."
},
"client_id": {
"type": "string",
"description": "For data source plugins. OAuth client id."
},
"client_secret": {
"type": "string",
"description": "For data source plugins. OAuth client secret. Usually populated by decrypting the secret from the SecureJson blob."
},
"resource": {
"type": "string",
"description": "For data source plugins. OAuth resource."
}
}
}
}
}
}
}
}
}
}

View File

@@ -0,0 +1,10 @@
+++
title = "Sign a plugin"
type = "docs"
+++
# Sign a plugin
Signing a plugin allows Grafana to verify the authenticity of the plugin with [signature verification]({{< relref "../../plugins/plugin-signature-verification.md" >}}). This gives users a way to make sure plugins haven't been tampered with. All Grafana Labs-authored backend plugins, including Enterprise plugins, are signed.
We're looking into providing a process for allowing community plugins to be signed in an upcoming version of Grafana.

View File

@@ -19,21 +19,9 @@ Grafana Enterprise includes all of the features found in the open source edition
[Learn more about Grafana Enterprise.](https://grafana.com/enterprise)
## Enhanced security features
## Authentication
Grafana Enterprise includes integrations with more ways to authenticate your users and enhanced authorization capabilities.
### Data source permissions
[Data source permissions]({{< relref "datasource_permissions.md" >}}) allow you to restrict query access to only specific teams and users.
### Enhanced LDAP integration
With Grafana Enterprise [enhanced LDAP]({{< relref "enhanced_ldap.md" >}}), you can set up synchronization between LDAP groups and Grafana teams.
### SAML authentication
[SAML authentication]({{< relref "saml.md" >}}) enables your Grafana Enterprise users to authenticate with SAML.
Grafana Enterprise includes integrations with more ways to authenticate your users and enhanced authentication capabilities.
### Team sync
@@ -42,25 +30,31 @@ With Grafana Enterprise [enhanced LDAP]({{< relref "enhanced_ldap.md" >}}), you
Supported auth providers:
* [Auth Proxy]({{< relref "../auth/auth-proxy.md#team-sync-enterprise-only">}})
* [Azure AD OAuth]({{< relref "../auth/azuread.md#team-sync-enterprise-only" >}})
* [GitHub OAuth]({{< relref "../auth/github.md#team-sync-enterprise-only" >}})
* [GitLab OAuth]({{< relref "../auth/gitlab.md#team-sync-enterprise-only" >}})
* [LDAP]({{< relref "enhanced_ldap.md#ldap-group-synchronization-for-teams" >}})
* [Okta]({{< relref "../auth/okta.md#team-sync-enterprise-only" >}})
* [SAML]({{< relref "saml.md#configure-team-sync" >}})
## Reporting
### Enhanced LDAP integration
[Reporting]({{< relref "reporting.md" >}}) allows you to take any dashboard, generate a PDF report, and set up a schedule to have it emailed to whoever you choose.
With Grafana Enterprise [enhanced LDAP]({{< relref "enhanced_ldap.md" >}}), you can set up active LDAP synchronization.
## Export dashboard as PDF
### SAML authentication
[Export dashboard as PDF]({{< relref "export-pdf.md" >}}) allows you to export a dashboard as a PDF document.
[SAML authentication]({{< relref "saml.md" >}}) enables your Grafana Enterprise users to authenticate with SAML.
## White labeling
## Enterprise features
[White labeling]({{< relref "white-labeling.md" >}}) allows you to replace the Grafana brand and logo with your own corporate brand and logo. You can also change footer links to point to your custom resources.
With Grafana Enterprise, you get access to new features, including:
## Usage insights
[Usage insights]({{< relref "usage-insights.md" >}}) allow you to understand how your Grafana instance is used. You can see who is looking at a dashboard, how often a dashboard is seen, and which dashboards are prone to errors. You'll also be able to discover what are the least and the most used dashboards.
* [Data source permissions]({{< relref "datasource_permissions.md" >}}) to restrict query access to specific teams and users.
* [Reporting]({{< relref "reporting.md" >}}) to generate a PDF report from any dashboard and set up a schedule to have it emailed to whoever you choose.
* [Export dashboard as PDF]({{< relref "export-pdf.md" >}})
* [White labeling]({{< relref "white-labeling.md" >}}) to customize Grafana from the brand and logo to the footer links.
* [Usage insights]({{< relref "usage-insights.md" >}}) to understand how your Grafana instance is used.
* [Vault integration]({{< relref "vault.md" >}}) to manage your configuration or provisioning secrets with Vault.
## Enterprise plugins
@@ -79,11 +73,11 @@ With a Grafana Enterprise license, you get access to premium plugins, including:
To purchase or obtain a trial license contact the Grafana Labs [Sales Team](https://grafana.com/contact?about=support&topic=Grafana%20Enterprise).
## License file management
### License file management
To download your Grafana Enterprise license log in to your [Grafana.com](https://grafana.com) account and go to your **Org Profile**. In the side menu there is a section for Grafana Enterprise licenses. At the bottom of the license details page there is **Download Token** link that will download the *license.jwt* file containing your license.
To download your Grafana Enterprise license log in to your [Grafana Cloud Account](https://grafana.com) and go to your **Org Profile**. In the side menu there is a section for Grafana Enterprise licenses. At the bottom of the license details page there is **Download Token** link that will download the *license.jwt* file containing your license.
Place the *license.jwt* file in Grafana's data folder. This is usually located at `/var/lib/grafana/data` on Linux systems.
Place the *license.jwt* file in Grafana's data folder. This is usually located at `/var/lib/grafana` on Linux systems.
You can also configure a custom location for the license file via the ini setting:
@@ -93,3 +87,22 @@ license_path = /company/secrets/license.jwt
```
This setting can also be set with an environment variable, which is useful if you're running Grafana with Docker and have a custom volume where you have placed the license file. In this case, set the environment variable `GF_ENTERPRISE_LICENSE_PATH` to point to the location of your license file.
### Root URL
Update the [`root_url`](../administration/configuration/#root-url) in your configuration. It should be the URL that users type in their browsers to access the frontend, not the node hostname(s).
This is important, because as part of the validation checks at startup, Grafana compares the license URL to the [`root_url`](../administration/configuration/#root-url) in your configuration.
In your configuration file:
```
[server]
root_url = https://grafana.blah.com/
```
Or with an environment variable:
```
GF_SERVER_ROOT_URL=https://grafana.blah.com/
```

View File

@@ -0,0 +1,218 @@
+++
title = "Enterprise configuration"
description = "Enterprise configuration documentation"
keywords = ["grafana", "configuration", "documentation", "enterprise"]
type = "docs"
[menu.docs]
name = "Enterprise configuration"
identifier = "enterprise-config"
parent = "enterprise"
weight = 300
+++
# Grafana Enterprise configuration
This page describes Grafana Enterprise-specific configuration options that you can specify in a `.ini` configuration file or using environment variables. Refer to [Configuration]({{< relref "../administration/configuration.md" >}}) for more information about available configuration options.
## [white_labeling]
### app_title
Set to your company name to override application title.
### login_logo
Set to complete URL to override login logo.
### login_background
Set to complete CSS background expression to override login background. Example:
```bash
[white_labeling]
login_background = url(http://www.bhmpics.com/wallpapers/starfield-1920x1080.jpg)
```
### menu_logo
Set to complete URL to override menu logo.
### fav_icon
Set to complete URL to override fav icon (icon shown in browser tab).
### apple_touch_icon
Set to complete URL to override Apple/iOS icon.
### footer_links
List the link IDs to use here. Grafana will look for matching link configurations, the link IDs should be space-separated and contain no whitespace.
## [meta_analytics]
### max_file_age
Max age for data files before they get deleted.
### max_data_directory_size
Max size in megabytes of the data files directory before files get deleted.
### data_path
The directory where events will be stored in.
## [analytics.summaries]
### buffer_write_interval
Interval for writing dashboard usage stats buffer to database.
### buffer_write_timeout
Timeout for writing dashboard usage stats buffer to database.
### rollup_interval
Interval for trying to roll up per dashboard usage summary. Only rolled up at most once per day.
### rollup_timeout
Timeout for trying to rollup per dashboard usage summary.
## [analytics.views]
### recent_users_age
Age for recent active users.
## [reporting]
### rendering_timeout
Timeout for each panel rendering request.
### concurrent_render_limit
Maximum number of concurrent calls to the rendering service.
### image_scale_factor
Scale factor for rendering images. Value `2` is enough for monitor resolutions, `4` would be better for printed material. Setting a higher value affects performance and memory.
## [auth.saml]
### enabled
If true, the feature is enabled. Defaults to false.
### certificate
Base64-encoded public X.509 certificate. Used to sign requests to the IdP.
### certificate_path
Path to the public X.509 certificate. Used to sign requests to the IdP.
### private_key
Base64-encoded private key. Used to decrypt assertions from the IdP.
### private_key_path
Path to the private key. Used to decrypt assertions from the IdP.
### idp_metadata
Base64-encoded IdP SAML metadata XML. Used to verify and obtain binding locations from the IdP.
### idp_metadata_path
Path to the SAML metadata XML. Used to verify and obtain binding locations from the IdP.
### idp_metadata_url
URL to fetch SAML IdP metadata. Used to verify and obtain binding locations from the IdP.
### max_issue_delay
Time since the IdP issued a response and the SP is allowed to process it. Defaults to 90 seconds.
### metadata_valid_duration
How long the SPs metadata is valid. Defaults to 48 hours.
### assertion_attribute_name
Friendly name or name of the attribute within the SAML assertion to use as the user name.
### assertion_attribute_login
Friendly name or name of the attribute within the SAML assertion to use as the user login handle.
### assertion_attribute_email
Friendly name or name of the attribute within the SAML assertion to use as the user email.
### assertion_attribute_groups
Friendly name or name of the attribute within the SAML assertion to use as the user groups.
### assertion_attribute_role
Friendly name or name of the attribute within the SAML assertion to use as the user roles.
### assertion_attribute_org
Friendly name or name of the attribute within the SAML assertion to use as the user organization.
### allowed_organizations
List of comma- or space-separated organizations. Each user must be a member of at least one organization to log in.
### org_mapping
List of comma- or space-separated Organization:OrgId mappings.
### role_values_editor
List of comma- or space-separated roles that will be mapped to the Editor role.
### role_values_admin
List of comma- or space-separated roles that will be mapped to the Admin role.
### role_values_grafana_admin
List of comma- or space-separated roles that will be mapped to the Grafana Admin (Super Admin) role.
## [keystore.vault]
### url
Location of the Vault server.
### namespace
Vault namespace if using Vault with multi-tenancy.
### auth_method
Method for authenticating towards Vault. Vault is inactive if this option is not set. Current possible values: `token`.
### token
Secret token to connect to Vault when auth_method is `token`.
### lease_renewal_interval
Time between checking if there are any secrets which needs to be renewed.
### lease_renewal_expires_within
Time until expiration for tokens which are renewed. Should have a value higher than lease_renewal_interval.
### lease_renewal_increment
New duration for renewed tokens. Vault may be configured to ignore this value and impose a stricter limit.

View File

@@ -8,7 +8,7 @@ parent = "enterprise"
weight = 8
+++
# License expiration
# License expiration
If your license has expired most of Grafana keeps working as normal. Some enterprise functionality stops or runs with reduced functionality and Grafana displays a banner informing the users that Grafana is running on an expired license. Your Grafana admin needs to upload a new license file to restore full functionality.
@@ -16,13 +16,14 @@ If your license has expired most of Grafana keeps working as normal. Some enterp
## Update your license
1. Locate your current `license.jwt` file. In a standard installation it is stored inside Grafana's data directory, which on a typical Linux installation is in `/var/lib/grafana/data`. This location might be overridden in the ini file [Configuration](https://grafana.com/docs/grafana/latest/installation/configuration/)
```
[enterprise]
license_path = /path/to/your/license.jwt
```
The configuration file's location may also be overridden by the `GF_ENTERPRISE_LICENSE_PATH` environment variable.
2. Log in to your [Grafana.com](https://grafana.com/login) user and make sure you're in the correct organization in the dropdown at the top of the page.
1. Locate your current `license.jwt` file. In a standard installation it is stored inside Grafana's data directory, which on a typical Linux installation is in `/var/lib/grafana/data`. This location might be overridden in the ini file [Configuration](https://grafana.com/docs/grafana/latest/administration/configuration/).
```ini
[enterprise]
license_path = /path/to/your/license.jwt
```
The configuration file's location may also be overridden by the `GF_ENTERPRISE_LICENSE_PATH` environment variable.
2. Log in to your [Grafana Cloud Account](https://grafana.com/login) and make sure you're in the correct organization in the dropdown at the top of the page.
3. Under the **Grafana Enterprise** section in the menu bar to the left, choose licenses and download the currently valid license with which you want to run Grafana. If you cannot see a valid license on Grafana.com, please contact your account manager at Grafana Labs to renew your subscription.
4. Replace the current `license.jwt`-file with the one you've just downloaded.
5. Restart Grafana.
@@ -52,3 +53,7 @@ Enterprise plugins might stop working.
## White labeling
The white labeling feature is turned off, meaning that any white labeling options will not have any effect.
## Usage insights
All the usage insights features are turned off, meaning that you won't be able to look at dashboard usage, presence indicator or to use improved search. Grafana still collects usage data and you will have access to it as soon as you update your license.

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