Compare commits

...

705 Commits

Author SHA1 Message Date
Leonard Gram
cf4c090fe2 Version updated to 5.2.3. 2018-08-22 10:20:39 +02:00
Torkel Ödegaard
1440e77bea fixed test in cherry picked commit 2018-08-21 14:01:52 +02:00
Torkel Ödegaard
df83bf10a2 sql: added code migration type
(cherry picked from commit 92ed1f04af)
2018-08-21 13:56:08 +02:00
Marcus Efraimsson
aeaf7b23a6 Merge pull request #12712 from grafana/cp-5.2.2
Cherry-picks for 5.2.2
2018-07-25 13:17:28 +02:00
Marcus Efraimsson
0ff4aa80ed remove unnecessary conversions
(cherry picked from commit d2f31a716f)
2018-07-25 12:27:42 +02:00
Marcus Efraimsson
020ecfdf56 release 5.2.2 2018-07-25 12:17:12 +02:00
Torkel Ödegaard
e70a9de45a fix: postgres/mysql engine cache was not being used, fixes #12636
(cherry picked from commit cd60234e7c)
2018-07-25 12:11:19 +02:00
Torkel Ödegaard
a6fc391583 fix: panel embedd scrolbar fix, fixes #12589
(cherry picked from commit 02ecf01bba)
2018-07-25 12:10:41 +02:00
Mitsuhiro Tanda
534ba6d805 (prometheus) prevent error to use $__interval_ms in query (#12533)
* prevent error to use $__interval_ms in query

* add test

* prevent error to use $__interval_ms in query

(cherry picked from commit 18a8290c65)
2018-07-25 12:08:42 +02:00
David Kaltschmidt
2bd1a19169 Fix freezing browser when loading plugin
- broken since 4d2dd2209
- `*` was previously working as a path matcher, but freezes browser when
  used with new cache-busting plugin loader
- changed matcher to be `/*`

(cherry picked from commit 81e62e1051)
2018-07-25 12:07:15 +02:00
David
a996dd25d6 Fix css loading in plugins (#12573)
- allow css loader to be imported again (wasnt prefixed by plugin)
(cherry picked from commit 4d2dd22095)
2018-07-25 12:06:36 +02:00
Marcus Efraimsson
4d108007fe fix links not updating after changing variables
(cherry picked from commit 5e4d6958d6)
2018-07-25 12:02:58 +02:00
David
4df07b4e25 Fix bar width issue in aligned prometheus queries (#12483)
* Fix bar width issue in aligned prometheus queries

This was broken because null values were filled in with unaligned times.

* use aligned times for result transformation
* add tests

An earlier version of this fix aligned the times again in the transformer, but
I think it's safe to only deal with aligned times in the response.

* Fixed prometheus heatmap tranformer test

The interval needs to be 1 to prevent step alignment.

(cherry picked from commit 0d1f7c8782)
2018-07-25 12:01:18 +02:00
Marcus Efraimsson
2040f61c56 Merge pull request #12458 from grafana/cp-5.2.1
Cherry-picks for 5.2.1
2018-06-29 11:17:46 +02:00
Marcus Efraimsson
aa94f7ebfe release 5.2.1 2018-06-29 10:58:00 +02:00
Torkel Ödegaard
855b570878 fix: log close/flush was done too early, before server shutdown log message was called, fixes #12438
(cherry picked from commit 7a7c6f8fab)
2018-06-29 10:56:00 +02:00
Marcus Efraimsson
1713f7f01d Revert "auth proxy: use real ip when validating white listed ip's"
(cherry picked from commit 8af5da7383)
2018-06-29 10:55:27 +02:00
Marcus Efraimsson
2b7d124be8 fix footer css issue
(cherry picked from commit 54420363d3)
2018-06-29 10:54:16 +02:00
Marcus Efraimsson
ad4d71740a Merge pull request #12415 from grafana/cp-5.2.0
Cherry-picks for v5.2.0 stable
2018-06-27 09:38:18 +02:00
Marcus Efraimsson
77312d3a9c release v5.2.0 2018-06-26 18:21:56 +02:00
Marcus Efraimsson
3565fe7105 login: fix layout issues
(cherry picked from commit 9f02927761)
2018-06-26 18:17:45 +02:00
Marcus Efraimsson
df62c6a197 set correct text in drop down when variable is present in url using key/values
(cherry picked from commit 5280084480)
2018-06-26 18:16:59 +02:00
Marcus Efraimsson
f929bd51db enhance error message if phantomjs executable is not found
if arm build, explain that phantomjs is not included by default in arm
builds. If not explain that phantom js isn't installed correctly

(cherry picked from commit f106de0efd)
2018-06-26 18:16:26 +02:00
rozetko
381f3da30e Set $rootScope in DatasourceSrv
(cherry picked from commit 97db9ece98)
2018-06-26 18:15:52 +02:00
Aleksei Magusev
f48ea5eea6 Fix ResponseParser for InfluxDB to return only string values
(cherry picked from commit b7482ae8b7)
2018-06-26 18:15:01 +02:00
Aleksei Magusev
3c2cb7715b Conditionally select a field to return in ResponseParser for InfluxDB
This patch also fixes "value[1] || value[0]" to not ignore zeros.

(cherry picked from commit e104e9b2c2)
2018-06-26 18:14:44 +02:00
Dan Cech
90132770fa handle "dn" ldap attribute more gracefully (#12385)
* handle "dn" ldap attribute more gracefully

* use strings.ToLower

(cherry picked from commit 583df47c2f)
2018-06-26 09:44:12 +02:00
Daniel Lee
30c882c18d Merge pull request #12364 from grafana/cp-5.2.0-beta3
Cherry-picks for v5.2.0-beta3
2018-06-21 11:11:12 +02:00
Marcus Efraimsson
e5836064ce release v5.2.0-beta3 2018-06-21 10:54:24 +02:00
Marcus Efraimsson
f7cb827944 build: fix signing of multiple rpm packages
(cherry picked from commit e617e23927)
2018-06-21 10:54:04 +02:00
Marcus Efraimsson
f76cafa68e Merge pull request #12357 from grafana/cp-5.2.0-beta2
Cherry-picks for v5.2.0-beta2
2018-06-20 15:21:50 +02:00
Marcus Efraimsson
cdae9126ed release v5.2.0-beta2 2018-06-20 14:58:30 +02:00
Marcus Efraimsson
b4c1df11f6 make sure to process panels in collapsed rows when exporting dashboard
(cherry picked from commit a2e08dc4e8)
2018-06-20 14:56:13 +02:00
Alexander Zobnin
7c94d5cd1a graph: fix legend decimals precision calculation
(cherry picked from commit 24f6d34abd)
2018-06-20 14:55:38 +02:00
Marcus Efraimsson
74d6b5fc1c dashboard: fix drop down links
(cherry picked from commit 4ef4a4d3a7)
2018-06-20 14:55:04 +02:00
Marcus Efraimsson
af42e0836a fix regressions after save modal changes of not storing time and variables per default
Fix problem with adhoc variable filters not handled.
Fix problem with saving variables and time per default when saving a
dashboard as/first time.
Fix updating dashboard model after save with saving time/variables
enabled so that next time you save you won't get checkboxes for save
time/variables unless any values changed.
Tests validating correctness if time/variable values has changed.

(cherry picked from commit 41ac8d4cd5)
2018-06-20 14:54:13 +02:00
Martin Molnar
f453fbe8ef feat(ldap): Allow use of DN in user attribute filter (#3132)
(cherry picked from commit be2fa54459)
2018-06-20 14:53:36 +02:00
Marcus Efraimsson
8d635efda0 snapshot: copy correct props when creating a snapshot
(cherry picked from commit a738347957)
2018-06-20 14:52:59 +02:00
Marcus Efraimsson
0f2e879339 set current org when adding/removing user to org
To not get into a situation where a user has a current organization assign which he is
not a member of we try to always make sure that a user has a valid current organization
assigned.

(cherry picked from commit 6d48d0a80c)
2018-06-20 14:52:11 +02:00
Marcus Efraimsson
e51dd88260 Merge pull request #12340 from grafana/apikey-permission-fix-cherry-pick2
v5.2.x cherry pick fix
2018-06-19 12:37:26 +02:00
Torkel Ödegaard
984293cc52 fix: fixed permission issue with api key with viewer role in dashboards with default permissions
(cherry picked from commit 24d0b43e62)
2018-06-19 11:14:33 +02:00
Marcus Efraimsson
9a1a9584b7 Merge pull request #12316 from grafana/v52_merge_master
Merge master to v5.2.x release branch
2018-06-18 11:50:48 +02:00
Marcus Efraimsson
8a69ffb007 Merge branch 'master' into v52_merge_master 2018-06-18 09:44:39 +02:00
Marcus Efraimsson
ab9f0e8edd changelog: add notes about closing #10707
[skip ci]
2018-06-18 09:03:30 +02:00
Marcus Efraimsson
18167f1c18 Merge pull request #12299 from grafana/10707_whitelist
auth proxy: whitelist proxy ip instead of client ip
2018-06-18 09:00:41 +02:00
Tim Heckman
a2ff7629e0 Include the vendor directory when copying source in to Docker (#12305)
This change updates the `.dockerignore` file to no longer contain the `vendor/`
directory. When a Go project provides a `vendor/` directory within the
repository, the best practice is to build that project using their vendored
dependencies. By putting it in the `.dockerignore` file we prevent consumers
from easily doing that.

The `vendor/` directory is used to include all of the dependencies needed to
build a project. This makes it so that we can reproducibly build the project, at
any given commit, because the dependencies will always be present. Also, using
the vendor directory avoids us needing to continually re-download all the
dependencies, and it protects us from build failures if GitHub is down or a
dependency gets removed or renamed.

In addition to the change above, this also removes an extra `/tmp` entry from
the `.dockerignore` file.

Fixes #12304

Signed-off-by: Tim Heckman <t@heckman.io>
2018-06-17 22:38:37 -07:00
bergquist
6782be80fd changelog: adds note about closing #12199 2018-06-16 16:59:15 +02:00
Carl Bergquist
e2adb4ced5 Merge pull request #12302 from grafana/12199_cloudwatch_panic
cloudwatch: handle invalid time range
2018-06-16 16:57:23 +02:00
Marcus Efraimsson
c02dd7462a cloudwatch: handle invalid time range 2018-06-15 15:48:25 +02:00
Marcus Efraimsson
b418e14bd9 make sure to use real ip when validating white listed ip's 2018-06-15 15:29:43 +02:00
bergquist
4be6ef4ab3 changelog: adds note about closing #12286 2018-06-15 12:47:53 +02:00
Carl Bergquist
e33d18701d Merge pull request #12287 from bergquist/fix_12286
Influxdb: add mode functions
2018-06-15 12:43:47 +02:00
Marcus Efraimsson
f0254c201a Merge pull request #12215 from ryantxu/use-ng-if-for-time
use ng-if for the panel timeInfo
2018-06-15 12:16:48 +02:00
Marcus Efraimsson
a02306bc75 Merge pull request #12295 from bergquist/docker_master
docs: adds info about grafana-dev container
2018-06-15 11:32:24 +02:00
bergquist
10d840b1cc docs: adds info about grafana-dev container 2018-06-15 11:07:23 +02:00
Marcus Efraimsson
551957fc4d changelog: add notes about closing #12282
[skip ci]
2018-06-15 10:57:19 +02:00
flopp999
2d1f59a9cc Added Litre/min and milliLitre/min in Flow (#12282)
units: Litre/min and milliLitre/min in Flow
2018-06-15 10:54:38 +02:00
Marcus Efraimsson
5f78ad583f remove papaparse dependency 2018-06-15 10:49:57 +02:00
Marcus Efraimsson
22c7c741eb Merge pull request #12252 from grafana/davkal/ifql-query
Internal Influx Flux plugin cleanup
2018-06-15 10:43:34 +02:00
Marcus Efraimsson
b62322b128 Merge pull request #12288 from mlclmj/master
docs: HTTP Endpoint for Deleting an Organization
2018-06-15 10:37:51 +02:00
Marcus Efraimsson
96287a9061 Merge pull request #12294 from vincent-fuchs/patch-1
docs: delete_datasources -> deleteDatasources in provisioning
2018-06-15 10:33:03 +02:00
Vincent Fuchs
c8becf57fa list name is deleteDatasources, not delete_datasources
fixes https://github.com/grafana/grafana/issues/12293
2018-06-15 12:19:53 +05:30
David Kaltschmidt
d5196ab322 remove internal influx ifql datasource 2018-06-14 20:42:33 +01:00
Malcolm Jones
2765afc830 Document the endpoint for deleting an org 2018-06-14 15:28:54 -04:00
bergquist
c63533f004 tests: rewrite into table tests 2018-06-14 20:33:36 +02:00
bergquist
bf4ee9bcc6 influxdb: adds mode func to backend
closes #12286
2018-06-14 20:33:22 +02:00
Marcus Efraimsson
56628996b7 Merge pull request #12280 from dehrax/12224-elastic-response
karma to jest: 6 test files
2018-06-14 17:24:36 +02:00
Marcus Efraimsson
0107491195 changelog: add notes about closing #11484
[skip ci]
2018-06-14 15:59:31 +02:00
Marcus Efraimsson
81d34137a8 Merge pull request #11484 from manacker/master
alerting: fix mobile notifications for microsoft teams notifier
2018-06-14 15:56:18 +02:00
Marcus Efraimsson
e6135ffd4f changelog: add notes about closing #11233
[skip ci]
2018-06-14 15:39:32 +02:00
Marcus Efraimsson
9dd38031e4 Merge pull request #11233 from flopp999/patch-2
units: W/m2(energy), l/h(flow) and kPa(pressure)
2018-06-14 15:36:38 +02:00
Tobias Skarhed
dbbd6b9b66 Remove import 2018-06-14 15:27:11 +02:00
Marcus Efraimsson
1626a66bab Merge pull request #12275 from dehrax/12224-exporter
karma to jest: exporter, playlist_edit_ctrl
2018-06-14 15:10:06 +02:00
Marcus Efraimsson
25e1d723c6 Merge pull request #12276 from grafana/davkal/expose-react-slate
Expose react and slate to external plugins
2018-06-14 14:41:30 +02:00
Tobias Skarhed
23abf044ff Fix PR feedback 2018-06-14 14:37:48 +02:00
David Kaltschmidt
5ec7d60e5f Removed papaparse from external plugin exports 2018-06-14 13:22:16 +01:00
Tobias Skarhed
ef0586acab Karma to Jest: query_builder 2018-06-14 14:20:42 +02:00
Marcus Efraimsson
284045748c Merge pull request #12243 from grafana/12236-ds-proxy-tokens
dsproxy: allow multiple access tokens per datasource
2018-06-14 14:03:08 +02:00
Marcus Efraimsson
99c188f626 Merge pull request #12273 from grafana/12247-link-icon
fix panel link icon positioning
2018-06-14 13:54:08 +02:00
Daniel Lee
10d30f0b73 dsproxy: move http client variable back
After refactoring to be able to mock the client in
a test, the client wasn't a global variable anymore.
This change moves the client back to being a package-
level variable.
2018-06-14 13:39:46 +02:00
Tobias Skarhed
283b39c397 Karma to Jest: threshold_mapper 2018-06-14 13:38:03 +02:00
David Kaltschmidt
eb686c06f2 Expose react and slate to external plugins
Experimental support for react in external plugins

- react
- slate (editor)
- papaparse (csv parsing)
- prismjs (syntax highlighting)

This is needed for new external datasource plugins like Flux
2018-06-14 12:32:57 +01:00
Tobias Skarhed
155ff06cbe Karma to Jest: threshold_manager 2018-06-14 13:22:17 +02:00
Tobias Skarhed
2465f53324 Karma to Jest: query_def, index_pattern 2018-06-14 12:18:11 +02:00
Tobias Skarhed
a911d36dea Remove import 2018-06-14 12:00:54 +02:00
Tobias Skarhed
04029a94cd Karma to Jest: elastic_response 2018-06-14 11:56:03 +02:00
Marcus Efraimsson
71b0326769 Merge pull request #12237 from dehrax/12224-version-panel
Convert tests from Karma to Jest
2018-06-14 10:13:46 +02:00
Patrick O'Carroll
8345e83bd6 changelog: notes about closing #12189 2018-06-14 10:05:11 +02:00
Patrick O'Carroll
9802d86783 Merge pull request #12189 from ryantxu/focus-panel-search
autoFocus the add-panel search filter, and add on enter
2018-06-14 09:54:41 +02:00
Tobias Skarhed
a3552a60e1 Improve test readability 2018-06-14 09:46:36 +02:00
Patrick O'Carroll
a0aa0b55e7 moved link icon in panel header 2018-06-14 09:24:51 +02:00
Tobias Skarhed
4dd9b8f324 Karma to Jest: playlist_edit_ctrl 2018-06-13 16:29:50 +02:00
Tobias Skarhed
94b8cbdc6a Karma to Jest: exporter 2018-06-13 15:15:36 +02:00
nikoalch
0cc8ccdaa5 Update graphite.md 2018-06-13 08:40:15 -04:00
Marcus Efraimsson
ff3db60e2e changelog: add notes about closing #10796
[skip ci]
2018-06-13 13:13:57 +02:00
Marcus Efraimsson
2288e01752 Merge pull request #12169 from alexanderzobnin/feat-10796
Import dashboard to folder
2018-06-13 13:10:52 +02:00
Marcus Efraimsson
c39979a557 Merge pull request #12255 from dehrax/docs-dev-grafana
Update "Building from source" docs
2018-06-13 12:46:45 +02:00
Alexander Zobnin
25504e84ed dashboard import to folder: minor fixes 2018-06-13 10:44:37 +03:00
Tobias Skarhed
c650b50c37 Docs: output location from build script 2018-06-13 09:37:14 +02:00
Carl Bergquist
d3a3e7cfd1 Merge pull request #12222 from PrincipalsOffice/remove-QueryOptionsCtrl-references
removed QueryOptionsCtrl references
2018-06-13 09:34:02 +02:00
Marcus Efraimsson
3b824a5e00 Merge pull request #12244 from kdombeck/patch-1
docs: correct provisioning link
2018-06-13 09:14:32 +02:00
Ken Dombeck
110522307a Correct Provisioning documentation link
It was pointing to Prometheus documentation instead.
2018-06-12 09:01:25 -07:00
Daniel Lee
719ebdc24d dsproxy: allow multiple access tokens per datasource
Changes the cache key for tokens to cache on datasource id +
route path + http method instead of just datasource id.
2018-06-12 17:39:38 +02:00
Daniel Lee
610a90b79a Merge pull request #12231 from dehrax/12224-graph-tooltip
Karma to Jest: graph-tooltip
2018-06-12 16:32:14 +02:00
Tobias Skarhed
72ecf72c45 Mock core in jest-setup 2018-06-12 16:14:22 +02:00
Tobias Skarhed
8155ce9804 Docs: Update Build from Source 2018-06-12 15:06:17 +02:00
Tobias Skarhed
d91e9ddd22 Convert tests from Karma to Jest 2018-06-12 13:54:07 +02:00
Marcus Efraimsson
d8f269954a changelog: add notes about closing #11963
[skip ci]
2018-06-12 13:10:48 +02:00
Patrick O'Carroll
0bb30b146c save-modal save button (#12047)
Disable save dashboard button when saving
2018-06-12 11:54:50 +02:00
Tobias Skarhed
da9a28f37d Karma to Jest: graph-tooltip 2018-06-11 15:59:20 +02:00
Jiang Ye
c92874875c removed QueryOptionsCtrl references 2018-06-09 16:06:03 -04:00
bergquist
dbaa45e51e update latest.json to 5.1.3 2018-06-09 21:26:07 +02:00
ryan
0a3ec93347 use ng-if 2018-06-08 15:49:30 +02:00
David Kaltschmidt
ab76864e61 hot-fix ifql testdatasource() 2018-06-08 14:56:48 +02:00
Carl Bergquist
5ed2880a8b Merge pull request #12202 from grafana/11486_sqlite
Upgrade mattn/go-sqlite3 to v1.7.0
2018-06-08 13:11:46 +02:00
Carl Bergquist
38864d74bd Merge pull request #12180 from grafana/deploy
Propagate specific git-sha into tarball and docker builds
2018-06-08 13:02:07 +02:00
bergquist
484d9e3f9d triggers grafana-docker master build 2018-06-08 12:44:01 +02:00
Patrick O'Carroll
77403b0dc1 changed som variables to values so it's the same for dark and light theme, added special styling for login text, link and input (#12196) 2018-06-07 11:03:58 -07:00
Marcus Efraimsson
c0830e9cde mattn/go-sqlite3 v1.6.0 to v1.7.0 2018-06-07 16:53:39 +02:00
Marcus Efraimsson
7d508df1b4 changelog: add notes about closing #11074
[skip ci]
2018-06-07 16:24:45 +02:00
Patrick O'Carroll
25f2960717 fixed so panel title doesn't wrap and (#12142)
dashboard: fix so panel titles doesn't wrap
2018-06-07 16:20:55 +02:00
Ryan McKinley
1f32871f70 Use Passive eventListener for 'wheel' (#12106)
* make wheel passive

* remove console
2018-06-07 03:41:50 -07:00
Marcus Efraimsson
3fb4eb7322 Merge pull request #12175 from grafana/davkal/12168-fix-explore-setting
Respect explore settings in config ini
2018-06-07 12:08:42 +02:00
ryan
09dbb52423 Merge remote-tracking branch 'grafana/master' into focus-panel-search
* grafana/master:
  nicer collapsed row behaviour (#12186)
  remove DashboardRowCtrl (#12187)
  Annotations support for ifql datasource
  Template variable support for ifql datasource
  Query helpers for IFQL datasource
2018-06-07 10:31:46 +02:00
David
82ae7c6eee Merge pull request #12167 from grafana/davkal/ifql-helpers
Query helpers, Annotations, and Template Variables for IFQL datasource
2018-06-07 10:24:21 +02:00
Ryan McKinley
17a2ce13f0 nicer collapsed row behaviour (#12186)
* nicer collapsed row behavior

* don't block events

* use a div to toggle

* use singular name
2018-06-06 21:58:42 -07:00
Ryan McKinley
415ad8fbf3 remove DashboardRowCtrl (#12187) 2018-06-06 21:57:30 -07:00
ryan
c71608aae8 add panel on enter 2018-06-07 03:08:39 +02:00
ryan
37c45a81a9 autoFocus the search filter 2018-06-07 02:48:54 +02:00
bergquist
f93d83befe adds missing return statement 2018-06-06 22:17:19 +02:00
Sławek Piotrowski
9db964bf35 Fix typo: eleasticsearch -> elasticsearch (#12184) 2018-06-06 13:09:16 -07:00
David Kaltschmidt
cdba2bd184 Annotations support for ifql datasource 2018-06-06 16:11:40 +02:00
Alexander Zobnin
8fd3015e52 dashboard: improve import UX for non-editor users
validate folderId, import only into available folders
2018-06-06 15:35:19 +03:00
David Kaltschmidt
2c86484e54 Template variable support for ifql datasource
* Implements findMetricQuery()
* Macros for template queries: measurements(), tags(), tag_values(),
 field_keys()
* Tests for macro expansion
2018-06-06 14:11:48 +02:00
Tom Wilkie
c47f40d99c Use cut to trim down the SHA1.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2018-06-06 12:07:47 +01:00
Alexander Zobnin
9460063ab5 show import menu in sidenav, dashboard search and manage dashboards page
if user has editor permissions for at least one folder
2018-06-06 13:55:00 +03:00
David Kaltschmidt
3bd58446d6 Fix metrics panel test by adding config mock 2018-06-06 11:15:24 +02:00
David Kaltschmidt
661503f828 Respect explore settings in config ini
Previous explore restrictions only took permissions into consideration.

* add `exploreEnabled` to global settings
* only bind `x` if enabled
* only show explore in panel menu if enabled
2018-06-06 10:50:47 +02:00
David Kaltschmidt
56fc82151b Add .html to webpack.hot resolve extensions 2018-06-06 09:12:06 +02:00
Tom Wilkie
681326140d Version the tarball uploaded to s3 and tell the next step about it.
Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
2018-06-05 20:02:51 +01:00
Alexander Zobnin
4ff4ac1d5f dashboard: import into current folder from manage folder page 2018-06-05 20:01:48 +03:00
Alexander Zobnin
393f41cd14 dashboard: add Import button to manage page 2018-06-05 19:37:47 +03:00
Alexander Zobnin
4063ae37a4 dashboard: import to folder 2018-06-05 19:23:09 +03:00
David Kaltschmidt
d7379912c1 Query helpers for IFQL datasource
* raw CSV preview next to query field (query inspector is not that
 useful here)
* added result table and record counts
2018-06-05 17:15:35 +02:00
David
45a156577c Merge pull request #12143 from grafana/davkal/ifql-datasource
InfluxDB IFQL datasource (beta)
2018-06-05 14:23:21 +02:00
Leonard Gram
9e7651a1b3 docs: docker secrets available in v5.2.0 2018-06-05 13:54:23 +02:00
David Kaltschmidt
64f5874778 Remove round-robin urls in ifql DS 2018-06-05 13:49:35 +02:00
David Kaltschmidt
1d587450b3 IFQL range variable expansion 2018-06-05 13:42:32 +02:00
Leonard Gram
eb66266629 changelog: release v5.2.0-beta1. 2018-06-05 10:57:18 +02:00
Leonard Gram
faa5e699d2 Release v5.2.0-beta1. 2018-06-05 10:43:14 +02:00
Marcus Efraimsson
cb9fc3f6b4 changelog: add notes about closing #11657
[skip ci]
2018-06-05 09:35:24 +02:00
Carl Bergquist
6d27c3d0c5 Merge pull request #12154 from grafana/11657_server_admin
Always show server admin link in sidenav if grafana admin
2018-06-05 08:02:05 +02:00
Marcus Efraimsson
962f996799 always show server admin link in sidenav if grafana admin 2018-06-04 19:28:01 +02:00
Marcus Efraimsson
d09749eaaa Merge pull request #12153 from grafana/googleOAuthDocs
update google auth config docs
2018-06-04 18:50:28 +02:00
Dan Cech
9b29a19609 update google auth config docs 2018-06-04 12:32:35 -04:00
Marcus Efraimsson
58406707f9 changelog: add notes about closing #11525
[skip ci]
2018-06-04 18:10:28 +02:00
Marcus Efraimsson
38c94bb633 Merge pull request #12117 from grafana/11525-dashlist-folder-picker
Fix search by folder in dashboard list panel
2018-06-04 18:08:38 +02:00
Torkel Ödegaard
9e59751c07 fix: fixed problem with expanding access mode help in ds settings 2018-06-04 18:05:16 +02:00
Torkel Ödegaard
ae82112c2e dep: use master branch for plugin model 2018-06-04 17:47:38 +02:00
David
95aef8241c Merge pull request #12146 from grafana/12144-new-variable-save
added if to check if new variable has been added
2018-06-04 17:26:48 +02:00
Patrick O'Carroll
d650dc94c9 fixed so default is all and general only show dashboards 2018-06-04 17:25:20 +02:00
Marcus Efraimsson
09a0a49c52 changelog: add notes about closing #11882
[skip ci]
2018-06-04 16:32:42 +02:00
Patrick O'Carroll
937b26f3fd added s to folderId in params 2018-06-04 16:28:24 +02:00
Patrick O'Carroll
89238b4a04 renamed variable in tests 2018-06-04 16:23:36 +02:00
Patrick O'Carroll
b122f53085 added comment, variableChange -> variableValueChange 2018-06-04 16:23:36 +02:00
Patrick O'Carroll
609b0fa498 added a test 2018-06-04 16:23:36 +02:00
Patrick O'Carroll
5e484e8393 added if to check if new variable has been added 2018-06-04 16:23:36 +02:00
Marcus Efraimsson
6281910591 Merge pull request #12037 from grafana/login-change-password
change admin password after first login
2018-06-04 16:21:45 +02:00
pari-
9680a3d44d Gravatar fallback does not respect 'AppSubUrl'-setting (#12149)
Closes #12148
2018-06-04 16:03:59 +02:00
David
b5c53aae97 Merge pull request #12108 from grafana/davkal/12001-explore-permissions
Restrict Explore UI to Editor and Admin roles
2018-06-04 16:01:39 +02:00
Patrick O'Carroll
cb6c6c8172 change admin password after first login 2018-06-04 16:01:09 +02:00
bergquist
574e92e1d8 changelog: adds note about closing #11958
[skip ci]
2018-06-04 16:00:44 +02:00
Carl Bergquist
7214ee9024 Merge pull request #12007 from bergquist/provisioning_symlinked_folders
Add support for symlinked folders in dashboard provisioning
2018-06-04 16:00:32 +02:00
Torkel Ödegaard
829af9425f revert: reverted singlestat panel position change PR #12004 2018-06-04 15:45:29 +02:00
bergquist
cd4026da6b Revert "provisioning: turn relative symlinked path into absolut paths"
This reverts commit d089b5e05d.
2018-06-04 15:38:37 +02:00
bergquist
d089b5e05d provisioning: turn relative symlinked path into absolut paths 2018-06-04 15:20:26 +02:00
Marcus Efraimsson
33ee1fba30 Merge pull request #12150 from grafana/12120_whats_new
Draft: What's new in v5.2
2018-06-04 15:17:31 +02:00
bergquist
c138ff2c90 changelog: adds note about closing #11670 2018-06-04 15:16:34 +02:00
Marcus Efraimsson
38906acda9 elasticsearch: sort bucket keys to fix issue wth response parser tests 2018-06-04 15:15:47 +02:00
Carl Bergquist
49d9235433 Merge pull request #12122 from grafana/provisioning_ha
Support provisioning in HA setup where modtime differs
2018-06-04 15:12:46 +02:00
Marcus Efraimsson
0d5579b4c0 docs: what's new in v5.2 2018-06-04 14:31:43 +02:00
David Kaltschmidt
08ee1da6b1 InfluxDB IFQL datasource 2018-06-04 12:24:47 +02:00
Marcus Efraimsson
7453df2662 changelog: add notes about closing #11167
[skip ci]
2018-06-04 11:57:13 +02:00
Marcus Efraimsson
e258f30704 Merge pull request #12129 from alexanderzobnin/fix-11167
alert list panel: show alerts for user with viewer role
2018-06-04 11:54:51 +02:00
Leonard Gram
e562ae753b docs: docker secrets support. (#12141)
Closes #12132
2018-06-04 11:49:12 +02:00
Alexander Zobnin
13c6f37ea5 alerting: show alerts for user with Viewer role
changelog: add notes about closing #11167

remove changelog note

reformat alert_test.go
2018-06-04 12:34:30 +03:00
Torkel Ödegaard
feb5e20779 datasource: added option no-direct-access to ds-http-settings diretive, closes #12138 2018-06-04 11:17:50 +02:00
bergquist
f606654c50 provisioning: adds fallback if evalsymlink/abs fails 2018-06-04 09:04:33 +02:00
bergquist
3f5078339c tests: uses different paths depending on os 2018-06-04 08:27:03 +02:00
bergquist
75ee1e9208 renames intervalSeconds to updateIntervalSeconds 2018-06-04 08:13:20 +02:00
Marcus Efraimsson
f5cf926364 changelog: add notes about closing #5893
[skip ci]
2018-06-01 15:23:26 +02:00
Marcus Efraimsson
b6afe5f2e8 Merge pull request #11380 from WPH95/feature/add_es_alerting
elasticsearch: alerting support
2018-06-01 15:17:28 +02:00
Marcus Efraimsson
b67872bc35 changelog: add notes about closing #11500, #8168, #6541
[skip ci]
2018-06-01 14:49:14 +02:00
Patrick O'Carroll
0c269d64d0 Alert panel filters (#11712)
alert list panel: filter alerts by name, dashboard, folder, tags
2018-06-01 14:36:40 +02:00
Marcus Efraimsson
ce75afa413 docs: update alerting docs with alerting support for elasticsearch 2018-06-01 12:26:20 +02:00
David
13a9701581 Update CHANGELOG.md
- added Prometheus query date alignment
2018-06-01 10:13:48 +02:00
bergquist
333af6fd9b provisioning: makes the interval for polling for changes configurable 2018-05-31 21:07:34 +02:00
bergquist
c817aecd66 provisioning: only update dashboard if hash of json changed 2018-05-31 21:05:52 +02:00
Marcus Efraimsson
b8ff3b1e3f remove dead code 2018-05-31 19:05:32 +02:00
Marcus Efraimsson
dcac63936b elasticsearch: minor refactor
Handle all replacements if interval template variables in the client.
Fix issue with client and different versions.
Adds better tests of the client
2018-05-31 19:02:20 +02:00
Marcus Efraimsson
28f0acd854 Merge branch 'master' into feature/add_es_alerting 2018-05-31 16:33:07 +02:00
Marcus Efraimsson
a2cd05f6db changelog: update
[skip ci]
2018-05-31 16:31:53 +02:00
Marcus Efraimsson
67410f7a4d changelog: add notes about closing #10748, #8805
[skip ci]
2018-05-31 15:48:19 +02:00
Patrick O'Carroll
37f9bdfc8c save modal ux improvements (#11822)
changes to save modal when saving an updated dashboard

Changed time range and variables are now not saved by default, 
you'll need to actively choose if you want to save updated time 
range and or variables.
2018-05-31 15:40:57 +02:00
Marcus Efraimsson
938deae4b4 changelog: add notes about closing #11515
[skip ci]
2018-05-31 15:24:01 +02:00
Marcus Efraimsson
a1b20bf69a Merge pull request #12092 from grafana/11515_import_uid
Validate uid when importing dashboards
2018-05-31 15:18:24 +02:00
bergquist
44f5b92fbc provisioning: only provision if json file is newer then db 2018-05-31 11:38:29 +02:00
David Kaltschmidt
0c45ee63a9 Guard /explore by editor role on the backend 2018-05-31 11:26:24 +02:00
bergquist
2bd4c14e5f make path absolute before following symlink 2018-05-31 09:53:15 +02:00
bergquist
47d3884377 provisioning: follow symlinked folders
fixes #11958
2018-05-31 09:38:09 +02:00
bergquist
d5aeae3a90 test: fixes broken test on windows 2018-05-31 08:27:29 +02:00
Carl Bergquist
5c30643f6e Merge pull request #12101 from bergquist/devenv
devenv: initial scripts for setting up devenv
2018-05-30 21:49:17 +02:00
Marcus Efraimsson
82ba27b5f2 changelog: add notes about closing #11771
[skip ci]
2018-05-30 21:31:31 +02:00
Marcus Efraimsson
d2296d332e Merge pull request #12107 from grafana/davkal/11771-hide-gridcontrols
Fix CSS to hide grid controls in fullscreen/low-activity views
2018-05-30 21:29:24 +02:00
Marcus Efraimsson
a4b1dd036d changelog: add notes about closing #11971
[skip ci]
2018-05-30 18:11:47 +02:00
Patrick O'Carroll
b894b5e669 Fix singlestat threshold tooltip (#12109)
fix singlestat threshold tooltip
2018-05-30 18:09:57 +02:00
Leonard Gram
b379b28337 build: only runs db related tests on db. 2018-05-30 16:27:47 +02:00
Leonard Gram
e33b17fac6 build: integration testing postegres on ci. 2018-05-30 16:27:47 +02:00
Leonard Gram
50d1519a91 build: mysql integration testing on ci. 2018-05-30 16:27:47 +02:00
David Kaltschmidt
827fb7e8de Fix karma tests that rely on MetricsPanelCtrl 2018-05-30 15:24:47 +02:00
Leonard Gram
21ecaae6ff changelog: Second epochs are now correctly converted to ms. 2018-05-30 14:30:01 +02:00
David Kaltschmidt
7224ca6c62 Fix panel menu test 2018-05-30 13:24:09 +02:00
David Kaltschmidt
f69654fcd5 Restrict Explore UI to Editor and Admin roles
Access is restricted via not showing in the following places:

* hide from sidemenu
* hide from panel header menu
* disable keybinding `x`

Also adds a `roles` property to reactContainer routes that will be
checked if `roles` is set, and on failure redirects to `/`.
2018-05-30 13:13:29 +02:00
David
7a3c1e162c Merge pull request #11942 from grafana/davkal/design-integration
Explore: Time selector, split view, design integration
2018-05-30 12:27:24 +02:00
David Kaltschmidt
ac1dda3b3a Fix CSS to hide grid controls in fullscreen/low-activity views
* there was a comma missing to hide the handles, fixed now
* added new styles to hide header interaction in full screen panels
2018-05-30 12:07:51 +02:00
David
40844614bf Merge pull request #12096 from grafana/davkal/11446-fix-systemjs-cachebust
Fix cache busting for systemjs imports for plugins
2018-05-30 10:05:46 +02:00
Marcus Efraimsson
f2942d94a5 changelog: add notes about closing #11645
[skip ci]
2018-05-30 09:26:15 +02:00
Kim Christensen
48fc5edda1 Support InfluxDB count distinct aggregation (#11658)
influxdb: support count distinct aggregation
2018-05-30 09:22:16 +02:00
bergquist
c7acbcdaf5 provisioning: enable relative path's
this commit enable relatives path for provisioning dashboards.
this enables easier dev setups
2018-05-30 08:46:44 +02:00
bergquist
f32e3a2960 changelog: note about closing #11858 2018-05-29 17:22:52 +02:00
Carl Bergquist
813a9a975f Merge pull request #12090 from grafana/11858_create_dashboard_link
Show create dashboard link if at least editor in one folder
2018-05-29 17:18:41 +02:00
bergquist
b253284acc devenv: improve readme 2018-05-29 16:52:02 +02:00
bergquist
1411709db1 provisioning: place testfiles within testdata folder 2018-05-29 16:30:12 +02:00
David
9b9e3962c5 Merge pull request #12072 from grafana/davkal/12024-fix-alignment
Changed Prometheus interval-alignment to cover whole panel range
2018-05-29 15:03:06 +02:00
Marcus Efraimsson
048ac3089b Merge branch 'master' into feature/add_es_alerting 2018-05-29 14:36:52 +02:00
Marcus Efraimsson
79575ea124 changelog: add notes about closing #11494
[skip ci]
2018-05-29 14:29:00 +02:00
Christophe Le Guern
3ba3fd9a59 Add new regions to handleGetRegions function (#12082)
As public/app/plugins/datasource/cloudwatch/partials/config.html and this file differ between the AWS regions available, I've updated the latest so they share the same data.
In that way, the regions() method in dashboards returns the same list as the frontend does.
2018-05-29 14:26:33 +02:00
Torkel Ödegaard
6e145ad32d Merge branch 'master' of github.com:grafana/grafana 2018-05-29 14:11:36 +02:00
Torkel Ödegaard
4c9b146bda PR: minor change to PR #12004 before merge 2018-05-29 14:11:05 +02:00
Marcus Efraimsson
2c8571a686 Merge pull request #12089 from bergquist/graphite_header
graphite: avoid distributed tracing headers in direct/browser mode
2018-05-29 14:07:18 +02:00
Torkel Ödegaard
249e682511 Merge branch 'master' of https://github.com/mammuthus/grafana 2018-05-29 14:04:54 +02:00
Torkel Ödegaard
be34417b3a fix: refactoring PR #11996 and fixing issue #11551 16706hashkey in json editors 2018-05-29 14:02:52 +02:00
bergquist
a1e6c31ec1 devenv: script for setting up default datasources 2018-05-29 14:00:46 +02:00
Torkel Ödegaard
634a26d2eb Merge branch 'remove_hash' of https://github.com/eMerzh/grafana 2018-05-29 13:25:44 +02:00
Torkel Ödegaard
ddd5e5ae70 tech: updated react-grid-layout to latest official release, closes #12100 2018-05-29 13:23:07 +02:00
David
c67d72db63 Merge pull request #12041 from grafana/davkal/11931-table-docs
Document table row merge for multiple queries
2018-05-29 12:08:55 +02:00
David Kaltschmidt
8bcd55d221 Fix cache busting for systemjs imports for plugins
* everything imported via systemjs in the path `plugin/` will get a
 timestamp appended for cache busting
* timestamp is set once on page load
* plugin css loader gets cache buster too
2018-05-29 12:01:10 +02:00
bergquist
6a82098ddf devenv: scripts for generating many unique dashboards 2018-05-29 11:52:00 +02:00
Marcus Efraimsson
e80f54c243 Merge pull request #12094 from grafana/elastic6-docker
docker: new block for elasticsearch6
2018-05-29 11:22:42 +02:00
Daniel Lee
fb41048dd7 docker: new block for elasticsearch6 2018-05-29 11:04:16 +02:00
Marcus Efraimsson
2d5ec9b9e4 changelog: add notes about closing #12087
[skip ci]
2018-05-29 10:50:13 +02:00
Marcus Efraimsson
1bc94c7d5a Merge pull request #12088 from thurt/12087-better-error-when-smtp-not-configured
inviting users: show friendlier error message when smtp is not configured
2018-05-29 10:46:46 +02:00
Leonard Gram
e6f2811b21 sql: seconds epochs are now correctly converted to ms.
Closes #12061
2018-05-29 08:44:03 +02:00
Marcus Efraimsson
7c3e8afd82 add validation of uid when importing dashboards 2018-05-28 22:34:40 +02:00
Brice Maron
01f80950de fix: add track by name in annotation list to avoid $$hashKey in json 2018-05-28 21:11:32 +02:00
bergquist
83b7bbd60b changelog: adds note about closing #9703 2018-05-28 20:55:11 +02:00
bergquist
add791b2cc Merge branch '9703-auth-proxy'
* 9703-auth-proxy:
  go fmt fixes
  configure proxy environments for Transport property
2018-05-28 20:49:40 +02:00
bergquist
d7b5fb4604 go fmt fixes 2018-05-28 20:48:01 +02:00
iyeonok
bafe25fbd9 configure proxy environments for Transport property
related issue: https://github.com/grafana/grafana/issues/9703
2018-05-28 20:48:01 +02:00
Marcus Efraimsson
7548d6f6d1 Show create dashboard link if at least editor in one folder 2018-05-28 20:37:39 +02:00
bergquist
e708e9ac3c graphite: avoid dtracing headers in direct mode
closes #11494
2018-05-28 20:35:19 +02:00
David Kaltschmidt
6d8d6cdb57 Fix sourcemaps for webpack hot config 2018-05-28 20:32:33 +02:00
thurt
b487aa3e6a return better error message when err is ErrSmtpNotEnabled
fixes #12087
2018-05-28 17:49:31 +00:00
Marcus Efraimsson
7cb0403faa elasticsearch: handle if alert query contains template variable
If datasource handles targetContainsTemplate function it can evaluate if a certain
query contains template variables and this is used for show an error message that
template variables not is supported in alert queries.
2018-05-28 19:45:18 +02:00
Marcus Efraimsson
e5e1683840 Merge branch 'master' into feature/add_es_alerting 2018-05-28 18:10:34 +02:00
bergquist
8d400b8f7b changelog: adds note about closing #9847 2018-05-28 17:50:36 +02:00
Ryan McKinley
17b9609209 Sparklines should scale to the data range (#12010)
* Add a full range option to sparklines

* line zero=false
2018-05-28 16:30:44 +02:00
Torkel Ödegaard
7b09dfe9a0 Merge branch 'davkal/split-webpack-config-hot' 2018-05-28 14:18:35 +02:00
David Kaltschmidt
ebe8e62bd5 Split webpack dev config into dev and hot
Motivation:

* too many conditionals for config, better to be explicit
* different priorities: faster build for hot mode
* working SCSS sources for styles in hot mode

The biggest differences:

* removed linter from TS loader in hot (should be editor or precommit
 or responsibility)
* simplified styles loading
* hot needs more extensions to resolve
* removed commons chunking for hot
* removed devServer from dev

Reduced HMR time from 8s to 4s on my machine.
2018-05-28 13:49:15 +02:00
David
ced8c5f0e4 Upgrade webpack loaders (#12081)
* upgrade all webpack loaders to recent version
* keep TS loader at 4.0.0 (5.0.0 requires webpack 4)
* remove unused json-loader
2018-05-28 13:46:57 +02:00
Marcus Efraimsson
5a96863eed pin versions of xorm to resolve sql tests
Resolves issue with postgres tests.
Also sets timezone of test instance and database to utc to resolve
mysql tests.
Closes #12065
2018-05-28 13:07:41 +02:00
Carl Bergquist
519e58a267 Merge pull request #12071 from grafana/12056_usage_stats
Additional anonymous usage stats
2018-05-28 11:23:16 +02:00
bergquist
a2ed0b15da build: fixes broken path for bra run
removes os and arch from binary path
when building in dev mode
2018-05-28 10:39:42 +02:00
Marcus Efraimsson
c9e9f25699 use sql builder for the get system stats sql query 2018-05-28 10:37:17 +02:00
Carl Bergquist
6c259eb04d Merge pull request #12077 from roidelapluie/logout
Fix #9847 Add a generic signout_redirect_url to enable oauth logout
2018-05-28 08:06:00 +02:00
Daniel Lee
de295af231 Merge pull request #12003 from mageo/master
Added Swiss franc currency
2018-05-28 01:13:21 +02:00
Julien Pivotto
a5e6cb9a02 Fix #9847 Add a generic signout_redirect_url to enable oauth logout
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2018-05-27 14:52:50 +02:00
David Kaltschmidt
750ea9bbdd Changed Prometheus interval-alignment to cover whole panel range
* the existing query date alignment shifts the range forward to match
a multiple epoch of the interval, but keeps the range length the same,
the result is that the start date is shifted forward as well, leaving a
gap in the graph (or a zero-line when null-as-zero was set, issue #12024)
* this pr extends the aligned range to cover the original start date as
well
2018-05-25 16:46:38 +02:00
bergquist
238139fad6 alerting: refactor tests 2018-05-25 16:12:34 +02:00
Marcus Efraimsson
fbc44025dc add usage stats for datasource access mode 2018-05-25 16:06:35 +02:00
David Kaltschmidt
27e7a28b37 Review feedback (heading, typos)
* iff and therefor
* mention merge in heading
* add note about checking query inspector
2018-05-25 14:47:46 +02:00
Marcus Efraimsson
2ea5b6fe33 add additional usage stats metrics
nr of folders
nr of folder permissions
nr of dashboard permissions
nr of snapshots
nr of teams
nr of provisioned dashboards
2018-05-25 14:33:37 +02:00
Marcus Efraimsson
a6a12d36d7 add tests for sending usage stats 2018-05-25 13:32:55 +02:00
David Kaltschmidt
448b1cbc15 Integrated dark theme for explore UI 2018-05-25 12:51:27 +02:00
Marcus Efraimsson
4752d7884a elasticsearch: adds some more/better debug logging to client 2018-05-25 10:31:56 +02:00
bergquist
21ade3f64f changelog: fix broken link to contributor 2018-05-25 10:14:13 +02:00
bergquist
94ee9c63a8 changelog: adds note about closing #11788 2018-05-25 07:41:15 +02:00
balyn
fac0333f47 The old code for centering removed
Old code removed
2018-05-24 19:35:04 +03:00
Torkel Ödegaard
80d694d205 Backend image rendering as plugin (#11966)
* rendering: headless chrome progress

* renderer: minor change

* grpc: version hell

* updated grpc libs

* wip: minor progess

* rendering: new image rendering plugin is starting to work

* feat: now phantomjs works as well and updated alerting to use new rendering service

* refactor: renamed renderer package and service to rendering to make renderer name less confusing (rendering is internal service that handles the renderer plugin now)

* rendering: now render key is passed and render auth is working in plugin mode

* removed unneeded lines from gitignore

* rendering: now plugin mode supports waiting for all panels to complete rendering

* fix: LastSeenAt fix for render calls, was not set which causes a lot of updates to Last Seen at during rendering, this should fix sqlite db locked issues in seen in previous releases

* change: changed render tz url parameter to use proper timezone name as chrome does not handle UTC offset TZ values

* fix: another update to tz param generation

* renderer: added http mode to renderer service, new ini setting [rendering] server_url
2018-05-24 15:26:27 +02:00
Carl Bergquist
ca7bbc44c0 Merge pull request #12050 from aarongarciah/patch-1
Fix typo in README.md
2018-05-24 15:18:56 +02:00
Aarón García Hervás
4c5e1cacfe Fix typo in README.md 2018-05-24 12:39:11 +02:00
Leonard Gram
f80810081b build: updates publisher to support arm archs for deb and rpm. 2018-05-24 11:12:10 +02:00
David Kaltschmidt
f5e351af8b Explore split view
* button to bring a up a duplicate explore area to compare
* side by side rendering of two explore components
* right component has close button
* left component has page title
2018-05-24 10:55:01 +02:00
David Kaltschmidt
23c9da6162 Fixed custom dates for react timepicker
* added jest tests for timepicker component
2018-05-24 10:55:01 +02:00
David Kaltschmidt
eadaff6191 Explore: Design integration
* style header like other grafana components
* use panel container for graph and same styles for query field
* fix typeahead CSS selector (was created outside of .explore)
* use navbar buttons for +/- of rows
* moved elapsed time under run query button
* fix JS error on multiple timeseries being returned
* fix color for graph lines
* show prometheus query errors
2018-05-24 10:55:00 +02:00
David Kaltschmidt
0d3f24ce54 Explore: time selector
* time selector for explore section
* mostly ported the angular time selector, but left out the timepicker
 (3rd-party angular component)
* can be initialised via url parameters (jump from panels to explore)
* refreshing not implemented for now
* moved the forward/backward nav buttons around the time selector
2018-05-24 10:55:00 +02:00
Leonard Gram
7a30f72902 Merge pull request #12046 from fg2it/package
fix names of foreign arch packages
2018-05-24 09:34:15 +02:00
Dan Cech
417db13efb Fix dashboard snapshot deletion (#12025)
* fix issue deleting dashboard snapshots by deleteKey, add dedicated endopoint for authenticated requests, update frontend, tests & docs.
2018-05-24 08:55:16 +02:00
fg2it
22638db532 fix names of foreign arch packages 2018-05-23 23:53:59 +02:00
Marcus Efraimsson
16c3566a87 elasticsearch: handle NaN values 2018-05-23 22:57:46 +02:00
Marcus Efraimsson
688f5b830c elasticsearch: metric and pipeline agg setting json encoding fix 2018-05-23 22:21:41 +02:00
Marcus Efraimsson
4436b8da12 elasticsearch: query interval override fix 2018-05-23 22:07:52 +02:00
Marcus Efraimsson
8870e3e85b elasticsearch: default interval fix
5s instead of 15s
2018-05-23 21:44:09 +02:00
Marcus Efraimsson
ed110bc312 Merge pull request #11967 from grafana/migrate-jquery-lodash-extended-to-ts
chore: migrate files to ts
2018-05-23 17:58:37 +02:00
David Kaltschmidt
61b296afad Document table row merge for multiple queries
* added section to table feature docs
* marked as 5.0+ feature
* concrete examples of what works and the limits
2018-05-23 17:08:54 +02:00
Leonard Gram
0bfbb1c161 Merge pull request #11920 from grafana/crosscompile
Crosscompile and packages Grafana on arm, windows, linux and darwin
2018-05-23 17:03:25 +02:00
Marcus Efraimsson
242689abe2 elasticsearch: pipeline aggregation fix for json encoding 2018-05-23 16:46:26 +02:00
Leonard Gram
bea4741a12 build: always build for all platforms. 2018-05-23 16:03:21 +02:00
Marcus Efraimsson
dce59ccff2 fix: remove deadcode to make gometalinter happy 2018-05-23 15:28:36 +02:00
Marcus Efraimsson
4840adff00 elasticsearch: refactor query handling and use new es simple client
Removes moment dependency.
Adds response parser tests (based on frontend tests).
Adds time series query tests (based on frontend tests).
Fixes various issues related to response parsing and building search request queries.
Added support for extended stats metrics and geo hash grid aggregations.
2018-05-23 15:09:58 +02:00
Marcus Efraimsson
e171ed8910 elasticsearch: new simple client for communicating with elasticsearch
Handles minor differences of es 2, 5 and 5.6.
Implements index pattern logic.
Exposes builders for building search requests.
2018-05-23 14:59:12 +02:00
Marcus Efraimsson
77400cef08 elasticsearch: refactor and cleanup
Move time series query logic to specific file.
Remove model parser and move to time series query file, adds parser test.
2018-05-23 14:36:41 +02:00
Marcus Efraimsson
1324a67cbd Merge branch 'master' into WPH95-feature/add_es_alerting 2018-05-23 14:35:45 +02:00
Carl Bergquist
64053e1954 Merge pull request #11788 from mtanda/prom_query_timeout
add query timeout option for Prometheus
2018-05-22 09:40:29 +02:00
Leonard Gram
1b85b2fca7 build: removes deploy from nightly while testing it. 2018-05-22 09:07:52 +02:00
Daniel Lee
6d6b509d27 Merge pull request #12020 from xginn8/patch-1
update provisioning.md
2018-05-21 18:14:33 +02:00
xginn8
68bc9dd9dc update provisioning.md
stylize & name datasources properly
2018-05-21 11:19:44 -04:00
Leonard Gram
5f98982a09 build: clean up the workflow filters. 2018-05-21 15:57:57 +02:00
Daniel Lee
de7a880d66 Revert "Conditionally select a field to return in ResponseParser for InfluxDB"
This reverts commit a101177b55.

Ref #12009
2018-05-21 15:47:29 +02:00
Daniel Lee
80f8fb1e02 Revert "Fix ResponseParser for InfluxDB to return only string values"
This reverts commit 92e5968f91.

Ref #12009
2018-05-21 15:46:23 +02:00
Mitsuhiro Tanda
067ceb178e Revert "move queryTimeout option to common setting"
This reverts commit 3ba59a1d66a2a3c07ccd04a48c403f0772fbef31.
2018-05-21 21:45:51 +09:00
Mitsuhiro Tanda
12ace5ab65 move queryTimeout option to common setting 2018-05-21 21:45:51 +09:00
Mitsuhiro Tanda
8ddcd67080 add query timeout option for Prometheus 2018-05-21 21:45:51 +09:00
Carl Bergquist
a376de56f2 Merge pull request #11934 from liquidm/improve_alert_docs
Improve alert docs
2018-05-21 14:34:58 +02:00
Leonard Gram
7b1e41abc6 build: crosscompilation for nightlies and releases. 2018-05-21 14:06:01 +02:00
Marcus Efraimsson
cebae40468 Merge pull request #11973 from grafana/11953-explore-metricpanel
explore: fixes #11953
2018-05-21 11:13:22 +02:00
mammuthus
0cfdd726f7 Singlestat value: vertical alignment fix
There is a problem with vertical alignment of Singlestat value - it's a bit lower then it has to be.
This hack fix it.
2018-05-20 21:28:53 +03:00
Alexandre Georges
2e67e3ba63 Added Swiss franc currency 2018-05-20 14:07:40 +02:00
bergquist
c40b0ea1df test: moves test files to testdata folder 2018-05-18 23:23:13 +02:00
Carl Bergquist
dd8c50e140 Merge pull request #11988 from bergquist/tag_release_script
build: script for tagging and pushing a release
2018-05-18 16:37:11 +02:00
Leonard Gram
7ca346e9f0 build: downloads and bundles phantomjs for darwin and windows. 2018-05-18 14:39:25 +02:00
Leonard Gram
3933cb6bf6 build: publisher updated to support more architectures and OSs. 2018-05-18 14:39:25 +02:00
Leonard Gram
803694f41b build: saves artifacts with the build 2018-05-18 14:39:25 +02:00
Leonard Gram
9123e0fca8 build: crossplatform build with packages.
Big thanks to @fg2it who created a POC as
well as the build container that this work
is based on.
2018-05-18 14:38:04 +02:00
Daniel Lee
5de2c99c32 Merge pull request #11976 from steakunderscore/master
Adds constant description for units
2018-05-18 13:29:10 +02:00
bergquist
f565800a51 build: script for tagging and pushing a release 2018-05-18 13:07:26 +02:00
Torkel Ödegaard
a73365c3fe codespell: fixes 2018-05-18 11:49:00 +02:00
Torkel Ödegaard
d0c17100cb fix: fixed some minor startup logging issues 2018-05-18 11:17:31 +02:00
Torkel Ödegaard
6c0752473a Sqlstore refactor (#11908)
* refactor: tracing service refactoring

* refactor: sqlstore to instance service

* refactor: sqlstore & registory priority

* refactor: sqlstore refactor wip

* sqlstore: progress on getting tests to work again

* sqlstore: progress on refactoring and getting tests working

* sqlstore: connection string fix

* fix: not sure why this test is not working and required changing expires

* fix: updated grafana-cli
2018-05-18 11:10:10 +02:00
Henry Jenkins
f7c9fe6abc Adds constant description for units
Makes `km/h` constant with distances
2018-05-17 17:55:13 +01:00
bergquist
78e837cf39 test: increase expire time to avoid tz issues in tests 2018-05-17 14:59:50 +02:00
Daniel Lee
f15919555b explore: fixes #11953 2018-05-17 14:56:15 +02:00
Patrick O'Carroll
1ab2928f9d migrated files to ts, removed unused functions from lodash_extended 2018-05-17 14:24:49 +02:00
Daniel Lee
75993971c6 docs: installation pages for 5.1.3 2018-05-16 21:48:26 +02:00
Daniel Lee
66c4a04dec changelog: add note for #11830 2018-05-16 17:46:32 +02:00
Daniel Lee
b086981e15 Merge pull request #11954 from grafana/11830-firefox-legend
legend: fixes Firefox/baron scroll bug
2018-05-16 16:49:42 +02:00
Daniel Lee
574baa7151 Merge pull request #11719 from mtanda/annotation_on_non_editable_dashboard
create annotation on non-editable dashboard
2018-05-16 15:18:32 +02:00
Daniel Lee
3305ac1f36 Merge pull request #11946 from grafana/11937-panel-content
scroll: temporary fix for double scrollbar issue
2018-05-16 15:16:44 +02:00
Daniel Lee
50026fad2e legend: fixes Firefox/baron scroll bug
Compensates for Firefox scrollbar calculation error in the baron framework.
Offsetwidth and clientwidth are used to find the width of the scrollbar. In
the legend these differ by 9px and cause the scroll div to grow by 9px for
every refresh. This fix compensates with a negative margin-right in that
case.

Fixes #11830
2018-05-16 15:08:22 +02:00
Mitsuhiro Tanda
87c9c47579 use canMakeEditable 2018-05-16 11:58:51 +09:00
Mitsuhiro Tanda
fe301142ba allow to add annotation for non editable dashboard 2018-05-16 11:51:28 +09:00
Daniel Lee
567fec402e scroll: temporary fix for double scrollbar issue
If #11939 is not merged in the patch release, then
this is a temporary fix for 5.1.3. It sets overflow to
hidden for larger screens and keeps the overflow set to
auto for mobiles and tablets.

Fixes #11937
2018-05-16 00:19:15 +02:00
Carl Bergquist
0841e67da8 Merge pull request #11940 from alexanderzobnin/plugin-meta-field
backend plugins: expose meta field
2018-05-15 20:20:28 +02:00
Alexander Zobnin
214b9af5a3 backend plugins: log an error if parsing meta field failed 2018-05-15 20:59:24 +03:00
Alexander Zobnin
4533f22871 backend plugins: expose meta field 2018-05-15 15:33:05 +03:00
Stuart McLean
c09c00a1f5 fixes following first code review 2018-05-15 10:06:26 +02:00
Stuart McLean
295169b94f add useful note to alerting api docs 2018-05-14 20:50:44 +02:00
Stuart McLean
2dd40eb4e4 improve alerting api docs sample responses 2018-05-14 20:50:08 +02:00
Marcus Efraimsson
b8c4aa3936 Merge pull request #11926 from grafana/davkal/fix-phantomjs-render
Use babel and hot loader only in yarn start
2018-05-14 13:47:35 +02:00
David
65f9970a3e Merge pull request #10434 from craig-miskell-fluxfederation/prometheus_align_queries
Align queries to prometheus with the step
2018-05-14 12:30:55 +02:00
David Kaltschmidt
a1b92369db Merge remote-tracking branch 'origin/master' into prometheus_align_queries
* origin/master: (21 commits)
  docs: removes notes about beeing introduced in 5.0
  lock caniuse-db version to resolve phantomjs rendering issue
  Update dashboard_permissions.md
  move database-specific code into dialects (#11884)
  refactor: tracing service refactoring (#11907)
  fix typo in getLdapAttrN (#11898)
  docs: update installation instructions targeting v5.1.2 stable
  changelog: add notes about closing #11862, #11656
  Fix dependencies on Node v10
  Update dashboard.md
  changelog: add notes about closing #10338
  Phantom render.js is incorrectly retrieving number of active panels (#11100)
  singlestat: render time of last point based on dashboard timezone (#11425)
  Fix for #10078: symbol "&" is not escaped (#10137)
  Add alpha color channel support for graph bars (#10956)
  interpolate 'field' again in Elasticsearch terms queries (#10026)
  Templating : return __empty__ value when all value return nothing to prevent elasticsearch syntaxe error (#9701)
  http_server: All files in public/build have now a huge max-age (#11536)
  fix: ldap unit test
  decrease length of auth_id column in user_auth table
  ...
2018-05-14 12:11:14 +02:00
David Kaltschmidt
e731c248d7 Prometheus step alignment: shift interval only on jitter
* only increase interval by step if jitter happened
* shift both start and end
* simplified tests by using low epoch numbers
2018-05-14 12:08:30 +02:00
David Kaltschmidt
dd66cbc847 Use babel and hot loader only in yarn start
* moved babel rules for hot reloading into TS loader
* toggling use of babel via HOT variable (true with `yarn start`)
* overriding webpack output when HOT to fix asset paths in dashboard
 urls like http://localhost:3333/d/...
2018-05-14 11:58:15 +02:00
bergquist
ca25a25386 docs: removes notes about beeing introduced in 5.0 2018-05-14 09:51:23 +02:00
Marcus Efraimsson
d3f516f1c4 Merge branch 'master' into WPH95-feature/add_es_alerting 2018-05-12 11:33:58 +02:00
Marcus Efraimsson
95285aa09f Merge pull request #11917 from grafana/fix_phantomjs
resolve phantomjs rendering in production build
2018-05-11 14:24:52 +02:00
Marcus Efraimsson
8ed856c64f lock caniuse-db version to resolve phantomjs rendering issue
For some reason a newer version of this sub-dependency makes phantomjs
rendering unable to generate and save a png image, however without
any error message logged
2018-05-11 14:10:54 +02:00
Marcus Efraimsson
26e1b3a3fa Merge pull request #11914 from b4456609/patch-1
docs: update dashboard_permissions.md
2018-05-11 09:21:23 +02:00
Bernie
1157542f70 Update dashboard_permissions.md
miss { in repsponse
2018-05-11 10:19:28 +08:00
Dan Cech
1dfff74da9 move database-specific code into dialects (#11884) 2018-05-10 16:54:21 +02:00
Torkel Ödegaard
27e1c67453 refactor: tracing service refactoring (#11907) 2018-05-10 16:51:55 +02:00
Dan Cech
bc64754364 fix typo in getLdapAttrN (#11898) 2018-05-09 20:26:17 +02:00
Marcus Efraimsson
486aaca109 docs: update installation instructions targeting v5.1.2 stable 2018-05-09 14:03:22 +02:00
Marcus Efraimsson
4dfaab4c5b changelog: add notes about closing #11862, #11656
[skip ci]
2018-05-09 10:45:40 +02:00
Daniel Lee
2c3b8bb035 Merge pull request #9910 from jeroenj/patch-1
Adding a user in a specified organisation uses the admin API
2018-05-08 23:09:25 +02:00
Daniel Lee
377b78102d Merge pull request #11888 from simPod/fix-node10
Fix dependencies on Node v10
2018-05-08 23:03:51 +02:00
Simon Podlipsky
4565676233 Fix dependencies on Node v10 2018-05-08 22:18:58 +02:00
Carl Bergquist
fa9a95f645 Merge pull request #11887 from simPod/patch-1
Update dashboard.md
2018-05-08 21:27:32 +02:00
Šimon Podlipský
ef60d89742 Update dashboard.md 2018-05-08 21:25:45 +02:00
Torkel Ödegaard
c79b1bef15 Merge branch 'master' into master 2018-05-08 21:23:34 +02:00
Marcus Efraimsson
cde347bd3d Merge branch 'master' into WPH95-feature/add_es_alerting 2018-05-08 17:13:08 +02:00
Marcus Efraimsson
77421531d0 changelog: add notes about closing #10338
[skip ci]
2018-05-08 16:18:54 +02:00
Adrian Muraru
5377b82612 Phantom render.js is incorrectly retrieving number of active panels (#11100)
Fixes #11099
2018-05-08 16:05:22 +02:00
Marcus Efraimsson
ef0b7bda6f singlestat: render time of last point based on dashboard timezone (#11425)
* singlestat: render time of last point based on dashboard timezone

* changelog: add note for #10338
2018-05-08 15:59:29 +02:00
Angrite
e52aceeaba Fix for #10078: symbol "&" is not escaped (#10137)
Fix for #10078: Render value as link in Table panel: ampersand symbol "&" is not escaped in link URL, resulting URL is wrong.
2018-05-08 15:47:09 +02:00
Chris Rice
10f934d287 Add alpha color channel support for graph bars (#10956)
* Set fillColor in bars on load and on color change

* Change bar fill color on color override

* Added test for series overrides

* Moved bars fill color setting into time_series. Fixed issue with prev commit where you could not show bars because of series overrides.
2018-05-08 15:18:57 +02:00
Andrew Richards
3095dabe3c interpolate 'field' again in Elasticsearch terms queries (#10026)
* interpolate 'field' again in Elasticsearch terms queries

Fix for #8662 which was regressed in commit e4950c2dc1 (the field 'field' was no longer interpolated)

* remove unnecessary check for existence of field 'field'
2018-05-08 15:17:16 +02:00
Seuf
1888708ca5 Templating : return __empty__ value when all value return nothing to prevent elasticsearch syntaxe error (#9701) 2018-05-08 14:04:20 +02:00
Thibaut Patel
bdb736a9ee http_server: All files in public/build have now a huge max-age (#11536) 2018-05-08 13:54:00 +02:00
Marcus Efraimsson
219118ef4a Merge pull request #11867 from grafana/11862_migration
decrease length of auth_id column in user_auth table
2018-05-08 13:10:22 +02:00
Torkel Ödegaard
869d8e6f0e fix: ldap unit test 2018-05-08 12:50:39 +02:00
David
06aca5e8b5 Merge branch 'master' into prometheus_align_queries 2018-05-08 12:22:55 +02:00
bergquist
65352dccc0 only error log when err is not nil 2018-05-08 11:59:27 +02:00
bergquist
b649358734 rename alerting engine to service 2018-05-08 11:56:30 +02:00
Tomasz Torcz
e1b9d361ed case-insensitive LDAP group comparison (#9926)
* ldap: case-insensitive LDAP group comparison

According to RFC2251 4.1.5, LDAP strings are case-insensitive. Disregard case when comparing group mappings.

* ldap: add test for case-insensitive group mapping
2018-05-08 11:47:23 +02:00
Marcus Efraimsson
3d9ea3f1fa changelog: add notes about closing #11813
[skip ci]
2018-05-08 11:36:05 +02:00
Torkel Ödegaard
4aae3c6c05 Merge branch 'master' of github.com:grafana/grafana 2018-05-08 11:33:13 +02:00
Torkel Ödegaard
cec783ca2c docs: updated changelog 2018-05-08 11:30:52 +02:00
Alexander Zobnin
00454b32f5 fix XSS vulnerabilities in dashboard links (#11813)
fix XSS vulnerabilities in dashboard links
2018-05-08 11:28:16 +02:00
Torkel Ödegaard
1c886940ff Merge branch 'jereksel-feature/save_json' 2018-05-08 11:25:20 +02:00
Torkel Ödegaard
eb3aa7b193 PR: ux changes to #11528 2018-05-08 11:24:20 +02:00
Torkel Ödegaard
6a5ce09b08 Merge branch 'feature/save_json' of https://github.com/jereksel/grafana into jereksel-feature/save_json 2018-05-08 10:54:26 +02:00
bergquist
7e9a10a5fb renames alerting engine to match other services 2018-05-08 10:53:42 +02:00
Dan Cech
93a8d8a25b allow analytics.js to be cached, enable anonymizeIP setting (#11656) 2018-05-08 10:48:27 +02:00
Torkel Ödegaard
a2b864dd6b Update CHANGELOG.md 2018-05-08 10:23:28 +02:00
Torkel Ödegaard
f84534adea Revert "Add baron scrollbar to a node managed by gafana (#11850)"
This reverts commit 34133671b9.
2018-05-08 09:45:08 +02:00
Torkel Ödegaard
4b61c7cd55 Merge branch 'influx-db-select-query-variable' 2018-05-08 09:29:53 +02:00
Marcus Efraimsson
8ed79d614b decrease length of auth_id column in user_auth table
certain mysql versions don't support having indices with a greater varchar length
than 190.
2018-05-08 09:26:28 +02:00
Carl Bergquist
8d13276844 Merge pull request #11852 from grafana/davkal/super-simple-docker
Support for local Docker builds
2018-05-08 09:17:01 +02:00
Torkel Ödegaard
b894a5ff16 Merge branch 'am/fix-query-variable-influxdb' of https://github.com/forzafootball/grafana into influx-db-select-query-variable 2018-05-08 09:01:58 +02:00
Patrick O'Carroll
8f0c8005af fixed svg background (#11848) 2018-05-08 06:40:34 +02:00
Ryan McKinley
34133671b9 Add baron scrollbar to a node managed by gafana (#11850)
* Add baron scroller to grafana panel, not plugin panel

* remove comment about root <div> element, since it will not be true
2018-05-08 06:39:12 +02:00
David
ed067e8d35 Fix CSS asset loading for yarn start (HMR) (#11855)
* enable url() processing in CSS to ensure assets load in HMR mode
* only needed when running `yarn start` which needs this for the hot
reloader
2018-05-07 17:02:55 +02:00
Torkel Ödegaard
4c6e4e2aa6 fix: fixed gometalinter issues with Discord PR 2018-05-07 17:01:31 +02:00
Carl Bergquist
23738ad4ac Merge pull request #11801 from grafana/provision-service-refactor
Server shutdown flow rewrite & provision service refactor
2018-05-07 16:32:26 +02:00
David
1236b7b918 Merge pull request #11770 from grafana/davkal/explore-panel-link
Explore: Add entry to panel menu to jump to Explore
2018-05-07 16:31:19 +02:00
Torkel Ödegaard
b170bde74f Update CHANGELOG.md 2018-05-07 15:44:34 +02:00
Torkel Ödegaard
c46a3c8646 Merge branch 'jereksel-feature/discord' 2018-05-07 15:41:10 +02:00
Torkel Ödegaard
e5e8b9800c merge: fixed conflicts in discord PR 2018-05-07 15:40:43 +02:00
Marcus Efraimsson
23c88a3b3f docs: update installation instructions targeting v5.1.1 stable 2018-05-07 14:57:18 +02:00
Dan Cech
29c9d3f74c fix root_url in docs & comments (#11819)
* fix root_url in docs & comments

* include ports in docker-compose config
2018-05-07 14:18:21 +02:00
Marcus Efraimsson
b804f6d999 changelog: 5.1.1 update
add notes about closing #11743 and add release data for 5.1.1
[skip ci]
2018-05-07 14:09:04 +02:00
Torkel Ödegaard
249c1e8d3d fix: loading of css url (images/fonts) 2018-05-07 14:02:38 +02:00
David Kaltschmidt
c3cc60b080 Support for local Docker builds
* add a git-ignored `local/` folder for Makefile/Dockerfile
* import `local/Makefile` to root Makefile
* add `.dockerignore`
2018-05-07 12:32:18 +02:00
Torkel Ödegaard
afec9ec5be Update ROADMAP.md 2018-05-07 11:16:59 +02:00
Dan Cech
543c7fe587 support additional fields in authproxy (#11661) 2018-05-07 10:39:16 +02:00
Dan Cech
b4ad044044 better handling for special chars in db config (#11662) 2018-05-07 10:33:33 +02:00
Florian Plattner
5d54bc00e1 Fix/improved csv output (#11740)
* fix: initial cleanup and implementation

* feat: finish special character escaping

* feat: updates fileExport to generate RFC-4180 compliant CSV

* chore: replace html decoder with the lodash version and final cleanup

* fix: restore character html decoding
2018-05-07 10:22:54 +02:00
Torkel Ödegaard
871b85f199 Update ROADMAP.md 2018-05-07 10:16:39 +02:00
Torkel Ödegaard
ec7703bad7 Update ROADMAP.md 2018-05-07 10:14:04 +02:00
Torkel Ödegaard
217d43e512 Update ROADMAP.md 2018-05-07 10:13:39 +02:00
Carl Bergquist
06623506d3 Merge pull request #11805 from simPod/missing-lock
Add missing items to Gopkg.lock
2018-05-07 10:08:05 +02:00
Torkel Ödegaard
fb7db147ed Merge remote-tracking branch 'origin/11809-permission-dropdown' 2018-05-07 09:49:38 +02:00
Šimon Podlipský
1fbac909cb Remove preceding / from public JS path (#11804) 2018-05-07 08:11:48 +02:00
Ryan McKinley
2ee59ccad8 Add panel scrolling docs (#11826) 2018-05-07 08:03:30 +02:00
Marcus Efraimsson
e078e2733f Merge pull request #11803 from svenklemm/whatsnew51-table
Fix variable interpolation examples in whats new in 5.1 docs
2018-05-06 08:45:02 +02:00
Sven Klemm
ed4dc241cc escape pipe symbol same way as in templating docs 2018-05-05 10:47:44 +02:00
Marcus Efraimsson
8523b1e410 changelog: add notes about closing #11616
[skip ci]
2018-05-04 15:03:30 +02:00
Marcus Efraimsson
d0753949bc Merge pull request #11794 from grafana/11616-timepicker-buttons
fix dark/light theme date selector styling in timepicker control
2018-05-04 14:55:56 +02:00
Patrick O'Carroll
515eab2405 added left:unset to counter left:0 in recent react-select release 2018-05-04 11:46:17 +02:00
Patrick O'Carroll
c897485958 fixed text color in light theme 2018-05-04 10:30:42 +02:00
Marcus Efraimsson
4d2e6b4a34 changelog: add notes about closing #11800
[skip ci]
2018-05-03 19:13:57 +02:00
Marcus Efraimsson
6eba9c2438 Merge pull request #11802 from svenklemm/variable-interpolation
dont shadow format passed in as function parameter in replace function in templatesrv
2018-05-03 19:09:40 +02:00
Sven Klemm
a806f542c6 test if default variable interpolation is effective when no specific
format is specified
2018-05-03 18:42:58 +02:00
Marcus Efraimsson
8a9da4ba66 changelog: notes about closing #11690
[skip ci]
2018-05-03 18:42:14 +02:00
Marcus Efraimsson
da8f6c150b Merge pull request #11751 from mtanda/11690
fix to match table column name and order
2018-05-03 18:33:46 +02:00
Daniel Lee
d518ed5330 changelog: add notes for ##11754, #11758, #11710 2018-05-03 15:46:21 +02:00
Daniel Lee
2c10f29b0f Merge pull request #11784 from grafana/11754_auth_migration
increase length of auth_id column in user_auth table
2018-05-03 15:30:38 +02:00
Daniel Lee
7db9cc3bf0 Merge pull request #11796 from alexanderzobnin/fix-11710
scroll: fix scrolling on mobile Chrome
2018-05-03 15:18:29 +02:00
Marcus Efraimsson
99257eb048 Merge branch 'master' of git://github.com/grafana/grafana into WPH95-feature/add_es_alerting 2018-05-03 12:03:04 +02:00
Alexander Zobnin
83d599670d scroll: remove firefox scrollbars 2018-05-03 11:54:02 +03:00
Simon Podlipsky
fc0a4b34a1 Add missing items to Gopkg.lock 2018-05-03 01:25:52 +02:00
Sven Klemm
f52920aa01 pipe escape try #3 2018-05-03 00:23:35 +02:00
Sven Klemm
7f8dacd087 use ascii code for pipe symbol to not mess up markdown table 2018-05-03 00:19:47 +02:00
Sven Klemm
fc7d876158 try to fix table 2018-05-03 00:17:18 +02:00
Sven Klemm
764fa15e24 dont shadow format passed in as function parameter 2018-05-02 23:03:37 +02:00
Torkel Ödegaard
c40a50829d fix: removed manully added http server from inject graph as it is now a self registered service 2018-05-02 21:30:15 +02:00
Torkel Ödegaard
b5e70d4607 fix: removed unused channel 2018-05-02 19:56:15 +02:00
Torkel Ödegaard
e3ea6c683c fix: comment spell fix 2018-05-02 19:56:15 +02:00
Torkel Ödegaard
23655315b8 fix: fixed race condition between http.Server ListenAndServe & Shutdown, now service crash during startup correctly closes http server every time 2018-05-02 19:56:15 +02:00
Torkel Ödegaard
d04ad835e2 refactoring: lots of refactoring around server shutdown flows, making sure process is terminated when background service has crashed 2018-05-02 19:56:15 +02:00
Torkel Ödegaard
053c2039bb refactor: provisioning service refactoring 2018-05-02 19:56:15 +02:00
Torkel Ödegaard
14bb7832af Metrics package now follows new service interface & registration (#11787)
* refactoring: metrics package now follows new service interface & registration

* fix: minor fix, make sure metrics service is imported, by grafana-server
2018-05-02 19:54:07 +02:00
Marcus Efraimsson
04d071aaa3 Merge pull request #11797 from grafana/revert-11775-unindent
Revert "Opportunities to unindent code (unindent)"
2018-05-02 14:19:55 +02:00
Marcus Efraimsson
de0d409a23 Revert "Opportunities to unindent code (unindent)" 2018-05-02 14:06:46 +02:00
Alexander Zobnin
64283408ee scroll: fix scrolling on mobile Chrome (#11710) 2018-05-02 12:43:25 +03:00
Marcus Efraimsson
6dcb9e696d changelog: add notes about closing #11625
[skip ci]
2018-05-02 11:19:22 +02:00
Marcus Efraimsson
f17100e98e Merge pull request #11786 from marefr/11625_save_as
dashboard: show save as button if user has edit permission

This will show the "Save As..." button in dashboard settings page if the user 
has edit permissions (org role admin/editor or viewers_can_edit enabled) 
and has at least edit permission in any folder.
2018-05-02 11:15:22 +02:00
Marcus Efraimsson
1f21b3e23b remove jest it.only to not skip important tests 2018-05-02 10:54:00 +02:00
Patrick O'Carroll
3dd073f98d fixed so all buttons are styled not just small ones, fixes #11616 2018-05-02 09:56:53 +02:00
Carl Bergquist
6ed69e3d93 Merge pull request #11775 from knweiss/unindent
Opportunities to unindent code (unindent)
2018-05-01 16:03:06 +02:00
Torkel Ödegaard
2b93cbbf04 --amend 2018-05-01 14:18:10 +02:00
Torkel Ödegaard
13e015fe3f fix: improved handling of http server shutdown 2018-05-01 14:14:11 +02:00
Mitsuhiro Tanda
253b2cc081 add test for prometheus table column title 2018-05-01 05:00:56 +09:00
David Kaltschmidt
8a53ec610b Fix url encoding, expand template vars, fix TS hacks
* moved datasource related functions to panel sub-class
* expand panel template vars for url
* added keybindings for x -> Explore
* url encoding for explore state
2018-04-30 17:44:30 +02:00
David Kaltschmidt
05b0bfafe4 Explore: Add entry to panel menu to jump to Explore
* panel container menu gets new Explore entry (between Edit and Share)
* entry only shows if datasource has `supportsExplore` set to true (set
 for Prometheus only for now)
* click on Explore entry changes url to `/explore/state` via location provider
* `state` is a JSON representation of the panel queries
* datasources implement `getExploreState()` how to turn a panel config into explore initial
 state
* Explore can parse the state and initialize its query expressions
* ReactContainer now forwards route parameters as props to component
* `pluginlist` and `singlestat` panel subclasses needed to be adapted because
 `panel_ctrl` now has the location provider as a property already
2018-04-30 17:44:28 +02:00
Marcus Efraimsson
0fc4da810f changelog: notes about closing #11498
[skip ci]
2018-04-30 16:33:27 +02:00
Marcus Efraimsson
b0349bc795 Merge pull request #11575 from alexanderzobnin/fix-11498
Histogram: fix invisible highest value bucket
2018-04-30 16:32:21 +02:00
Torkel Ödegaard
fa7d7ed5df Initial Baby Step to refactoring settings from global vars to instance (#11777)
* wip: start on refactoring settings

* settings: progress on settings refactor

* refactor: progress on settings refactoring

* fix: fixed failing test

* settings: moved smtp settings from global to instance
2018-04-30 16:21:04 +02:00
Daniel Lee
fc718b8a9a table: fix for padding
The table-panel-wrapper class got removed when clicking on the panel
menu which resulted in extra padding for the .panel-content div. This
fixes that by setting the table-specific css class lower down in the
html.
2018-04-30 16:17:37 +02:00
Alexander Zobnin
b16626c3b5 graph histogram: fix invisible highest value bucket 2018-04-30 16:12:31 +02:00
Marcus Efraimsson
5c57c7cff5 dashboard: show save as button if can edit and has edit permission to folders 2018-04-30 15:38:46 +02:00
Marcus Efraimsson
770acee56a new property for current user indicating if edit permissions in folders 2018-04-30 15:34:31 +02:00
Marcus Efraimsson
3d9b7a5892 increase length of auth_id column in user_auth table 2018-04-30 14:41:52 +02:00
Marcus Efraimsson
4f7791b9fa fix dropdown typeahead issue
New explore feature overriding css for dropdown typeahead component.
2018-04-30 11:50:50 +02:00
Karsten Weiss
893a91af3a Use opportunities to unindent code (unindent)
This commit fixes the following unindent findings:
pkg/api/common.go:102:2: "if x { if y" should be "if x && y"
pkg/components/dynmap/dynmap.go:642:2: invert condition and early return
pkg/components/dynmap/dynmap.go:681:2: invert condition and early return
pkg/components/simplejson/simplejson.go:171:2: "if x { if y" should be "if x && y"
pkg/middleware/dashboard_redirect.go:42:3: invert condition and early return
pkg/tsdb/mssql/mssql.go:301:3: invert condition and early break
pkg/tsdb/mysql/mysql.go:312:3: invert condition and early break
pkg/tsdb/postgres/postgres.go:292:3: invert condition and early break
pkg/tsdb/sql_engine.go:144:2: invert condition and early return
2018-04-28 10:53:16 +02:00
Carl Bergquist
c5419ba885 Merge pull request #11774 from knweiss/golint
Fix golint warnings
2018-04-28 09:40:56 +02:00
Karsten Weiss
de8696d5d3 Outdent code after if block that ends with return (golint)
This commit fixes the following golint warnings:
pkg/bus/bus.go:64:9: if block ends with a return statement, so drop this else and outdent its block
pkg/bus/bus.go:84:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:137:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:177:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:183:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:199:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:208:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/components/dynmap/dynmap.go:236:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:242:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:257:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:263:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:278:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:284:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:299:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:331:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:350:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:356:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:366:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:390:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:396:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:405:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:427:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:433:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:442:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:459:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:465:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:474:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:491:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:497:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:506:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:523:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:529:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:538:12: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:555:9: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:561:10: if block ends with a return statement, so drop this else and outdent its block
pkg/components/dynmap/dynmap.go:570:12: if block ends with a return statement, so drop this else and outdent its block
pkg/login/ldap.go:55:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/login/ldap_test.go:372:10: if block ends with a return statement, so drop this else and outdent its block
pkg/middleware/middleware_test.go:213:12: if block ends with a return statement, so drop this else and outdent its block
pkg/plugins/dashboard_importer.go:153:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/plugins/dashboards_updater.go:39:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/plugins/dashboards_updater.go:121:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/plugins/plugins.go:210:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/plugins/plugins.go:235:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/eval_context.go:111:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/notifier.go:92:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/notifier.go:98:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/notifier.go:122:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/rule.go:108:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/rule.go:118:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/rule.go:121:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/alerting/notifiers/telegram.go:94:10: if block ends with a return statement, so drop this else and outdent its block
pkg/services/sqlstore/annotation.go:34:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/sqlstore/annotation.go:99:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/sqlstore/dashboard_test.go:107:13: if block ends with a return statement, so drop this else and outdent its block
pkg/services/sqlstore/plugin_setting.go:78:10: if block ends with a return statement, so drop this else and outdent its block
pkg/services/sqlstore/preferences.go:91:10: if block ends with a return statement, so drop this else and outdent its block
pkg/services/sqlstore/user.go:50:10: if block ends with a return statement, so drop this else and outdent its block
pkg/services/sqlstore/migrator/migrator.go:106:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/services/sqlstore/migrator/postgres_dialect.go:48:10: if block ends with a return statement, so drop this else and outdent its block
pkg/tsdb/time_range.go:59:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/tsdb/time_range.go:67:9: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
pkg/tsdb/cloudwatch/metric_find_query.go:225:9: if block ends with a return statement, so drop this else and outdent its block
pkg/util/filepath.go:68:11: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
2018-04-27 23:10:43 +02:00
Karsten Weiss
b7adf28501 Remove redundancy in variable declarations (golint)
This commit fixes the following golint warnings:
pkg/api/avatar/avatar.go:229:12: should omit type *http.Client from declaration of var client; it will be inferred from the right-hand side
pkg/login/brute_force_login_protection.go:13:26: should omit type time.Duration from declaration of var loginAttemptsWindow; it will be inferred from the right-hand side
pkg/metrics/graphitebridge/graphite.go:58:26: should omit type []string from declaration of var metricCategoryPrefix; it will be inferred from the right-hand side
pkg/metrics/graphitebridge/graphite.go:69:22: should omit type []string from declaration of var trimMetricPrefix; it will be inferred from the right-hand side
pkg/models/alert.go:37:36: should omit type error from declaration of var ErrCannotChangeStateOnPausedAlert; it will be inferred from the right-hand side
pkg/models/alert.go:38:36: should omit type error from declaration of var ErrRequiresNewState; it will be inferred from the right-hand side
pkg/models/datasource.go:61:28: should omit type map[string]bool from declaration of var knownDatasourcePlugins; it will be inferred from the right-hand side
pkg/plugins/update_checker.go:16:13: should omit type http.Client from declaration of var httpClient; it will be inferred from the right-hand side
pkg/services/alerting/engine.go:103:24: should omit type time.Duration from declaration of var unfinishedWorkTimeout; it will be inferred from the right-hand side
pkg/services/alerting/engine.go:105:19: should omit type time.Duration from declaration of var alertTimeout; it will be inferred from the right-hand side
pkg/services/alerting/engine.go:106:19: should omit type int from declaration of var alertMaxAttempts; it will be inferred from the right-hand side
pkg/services/alerting/notifier.go:143:23: should omit type map[string]*NotifierPlugin from declaration of var notifierFactories; it will be inferred from the right-hand side
pkg/services/alerting/rule.go:136:24: should omit type map[string]ConditionFactory from declaration of var conditionFactories; it will be inferred from the right-hand side
pkg/services/alerting/conditions/evaluator.go:12:15: should omit type []string from declaration of var defaultTypes; it will be inferred from the right-hand side
pkg/services/alerting/conditions/evaluator.go:13:15: should omit type []string from declaration of var rangedTypes; it will be inferred from the right-hand side
pkg/services/alerting/notifiers/opsgenie.go:44:19: should omit type string from declaration of var opsgenieAlertURL; it will be inferred from the right-hand side
pkg/services/alerting/notifiers/pagerduty.go:43:23: should omit type string from declaration of var pagerdutyEventApiUrl; it will be inferred from the right-hand side
pkg/services/alerting/notifiers/telegram.go:21:17: should omit type string from declaration of var telegramApiUrl; it will be inferred from the right-hand side
pkg/services/provisioning/dashboards/config_reader_test.go:11:24: should omit type string from declaration of var simpleDashboardConfig; it will be inferred from the right-hand side
pkg/services/provisioning/dashboards/config_reader_test.go:12:24: should omit type string from declaration of var oldVersion; it will be inferred from the right-hand side
pkg/services/provisioning/dashboards/config_reader_test.go:13:24: should omit type string from declaration of var brokenConfigs; it will be inferred from the right-hand side
pkg/services/provisioning/dashboards/file_reader.go:22:30: should omit type time.Duration from declaration of var checkDiskForChangesInterval; it will be inferred from the right-hand side
pkg/services/provisioning/dashboards/file_reader.go:24:23: should omit type error from declaration of var ErrFolderNameMissing; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:15:34: should omit type string from declaration of var twoDatasourcesConfig; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:16:34: should omit type string from declaration of var twoDatasourcesConfigPurgeOthers; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:17:34: should omit type string from declaration of var doubleDatasourcesConfig; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:18:34: should omit type string from declaration of var allProperties; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:19:34: should omit type string from declaration of var versionZero; it will be inferred from the right-hand side
pkg/services/provisioning/datasources/config_reader_test.go:20:34: should omit type string from declaration of var brokenYaml; it will be inferred from the right-hand side
pkg/services/sqlstore/stats.go:16:25: should omit type time.Duration from declaration of var activeUserTimeLimit; it will be inferred from the right-hand side
pkg/services/sqlstore/migrator/mysql_dialect.go:69:14: should omit type bool from declaration of var hasLen1; it will be inferred from the right-hand side
pkg/services/sqlstore/migrator/mysql_dialect.go:70:14: should omit type bool from declaration of var hasLen2; it will be inferred from the right-hand side
pkg/services/sqlstore/migrator/postgres_dialect.go:95:14: should omit type bool from declaration of var hasLen1; it will be inferred from the right-hand side
pkg/services/sqlstore/migrator/postgres_dialect.go:96:14: should omit type bool from declaration of var hasLen2; it will be inferred from the right-hand side
pkg/setting/setting.go:42:15: should omit type string from declaration of var Env; it will be inferred from the right-hand side
pkg/setting/setting.go:161:18: should omit type bool from declaration of var LdapAllowSignup; it will be inferred from the right-hand side
pkg/setting/setting.go:473:30: should omit type bool from declaration of var skipStaticRootValidation; it will be inferred from the right-hand side
pkg/tsdb/interval.go:14:21: should omit type time.Duration from declaration of var defaultMinInterval; it will be inferred from the right-hand side
pkg/tsdb/interval.go:15:21: should omit type time.Duration from declaration of var year; it will be inferred from the right-hand side
pkg/tsdb/interval.go:16:21: should omit type time.Duration from declaration of var day; it will be inferred from the right-hand side
pkg/tsdb/cloudwatch/credentials.go:26:24: should omit type map[string]cache from declaration of var awsCredentialCache; it will be inferred from the right-hand side
pkg/tsdb/influxdb/query.go:15:27: should omit type *regexp.Regexp from declaration of var regexpOperatorPattern; it will be inferred from the right-hand side
pkg/tsdb/influxdb/query.go:16:27: should omit type *regexp.Regexp from declaration of var regexpMeasurementPattern; it will be inferred from the right-hand side
pkg/tsdb/mssql/mssql_test.go:25:14: should omit type string from declaration of var serverIP; it will be inferred from the right-hand side
2018-04-27 22:14:36 +02:00
Torkel Ödegaard
b3531362ca fix: minor fix to plugin service shut down flow 2018-04-27 21:22:29 +02:00
Daniel Lee
7e2fb5e92e appveyor: uppercase the C drive in go path
Fixes #11758
2018-04-27 17:32:53 +02:00
David
cc74f6c6a0 Merge pull request #11761 from grafana/davkal/explore-multi-row
Explore: add support for multiple queries
2018-04-27 17:31:25 +02:00
Leonard Gram
ec23816df6 docs: further documents changes to the docker image. (#11763)
* docs: further documents changes to the docker image.
* docs: explains the changes to user id better.
2018-04-27 17:06:08 +02:00
bergquist
c902ec1808 Merge branch 'notification-service-refactor2'
* notification-service-refactor2:
  fix: removed log calls used while troubleshooting
  refactor: refactoring notification service to use new service registry hooks
2018-04-27 16:59:32 +02:00
Carl Bergquist
2cc855a131 Merge branch 'master' into notification-service-refactor2 2018-04-27 16:59:14 +02:00
bergquist
0cbeb56af1 disable ent build to avoid slowing down build speed 2018-04-27 16:41:07 +02:00
David
d8abfe6a7d Merge pull request #11742 from grafana/davkal/explore
Explore UI skeleton
2018-04-27 15:46:40 +02:00
David Kaltschmidt
949e3d29e8 Explore: add support for multiple queries
* adds +/- buttons to query rows in the Explore section
* on Run Query all query expressions are submitted
* `generateQueryKey` and `ensureQueries` are helpers to ensure each
 query field has a unique key for react.
2018-04-27 15:42:35 +02:00
David Kaltschmidt
25d3ec5bbf Fixed settings default and explore path 2018-04-27 15:35:46 +02:00
Torkel Ödegaard
a8eed9d344 Refactoring PluginManager to be a self registering service (#11755)
* refator: refactored PluginManager to be a self registering service, a lot more work needed to fully make plugin manager use instance variables and not so many globals
2018-04-27 15:11:55 +02:00
Torkel Ödegaard
44b0f15a61 fix: removed log calls used while troubleshooting 2018-04-27 14:28:42 +02:00
Torkel Ödegaard
df71fe33fd refactor: refactoring notification service to use new service registry hooks 2018-04-27 14:15:17 +02:00
Marcus Efraimsson
8f29d28572 Merge pull request #11753 from grafana/11743_unit_revert
revert renaming of unit key ppm
2018-04-27 14:02:57 +02:00
Carl Bergquist
28f7b6dad1 Enable Grafana extensions at build time. (#11752)
* extensions: import and build

* bus: use predefined error

* enterprise: build script for enterprise packages

* poc: auto registering services and dependency injection

(cherry picked from commit b5b1ef875f905473af41e49f8071cb9028edc845)

* poc: backend services registry progress

(cherry picked from commit 97be69725881241bfbf1e7adf0e66801d6b0af3d)

* poc: minor update

(cherry picked from commit 03d7a6888b81403f458b94305792e075568f0794)

* ioc: introduce manuel ioc

* enterprise: adds setting for enterprise

* build: test and build specific ee commit

* cleanup: test testing code

* removes example hello service
2018-04-27 13:41:58 +02:00
Marcus Efraimsson
138c8c348e revert renaming of unit key ppm
#11211 removed the unit key ppm in favor of conppm. A change which is not forward compatible.
This commit revert the unit key back to ppm.
Also adds some better error description if trying to use a unit which don't exists.
Fixes #11743
2018-04-27 13:41:20 +02:00
Mitsuhiro Tanda
c2b720835b fix to match table column name and order 2018-04-27 19:34:10 +09:00
David Kaltschmidt
d338b7ea7b Import and typescript fixups 2018-04-27 11:49:11 +02:00
David Kaltschmidt
1e6e89121c Settings to enable Explore UI 2018-04-27 11:39:14 +02:00
bergquist
afce0feb05 Merge branch 'mjtrangoni-fix-deadcode-issues'
* mjtrangoni-fix-deadcode-issues:
  tech: removes unused code
  add deadcode linter to circleci
  pkg: fix deadcode issues
  build.go: fix deadcode issues
2018-04-27 10:41:56 +02:00
bergquist
8e9b3507c5 tech: removes unused code 2018-04-27 10:39:06 +02:00
bergquist
034f5921cc Merge branch 'fix-deadcode-issues' of https://github.com/mjtrangoni/grafana into mjtrangoni-fix-deadcode-issues
* 'fix-deadcode-issues' of https://github.com/mjtrangoni/grafana:
  add deadcode linter to circleci
  pkg: fix deadcode issues
  build.go: fix deadcode issues
2018-04-27 10:31:44 +02:00
David Kaltschmidt
f1220fd2a4 Explore WIP 2018-04-26 20:27:19 +02:00
Mario Trangoni
0459261d19 add deadcode linter to circleci 2018-04-26 19:24:21 +02:00
Mario Trangoni
97fd66db2e pkg: fix deadcode issues 2018-04-26 19:24:21 +02:00
Mario Trangoni
7aaa188471 build.go: fix deadcode issues 2018-04-26 19:04:07 +02:00
Marcus Efraimsson
b53a57610b docs: update current version to 5.1 2018-04-26 18:59:45 +02:00
Marcus Efraimsson
6fa7ffc23f docs: update installation instructions targeting v5.1.0 stable 2018-04-26 18:56:44 +02:00
Marcus Efraimsson
914071993d Merge branch 'docs-5.1' 2018-04-26 18:44:51 +02:00
Daniel Lee
44a61a6db3 changelog: update for v5.1.0 2018-04-26 18:18:54 +02:00
Marcus Efraimsson
28781e7dfd Merge pull request #11736 from grafana/11735_ga
fix so that google analytics script are cached
2018-04-26 16:01:08 +02:00
Marcus Efraimsson
ddeba41638 fix so that google analytics script are cached 2018-04-26 15:49:22 +02:00
Daniel Lee
1dd4f03100 Merge pull request #11726 from grafana/11708_prom_variables
prometheus: variable query should fallback correctly to a series query
2018-04-26 10:29:09 +02:00
Daniel Lee
375816106e Merge pull request #11714 from grafana/11703_mysql_ts_datatypes
sql tsdb: fix value columns conversion to float when using timeseries query
2018-04-25 23:17:22 +02:00
Marcus Efraimsson
fff5d7154e Merge pull request #11721 from grafana/11677-missaligned-menu-carot
fix misalignment of unit and other drop downs in firefox
2018-04-25 17:24:54 +02:00
Daniel Lee
4b73f67703 Merge pull request #11722 from grafana/ie11-panel-edit-height
removed height 100% from panel-container to fix ie11 panel edit mode
2018-04-25 16:26:41 +02:00
Daniel Lee
3000a2a43b Merge pull request #11652 from grafana/davkal/hmr
Add weback-dev-server with hot/hmr support
2018-04-25 15:52:53 +02:00
Marcus Efraimsson
f112e38266 prometheus: convert metric find query tests to jest 2018-04-25 15:37:58 +02:00
Marcus Efraimsson
6687409efb prometheus: fix variable query to fallback correctly to series query
Using a query of for example up or up{job=job1}
2018-04-25 15:37:58 +02:00
Patrick O'Carroll
6836268f3e removed height 100% from panel-container to fix ie11 panel edit mode 2018-04-25 12:44:39 +02:00
Patrick O'Carroll
99aa9a46bc replaced border hack carot with fontawesome carot fixes #11677 2018-04-25 12:16:43 +02:00
Leonard Gram
1290087b78 dev: Mac compatible prometheus block. (#11718) 2018-04-25 11:01:33 +02:00
David
c99d6bd505 Merge pull request #11678 from grafana/davkal/11673-silent-response
Add silent option to backend requests
2018-04-25 09:46:41 +02:00
Carl Bergquist
f2b5b6f299 Merge pull request #11694 from flopp999/patch-5
Added requests/sec(throughput)
2018-04-24 21:30:34 +02:00
Marcus Efraimsson
7626775491 Merge pull request #11695 from grafana/11508_variables_preview_values
allow to show more preview values for variables
2018-04-24 20:05:47 +02:00
Marcus Efraimsson
1452634a2a mssql: fix value columns conversion to float when using timeseries query 2018-04-24 19:54:08 +02:00
Marcus Efraimsson
cf43007531 postgres: fix value columns conversion to float when using timeseries query 2018-04-24 19:53:36 +02:00
Marcus Efraimsson
346577b664 mysql: fix value columns conversion to float when using timeseries query 2018-04-24 19:53:06 +02:00
Marcus Efraimsson
76bd2aea44 sql datasource: extract common logic for converting value column to float 2018-04-24 19:50:14 +02:00
Patrick O'Carroll
a40314022b added pointer to show more, reset values on new query 2018-04-24 17:40:03 +02:00
Marcus Efraimsson
7992897418 docs: add known issues section for mssql documentation
Fixes #11707
2018-04-24 16:30:24 +02:00
David Kaltschmidt
707700ac7d force GET for metadataRequests, w/ test 2018-04-24 16:26:46 +02:00
Marcus Efraimsson
85ccefdb84 Merge branch 'master' into docs-5.1 2018-04-24 16:17:15 +02:00
Marcus Efraimsson
d36efddcf7 Merge pull request #11699 from grafana/11466-edit-row
fixed so user who can edit dashboard can edit row
2018-04-24 14:57:50 +02:00
Carl Bergquist
005556632f Merge pull request #11705 from mjtrangoni/fix-ineffassign-issues
Fix ineffassign issues
2018-04-24 12:56:16 +02:00
David Kaltschmidt
006286ac05 Renamed helperRequest and removed positional args
From review feedback:

* s/helper/metadata
* combined positional args to _request into options dict
* metadataRequest reuses _request()
* moved consumption of this.httpMethod into _request, can be overwritten
 in options due to spread-after
2018-04-24 12:27:37 +02:00
David Kaltschmidt
0695e431ea Move function calls w/ side-effects to componentDidMount
* loadStore() modified the url which triggered a new render path, this
gets noticed by react. Moved to componentDidMount.
2018-04-24 12:07:24 +02:00
Patrick O'Carroll
38a4a2dc60 changed test name and dashboardMock code 2018-04-24 11:22:58 +02:00
Patrick O'Carroll
1446f54447 fixed test 2018-04-24 09:45:53 +02:00
Mario Trangoni
2e927a1053 add ineffassign to circleci gometalinter check 2018-04-23 20:07:31 +02:00
Mario Trangoni
b02a860e66 pkg/components: fix ineffassign issues 2018-04-23 20:03:57 +02:00
Mario Trangoni
15f11effa0 pkg/cmd: fix ineffassign issues 2018-04-23 19:34:55 +02:00
Mario Trangoni
bc570bb140 pkg/log: fix ineffassign issues 2018-04-23 19:31:23 +02:00
Mario Trangoni
6eb00000fe pkg/services: fix ineffassign issues 2018-04-23 19:28:54 +02:00
Patrick O'Carroll
45e6d9fcc4 removed import config 2018-04-23 17:45:51 +02:00
Patrick O'Carroll
3eaaa5d32d fixed so user who can edit dashboard can edit row, fixes #11466 2018-04-23 17:44:29 +02:00
Leonard Gram
3a48ea8dde Fixes signing of packages.
Signing was failing as the builds
were expected to run as ubuntu but
is run as root.

Closes #11686
2018-04-23 17:05:32 +02:00
Dan Cech
affd3d15a0 Merge pull request #11150 from sbskas/master
Make Ldap group composed of  DNs work.
2018-04-23 10:49:45 -04:00
Marcus Efraimsson
d14ac54af6 db: fix failing user auth tests for postgres 2018-04-23 16:02:59 +02:00
Daniel Lee
1dea5cb34b Merge pull request #11683 from marefr/11668_default_permissions
Fix for default permissions on folder are not shown as inherited in it's dashboards
2018-04-23 14:58:22 +02:00
flopp999
28ce71253f changed rps to reqps 2018-04-23 14:06:25 +02:00
bergquist
3cca45dd88 bump version 2018-04-23 13:59:52 +02:00
Patrick O'Carroll
c2cc77fa08 added button to show more preview values for variables, button runs a function that increases options limit, fixes #11508 2018-04-23 13:00:24 +02:00
flopp999
1cc4c0c1f0 Added requests/sec(throughput)
#9630
2018-04-23 12:05:26 +02:00
Marcus Efraimsson
079346917f use inherited property from api when rendering permissions 2018-04-23 09:23:31 +02:00
Marcus Efraimsson
d86ed679b1 return inherited property for permissions 2018-04-23 09:23:14 +02:00
Carl Bergquist
6315142d00 Merge pull request #11689 from mjtrangoni/fix-ineffassign-issues
pkg/tsdb: fix ineffassign isues
2018-04-23 07:57:55 +02:00
Carl Bergquist
7e089314f7 Merge pull request #11688 from mjtrangoni/fix-gometalinter-circleci
fix CircleCI gometalinter test
2018-04-23 07:54:21 +02:00
Andrzej Ressel
9d5ccaef54 Merge branch 'master' into feature/save_json 2018-04-22 21:24:52 +02:00
Mario Trangoni
556219b192 pkg/tsdb: fix ineffassign isues 2018-04-22 20:51:58 +02:00
Mario Trangoni
fd20aa7c03 fix circleci gometalinter test 2018-04-22 16:22:29 +02:00
Daniel Lee
6b5854936d Merge pull request #11502 from marefr/graphite_ds_test
graphite: use a query when testing data source
2018-04-22 11:31:51 +02:00
Daniel Lee
b5a54c535b Merge pull request #11654 from svenklemm/postgres-docs-timefilter
postgres: adjust timeFilter, timeFrom and timeTo macro examples
2018-04-22 11:16:15 +02:00
Sven Klemm
eb994ad72e Merge remote-tracking branch 'upstream/master' into postgres-docs-timefilter 2018-04-21 18:31:45 +02:00
Daniel Lee
3451f9a9db Merge branch 'annotations-created' of https://github.com/ryantxu/grafana into ryantxu-annotations-created 2018-04-20 17:14:06 +02:00
David Kaltschmidt
53817b7429 Add silent option to backend requests
* When set to `true`, the `silent` option for backend_srv requests
 suppresses all event emitters that are triggered when the response is
received.
* Added `helperRequest()` to the Prometheus datasource to support
 requests that are not triggered by the user, e.g., for tab completion.
`helperRequest()` sets the `silent` option.
* Migrated all non-timeseries queries of the Prometheus datasource to
 use `helperRequest()`.

Fixes #11673
2018-04-20 15:28:04 +02:00
Daniel Lee
8f9d9ed35d docs: escape asterisk in Graphite docs 2018-04-20 15:27:20 +02:00
Daniel Lee
f4f12c1e84 Merge remote-tracking branch 'upstream/master' into docs-5.1 2018-04-20 15:15:42 +02:00
Daniel Lee
bde0136317 Merge pull request #11671 from grafana/docs-variable-interpolation-mssql
Docs for mssql for #11642
2018-04-20 15:09:20 +02:00
Daniel Lee
2b3c547589 Merge pull request #11642 from grafana/docs-variable-interpolation
Docs variable interpolation
2018-04-20 15:09:05 +02:00
Daniel Lee
ba2e43f547 docs: disable quoting option for MSSQL 2018-04-20 13:36:07 +02:00
Daniel Lee
492f842c53 docs: fix example for graphite tag query
Was missing a tilde in the tag_values example
2018-04-20 13:32:17 +02:00
Daniel Lee
3a99148315 docs: spelling 2018-04-20 13:24:37 +02:00
bergquist
e168bfe03e docs: release 5.1.0-beta1 2018-04-20 13:23:45 +02:00
Daniel Lee
71dcafebb8 docs: add missing backtick for mysql/postgres 2018-04-20 13:22:43 +02:00
Daniel Lee
c10359dd5b docs: fixes for table in variable docs 2018-04-20 13:21:14 +02:00
bergquist
177220e2fe build: fixes release deploy 2018-04-20 12:59:44 +02:00
bergquist
d7f58d74d3 changelog: adds releaste date for 5.1.0-beta1 2018-04-20 11:16:24 +02:00
Daniel Lee
cdbd4e0fc0 graphite: convert ds test to jest 2018-04-20 11:09:52 +02:00
Daniel Lee
c2064781a0 Merge pull request #11640 from grafana/11637-dropdown-styling
removed padding and moved carrot
2018-04-20 11:05:40 +02:00
Dan Cech
7cc3d0c34e Merge branch 'master' into master 2018-04-19 12:01:48 -04:00
Sven Klemm
5076f9304b slightly better example 2018-04-19 17:01:48 +02:00
Sven Klemm
048cecdab5 adjust timeFilter, timeFrom and timeTo macro examples 2018-04-19 16:56:58 +02:00
Marcus Efraimsson
9fc59cc212 Merge pull request #11644 from grafana/11392_whats_new_v51
docs: What's new in v5.1
2018-04-19 16:37:04 +02:00
Marcus Efraimsson
727a7bf27a docs: what's new improvements 2018-04-19 16:26:42 +02:00
Marcus Efraimsson
886c8b823a docs: what's new improvements 2018-04-19 14:51:33 +02:00
bergquist
b5820d930c Merge branch 'master' into 11392_whats_new_v51
* master:
  build: only lint the pkg folder
  changelog: adds note about closing #11476
  singlestat: Fix optimization in setTableColumnToSensibleDefault
  influxdb: Check before assuming first column to be 'time'
2018-04-19 14:27:13 +02:00
bergquist
ffb1db833c docs: what's new
add's info about new template variable interpolation
2018-04-19 14:23:47 +02:00
Marcus Efraimsson
540bde269e docs: fix typos 2018-04-19 13:49:40 +02:00
Marcus Efraimsson
cc3418f6a3 docs: what's new
Improved scrolling experience
2018-04-19 13:44:37 +02:00
bergquist
b4a77d49b4 docs: whats new
reduce content a little bit and highlight mssql and prom heatmap
2018-04-19 13:39:02 +02:00
bergquist
601a1d9b92 docs: more info prometheus heapmap to whats new 2018-04-19 13:33:50 +02:00
Marcus Efraimsson
6737f79331 docs: improve what's new in v5.1 2018-04-19 13:25:16 +02:00
Marcus Efraimsson
250f85b9bd docs: what's new in v5.1 draft 2018-04-19 12:54:10 +02:00
David Kaltschmidt
cc5d7002b0 Add weback-dev-server with hot/hmr support
* adds `npm start` / `yarn start` script
* starts a webpack-dev-server using the dev config, served on :3333
* hot reloading (HMR) for react/styles, not working for angular code
* new entry `dev.ts` for dynamic imports of CSS theme (ExtractText does
not work with HMR)
* TS loader pipeline moved out of common to add HMR for react
* applied `hot()` to some react containers (that's their new default
 export, named exports remains for testing)
* added sections to README
* updated yarn.lock
2018-04-19 11:42:53 +02:00
Marcus Efraimsson
ba9c3f60c4 Merge branch 'master' into docs-5.1 2018-04-19 10:52:17 +02:00
Marcus Efraimsson
cec9634f4a fix typo 2018-04-18 14:52:36 +02:00
Daniel Lee
ab4f8c273d docs: describes variable formatting options
csv option in postgres/mysql docs and the regex option in the
graphite docs
2018-04-18 14:40:34 +02:00
Daniel Lee
120a86ecf9 docs: graphite template variables for tag queries
ref #11388 and ref #9911 and ref #10366
2018-04-18 14:40:34 +02:00
Daniel Lee
24ae9cef36 docs: describes new variable formatting syntax
Fixes #11388
Ref #11141
2018-04-18 14:40:34 +02:00
Marcus Efraimsson
7e8bd8d004 Merge branch 'master' into docs-5.1 2018-04-18 14:39:38 +02:00
Patrick O'Carroll
e794951087 removed padding and moved carrot 2018-04-18 10:21:48 +02:00
Marcus Efraimsson
d30835f648 docs: update provisioning documentation
In addition to closing #10883
2018-04-17 17:22:25 +02:00
Marcus Efraimsson
b142d6a037 Merge branch 'master' into docs-5.1 2018-04-17 16:50:26 +02:00
Marcus Efraimsson
ad22e20ecd docs: update postgres macro functions documentation
In addition to closing #11578
2018-04-17 00:06:25 +02:00
Marcus Efraimsson
979f2d79fb Merge branch 'master' into docs-5.1 2018-04-16 23:58:50 +02:00
Leonard Gram
abed9c055f docs: new docker image in Grafana 5.1.0. 2018-04-16 15:33:15 +02:00
Marcus Efraimsson
c9f5568332 Merge branch 'master' into docs-5.1 2018-04-16 14:35:43 +02:00
Marcus Efraimsson
92ac1fbb5b Merge branch 'master' into docs-5.1 2018-04-16 09:58:46 +02:00
Marcus Efraimsson
48143d6caf Merge branch 'master' into docs-5.1 2018-04-13 16:40:38 +02:00
Marcus Efraimsson
9c492bd774 docs: add mssql provisioning example 2018-04-13 15:53:45 +02:00
Marcus Efraimsson
428d4b0dbf Merge branch 'master' into docs-5.1 2018-04-13 15:44:53 +02:00
Marcus Efraimsson
f2c5417ee4 Merge branch 'master' into docs-5.1 2018-04-13 11:36:54 +02:00
Marcus Efraimsson
aa59843902 docs: update mssql with azure sql database support 2018-04-13 11:36:40 +02:00
Marcus Efraimsson
fa95297e6a docs: update default annotation limit when querying api
Needed due to closing #11569
2018-04-13 10:58:29 +02:00
Marcus Efraimsson
80e4a9dc55 Merge branch 'master' into docs-5.1 2018-04-13 10:56:26 +02:00
Andrzej Ressel
bff174dba9 PR comments 2018-04-11 22:59:29 +02:00
Marcus Efraimsson
1232745e89 docs: fix typo of default port for mssql
Fixes #11562
2018-04-11 20:56:16 +02:00
Marcus Efraimsson
fe4cfbeb73 Merge branch 'master' into docs-5.1 2018-04-11 20:38:09 +02:00
Daniel Lee
d39dac10a6 docs: update after #11531 2018-04-09 15:19:41 +02:00
ryan
5ca972542b convert graphite epoch to ms 2018-04-09 13:58:09 +02:00
ryan
56679ac80f Merge remote-tracking branch 'grafana/master' into annotations-created
* grafana/master:
  prevent angular from evaluating {{hostname}} in tooltip (#11514)
2018-04-09 13:52:54 +02:00
ryan
60816f5fc2 using millis for annotations too 2018-04-09 12:48:01 +02:00
ryan
39f37ff8aa Merge remote-tracking branch 'grafana/master' into annotations-created
* grafana/master:
  docs: updated debian distro in install docs to stretch, closes #11527
  css: quick fix after IE11 changes
  fixed sidemenu icon issue created by earlier pr
  changelog: adds note for #11165
  migrated dash_class to ts
  migrated segment_srv to ts
  removed indent for manage dashboards
  created closeDropdown function, renamed appevent, added second appevent for open timepicker
  added if to onAppevent, renamed appevent, add appevent to applyCustom and setRelativeFilter
  docker: add users and groups to ldap block
  timepicker now closes without exiting edit/view mode, close order: modal, timepicker, view
  bounnd the esc key to exit timepicker
  added indent to dashboards inside folder in search dropdown, and added indent to dashboard icon in search item
2018-04-09 12:31:44 +02:00
Aleksei Magusev
92e5968f91 Fix ResponseParser for InfluxDB to return only string values 2018-04-09 11:52:12 +02:00
Aleksei Magusev
a101177b55 Conditionally select a field to return in ResponseParser for InfluxDB
This patch also fixes "value[1] || value[0]" to not ignore zeros.
2018-04-09 11:51:22 +02:00
Penghan Wang
fbed72c89c Merge branch 'master' into feature/add_es_alerting 2018-04-09 14:00:28 +08:00
Andrzej Ressel
c4b57a2562 Revert files 2018-04-08 20:40:09 +02:00
Andrzej Ressel
cfd1f5c072 Revert files 2018-04-08 20:38:08 +02:00
Andrzej Ressel
697a3eaa43 Fix after merge 2018-04-08 20:31:17 +02:00
Andrzej Ressel
30f048965c Merge branch 'master' into feature/discord 2018-04-08 20:09:56 +02:00
Andrzej Ressel
dc11f1da81 Make dashboard JSON editable 2018-04-08 20:00:18 +02:00
Marcus Efraimsson
4cc80efee6 graphite: use a query when testing data source
Using a query (POST /render) request instead of GET /metrics/find to better
mimic an actual request for rendering a panel in a dashboard. The POST /render
request will add at least a custom http header which can be problematic when
using direct access mode since it will trigger a CORS prerequest check. By
doing this kind of query when testing the data source possible CORS issues
can be detected there instead of later when trying to use the data source
in a dashboard.
2018-04-05 18:11:35 +02:00
ryan
66d020eb7e skip migration if it is a big number 2018-04-05 09:51:08 +02:00
ryan
392c47f39b Merge remote-tracking branch 'grafana/master' into annotations-created
* grafana/master: (51 commits)
  Use curly brackets around hyperlink help text #11478 (#11479)
  migrated playlist-routes to ts
  migrated last all.js to ts
  Notes for closing #7119
  changelog: adds note for #11128
  variables: adds test for variable sorting
  Add case-insensitive sort for variables.
  graphite: fixes #11434
  settings: fixes test
  changed from margin to padding
  changed variable for tabbed close btn hover, and changed text-strong variable for lighttheme, removed commented out variable
  mssql: typos in help sections
  Webpack Grafana plugin template project to links (#11457)
  rm panel.type  constrain from threshold_mapper.ts (#11448)
  No need for node_modules/bin in npm run-script (#11449)
  changelog: adds note about closing #11555
  add article
  fix some typos
  migrated graph_tooltip to ts
  started migration to ts
  ...
2018-04-05 09:48:00 +02:00
Marcel Anacker
64c16eb912 Alerting: Fixing mobile notifications in Microsoft Teams 2018-04-04 16:28:12 +02:00
Daniel Lee
51b078fb65 docs: spelling 2018-04-03 09:47:53 +02:00
wph95
4050fce220 add response_parser test 2018-03-28 12:35:05 +08:00
Marcus Efraimsson
828dd34507 docs: update table plugin documentation with value/range to text mapping 2018-03-27 20:18:04 +02:00
wph95
06f7332156 cleanup and add more test 2018-03-28 01:42:25 +08:00
Marcus Efraimsson
c9cdb4cda0 Merge pull request #11383 from alexanderzobnin/docs-10009
Update heatmap and prometheus docs
2018-03-27 14:01:36 +02:00
Marcus Efraimsson
41ff37f0a1 Merge branch 'master' into docs-5.1 2018-03-27 14:00:16 +02:00
Alexander Zobnin
2c7040c246 docs: prometheus ds, remove "new in v4.3" note 2018-03-27 09:48:19 +03:00
wph95
4042e4b225 fix a terms bug and add test 2018-03-27 02:12:43 +08:00
Alexander Zobnin
b97cede054 docs: update heatmap and prometheus docs, #10009 2018-03-26 17:12:25 +03:00
Penghan Wang
a21afbe9a6 Merge branch 'master' into feature/add_es_alerting 2018-03-26 19:51:03 +08:00
wph95
63a200686e - pipeline aggs support
- add some test
2018-03-26 19:48:57 +08:00
wph95
d6cdc2497c Handle Interval Date Format similar to the JS variant
7e14e272fa
2018-03-26 16:13:14 +08:00
wph95
1e275d0cd1 set right series name
Signed-off-by: wph95 <wph657856467@gmail.com>
2018-03-25 02:18:28 +08:00
ryan
71ef9b6db5 Merge remote-tracking branch 'grafana/master' into annotations-created
* grafana/master: (26 commits)
  notes about closing #11306
  cleanup
  changelog: unix socket permissions
  Adjust permissions of unix socket
  docs: tweaks
  changelog: adds note about closing #5855
  legend: small refactoring
  Make golint happier
  mysql: skip tests by default
  mssql: update query editor help
  mysql: fix precision for the time column in table/annotation query mode
  postgres: fix precision for the time column in table/annotation query mode
  mssql: fix precision for the time column in table/annotation query mode
  mssql: remove UTC conversion in macro functions
  mssql: fix timeGroup macro so that it properly creates correct groups
  small screen legend right also work like legend under in render + set scrollbar to undefined in destroyScrollbar so it doesnt become disabled when toggeling between right and under
  fixed so legend right works like legend under on small screens
  Alerting: move getNewState to EvalContext
  graphite: adds more traces for alerting
  sql datasource: extract common logic for converting time column to epoch time in ms
  ...
2018-03-24 11:39:35 +01:00
ryan
eabcbcda88 remove README changes 2018-03-24 11:39:20 +01:00
wph95
bc5b59737c finished CODING PHASE 1
Signed-off-by: wph95 <wph657856467@gmail.com>
2018-03-24 13:06:21 +08:00
wph95
8e7d23cdeb wip
Signed-off-by: wph95 <wph657856467@gmail.com>
2018-03-23 23:50:16 +08:00
Patrick O'Carroll
bd7964d549 Merge pull request #11367 from grafana/graph_51_docs
Update graph panel documentation
2018-03-23 16:21:39 +01:00
Penghan Wang
fa72c4fea4 Merge pull request #1 from grafana/master
upgrade from grafana/grafana
2018-03-23 23:18:27 +08:00
Marcus Efraimsson
13d0bd5815 Merge branch 'docs-5.1' into graph_51_docs 2018-03-23 15:51:32 +01:00
Marcus Efraimsson
0a487c484d docs: fix typos 2018-03-23 15:49:54 +01:00
Marcus Efraimsson
403c64ab20 docs: update postgres, mysql and mssql documentation
Due to changes closing #11306
2018-03-23 15:48:04 +01:00
Marcus Efraimsson
c318f7bb31 Merge branch 'master' into docs-5.1 2018-03-23 15:15:57 +01:00
Marcus Efraimsson
1b8103f0ea docs: update graph panel documentation
Added new versions of images and new images to better highlight the possible
configuration options.
Documentation was very outdated so tried to fix that to better reflect the
current state/latest release.
2018-03-23 14:43:57 +01:00
ryan
7defb1adf5 remove dashboardId check... i can't figure out how the tests work 2018-03-23 12:54:53 +01:00
ryan
e92ea79524 get circle to run tests again 2018-03-23 12:48:03 +01:00
ryan
2116152295 add dashboardId to test 2018-03-23 12:35:39 +01:00
ryan
a58b4ff2d6 remove api tests 2018-03-23 12:13:38 +01:00
ryan
14b737e662 update CHANGELOG 2018-03-23 12:08:32 +01:00
ryan
b39fb7fdd5 fix operator 2018-03-23 12:01:21 +01:00
ryan
a0a6fa6fa5 remove constraint from sqlstore 2018-03-23 11:47:07 +01:00
ryan
a5588b6957 Merge remote-tracking branch 'origin/annotations-created' into annotations-created
* origin/annotations-created:
  dooh
2018-03-23 11:44:21 +01:00
ryan
4ed1ec5174 Merge remote-tracking branch 'grafana/master' into annotations-created
* grafana/master: (30 commits)
  changelog: adds note about closing #11278
  docs: spelling
  docs: add intro paragraph to provisioning page
  Cleanup CircleCI V2 Conversion
  changelog: notes for #1271 and #2740
  graph: minor fixes to y-axes alignment feature
  added save icon to save buttons
  removed trash can icon from save buttons
  Return actual user ID in UserProfileDTO
  dashboard version cleanup: more tests and refactor
  minor refactor of dashboard version cleanup
  refactor: dashboard version cleanup
  limit number of rows deleted by dashboard version cleanup
  fix dashboard version cleanup on large datasets
  Allocated to a separate alignment block. Replaced the attribute of the second axis by the attribute of the axes.
  Fixed unit test.
  Changed the way this feature was activated. And changed tolltip.
  Added validation of input parameters.
  Resolved conflict
  Corrected work for graphs created before this feature.
  ...
2018-03-23 11:38:43 +01:00
ryan
db92a96067 move dashboard error to API (not sql) 2018-03-23 11:36:44 +01:00
Marcus Efraimsson
1d515bb52c Merge branch 'master' into docs-5.1 2018-03-23 10:40:12 +01:00
Ryan McKinley
164ddb16c9 dooh 2018-03-22 20:48:40 +01:00
ryan
0c7294593c update the updated column! 2018-03-22 20:05:04 +01:00
ryan
d554c6f9be using circle as my tester 2018-03-22 19:44:47 +01:00
ryan
fa021b547a using circle as my tester 2018-03-22 19:39:30 +01:00
ryan
db91033b6e adding tests, but they arent running locally 2018-03-22 19:33:33 +01:00
ryan
20353db966 convert epoch to milliseconds 2018-03-22 16:21:47 +01:00
ryan
a2bbd89a9e adding updated column 2018-03-22 15:52:09 +01:00
ryan
df94b380f4 Merge remote-tracking branch 'grafana/master' into annotations-created
* grafana/master:
  Make golint happier
2018-03-22 14:59:14 +01:00
ryan
3898ea02e6 adding created column 2018-03-22 02:22:58 +01:00
Daniel Lee
fe293718a2 Merge pull request #11310 from grafana/mssql_datasource_docs
docs: Using Microsoft SQL Server in Grafana
2018-03-20 20:39:52 +01:00
Daniel Lee
e5df179c7c docs: spelling 2018-03-20 20:38:20 +01:00
Marcus Efraimsson
74c3f732c1 docs: update using mssql in grafana 2018-03-20 10:59:35 +01:00
Marcus Efraimsson
1f8a2a67bf docs: Using Microsoft SQL Server in Grafana 2018-03-19 11:06:10 +01:00
flopp999
08461408a2 Added Kilopascals(kPa) under pressure 2018-03-13 22:17:56 +01:00
flopp999
af63a26be0 Added W/m2(energy) and l/h(flow)
both as .fixedUnit
2018-03-13 22:11:58 +01:00
Dan Cech
abef722265 Fix indent 2018-03-07 14:41:05 -05:00
Sébastien BERNARD
380aa26ea3 Fix the code to match the documentation.
Permit for LDAP groups to be groupofuniquenames composed of uniquename (DN).
For this, propose DN as group_search_filter_user_attribute and DN also for the member_of in the server.attributes section.

DN is processed as a special attribute name which returns the LdapSearchResult.DN field instead of a member of attr array.
2018-03-07 18:14:18 +01:00
Daniel Lee
0e54c474aa Merge branch 'master' into docs-5.1 2018-03-06 09:28:13 +01:00
Daniel Lee
8a1bd2ee22 docs: fill for mysql/postgres
ref #10138
2018-03-06 09:24:36 +01:00
Craig Miskell
2e86985d44 Remove silly noise 2018-01-05 16:22:49 +13:00
Craig Miskell
f9fb315dbd Update tests to match new reality, and rejig the implementation a bit to truly work as desired 2018-01-05 16:20:54 +13:00
Craig Miskell
61e6f63b32 Align queries to prometheus with the step to ensure 'rate' type expressions get consistent results 2018-01-05 09:08:40 +13:00
Jeroen Jacobs
5b926cc102 Adding a user in a specified organisation uses the admin API 2017-11-17 12:19:18 +01:00
Andrzej Ressel
1bf982439b Sending image 2017-03-23 21:53:54 +01:00
Andrzej Ressel
5f3b7eaa45 Discord integration 2017-03-22 23:28:55 +01:00
896 changed files with 66357 additions and 27141 deletions

View File

@@ -1,6 +1,56 @@
aliases:
# Workflow filters
- &filter-only-release
branches:
ignore: /.*/
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- &filter-not-release
tags:
ignore: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
version: 2
jobs:
mysql-integration-test:
docker:
- image: circleci/golang:1.10
- image: circleci/mysql:5.6-ram
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: grafana_tests
MYSQL_USER: grafana
MYSQL_PASSWORD: password
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- run: sudo apt update
- run: sudo apt install -y mysql-client
- run: dockerize -wait tcp://127.0.0.1:3306 -timeout 120s
- run: cat docker/blocks/mysql_tests/setup.sql | mysql -h 127.0.0.1 -P 3306 -u root -prootpass
- run:
name: mysql integration tests
command: 'GRAFANA_TEST_DB=mysql go test ./pkg/services/sqlstore/... ./pkg/tsdb/mysql/... '
postgres-integration-test:
docker:
- image: circleci/golang:1.10
- image: circleci/postgres:9.3-ram
environment:
POSTGRES_USER: grafanatest
POSTGRES_PASSWORD: grafanatest
POSTGRES_DB: grafanatest
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- run: sudo apt update
- run: sudo apt install -y postgresql-client
- run: dockerize -wait tcp://127.0.0.1:5432 -timeout 120s
- run: 'PGPASSWORD=grafanatest psql -p 5432 -h 127.0.0.1 -U grafanatest -d grafanatest -f docker/blocks/postgres_tests/setup.sql'
- run:
name: postgres integration tests
command: 'GRAFANA_TEST_DB=postgres go test ./pkg/services/sqlstore/... ./pkg/tsdb/postgres/...'
codespell:
docker:
- image: circleci/python
@@ -20,18 +70,21 @@ jobs:
gometalinter:
docker:
- image: circleci/golang:1.10
environment:
# we need CGO because of go-sqlite3
CGO_ENABLED: 1
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- run: 'go get -u gopkg.in/alecthomas/gometalinter.v2'
- run: 'go get -u github.com/tsenart/deadcode'
- run: 'go get -u github.com/gordonklaus/ineffassign'
- run: 'go get -u github.com/opennota/check/cmd/structcheck'
- run: 'go get -u github.com/mdempsky/unconvert'
- run: 'go get -u github.com/opennota/check/cmd/varcheck'
- run:
name: install gometalinter tool
command: 'go get -u github.com/alecthomas/gometalinter'
- run:
name: install linters
command: 'gometalinter --install'
- run:
name: run some linters
command: 'gometalinter --vendor --deadline 6m --disable-all --enable=structcheck --enable=unconvert --enable=varcheck ./pkg/...'
name: run linters
command: 'gometalinter.v2 --enable-gc --vendor --deadline 10m --disable-all --enable=deadcode --enable=ineffassign --enable=structcheck --enable=unconvert --enable=varcheck ./...'
test-frontend:
docker:
@@ -43,7 +96,6 @@ jobs:
command: 'sudo npm install -g yarn --quiet'
- restore_cache:
key: dependency-cache-{{ checksum "yarn.lock" }}
# Could we skip this step if the cache has been restored? `[ -d node_modules ] || yarn install ...` should be able to apply to build step as well
- run:
name: yarn install
command: 'yarn install --pure-lockfile --no-progress'
@@ -65,15 +117,27 @@ jobs:
name: build backend and run go tests
command: './scripts/circle-test-backend.sh'
build:
build-all:
docker:
- image: grafana/build-container:v0.1
- image: grafana/build-container:1.0.0
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- run:
name: prepare build tools
command: '/tmp/bootstrap.sh'
- restore_cache:
key: phantomjs-binaries-{{ checksum "scripts/build/download-phantomjs.sh" }}
- run:
name: download phantomjs binaries
command: './scripts/build/download-phantomjs.sh'
- save_cache:
key: phantomjs-binaries-{{ checksum "scripts/build/download-phantomjs.sh" }}
paths:
- /tmp/phantomjs
- run:
name: build and package grafana
command: './scripts/build/build.sh'
command: './scripts/build/build-all.sh'
- run:
name: sign packages
command: './scripts/build/sign_packages.sh'
@@ -89,6 +153,24 @@ jobs:
- dist/grafana*
- scripts/*.sh
- scripts/publish
- store_artifacts:
path: dist
build-enterprise:
docker:
- image: grafana/build-container:v0.1
working_directory: /go/src/github.com/grafana/grafana
steps:
- checkout
- run:
name: build and package grafana
command: './scripts/build/build_enterprise.sh'
- run:
name: sign packages
command: './scripts/build/sign_packages.sh'
- run:
name: sha-sum packages
command: 'go run build.go sha-dist'
deploy-master:
docker:
@@ -101,23 +183,28 @@ jobs:
command: 'sudo pip install awscli'
- run:
name: deploy to s3
command: 'aws s3 sync ./dist s3://$BUCKET_NAME/master'
command: |
# Also
cp dist/grafana-latest.linux-x64.tar.gz dist/grafana-master-$(echo "${CIRCLE_SHA1}" | cut -b1-7).linux-x64.tar.gz
aws s3 sync ./dist s3://$BUCKET_NAME/master
- run:
name: Trigger Windows build
command: './scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} master'
- run:
name: Trigger Docker build
command: './scripts/trigger_docker_build.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN}'
command: './scripts/trigger_docker_build.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN} master-$(echo "${CIRCLE_SHA1}" | cut -b1-7)'
- run:
name: Publish to Grafana.com
command: './scripts/publish -apiKey ${GRAFANA_COM_API_KEY}'
command: |
rm dist/grafana-master-$(echo "${CIRCLE_SHA1}" | cut -b1-7).linux-x64.tar.gz
./scripts/publish -apiKey ${GRAFANA_COM_API_KEY}
deploy-release:
docker:
- image: circleci/python:2.7-stretch
steps:
- attach_workspace:
at: dist
at: .
- run:
name: install awscli
command: 'sudo pip install awscli'
@@ -135,37 +222,55 @@ workflows:
version: 2
test-and-build:
jobs:
- build-all:
filters: *filter-not-release
- codespell:
filters:
tags:
only: /.*/
- build:
filters:
tags:
only: /.*/
filters: *filter-not-release
- gometalinter:
filters: *filter-not-release
- test-frontend:
filters:
tags:
only: /.*/
filters: *filter-not-release
- test-backend:
filters:
tags:
only: /.*/
filters: *filter-not-release
- mysql-integration-test:
filters: *filter-not-release
- postgres-integration-test:
filters: *filter-not-release
- deploy-master:
requires:
- build-all
- test-backend
- test-frontend
- build
- codespell
- gometalinter
- mysql-integration-test
- postgres-integration-test
filters:
branches:
only: master
branches:
only: master
release:
jobs:
- build-all:
filters: *filter-only-release
- codespell:
filters: *filter-only-release
- gometalinter:
filters: *filter-only-release
- test-frontend:
filters: *filter-only-release
- test-backend:
filters: *filter-only-release
- mysql-integration-test:
filters: *filter-only-release
- postgres-integration-test:
filters: *filter-only-release
- deploy-release:
requires:
- build-all
- test-backend
- test-frontend
- build
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
- codespell
- gometalinter
- mysql-integration-test
- postgres-integration-test
filters: *filter-only-release

15
.dockerignore Normal file
View File

@@ -0,0 +1,15 @@
.awcache
.dockerignore
.git
.gitignore
.github
data*
dist
docker
docs
dump.rdb
node_modules
/local
/tmp
*.yml
*.md

9
.gitignore vendored
View File

@@ -1,8 +1,10 @@
node_modules
npm-debug.log
yarn-error.log
coverage/
.aws-config.json
awsconfig
/.awcache
/dist
/public/build
/public/views/index.html
@@ -42,10 +44,13 @@ docker-compose.yaml
/conf/provisioning/**/custom.yaml
profile.cov
/grafana
/local
.notouch
/Makefile.local
/pkg/cmd/grafana-cli/grafana-cli
/pkg/cmd/grafana-server/grafana-server
/pkg/cmd/grafana-server/debug
/pkg/extensions
debug.test
/examples/*/dist
/packaging/**/*.rpm
@@ -60,4 +65,6 @@ debug.test
/vendor/**/*_test.go
/vendor/**/.editorconfig
/vendor/**/appengine*
*.orig
*.orig
/devenv/dashboards/bulk-testing/*.json

View File

@@ -1,4 +1,86 @@
# 5.1.0 (unreleased)
# 5.2.0 (unreleased)
### New Features
* **Dashboard**: Import dashboard to folder [#10796](https://github.com/grafana/grafana/issues/10796)
### Minor
* **Dashboard**: Fix so panel titles doesn't wrap [#11074](https://github.com/grafana/grafana/issues/11074)
* **Dashboard**: Prevent double-click when saving dashboard [#11963](https://github.com/grafana/grafana/issues/11963)
* **Dashboard**: AutoFocus the add-panel search filter [#12189](https://github.com/grafana/grafana/pull/12189) thx [@ryantxu](https://github.com/ryantxu)
* **Units**: W/m2 (energy), l/h (flow) and kPa (pressure) [#11233](https://github.com/grafana/grafana/pull/11233), thx [@flopp999](https://github.com/flopp999)
* **Units**: Litre/min (flow) and milliLitre/min (flow) [#12282](https://github.com/grafana/grafana/pull/12282), thx [@flopp999](https://github.com/flopp999)
* **Alerting**: Fix mobile notifications for Microsoft Teams alert notifier [#11484](https://github.com/grafana/grafana/pull/11484), thx [@manacker](https://github.com/manacker)
* **Influxdb**: Add support for mode function [#12286](https://github.com/grafana/grafana/issues/12286)
* **Cloudwatch**: Fixes panic caused by bad timerange settings [#12199](https://github.com/grafana/grafana/issues/12199)
* **Auth Proxy**: Whitelist proxy IP address instead of client IP address [#10707](https://github.com/grafana/grafana/issues/10707)
# 5.2.0-beta1 (2018-06-05)
### New Features
* **Elasticsearch**: Alerting support [#5893](https://github.com/grafana/grafana/issues/5893), thx [@WPH95](https://github.com/WPH95)
* **Login**: Change admin password after first login [#11882](https://github.com/grafana/grafana/issues/11882)
* **Alert list panel**: Updated to support filtering alerts by name, dashboard title, folder, tags [#11500](https://github.com/grafana/grafana/issues/11500), [#8168](https://github.com/grafana/grafana/issues/8168), [#6541](https://github.com/grafana/grafana/issues/6541)
### Minor
* **Dashboard**: Modified time range and variables are now not saved by default [#10748](https://github.com/grafana/grafana/issues/10748), [#8805](https://github.com/grafana/grafana/issues/8805)
* **Graph**: Show invisible highest value bucket in histogram [#11498](https://github.com/grafana/grafana/issues/11498)
* **Dashboard**: Enable "Save As..." if user has edit permission [#11625](https://github.com/grafana/grafana/issues/11625)
* **Prometheus**: Query dates are now step-aligned [#10434](https://github.com/grafana/grafana/pull/10434)
* **Prometheus**: Table columns order now changes when rearrange queries [#11690](https://github.com/grafana/grafana/issues/11690), thx [@mtanda](https://github.com/mtanda)
* **Variables**: Fix variable interpolation when using multiple formatting types [#11800](https://github.com/grafana/grafana/issues/11800), thx [@svenklemm](https://github.com/svenklemm)
* **Dashboard**: Fix date selector styling for dark/light theme in time picker control [#11616](https://github.com/grafana/grafana/issues/11616)
* **Discord**: Alert notification channel type for Discord, [#7964](https://github.com/grafana/grafana/issues/7964) thx [@jereksel](https://github.com/jereksel),
* **InfluxDB**: Support SELECT queries in templating query, [#5013](https://github.com/grafana/grafana/issues/5013)
* **InfluxDB**: Support count distinct aggregation [#11645](https://github.com/grafana/grafana/issues/11645), thx [@kichristensen](https://github.com/kichristensen)
* **Dashboard**: JSON Model under dashboard settings can now be updated & changes saved, [#1429](https://github.com/grafana/grafana/issues/1429), thx [@jereksel](https://github.com/jereksel)
* **Security**: Fix XSS vulnerabilities in dashboard links [#11813](https://github.com/grafana/grafana/pull/11813)
* **Singlestat**: Fix "time of last point" shows local time when dashboard timezone set to UTC [#10338](https://github.com/grafana/grafana/issues/10338)
* **Prometheus**: Add support for passing timeout parameter to Prometheus [#11788](https://github.com/grafana/grafana/pull/11788), thx [@mtanda](https://github.com/mtanda)
* **Login**: Add optional option sign out url for generic oauth [#9847](https://github.com/grafana/grafana/issues/9847), thx [@roidelapluie](https://github.com/roidelapluie)
* **Login**: Use proxy server from environment variable if available [#9703](https://github.com/grafana/grafana/issues/9703), thx [@iyeonok](https://github.com/iyeonok)
* **Invite users**: Friendlier error message when smtp is not configured [#12087](https://github.com/grafana/grafana/issues/12087), thx [@thurt](https://github.com/thurt)
* **Graphite**: Don't send distributed tracing headers when using direct/browser access mode [#11494](https://github.com/grafana/grafana/issues/11494)
* **Sidenav**: Show create dashboard link for viewers if at least editor in one folder [#11858](https://github.com/grafana/grafana/issues/11858)
* **SQL**: Second epochs are now correctly converted to ms. [#12085](https://github.com/grafana/grafana/pull/12085)
* **Singlestat**: Fix singlestat threshold tooltip [#11971](https://github.com/grafana/grafana/issues/11971)
* **Dashboard**: Hide grid controls in fullscreen/low-activity views [#11771](https://github.com/grafana/grafana/issues/11771)
* **Dashboard**: Validate uid when importing dashboards [#11515](https://github.com/grafana/grafana/issues/11515)
* **Docker**: Support for env variables ending with _FILE [grafana-docker #166](https://github.com/grafana/grafana-docker/pull/166), thx [@efrecon](https://github.com/efrecon)
* **Alert list panel**: Show alerts for user with viewer role [#11167](https://github.com/grafana/grafana/issues/11167)
* **Provisioning**: Verify checksum of dashboards before updating to reduce load on database [#11670](https://github.com/grafana/grafana/issues/11670)
* **Provisioning**: Support symlinked files in dashboard provisioning config files [#11958](https://github.com/grafana/grafana/issues/11958)
* **Dashboard list panel**: Search dashboards by folder [#11525](https://github.com/grafana/grafana/issues/11525)
* **Sidenav**: Always show server admin link in sidenav if grafana admin [#11657](https://github.com/grafana/grafana/issues/11657)
# 5.1.3 (2018-05-16)
* **Scroll**: Graph panel / legend texts shifts on the left each time we move scrollbar on firefox [#11830](https://github.com/grafana/grafana/issues/11830)
# 5.1.2 (2018-05-09)
* **Database**: Fix MySql migration issue [#11862](https://github.com/grafana/grafana/issues/11862)
* **Google Analytics**: Enable Google Analytics anonymizeIP setting for GDPR [#11656](https://github.com/grafana/grafana/pull/11656)
# 5.1.1 (2018-05-07)
* **LDAP**: LDAP login with MariaDB/MySQL database and dn>100 chars not possible [#11754](https://github.com/grafana/grafana/issues/11754)
* **Build**: AppVeyor Windows build missing version and commit info [#11758](https://github.com/grafana/grafana/issues/11758)
* **Scroll**: Scroll can't start in graphs on Chrome mobile [#11710](https://github.com/grafana/grafana/issues/11710)
* **Units**: Revert renaming of unit key ppm [#11743](https://github.com/grafana/grafana/issues/11743)
# 5.1.0 (2018-04-26)
* **Folders**: Default permissions on folder are not shown as inherited in its dashboards [#11668](https://github.com/grafana/grafana/issues/11668)
* **Templating**: Allow more than 20 previews when creating a variable [#11508](https://github.com/grafana/grafana/issues/11508)
* **Dashboard**: Row edit icon not shown [#11466](https://github.com/grafana/grafana/issues/11466)
* **SQL**: Unsupported data types for value column using time series query [#11703](https://github.com/grafana/grafana/issues/11703)
* **Prometheus**: Prometheus query inspector expands to be very large on autocomplete queries [#11673](https://github.com/grafana/grafana/issues/11673)
# 5.1.0-beta1 (2018-04-20)
* **MSSQL**: New Microsoft SQL Server data source [#10093](https://github.com/grafana/grafana/pull/10093), [#11298](https://github.com/grafana/grafana/pull/11298), thx [@linuxchips](https://github.com/linuxchips)
* **Prometheus**: The heatmap panel now support Prometheus histograms [#10009](https://github.com/grafana/grafana/issues/10009)
@@ -43,13 +125,13 @@
* **Units**: Use B/s instead Bps for Bytes per second [#9342](https://github.com/grafana/grafana/pull/9342), thx [@mayli](https://github.com/mayli)
* **Units**: Radiation units [#11001](https://github.com/grafana/grafana/issues/11001), thx [@victorclaessen](https://github.com/victorclaessen)
* **Units**: Timeticks unit [#11183](https://github.com/grafana/grafana/pull/11183), thx [@jtyr](https://github.com/jtyr)
* **Units**: Concentration units and "Normal cubic metre" [#11211](https://github.com/grafana/grafana/issues/11211), thx [@flopp999](https://github.com/flopp999)
* **Units**: Concentration units and "Normal cubic metre" [#11211](https://github.com/grafana/grafana/issues/11211), thx [@flopp999](https://github.com/flopp999)
* **Units**: New currency - Czech koruna [#11384](https://github.com/grafana/grafana/pull/11384), thx [@Rohlik](https://github.com/Rohlik)
* **Avatar**: Fix DISABLE_GRAVATAR option [#11095](https://github.com/grafana/grafana/issues/11095)
* **Heatmap**: Disable log scale when using time time series buckets [#10792](https://github.com/grafana/grafana/issues/10792)
* **Provisioning**: Remove `id` from json when provisioning dashboards, [#11138](https://github.com/grafana/grafana/issues/11138)
* **Prometheus**: tooltip for legend format not showing properly [#11516](https://github.com/grafana/grafana/issues/11516), thx [@svenklemm](https://github.com/svenklemm)
* **Playlist**: Empty playlists cannot be deleted [#11133](https://github.com/grafana/grafana/issues/11133), thx [@kichristensen](https://github.com/kichristensen)
* **Prometheus**: tooltip for legend format not showing properly [#11516](https://github.com/grafana/grafana/issues/11516), thx [@svenklemm](https://github.com/svenklemm)
* **Playlist**: Empty playlists cannot be deleted [#11133](https://github.com/grafana/grafana/issues/11133), thx [@kichristensen](https://github.com/kichristensen)
* **Switch Orgs**: Alphabetic order in Switch Organization modal [#11556](https://github.com/grafana/grafana/issues/11556)
* **Postgres**: improve `$__timeFilter` macro [#11578](https://github.com/grafana/grafana/issues/11578), thx [@svenklemm](https://github.com/svenklemm)
* **Permission list**: Improved ux [#10747](https://github.com/grafana/grafana/issues/10747)

348
Gopkg.lock generated
View File

@@ -4,8 +4,8 @@
[[projects]]
name = "cloud.google.com/go"
packages = ["compute/metadata"]
revision = "767c40d6a2e058483c25fa193e963a22da17236d"
version = "v0.18.0"
revision = "056a55f54a6cc77b440b31a56a5e7c3982d32811"
version = "v0.22.0"
[[projects]]
name = "github.com/BurntSushi/toml"
@@ -19,17 +19,43 @@
packages = ["."]
revision = "7677a1d7c1137cd3dd5ba7a076d0c898a1ef4520"
[[projects]]
name = "github.com/apache/thrift"
packages = ["lib/go/thrift"]
revision = "b2a4d4ae21c789b689dd162deb819665567f481c"
version = "0.10.0"
[[projects]]
name = "github.com/aws/aws-sdk-go"
packages = ["aws","aws/awserr","aws/awsutil","aws/client","aws/client/metadata","aws/corehandlers","aws/credentials","aws/credentials/ec2rolecreds","aws/credentials/endpointcreds","aws/credentials/stscreds","aws/defaults","aws/ec2metadata","aws/endpoints","aws/request","aws/session","aws/signer/v4","internal/shareddefaults","private/protocol","private/protocol/ec2query","private/protocol/query","private/protocol/query/queryutil","private/protocol/rest","private/protocol/restxml","private/protocol/xml/xmlutil","service/cloudwatch","service/ec2","service/ec2/ec2iface","service/s3","service/sts"]
revision = "decd990ddc5dcdf2f73309cbcab90d06b996ca28"
version = "v1.12.67"
packages = [
"aws",
"aws/awserr",
"aws/awsutil",
"aws/client",
"aws/client/metadata",
"aws/corehandlers",
"aws/credentials",
"aws/credentials/ec2rolecreds",
"aws/credentials/endpointcreds",
"aws/credentials/stscreds",
"aws/defaults",
"aws/ec2metadata",
"aws/endpoints",
"aws/request",
"aws/session",
"aws/signer/v4",
"internal/sdkio",
"internal/sdkrand",
"internal/shareddefaults",
"private/protocol",
"private/protocol/ec2query",
"private/protocol/query",
"private/protocol/query/queryutil",
"private/protocol/rest",
"private/protocol/restxml",
"private/protocol/xml/xmlutil",
"service/cloudwatch",
"service/ec2",
"service/ec2/ec2iface",
"service/s3",
"service/sts"
]
revision = "c7cd1ebe87257cde9b65112fc876b0339ea0ac30"
version = "v1.13.49"
[[projects]]
branch = "master"
@@ -41,7 +67,7 @@
branch = "master"
name = "github.com/beorn7/perks"
packages = ["quantile"]
revision = "4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9"
revision = "3a771d992973f24aa725d07868b467d1ddfceafb"
[[projects]]
branch = "master"
@@ -75,20 +101,35 @@
[[projects]]
name = "github.com/denisenkom/go-mssqldb"
packages = [".","internal/cp"]
packages = [
".",
"internal/cp"
]
revision = "270bc3860bb94dd3a3ffd047377d746c5e276726"
[[projects]]
branch = "master"
name = "github.com/facebookgo/inject"
packages = ["."]
revision = "cc1aa653e50f6a9893bcaef89e673e5b24e1e97b"
[[projects]]
branch = "master"
name = "github.com/facebookgo/structtag"
packages = ["."]
revision = "217e25fb96916cc60332e399c9aa63f5c422ceed"
[[projects]]
name = "github.com/fatih/color"
packages = ["."]
revision = "570b54cabe6b8eb0bc2dfce68d964677d63b5260"
version = "v1.5.0"
revision = "5b77d2a35fb0ede96d138fc9a99f5c9b6aef11b4"
version = "v1.7.0"
[[projects]]
name = "github.com/go-ini/ini"
packages = ["."]
revision = "32e4c1e6bc4e7d0d8451aa6b75200d19e37a536a"
version = "v1.32.0"
revision = "6529cf7c58879c08d927016dde4477f18a0634cb"
version = "v1.36.0"
[[projects]]
name = "github.com/go-ldap/ldap"
@@ -117,7 +158,12 @@
[[projects]]
branch = "master"
name = "github.com/go-macaron/session"
packages = [".","memcache","postgres","redis"]
packages = [
".",
"memcache",
"postgres",
"redis"
]
revision = "b8e286a0dba8f4999042d6b258daf51b31d08938"
[[projects]]
@@ -132,10 +178,10 @@
version = "v1.7.0"
[[projects]]
branch = "master"
name = "github.com/go-xorm/builder"
packages = ["."]
revision = "488224409dd8aa2ce7a5baf8d10d55764a913738"
revision = "bad0a612f0d6277b953910822ab5dfb30dd18237"
version = "v0.2.0"
[[projects]]
name = "github.com/go-xorm/core"
@@ -152,14 +198,20 @@
[[projects]]
branch = "master"
name = "github.com/golang/protobuf"
packages = ["proto","ptypes","ptypes/any","ptypes/duration","ptypes/timestamp"]
revision = "c65a0412e71e8b9b3bfd22925720d23c0f054237"
packages = [
"proto",
"ptypes",
"ptypes/any",
"ptypes/duration",
"ptypes/timestamp"
]
revision = "927b65914520a8b7d44f5c9057611cfec6b2e2d0"
[[projects]]
branch = "master"
name = "github.com/gopherjs/gopherjs"
packages = ["js"]
revision = "178c176a91fe05e3e6c58fa5c989bad19e6cdcb3"
revision = "8dffc02ea1cb8398bb73f30424697c60fcf8d4c5"
[[projects]]
name = "github.com/gorilla/websocket"
@@ -175,32 +227,35 @@
[[projects]]
branch = "master"
name = "github.com/grafana/grafana_plugin_model"
packages = ["go/datasource"]
revision = "dfe5dc0a6ce05825ba7fe2d0323d92e631bffa89"
name = "github.com/grafana/grafana-plugin-model"
packages = [
"go/datasource",
"go/renderer"
]
revision = "84176c64269d8060f99e750ee8aba6f062753336"
[[projects]]
branch = "master"
name = "github.com/hashicorp/go-hclog"
packages = ["."]
revision = "5bcb0f17e36442247290887cc914a6e507afa5c4"
revision = "69ff559dc25f3b435631604f573a5fa1efdb6433"
[[projects]]
name = "github.com/hashicorp/go-plugin"
packages = ["."]
revision = "3e6d191694b5a3a2b99755f31b47fa209e4bcd09"
revision = "e8d22c780116115ae5624720c9af0c97afe4f551"
[[projects]]
branch = "master"
name = "github.com/hashicorp/go-version"
packages = ["."]
revision = "4fe82ae3040f80a03d04d2cccb5606a626b8e1ee"
revision = "23480c0665776210b5fbbac6eaaee40e3e6a96b7"
[[projects]]
branch = "master"
name = "github.com/hashicorp/yamux"
packages = ["."]
revision = "683f49123a33db61abfb241b7ac5e4af4dc54d55"
revision = "2658be15c5f05e76244154714161f17e3e77de2e"
[[projects]]
name = "github.com/inconshreveable/log15"
@@ -221,7 +276,10 @@
[[projects]]
name = "github.com/klauspost/compress"
packages = ["flate","gzip"]
packages = [
"flate",
"gzip"
]
revision = "6c8db69c4b49dd4df1fff66996cf556176d0b9bf"
version = "v1.2.1"
@@ -238,22 +296,25 @@
version = "v1.1"
[[projects]]
branch = "master"
name = "github.com/kr/pretty"
packages = ["."]
revision = "cfb55aafdaf3ec08f0db22699ab822c50091b1c4"
revision = "73f6ac0b30a98e433b289500d779f50c1a6f0712"
version = "v0.1.0"
[[projects]]
branch = "master"
name = "github.com/kr/text"
packages = ["."]
revision = "7cafcd837844e784b526369c9bce262804aebc60"
revision = "e2ffdb16a802fe2bb95e2e35ff34f0e53aeef34f"
version = "v0.1.0"
[[projects]]
branch = "master"
name = "github.com/lib/pq"
packages = [".","oid"]
revision = "61fe37aa2ee24fabcdbe5c4ac1d4ac566f88f345"
packages = [
".",
"oid"
]
revision = "d34b9ff171c21ad295489235aec8b6626023cd04"
[[projects]]
name = "github.com/mattn/go-colorable"
@@ -270,8 +331,8 @@
[[projects]]
name = "github.com/mattn/go-sqlite3"
packages = ["."]
revision = "6c771bb9887719704b210e87e934f08be014bdb1"
version = "v1.6.0"
revision = "323a32be5a2421b8c7087225079c6c900ec397cd"
version = "v1.7.0"
[[projects]]
name = "github.com/matttproud/golang_protobuf_extensions"
@@ -285,9 +346,19 @@
packages = ["."]
revision = "a61a99592b77c9ba629d254a693acffaeb4b7e28"
[[projects]]
name = "github.com/oklog/run"
packages = ["."]
revision = "4dadeb3030eda0273a12382bb2348ffc7c9d1a39"
version = "v1.0.0"
[[projects]]
name = "github.com/opentracing/opentracing-go"
packages = [".","ext","log"]
packages = [
".",
"ext",
"log"
]
revision = "1949ddbfd147afd4d964a9f00b24eb291e0e7c38"
version = "v1.0.2"
@@ -297,9 +368,20 @@
revision = "a3647f8e31d79543b2d0f0ae2fe5c379d72cedc0"
version = "v2.1.0"
[[projects]]
name = "github.com/pkg/errors"
packages = ["."]
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
name = "github.com/prometheus/client_golang"
packages = ["api","api/prometheus/v1","prometheus","prometheus/promhttp"]
packages = [
"api",
"api/prometheus/v1",
"prometheus",
"prometheus/promhttp"
]
revision = "967789050ba94deca04a5e84cce8ad472ce313c1"
version = "v0.9.0-pre1"
@@ -312,14 +394,23 @@
[[projects]]
branch = "master"
name = "github.com/prometheus/common"
packages = ["expfmt","internal/bitbucket.org/ww/goautoneg","model"]
revision = "89604d197083d4781071d3c65855d24ecfb0a563"
packages = [
"expfmt",
"internal/bitbucket.org/ww/goautoneg",
"model"
]
revision = "d811d2e9bf898806ecfb6ef6296774b13ffc314c"
[[projects]]
branch = "master"
name = "github.com/prometheus/procfs"
packages = [".","internal/util","nfsd","xfs"]
revision = "85fadb6e89903ef7cca6f6a804474cd5ea85b6e1"
packages = [
".",
"internal/util",
"nfs",
"xfs"
]
revision = "8b1c2da0d56deffdbb9e48d4414b4e674bd8083e"
[[projects]]
branch = "master"
@@ -328,20 +419,28 @@
revision = "cb7f23ec59bec0d61b19c56cd88cee3d0cc1870c"
[[projects]]
branch = "master"
name = "github.com/sergi/go-diff"
packages = ["diffmatchpatch"]
revision = "1744e2970ca51c86172c8190fadad617561ed6e7"
version = "v1.0.0"
[[projects]]
name = "github.com/smartystreets/assertions"
packages = [".","internal/go-render/render","internal/oglematchers"]
revision = "0b37b35ec7434b77e77a4bb29b79677cced992ea"
version = "1.8.1"
packages = [
".",
"internal/go-render/render",
"internal/oglematchers"
]
revision = "7678a5452ebea5b7090a6b163f844c133f523da2"
version = "1.8.3"
[[projects]]
name = "github.com/smartystreets/goconvey"
packages = ["convey","convey/gotest","convey/reporting"]
packages = [
"convey",
"convey/gotest",
"convey/reporting"
]
revision = "9e8dc3f972df6c8fcc0375ef492c24d0bb204857"
version = "1.6.3"
@@ -353,19 +452,39 @@
[[projects]]
name = "github.com/uber/jaeger-client-go"
packages = [".","config","internal/baggage","internal/baggage/remote","internal/spanlog","log","rpcmetrics","thrift-gen/agent","thrift-gen/baggage","thrift-gen/jaeger","thrift-gen/sampling","thrift-gen/zipkincore","utils"]
revision = "3ac96c6e679cb60a74589b0d0aa7c70a906183f7"
version = "v2.11.2"
packages = [
".",
"config",
"internal/baggage",
"internal/baggage/remote",
"internal/spanlog",
"internal/throttler",
"internal/throttler/remote",
"log",
"rpcmetrics",
"thrift",
"thrift-gen/agent",
"thrift-gen/baggage",
"thrift-gen/jaeger",
"thrift-gen/sampling",
"thrift-gen/zipkincore",
"utils"
]
revision = "b043381d944715b469fd6b37addfd30145ca1758"
version = "v2.14.0"
[[projects]]
name = "github.com/uber/jaeger-lib"
packages = ["metrics"]
revision = "7f95f4f7e80028096410abddaae2556e4c61b59f"
version = "v1.3.1"
revision = "ed3a127ec5fef7ae9ea95b01b542c47fbd999ce5"
version = "v1.5.0"
[[projects]]
name = "github.com/yudai/gojsondiff"
packages = [".","formatter"]
packages = [
".",
"formatter"
]
revision = "7b1b7adf999dab73a6eb02669c3d82dbb27a3dd6"
version = "1.0.0"
@@ -378,42 +497,87 @@
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["md4","pbkdf2"]
revision = "3d37316aaa6bd9929127ac9a527abf408178ea7b"
packages = [
"md4",
"pbkdf2"
]
revision = "1a580b3eff7814fc9b40602fd35256c63b50f491"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = ["context","context/ctxhttp","http2","http2/hpack","idna","internal/timeseries","lex/httplex","trace"]
revision = "5ccada7d0a7ba9aeb5d3aca8d3501b4c2a509fec"
packages = [
"context",
"context/ctxhttp",
"http/httpguts",
"http2",
"http2/hpack",
"idna",
"internal/timeseries",
"trace"
]
revision = "2491c5de3490fced2f6cff376127c667efeed857"
[[projects]]
branch = "master"
name = "golang.org/x/oauth2"
packages = [".","google","internal","jws","jwt"]
revision = "b28fcf2b08a19742b43084fb40ab78ac6c3d8067"
packages = [
".",
"google",
"internal",
"jws",
"jwt"
]
revision = "cdc340f7c179dbbfa4afd43b7614e8fcadde4269"
[[projects]]
branch = "master"
name = "golang.org/x/sync"
packages = ["errgroup"]
revision = "fd80eb99c8f653c847d294a001bdf2a3a6f768f5"
revision = "1d60e4601c6fd243af51cc01ddf169918a5407ca"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = ["unix"]
revision = "af50095a40f9041b3b38960738837185c26e9419"
revision = "7c87d13f8e835d2fb3a70a2912c811ed0c1d241b"
[[projects]]
branch = "master"
name = "golang.org/x/text"
packages = ["collate","collate/build","internal/colltab","internal/gen","internal/tag","internal/triegen","internal/ucd","language","secure/bidirule","transform","unicode/bidi","unicode/cldr","unicode/norm","unicode/rangetable"]
revision = "e19ae1496984b1c655b8044a65c0300a3c878dd3"
packages = [
"collate",
"collate/build",
"internal/colltab",
"internal/gen",
"internal/tag",
"internal/triegen",
"internal/ucd",
"language",
"secure/bidirule",
"transform",
"unicode/bidi",
"unicode/cldr",
"unicode/norm",
"unicode/rangetable"
]
revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0"
version = "v0.3.0"
[[projects]]
name = "google.golang.org/appengine"
packages = [".","cloudsql","internal","internal/app_identity","internal/base","internal/datastore","internal/log","internal/modules","internal/remote_api","internal/urlfetch","urlfetch"]
packages = [
".",
"cloudsql",
"internal",
"internal/app_identity",
"internal/base",
"internal/datastore",
"internal/log",
"internal/modules",
"internal/remote_api",
"internal/urlfetch",
"urlfetch"
]
revision = "150dc57a1b433e64154302bdc40b6bb8aefa313a"
version = "v1.0.0"
@@ -421,13 +585,39 @@
branch = "master"
name = "google.golang.org/genproto"
packages = ["googleapis/rpc/status"]
revision = "a8101f21cf983e773d0c1133ebc5424792003214"
revision = "7bb2a897381c9c5ab2aeb8614f758d7766af68ff"
[[projects]]
name = "google.golang.org/grpc"
packages = [".","balancer","balancer/base","balancer/roundrobin","codes","connectivity","credentials","encoding","grpclb/grpc_lb_v1/messages","grpclog","health","health/grpc_health_v1","internal","keepalive","metadata","naming","peer","resolver","resolver/dns","resolver/passthrough","stats","status","tap","transport"]
revision = "6b51017f791ae1cfbec89c52efdf444b13b550ef"
version = "v1.9.2"
packages = [
".",
"balancer",
"balancer/base",
"balancer/roundrobin",
"codes",
"connectivity",
"credentials",
"encoding",
"encoding/proto",
"grpclb/grpc_lb_v1/messages",
"grpclog",
"health",
"health/grpc_health_v1",
"internal",
"keepalive",
"metadata",
"naming",
"peer",
"resolver",
"resolver/dns",
"resolver/passthrough",
"stats",
"status",
"tap",
"transport"
]
revision = "1e2570b1b19ade82d8dbb31bba4e65e9f9ef5b34"
version = "v1.11.1"
[[projects]]
branch = "v3"
@@ -450,14 +640,14 @@
[[projects]]
name = "gopkg.in/ini.v1"
packages = ["."]
revision = "32e4c1e6bc4e7d0d8451aa6b75200d19e37a536a"
version = "v1.32.0"
revision = "6529cf7c58879c08d927016dde4477f18a0634cb"
version = "v1.36.0"
[[projects]]
name = "gopkg.in/macaron.v1"
packages = ["."]
revision = "75f2e9b42e99652f0d82b28ccb73648f44615faa"
version = "v1.2.4"
revision = "c1be95e6d21e769e44e1ec33cec9da5837861c10"
version = "v1.3.1"
[[projects]]
branch = "v2"
@@ -472,14 +662,14 @@
version = "v2.3.2"
[[projects]]
branch = "v2"
name = "gopkg.in/yaml.v2"
packages = ["."]
revision = "d670f9405373e636a5a2765eea47fac0c9bc91a4"
revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183"
version = "v2.2.1"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "ad3c71fd3244369c313978e9e7464c7116faee764386439a17de0707a08103aa"
inputs-digest = "85cc057e0cc074ab5b43bd620772d63d51e07b04e8782fcfe55e6929d2fc40f7"
solver-name = "gps-cdcl"
solver-version = 1

View File

@@ -85,11 +85,11 @@ ignored = [
[[constraint]]
name = "github.com/go-xorm/core"
version = "0.5.7"
version = "=0.5.7"
[[constraint]]
name = "github.com/go-xorm/xorm"
version = "0.6.4"
version = "=0.6.4"
[[constraint]]
name = "github.com/gorilla/websocket"
@@ -101,12 +101,16 @@ ignored = [
[[constraint]]
branch = "master"
name = "github.com/grafana/grafana_plugin_model"
name = "github.com/grafana/grafana-plugin-model"
[[constraint]]
branch = "master"
name = "github.com/hashicorp/go-hclog"
[[constraint]]
name = "github.com/hashicorp/go-plugin"
revision = "e8d22c780116115ae5624720c9af0c97afe4f551"
[[constraint]]
branch = "master"
name = "github.com/hashicorp/go-version"
@@ -125,7 +129,7 @@ ignored = [
[[constraint]]
name = "github.com/mattn/go-sqlite3"
version = "1.6.0"
version = "1.7.0"
[[constraint]]
name = "github.com/opentracing/opentracing-go"

View File

@@ -12,6 +12,10 @@ module.exports = function (grunt) {
platform: process.platform.replace('win32', 'windows'),
};
if (grunt.option('platform')) {
config.platform = grunt.option('platform');
}
if (grunt.option('arch')) {
config.arch = grunt.option('arch');
} else {

View File

@@ -1,3 +1,5 @@
-include local/Makefile
all: deps build
deps-go:

View File

@@ -39,12 +39,21 @@ go run build.go build
For this you need nodejs (v.6+).
To build the assets, rebuild on file change, and serve them by Grafana's webserver (http://localhost:3000):
```bash
npm install -g yarn
yarn install --pure-lockfile
npm run watch
```
Build the assets, rebuild on file change with Hot Module Replacement (HMR), and serve them by webpack-dev-server (http://localhost:3333):
```bash
yarn start
# OR set a theme
env GRAFANA_THEME=light yarn start
```
Note: HMR for Angular is not supported. If you edit files in the Angular part of the app, the whole page will reload.
Run tests
```bash
npm run jest

View File

@@ -1,26 +1,20 @@
# Roadmap (2018-02-22)
# Roadmap (2018-05-06)
This roadmap is a tentative plan for the core development team. Things change constantly as PRs come in and priorities change.
But it will give you an idea of our current vision and plan.
### Short term (1-2 months)
- v5.1
- Build speed improvements & integration test execution
- Kubernetes friendly docker container
- Enterprise LDAP
- Provisioning workflow
- MSSQL datasource
- Elasticsearch alerting
- Crossplatform builds
- Backend service refactorings
- Explore UI
- First login registration view
### Mid term (2-4 months)
- v5.2
- Azure monitor backend rewrite
- Elasticsearch alerting
- First login registration view
- Backend plugins? (alert notifiers, auth)
- Crossplatform builds
- IFQL Initial support
- Multi-Stat panel
- React Panels
- Templating Query Editor UI Plugin hook
### Long term (4 - 8 months)

View File

@@ -6,7 +6,7 @@ clone_folder: c:\gopath\src\github.com\grafana\grafana
environment:
nodejs_version: "6"
GOPATH: c:\gopath
GOPATH: C:\gopath
GOVERSION: 1.10
install:
@@ -38,16 +38,3 @@ artifacts:
- path: grafana-*windows-*.*
name: binzip
type: zip
deploy:
- provider: Environment
name: GrafanaReleaseMaster
on:
buildType: master
- provider: Environment
name: GrafanaReleaseRelease
on:
buildType: release

152
build.go
View File

@@ -16,7 +16,6 @@ import (
"os/exec"
"path"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
@@ -24,14 +23,13 @@ import (
)
var (
versionRe = regexp.MustCompile(`-[0-9]{1,3}-g[0-9a-f]{5,10}`)
goarch string
goos string
gocc string
gocxx string
cgo string
pkgArch string
version string = "v1"
//versionRe = regexp.MustCompile(`-[0-9]{1,3}-g[0-9a-f]{5,10}`)
goarch string
goos string
gocc string
cgo bool
pkgArch string
version string = "v1"
// deb & rpm does not support semver so have to handle their version a little differently
linuxPackageVersion string = "v1"
linuxPackageIteration string = ""
@@ -42,10 +40,9 @@ var (
buildNumber int = 0
binaries []string = []string{"grafana-server", "grafana-cli"}
isDev bool = false
enterprise bool = false
)
const minGoVersion = 1.8
func main() {
log.SetOutput(os.Stdout)
log.SetFlags(0)
@@ -55,12 +52,12 @@ func main() {
flag.StringVar(&goarch, "goarch", runtime.GOARCH, "GOARCH")
flag.StringVar(&goos, "goos", runtime.GOOS, "GOOS")
flag.StringVar(&gocc, "cc", "", "CC")
flag.StringVar(&gocxx, "cxx", "", "CXX")
flag.StringVar(&cgo, "cgo-enabled", "", "CGO_ENABLED")
flag.BoolVar(&cgo, "cgo-enabled", cgo, "Enable cgo")
flag.StringVar(&pkgArch, "pkg-arch", "", "PKG ARCH")
flag.StringVar(&phjsToRelease, "phjs", "", "PhantomJS binary")
flag.BoolVar(&race, "race", race, "Use race detector")
flag.BoolVar(&includeBuildNumber, "includeBuildNumber", includeBuildNumber, "IncludeBuildNumber in package name")
flag.BoolVar(&enterprise, "enterprise", enterprise, "Build enterprise version of Grafana")
flag.IntVar(&buildNumber, "buildNumber", 0, "Build number from CI system")
flag.BoolVar(&isDev, "dev", isDev, "optimal for development, skips certain steps")
flag.Parse()
@@ -94,20 +91,24 @@ func main() {
build("grafana-server", "./pkg/cmd/grafana-server", []string{})
case "build":
clean()
//clean()
for _, binary := range binaries {
build(binary, "./pkg/cmd/"+binary, []string{})
}
case "build-frontend":
grunt(gruntBuildArg("build")...)
case "test":
test("./pkg/...")
grunt("test")
case "package":
grunt(gruntBuildArg("release")...)
if runtime.GOOS != "windows" {
createLinuxPackages()
}
grunt(gruntBuildArg("build")...)
packageGrafana()
case "package-only":
packageGrafana()
case "pkg-rpm":
grunt(gruntBuildArg("release")...)
@@ -132,6 +133,22 @@ func main() {
}
}
func packageGrafana() {
platformArg := fmt.Sprintf("--platform=%v", goos)
previousPkgArch := pkgArch
if pkgArch == "" {
pkgArch = goarch
}
postProcessArgs := gruntBuildArg("package")
postProcessArgs = append(postProcessArgs, platformArg)
grunt(postProcessArgs...)
pkgArch = previousPkgArch
if goos == "linux" {
createLinuxPackages()
}
}
func makeLatestDistCopies() {
files, err := ioutil.ReadDir("dist")
if err != nil {
@@ -139,9 +156,9 @@ func makeLatestDistCopies() {
}
latestMapping := map[string]string{
".deb": "dist/grafana_latest_amd64.deb",
".rpm": "dist/grafana-latest-1.x86_64.rpm",
".tar.gz": "dist/grafana-latest.linux-x64.tar.gz",
"_amd64.deb": "dist/grafana_latest_amd64.deb",
".x86_64.rpm": "dist/grafana-latest-1.x86_64.rpm",
".linux-amd64.tar.gz": "dist/grafana-latest.linux-x64.tar.gz",
}
for _, file := range files {
@@ -212,6 +229,10 @@ type linuxPackageOptions struct {
}
func createDebPackages() {
previousPkgArch := pkgArch
if pkgArch == "armv7" {
pkgArch = "armhf"
}
createPackage(linuxPackageOptions{
packageType: "deb",
homeDir: "/usr/share/grafana",
@@ -229,9 +250,17 @@ func createDebPackages() {
depends: []string{"adduser", "libfontconfig"},
})
pkgArch = previousPkgArch
}
func createRpmPackages() {
previousPkgArch := pkgArch
switch {
case pkgArch == "armv7":
pkgArch = "armhfp"
case pkgArch == "arm64":
pkgArch = "aarch64"
}
createPackage(linuxPackageOptions{
packageType: "rpm",
homeDir: "/usr/share/grafana",
@@ -249,6 +278,7 @@ func createRpmPackages() {
depends: []string{"/sbin/service", "fontconfig", "freetype", "urw-fonts"},
})
pkgArch = previousPkgArch
}
func createLinuxPackages() {
@@ -286,19 +316,33 @@ func createPackage(options linuxPackageOptions) {
"-s", "dir",
"--description", "Grafana",
"-C", packageRoot,
"--vendor", "Grafana",
"--url", "https://grafana.com",
"--license", "\"Apache 2.0\"",
"--maintainer", "contact@grafana.com",
"--config-files", options.initdScriptFilePath,
"--config-files", options.etcDefaultFilePath,
"--config-files", options.systemdServiceFilePath,
"--after-install", options.postinstSrc,
"--name", "grafana",
"--version", linuxPackageVersion,
"-p", "./dist",
}
name := "grafana"
if enterprise {
name += "-enterprise"
}
args = append(args, "--name", name)
description := "Grafana"
if enterprise {
description += " Enterprise"
}
args = append(args, "--vendor", description)
if !enterprise {
args = append(args, "--license", "\"Apache 2.0\"")
}
if options.packageType == "rpm" {
args = append(args, "--rpm-posttrans", "packaging/rpm/control/posttrans")
}
@@ -326,20 +370,6 @@ func createPackage(options linuxPackageOptions) {
runPrint("fpm", append([]string{"-t", options.packageType}, args...)...)
}
func verifyGitRepoIsClean() {
rs, err := runError("git", "ls-files", "--modified")
if err != nil {
log.Fatalf("Failed to check if git tree was clean, %v, %v\n", string(rs), err)
return
}
count := len(string(rs))
if count > 0 {
log.Fatalf("Git repository has modified files, aborting")
}
log.Println("Git repository is clean")
}
func ensureGoPath() {
if os.Getenv("GOPATH") == "" {
cwd, err := os.Getwd()
@@ -352,10 +382,6 @@ func ensureGoPath() {
}
}
func ChangeWorkingDir(dir string) {
os.Chdir(dir)
}
func grunt(params ...string) {
if runtime.GOOS == "windows" {
runPrint(`.\node_modules\.bin\grunt`, params...)
@@ -391,7 +417,12 @@ func test(pkg string) {
}
func build(binaryName, pkg string, tags []string) {
binary := "./bin/" + binaryName
binary := fmt.Sprintf("./bin/%s-%s/%s", goos, goarch, binaryName)
if isDev {
//dont include os and arch in output path in dev environment
binary = fmt.Sprintf("./bin/%s", binaryName)
}
if goos == "windows" {
binary += ".exe"
}
@@ -413,6 +444,7 @@ func build(binaryName, pkg string, tags []string) {
if !isDev {
setBuildEnv()
runPrint("go", "version")
fmt.Printf("Targeting %s/%s\n", goos, goarch)
}
runPrint("go", args...)
@@ -433,6 +465,7 @@ func ldflags() string {
b.WriteString(fmt.Sprintf(" -X main.version=%s", version))
b.WriteString(fmt.Sprintf(" -X main.commit=%s", getGitSha()))
b.WriteString(fmt.Sprintf(" -X main.buildstamp=%d", buildStamp()))
b.WriteString(fmt.Sprintf(" -X main.enterprise=%t", enterprise))
return b.String()
}
@@ -455,6 +488,14 @@ func clean() {
func setBuildEnv() {
os.Setenv("GOOS", goos)
if goos == "windows" {
// require windows >=7
os.Setenv("CGO_CFLAGS", "-D_WIN32_WINNT=0x0601")
}
if goarch != "amd64" || goos != "linux" {
// needed for all other archs
cgo = true
}
if strings.HasPrefix(goarch, "armv") {
os.Setenv("GOARCH", "arm")
os.Setenv("GOARM", goarch[4:])
@@ -464,15 +505,12 @@ func setBuildEnv() {
if goarch == "386" {
os.Setenv("GO386", "387")
}
if cgo != "" {
os.Setenv("CGO_ENABLED", cgo)
if cgo {
os.Setenv("CGO_ENABLED", "1")
}
if gocc != "" {
os.Setenv("CC", gocc)
}
if gocxx != "" {
os.Setenv("CXX", gocxx)
}
}
func getGitSha() string {
@@ -492,24 +530,6 @@ func buildStamp() int64 {
return s
}
func buildArch() string {
os := goos
if os == "darwin" {
os = "macosx"
}
return fmt.Sprintf("%s-%s", os, goarch)
}
func run(cmd string, args ...string) []byte {
bs, err := runError(cmd, args...)
if err != nil {
log.Println(cmd, strings.Join(args, " "))
log.Println(string(bs))
log.Fatal(err)
}
return bytes.TrimSpace(bs)
}
func runError(cmd string, args ...string) ([]byte, error) {
ecmd := exec.Command(cmd, args...)
bs, err := ecmd.CombinedOutput()

View File

@@ -237,6 +237,9 @@ disable_login_form = false
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy
disable_signout_menu = false
# URL to redirect the user to after sign out
signout_redirect_url =
#################################### Anonymous Auth ######################
[auth.anonymous]
# enable anonymous access
@@ -442,6 +445,11 @@ enabled = true
# Makes it possible to turn off alert rule execution but alerting UI is visible
execute_alerts = true
#################################### Explore #############################
[explore]
# Enable the Explore section
enabled = false
#################################### Internal Grafana Metrics ############
# Metrics available at HTTP API Url /metrics
[metrics]

View File

@@ -217,6 +217,9 @@ log_queries =
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy, defaults to false
;disable_signout_menu = false
# URL to redirect the user to after sign out
;signout_redirect_url =
#################################### Anonymous Auth ##########################
[auth.anonymous]
# enable anonymous access
@@ -377,6 +380,11 @@ log_queries =
# Makes it possible to turn off alert rule execution but alerting UI is visible
;execute_alerts = true
#################################### Explore #############################
[explore]
# Enable the Explore section
;enabled = false
#################################### Internal Grafana Metrics ##########################
# Metrics available at HTTP API Url /metrics
[metrics]

11
devenv/README.md Normal file
View File

@@ -0,0 +1,11 @@
This folder contains useful scripts and configuration for...
* Configuring datasources in Grafana
* Provision example dashboards in Grafana
* Run preconfiured datasources as docker containers
want to know more? run setup!
```bash
./setup.sh
```

View File

@@ -0,0 +1,9 @@
apiVersion: 1
providers:
- name: 'Bulk dashboards'
folder: 'Bulk dashboards'
type: file
options:
path: devenv/dashboards/bulk-testing

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,75 @@
apiVersion: 1
datasources:
- name: Graphite
type: graphite
access: proxy
url: http://localhost:8080
jsonData:
graphiteVersion: "1.1"
- name: Prometheus
type: prometheus
access: proxy
isDefault: true
url: http://localhost:9090
- name: InfluxDB
type: influxdb
access: proxy
database: site
user: grafana
password: grafana
url: http://localhost:8086
jsonData:
timeInterval: "15s"
- name: OpenTsdb
type: opentsdb
access: proxy
url: http://localhost:4242
jsonData:
tsdbResolution: 1
tsdbVersion: 1
- name: Elastic
type: elasticsearch
access: proxy
database: "[metrics-]YYYY.MM.DD"
url: http://localhost:9200
jsonData:
interval: Daily
timeField: "@timestamp"
- name: MySQL
type: mysql
url: localhost:3306
database: grafana
user: grafana
password: password
- name: MSSQL
type: mssql
url: localhost:1433
database: grafana
user: grafana
password: "Password!"
- name: Postgres
type: postgres
url: localhost:5432
database: grafana
user: grafana
secureJsonData:
password: password
jsonData:
sslmode: "disable"
- name: Cloudwatch
type: cloudwatch
editable: true
jsonData:
authType: credentials
defaultRegion: eu-west-2

61
devenv/setup.sh Executable file
View File

@@ -0,0 +1,61 @@
#/bin/bash
bulkDashboard() {
requiresJsonnet
COUNTER=0
MAX=400
while [ $COUNTER -lt $MAX ]; do
jsonnet -o "dashboards/bulk-testing/dashboard${COUNTER}.json" -e "local bulkDash = import 'dashboards/bulk-testing/bulkdash.jsonnet'; bulkDash + { uid: 'uid-${COUNTER}', title: 'title-${COUNTER}' }"
let COUNTER=COUNTER+1
done
ln -s -f -r ./dashboards/bulk-testing/bulk-dashboards.yaml ../conf/provisioning/dashboards/custom.yaml
}
requiresJsonnet() {
if ! type "jsonnet" > /dev/null; then
echo "you need you install jsonnet to run this script"
echo "follow the instructions on https://github.com/google/jsonnet"
exit 1
fi
}
defaultDashboards() {
echo "not implemented yet"
}
defaultDatasources() {
echo "setting up all default datasources using provisioning"
ln -s -f -r ./datasources/default/default.yaml ../conf/provisioning/datasources/custom.yaml
}
usage() {
echo -e "install.sh\n\tThis script installs my basic setup for a debian laptop\n"
echo "Usage:"
echo " bulk-dashboards - create and provisioning 400 dashboards"
echo " default-datasources - provisiong all core datasources"
}
main() {
local cmd=$1
if [[ -z "$cmd" ]]; then
usage
exit 1
fi
if [[ $cmd == "bulk-dashboards" ]]; then
bulkDashboard
elif [[ $cmd == "default-datasources" ]]; then
defaultDatasources
elif [[ $cmd == "default-dashboards" ]]; then
bulkDashboard
else
usage
fi
}
main "$@"

View File

@@ -2,7 +2,7 @@
# http://localhost:3000 (Grafana running locally)
#
# Please note that you'll need to change the root_url in the Grafana configuration:
# root_url = %(protocol)s://%(domain)s:/grafana/
# root_url = %(protocol)s://%(domain)s:10081/grafana/
apacheproxy:
build: blocks/apache_proxy

View File

@@ -0,0 +1,15 @@
# You need to run 'sysctl -w vm.max_map_count=262144' on the host machine
elasticsearch6:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.4
command: elasticsearch
ports:
- "11200:9200"
- "11300:9300"
fake-elastic6-data:
image: grafana/fake-data-gen
network_mode: bridge
environment:
FD_DATASOURCE: elasticsearch6
FD_PORT: 11200

View File

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

View File

@@ -1,7 +1,19 @@
CREATE LOGIN %%USER%% WITH PASSWORD = '%%PWD%%'
GO
CREATE DATABASE %%DB%%;
CREATE DATABASE %%DB%%
ON
( NAME = %%DB%%,
FILENAME = '/var/opt/mssql/data/%%DB%%.mdf',
SIZE = 500MB,
MAXSIZE = 1000MB,
FILEGROWTH = 100MB )
LOG ON
( NAME = %%DB%%_log,
FILENAME = '/var/opt/mssql/data/%%DB%%_log.ldf',
SIZE = 500MB,
MAXSIZE = 1000MB,
FILEGROWTH = 100MB );
GO
USE %%DB%%;

View File

@@ -4,7 +4,7 @@
environment:
ACCEPT_EULA: Y
MSSQL_SA_PASSWORD: Password!
MSSQL_PID: Express
MSSQL_PID: Developer
MSSQL_DATABASE: grafana
MSSQL_USER: grafana
MSSQL_PASSWORD: Password!

View File

@@ -1,5 +1,5 @@
mysql:
image: mysql:latest
image: mysql:5.6
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: grafana

View File

@@ -1,3 +1,3 @@
FROM mysql:latest
FROM mysql:5.6
ADD setup.sql /docker-entrypoint-initdb.d
CMD ["mysqld"]
CMD ["mysqld"]

View File

@@ -2,7 +2,7 @@
# http://localhost:3000 (Grafana running locally)
#
# Please note that you'll need to change the root_url in the Grafana configuration:
# root_url = %(protocol)s://%(domain)s:/grafana/
# root_url = %(protocol)s://%(domain)s:10080/grafana/
nginxproxy:
build: blocks/nginx_proxy

View File

@@ -1,5 +1,5 @@
postgrestest:
image: postgres:latest
image: postgres:9.3
environment:
POSTGRES_USER: grafana
POSTGRES_PASSWORD: password
@@ -13,4 +13,4 @@
network_mode: bridge
environment:
FD_DATASOURCE: postgres
FD_PORT: 5432
FD_PORT: 5432

View File

@@ -1,3 +1,3 @@
FROM postgres:latest
FROM postgres:9.3
ADD setup.sql /docker-entrypoint-initdb.d
CMD ["postgres"]
CMD ["postgres"]

View File

@@ -1,3 +1,3 @@
CREATE DATABASE grafanadstest;
REVOKE CONNECT ON DATABASE grafanadstest FROM PUBLIC;
GRANT CONNECT ON DATABASE grafanadstest TO grafanatest;
GRANT CONNECT ON DATABASE grafanadstest TO grafanatest;

View File

@@ -0,0 +1,3 @@
FROM prom/prometheus:v1.8.2
ADD prometheus.yml /etc/prometheus/
ADD alert.rules /etc/prometheus/

View File

@@ -0,0 +1,10 @@
# Alert Rules
ALERT AppCrash
IF process_open_fds > 0
FOR 15s
LABELS { severity="critical" }
ANNOTATIONS {
summary = "Number of open fds > 0",
description = "Just testing"
}

View File

@@ -0,0 +1,26 @@
prometheus:
build: blocks/prometheus_mac
ports:
- "9090:9090"
node_exporter:
image: prom/node-exporter
ports:
- "9100:9100"
fake-prometheus-data:
image: grafana/fake-data-gen
ports:
- "9091:9091"
environment:
FD_DATASOURCE: prom
alertmanager:
image: quay.io/prometheus/alertmanager
ports:
- "9093:9093"
prometheus-random-data:
build: blocks/prometheus_random_data
ports:
- "8081:8080"

View File

@@ -0,0 +1,39 @@
# my global config
global:
scrape_interval: 10s # By default, scrape targets every 15 seconds.
evaluation_interval: 10s # By default, scrape targets every 15 seconds.
# scrape_timeout is set to the global default (10s).
# Load and evaluate rules in this file every 'evaluation_interval' seconds.
rule_files:
- "alert.rules"
# - "first.rules"
# - "second.rules"
alerting:
alertmanagers:
- scheme: http
static_configs:
- targets:
- "alertmanager:9093"
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'node_exporter'
static_configs:
- targets: ['node_exporter:9100']
- job_name: 'fake-data-gen'
static_configs:
- targets: ['fake-prometheus-data:9091']
- job_name: 'grafana'
static_configs:
- targets: ['host.docker.internal:3000']
- job_name: 'prometheus-random-data'
static_configs:
- targets: ['prometheus-random-data:8080']

View File

@@ -76,7 +76,7 @@ Saltstack | [https://github.com/salt-formulas/salt-formula-grafana](https://gith
> 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 `delete_datasources`. Grafana will delete datasources listed in `delete_datasources` before inserting/updating those in the `datasource` list.
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.
### Running Multiple Grafana Instances
@@ -94,13 +94,13 @@ deleteDatasources:
orgId: 1
# list of datasources to insert/update depending
# whats available in the database
# 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. direct or proxy. Required
# <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
@@ -154,7 +154,7 @@ Since not all datasources have the same configuration settings we only have the
| 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 | Elastic, Influxdb & Prometheus | Lowest interval/step value that should be used for this data source |
| timeInterval | string | Elastic, InfluxDB & Prometheus | Lowest interval/step value that should be used for this data source |
| esVersion | string | Elastic | Elasticsearch version as an number (2/5/56) |
| timeField | string | Elastic | Which field that should be used as timestamp |
| interval | string | Elastic | Index date time format |
@@ -162,9 +162,9 @@ Since not all datasources have the same configuration settings we only have the
| 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 | Postgre | SSLmode. 'disable', 'require', 'verify-ca' or 'verify-full' |
| tsdbVersion | string | OpenTSDB | Version |
| tsdbResolution | string | OpenTSDB | Resolution |
| sslmode | string | PostgreSQL | SSLmode. 'disable', 'require', 'verify-ca' or 'verify-full' |
#### Secure Json Data
@@ -177,8 +177,8 @@ Secure json data is a map of settings that will be encrypted with [secret key](/
| 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 | Postgre | password |
| user | string | Postgre | user |
| password | string | PostgreSQL | password |
| user | string | PostgreSQL | user |
| accessKey | string | Cloudwatch | Access key for connecting to Cloudwatch |
| secretKey | string | Cloudwatch | Secret key for connecting to Cloudwatch |
@@ -197,13 +197,23 @@ providers:
folder: ''
type: file
disableDeletion: false
editable: false
updateIntervalSeconds: 3 #how often Grafana will scan for changed dashboards
options:
path: /var/lib/grafana/dashboards
```
When Grafana starts, it will update/insert all dashboards available in the configured path. Then later on poll that path and look for updated json files and insert those update/insert those into the database.
#### Making changes to a provisioned dashboard
It's possible to make changes to a provisioned dashboard in Grafana UI, but there's currently no possibility to automatically save the changes back to the provisioning source.
However, if you make changes to a provisioned dashboard you can `Save` the dashboard which will bring up a *Cannot save provisioned dashboard* dialog like seen in the screenshot below.
Here available options will let you `Copy JSON to Clipboard` and/or `Save JSON to file` which can help you synchronize your dashboard changes back to the provisioning source.
Note: The JSON shown in input field and when using `Copy JSON to Clipboard` and/or `Save JSON to file` will have the `id` field automatically removed to aid the provisioning workflow.
{{< docs-imagebox img="/img/docs/v51/provisioning_cannot_save_dashboard.png" max-width="500px" class="docs-image--no-shadow" >}}
### Reuseable Dashboard Urls
If the dashboard in the json file contains an [uid](/reference/dashboard/#json-fields), Grafana will force insert/update on that uid. This allows you to migrate dashboards betweens Grafana instances and provisioning Grafana from configuration without breaking the urls given since the new dashboard url uses the uid as identifier.

View File

@@ -27,7 +27,9 @@ and the conditions that need to be met for the alert to change state and trigger
## 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`, `OpenTSDB`, `MySQL`, `Postgres` and `Cloudwatch`.
of core Grafana. Only some data sources are supported right now. They include `Graphite`, `Prometheus`, `Elasticsearch`, `InfluxDB`, `OpenTSDB`, `MySQL`, `Postgres` and `Cloudwatch`.
> Alerting support for Elasticsearch is only available in Grafana v5.2 and above.
### Clustering
@@ -152,6 +154,8 @@ filters = alerting.scheduler: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

View File

@@ -208,9 +208,9 @@ it costs $0.01 per 1,000 GetMetricStatistics or ListMetrics requests. For each q
issue a GetMetricStatistics request and every time you pick a dimension in the query editor
Grafana will issue a ListMetrics request.
## Configure datasource with provisioning
## Configure the Datasource with Provisioning
It's now possible to configure datasources using config files with Grafanas provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
It's now possible to configure datasources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
Here are some provisioning examples for this datasource.

View File

@@ -29,13 +29,19 @@ Name | Description
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Url* | The HTTP protocol, IP, and port of your Elasticsearch server.
*Access* | Proxy = access via Grafana backend, Direct = access directly from browser.
*Access* | Server (default) = URL needs to be accessible from the Grafana backend/server, Browser = URL needs to be accessible from the browser.
Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication to the browser.
Access mode controls how requests to the data source will be handled. Server should be the preferred way if nothing else stated.
### Direct access
### Server access mode (Default)
If you select direct access you must update your Elasticsearch configuration to allow other domains to access
All requests will be made from the browser to Grafana backend/server which in turn will forward the requests to the data source and by that circumvent possible Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the grafana backend/server if you select this access mode.
### Browser (Direct) access
All requests will be made from the browser directly to the data source and may be subject to Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this access mode.
If you select Browser access you must update your Elasticsearch configuration to allow other domains to access
Elasticsearch from the browser. You do this by specifying these to options in your **elasticsearch.yml** config file.
```bash
@@ -45,7 +51,7 @@ http.cors.allow-origin: "*"
### Index settings
![](/img/docs/elasticsearch/elasticsearch_ds_details.png)
![Elasticsearch Datasource Details](/img/docs/elasticsearch/elasticsearch_ds_details.png)
Here you can specify a default for the `time field` and specify the name of your Elasticsearch index. You can use
a time pattern for the index name or a wildcard.
@@ -73,7 +79,7 @@ Identifier | Description
## Metric Query editor
![](/img/docs/elasticsearch/query_editor.png)
![Elasticsearch Query Editor](/img/docs/elasticsearch/query_editor.png)
The Elasticsearch query editor allows you to select multiple metrics and group by multiple terms or filters. Use the plus and minus icons to the right to add/remove
metrics or group by clauses. Some metrics and group by clauses haves options, click the option text to expand the row to view and edit metric or group by options.
@@ -154,9 +160,9 @@ Time | The name of the time field, needs to be date field.
Text | Event description field.
Tags | Optional field name to use for event tags (can be an array or a CSV string).
## Configure datasource with provisioning
## Configure the Datasource with Provisioning
It's now possible to configure datasources using config files with Grafanas provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
It's now possible to configure datasources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
Here are some provisioning examples for this datasource.

View File

@@ -20,7 +20,7 @@ queries through the use of query references.
## Adding the data source
1. Open the side menu by clicking the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
2. In the side menu under the `Configuration` link you should find a link named `Data Sources`.
3. Click the `+ Add data source` button in the top header.
4. Select `Graphite` from the *Type* dropdown.
@@ -31,20 +31,28 @@ Name | Description
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Url* | The HTTP protocol, IP, and port of your graphite-web or graphite-api install.
*Access* | Proxy = access via Grafana backend, Direct = access directly from browser.
*Access* | Server (default) = URL needs to be accessible from the Grafana backend/server, Browser = URL needs to be accessible from the browser.
Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the browser.
Access mode controls how requests to the data source will be handled. Server should be the preferred way if nothing else stated.
### Server access mode (Default)
All requests will be made from the browser to Grafana backend/server which in turn will forward the requests to the data source and by that circumvent possible Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the grafana backend/server if you select this access mode.
### Browser access mode
All requests will be made from the browser directly to the data source and may be subject to Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this access mode.
## Metric editor
### Navigate metric segments
Click the ``Select metric`` link to start navigating the metric space. One you start you can continue using the mouse
or keyboard arrow keys. You can select a wildcard and still continue.
{{< docs-imagebox img="/img/docs/v45/graphite_query1_still.png"
animated-gif="/img/docs/v45/graphite_query1.gif" >}}
### Functions
Click the plus icon to the right to add a function. You can search for the function or select it from the menu. Once
@@ -55,7 +63,6 @@ by the x icon.
{{< docs-imagebox img="/img/docs/v45/graphite_query2_still.png"
animated-gif="/img/docs/v45/graphite_query2.gif" >}}
### Optional parameters
Some functions like aliasByNode support an optional second argument. To add this parameter specify for example 3,-2 as the first parameter and the function editor will adapt and move the -2 to a second parameter. To remove the second optional parameter just click on it and leave it blank and the editor will remove it.
@@ -63,7 +70,6 @@ Some functions like aliasByNode support an optional second argument. To add this
{{< docs-imagebox img="/img/docs/v45/graphite_query3_still.png"
animated-gif="/img/docs/v45/graphite_query3.gif" >}}
### Nested Queries
You can reference queries by the row “letter” that theyre on (similar to Microsoft Excel). If you add a second query to a graph, you can reference the first query simply by typing in #A. This provides an easy and convenient way to build compounded queries.
@@ -71,7 +77,6 @@ You can reference queries by the row “letter” that theyre on (similar to
{{< docs-imagebox img="/img/docs/v45/graphite_nested_queries_still.png"
animated-gif="/img/docs/v45/graphite_nested_queries.gif" >}}
## Point consolidation
All Graphite metrics are consolidated so that Graphite doesn't return more data points than there are pixels in the graph. By default,
@@ -89,6 +94,18 @@ being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different
types of template variables.
Graphite 1.1 introduced tags and Grafana added support for Graphite queries with tags in version 5.0. To create a variable using tag values, then you need to use the Grafana functions `tags` and `tag_values`.
Query | Description
------------ | -------------
*tags()* | Returns all tags.
*tags(server=~backend\*)* | Returns only tags that occur in series matching the filter expression.
*tag_values(server)* | Return tag values for the specified tag.
*tag_values(server, server=~backend\*)* | Returns filtered tag values that occur for the specified tag in series matching those expressions.
*tag_values(server, server=~backend\*, app=~${apps:regex})* | Multiple filter expressions and expressions can contain other variables.
For more details, see the [Graphite docs on the autocomplete api for tags](http://graphite.readthedocs.io/en/latest/tags.html#auto-complete-support).
### Query variable
The query you specify in the query field should be a metric find type of query. For example, a query like `prod.servers.*` will fill the
@@ -97,10 +114,10 @@ variable with all possible values that exist in the wildcard position.
You can also create nested variables that use other variables in their definition. For example
`apps.$app.servers.*` uses the variable `$app` in its query definition.
### Variable usage
### Variable Usage
You can use a variable in a metric node path or as a parameter to a function.
![](/img/docs/v2/templated_variable_parameter.png)
![variable](/img/docs/v2/templated_variable_parameter.png)
There are two syntaxes:
@@ -113,6 +130,18 @@ the second syntax in expressions like `my.server[[serverNumber]].count`.
Example:
[Graphite Templated Dashboard](http://play.grafana.org/dashboard/db/graphite-templated-nested)
### Variable Usage in Tag Queries
Multi-value variables in tag queries use the advanced formatting syntax introduced in Grafana 5.0 for variables: `{var:regex}`. Non-tag queries will use the default glob formatting for multi-value variables.
Example of a tag expression with regex formatting and using the Equal Tilde operator, `=~`:
```text
server=~${servers:regex}
```
Checkout the [Advanced Formatting Options section in the Variables]({{< relref "reference/templating.md#advanced-formatting-options" >}}) documentation for examples and details.
## Annotations
[Annotations]({{< relref "reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation
@@ -121,9 +150,9 @@ queries via the Dashboard menu / Annotations view.
Graphite supports two ways to query annotations. A regular metric query, for this you use the `Graphite query` textbox. A Graphite events query, use the `Graphite event tags` textbox,
specify a tag or wildcard (leave empty should also work)
## Configure datasource with provisioning
## Configure the Datasource with Provisioning
It's now possible to configure datasources using config files with Grafanas provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
It's now possible to configure datasources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
Here are some provisioning examples for this datasource.

View File

@@ -30,6 +30,7 @@ The following datasources are officially supported:
* [Prometheus]({{< relref "prometheus.md" >}})
* [MySQL]({{< relref "mysql.md" >}})
* [Postgres]({{< relref "postgres.md" >}})
* [Microsoft SQL Server (MSSQL)]({{< relref "mssql.md" >}})
## Data source plugins

View File

@@ -28,16 +28,20 @@ Name | Description
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Url* | The http protocol, ip and port of you influxdb api (influxdb api port is by default 8086)
*Access* | Proxy = access via Grafana backend, Direct = access directly from browser.
*Access* | Server (default) = URL needs to be accessible from the Grafana backend/server, Browser = URL needs to be accessible from the browser.
*Database* | Name of your influxdb database
*User* | Name of your database user
*Password* | Database user's password
### Proxy vs Direct access
Access mode controls how requests to the data source will be handled. Server should be the preferred way if nothing else stated.
Proxy access means that the Grafana backend will proxy all requests from the browser. So requests to InfluxDB will be channeled through
`grafana-server`. This means that the URL you specify needs to be accessible from the server you are running Grafana on. Proxy access
mode is also more secure as the username & password will never reach the browser.
### Server access mode (Default)
All requests will be made from the browser to Grafana backend/server which in turn will forward the requests to the data source and by that circumvent possible Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the grafana backend/server if you select this access mode.
### Browser access mode
All requests will be made from the browser directly to the data source and may be subject to Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this access mode.
### Min time interval
A lower limit for the auto group by time interval. Recommended to be set to write frequency, for example `1m` if your data is written every minute.
@@ -191,9 +195,9 @@ For InfluxDB you need to enter a query like in the above example. You need to ha
part. If you only select one column you will not need to enter anything in the column mapping fields. The
Tags field can be a comma separated string.
## Configure datasource with provisioning
## Configure the Datasource with Provisioning
It's now possible to configure datasources using config files with Grafanas provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
It's now possible to configure datasources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
Here are some provisioning examples for this datasource.

View File

@@ -0,0 +1,565 @@
+++
title = "Using Microsoft SQL Server in Grafana"
description = "Guide for using Microsoft SQL Server in Grafana"
keywords = ["grafana", "MSSQL", "Microsoft", "SQL", "guide", "Azure SQL Database"]
type = "docs"
[menu.docs]
name = "Microsoft SQL Server"
parent = "datasources"
weight = 7
+++
# Using Microsoft SQL Server in Grafana
> Only available in Grafana v5.1+.
Grafana ships with a built-in Microsoft SQL Server (MSSQL) data source plugin that allows you to query and visualize data from any Microsoft SQL Server 2005 or newer, including Microsoft Azure SQL Database.
## Adding the data source
1. Open the side menu by clicking the Grafana icon in the top header.
2. In the side menu under the `Configuration` link you should find a link named `Data Sources`.
3. Click the `+ Add data source` button in the top header.
4. Select *Microsoft SQL Server* from the *Type* dropdown.
### Data source options
Name | Description
------------ | -------------
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Host* | The IP address/hostname and optional port of your MSSQL instance. If port is omitted, default 1433 will be used.
*Database* | Name of your MSSQL database.
*User* | Database user's login/username
*Password* | Database user's password
### Database User Permissions (Important!)
The database user you specify when you add the data source should only be granted SELECT permissions on
the specified database & tables you want to query. Grafana does not validate that the query is safe. The query
could include any SQL statement. For example, statements like `DELETE FROM user;` and `DROP TABLE user;` would be
executed. To protect against this we **Highly** recommend you create a specific MSSQL user with restricted permissions.
Example:
```sql
CREATE USER grafanareader WITH PASSWORD 'password'
GRANT SELECT ON dbo.YourTable3 TO grafanareader
```
Make sure the user does not get any unwanted privileges from the public role.
### Known Issues
MSSQL 2008 and 2008 R2 engine cannot handle login records when SSL encryption is not disabled. Due to this you may receive an `Login error: EOF` error when trying to create your datasource.
To fix MSSQL 2008 R2 issue, install MSSQL 2008 R2 Service Pack 2. To fix MSSQL 2008 issue, install Microsoft MSSQL 2008 Service Pack 3 and Cumulative update package 3 for MSSQL 2008 SP3.
## Query Editor
{{< docs-imagebox img="/img/docs/v51/mssql_query_editor.png" class="docs-image--no-shadow" >}}
You find the MSSQL query editor in the metrics tab in Graph, Singlestat or Table panel's edit mode. You enter edit mode by clicking the
panel title, then edit. The editor allows you to define a SQL query to select data to be visualized.
1. Select *Format as* `Time series` (for use in Graph or Singlestat panel's among others) or `Table` (for use in Table panel among others).
2. This is the actual editor where you write your SQL queries.
3. Show help section for MSSQL below the query editor.
4. Show actual executed SQL query. Will be available first after a successful query has been executed.
5. Add an additional query where an additional query editor will be displayed.
<div class="clearfix"></div>
## Macros
To simplify syntax and to allow for dynamic parts, like date range filters, the query can contain macros.
Macro example | Description
------------ | -------------
*$__time(dateColumn)* | Will be replaced by an expression to rename the column to *time*. For example, *dateColumn as time*
*$__timeEpoch(dateColumn)* | Will be replaced by an expression to convert a DATETIME column type to unix timestamp and rename it to *time*. <br/>For example, *DATEDIFF(second, '1970-01-01', dateColumn) AS time*
*$__timeFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name. <br/>For example, *dateColumn >= DATEADD(s, 1494410783, '1970-01-01') AND dateColumn <= DATEADD(s, 1494410783, '1970-01-01')*
*$__timeFrom()* | Will be replaced by the start of the currently active time selection. For example, *DATEADD(second, 1494410783, '1970-01-01')*
*$__timeTo()* | Will be replaced by the end of the currently active time selection. For example, *DATEADD(second, 1494410783, '1970-01-01')*
*$__timeGroup(dateColumn,'5m'[, fillvalue])* | Will be replaced by an expression usable in GROUP BY clause. Providing a *fillValue* of *NULL* or *floating value* will automatically fill empty series in timerange with that value. <br/>For example, *CAST(ROUND(DATEDIFF(second, '1970-01-01', time_column)/300.0, 0) as bigint)\*300*.
*$__timeGroup(dateColumn,'5m', 0)* | Same as above but with a fill parameter so all null values will be converted to the fill value (all null values would be set to zero using this example).
*$__unixEpochFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name with times represented as unix timestamp. For example, *dateColumn > 1494410783 AND dateColumn < 1494497183*
*$__unixEpochFrom()* | Will be replaced by the start of the currently active time selection as unix timestamp. For example, *1494410783*
*$__unixEpochTo()* | Will be replaced by the end of the currently active time selection as unix timestamp. For example, *1494497183*
We plan to add many more macros. If you have suggestions for what macros you would like to see, please [open an issue](https://github.com/grafana/grafana) in our GitHub repo.
The query editor has a link named `Generated SQL` that shows up after a query has been executed, while in panel edit mode. Click on it and it will expand and show the raw interpolated SQL string that was executed.
## Table queries
If the `Format as` query option is set to `Table` then you can basically do any type of SQL query. The table panel will automatically show the results of whatever columns & rows your query returns.
**Example database table:**
```sql
CREATE TABLE [event] (
time_sec bigint,
description nvarchar(100),
tags nvarchar(100),
)
```
```sql
CREATE TABLE [mssql_types] (
c_bit bit, c_tinyint tinyint, c_smallint smallint, c_int int, c_bigint bigint, c_money money, c_smallmoney smallmoney, c_numeric numeric(10,5),
c_real real, c_decimal decimal(10,2), c_float float,
c_char char(10), c_varchar varchar(10), c_text text,
c_nchar nchar(12), c_nvarchar nvarchar(12), c_ntext ntext,
c_datetime datetime, c_datetime2 datetime2, c_smalldatetime smalldatetime, c_date date, c_time time, c_datetimeoffset datetimeoffset
)
INSERT INTO [mssql_types]
SELECT
1, 5, 20020, 980300, 1420070400, '$20000.15', '£2.15', 12345.12,
1.11, 2.22, 3.33,
'char10', 'varchar10', 'text',
N'☺nchar12☺', N'☺nvarchar12☺', N'☺text☺',
GETDATE(), CAST(GETDATE() AS DATETIME2), CAST(GETDATE() AS SMALLDATETIME), CAST(GETDATE() AS DATE), CAST(GETDATE() AS TIME), SWITCHOFFSET(CAST(GETDATE() AS DATETIMEOFFSET), '-07:00'))
```
Query editor with example query:
{{< docs-imagebox img="/img/docs/v51/mssql_table_query.png" max-width="500px" class="docs-image--no-shadow" >}}
The query:
```sql
SELECT * FROM [mssql_types]
```
You can control the name of the Table panel columns by using regular `AS ` SQL column selection syntax. Example:
```sql
SELECT
c_bit as [column1], c_tinyint as [column2]
FROM
[mssql_types]
```
The resulting table panel:
{{< docs-imagebox img="/img/docs/v51/mssql_table_result.png" max-width="1489px" class="docs-image--no-shadow" >}}
## Time series queries
If you set `Format as` to `Time series`, for use in Graph panel for example, then the query must must have a column named `time` that returns either a sql datetime or any numeric datatype representing unix epoch in seconds. You may return a column named `metric` that is used as metric name for the value column. Any column except `time` and `metric` is treated as a value column. If you omit the `metric` column, tha name of the value column will be the metric name. You may select multiple value columns, each will have its name as metric.
**Example database table:**
```sql
CREATE TABLE [event] (
time_sec bigint,
description nvarchar(100),
tags nvarchar(100),
)
```
```sql
CREATE TABLE metric_values (
time datetime,
measurement nvarchar(100),
valueOne int,
valueTwo int,
)
INSERT metric_values (time, measurement, valueOne, valueTwo) VALUES('2018-03-15 12:30:00', 'Metric A', 62, 6)
INSERT metric_values (time, measurement, valueOne, valueTwo) VALUES('2018-03-15 12:30:00', 'Metric B', 49, 11)
...
INSERT metric_values (time, measurement, valueOne, valueTwo) VALUES('2018-03-15 13:55:00', 'Metric A', 14, 25)
INSERT metric_values (time, measurement, valueOne, valueTwo) VALUES('2018-03-15 13:55:00', 'Metric B', 48, 10)
```
{{< docs-imagebox img="/img/docs/v51/mssql_time_series_one.png" class="docs-image--no-shadow docs-image--right" >}}
**Example with one `value` and one `metric` column.**
```sql
SELECT
time,
valueOne,
measurement as metric
FROM
metric_values
WHERE
$__timeFilter(time)
ORDER BY 1
```
When above query are used in a graph panel the result will be two series named `Metric A` and `Metric B` with value of `valueOne` and `valueTwo` plotted over `time`.
<div class="clearfix"></div>
{{< docs-imagebox img="/img/docs/v51/mssql_time_series_two.png" class="docs-image--no-shadow docs-image--right" >}}
**Example with multiple `value` culumns:**
```sql
SELECT
time,
valueOne,
valueTwo
FROM
metric_values
WHERE
$__timeFilter(time)
ORDER BY 1
```
When above query are used in a graph panel the result will be two series named `valueOne` and `valueTwo` with value of `valueOne` and `valueTwo` plotted over `time`.
<div class="clearfix"></div>
{{< docs-imagebox img="/img/docs/v51/mssql_time_series_three.png" class="docs-image--no-shadow docs-image--right" >}}
**Example using the $__timeGroup macro:**
```sql
SELECT
$__timeGroup(time, '3m') as time,
measurement as metric,
avg(valueOne)
FROM
metric_values
WHERE
$__timeFilter(time)
GROUP BY
$__timeGroup(time, '3m'),
measurement
ORDER BY 1
```
When above query are used in a graph panel the result will be two series named `Metric A` and `Metric B` with an average of `valueOne` plotted over `time`.
Any two series lacking a value in a 3 minute window will render a line between those two lines. You'll notice that the graph to the right never goes down to zero.
<div class="clearfix"></div>
{{< docs-imagebox img="/img/docs/v51/mssql_time_series_four.png" class="docs-image--no-shadow docs-image--right" >}}
**Example using the $__timeGroup macro with fill parameter set to zero:**
```sql
SELECT
$__timeGroup(time, '3m', 0) as time,
measurement as metric,
sum(valueTwo)
FROM
metric_values
WHERE
$__timeFilter(time)
GROUP BY
$__timeGroup(time, '3m'),
measurement
ORDER BY 1
```
When above query are used in a graph panel the result will be two series named `Metric A` and `Metric B` with a sum of `valueTwo` plotted over `time`.
Any series lacking a value in a 3 minute window will have a value of zero which you'll see rendered in the graph to the right.
## Templating
Instead of hard-coding things like server, application and sensor name in you metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns makes it easy to change the data being displayed in your dashboard.
Checkout the [Templating]({{< relref "reference/templating.md" >}}) documentation for an introduction to the templating feature and the different types of template variables.
### Query Variable
If you add a template variable of the type `Query`, you can write a MSSQL query that can
return things like measurement names, key names or key values that are shown as a dropdown select box.
For example, you can have a variable that contains all values for the `hostname` column in a table if you specify a query like this in the templating variable *Query* setting.
```sql
SELECT hostname FROM host
```
A query can return multiple columns and Grafana will automatically create a list from them. For example, the query below will return a list with values from `hostname` and `hostname2`.
```sql
SELECT [host].[hostname], [other_host].[hostname2] FROM host JOIN other_host ON [host].[city] = [other_host].[city]
```
Another option is a query that can create a key/value variable. The query should return two columns that are named `__text` and `__value`. The `__text` column value should be unique (if it is not unique then the first value is used). The options in the dropdown will have a text and value that allows you to have a friendly name as text and an id as the value. An example query with `hostname` as the text and `id` as the value:
```sql
SELECT hostname __text, id __value FROM host
```
You can also create nested variables. For example if you had another variable named `region`. Then you could have
the hosts variable only show hosts from the current selected region with a query like this (if `region` is a multi-value variable then use the `IN` comparison operator rather than `=` to match against multiple values):
```sql
SELECT hostname FROM host WHERE region IN ($region)
```
### Using Variables in Queries
> From Grafana 4.3.0 to 4.6.0, template variables are always quoted automatically so if it is a string value do not wrap them in quotes in where clauses.
>
> From Grafana 5.0.0, template variable values are only quoted when the template variable is a `multi-value`.
If the variable is a multi-value variable then use the `IN` comparison operator rather than `=` to match against multiple values.
There are two syntaxes:
`$<varname>` Example with a template variable named `hostname`:
```sql
SELECT
atimestamp time,
aint value
FROM table
WHERE $__timeFilter(atimestamp) and hostname in($hostname)
ORDER BY atimestamp
```
`[[varname]]` Example with a template variable named `hostname`:
```sql
SELECT
atimestamp as time,
aint as value
FROM table
WHERE $__timeFilter(atimestamp) and hostname in([[hostname]])
ORDER BY atimestamp
```
#### Disabling Quoting for Multi-value Variables
Grafana automatically creates a quoted, comma-separated string for multi-value variables. For example: if `server01` and `server02` are selected then it will be formatted as: `'server01', 'server02'`. Do disable quoting, use the csv formatting option for variables:
`${servers:csv}`
Read more about variable formatting options in the [Variables]({{< relref "reference/templating.md#advanced-formatting-options" >}}) documentation.
## Annotations
[Annotations]({{< relref "reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation queries via the Dashboard menu / Annotations view.
**Columns:**
Name | Description
------------ | -------------
time | The name of the date/time field. Could be a column with a native sql date/time data type or epoch value.
text | Event description field.
tags | Optional field name to use for event tags as a comma separated string.
**Example database tables:**
```sql
CREATE TABLE [events] (
time_sec bigint,
description nvarchar(100),
tags nvarchar(100),
)
```
We also use the database table defined in [Time series queries](#time-series-queries).
**Example query using time column with epoch values:**
```sql
SELECT
time_sec as time,
description as [text],
tags
FROM
[events]
WHERE
$__unixEpochFilter(time_sec)
ORDER BY 1
```
**Example query using time column of native sql date/time data type:**
```sql
SELECT
time,
measurement as text,
convert(varchar, valueOne) + ',' + convert(varchar, valueTwo) as tags
FROM
metric_values
WHERE
$__timeFilter(time_column)
ORDER BY 1
```
## Stored procedure support
Stored procedures have been verified to work. However, please note that we haven't done anything special to support this why there may exist edge cases where it won't work as you would expect.
Stored procedures should be supported in table, time series and annotation queries as long as you use the same naming of columns and return data in the same format as describe above under respective section.
Please note that any macro function will not work inside a stored procedure.
### Examples
{{< docs-imagebox img="/img/docs/v51/mssql_metrics_graph.png" class="docs-image--no-shadow docs-image--right" >}}
For the following examples the database table defined in [Time series queries](#time-series-queries). Let's say that we want to visualize 4 series in a graph panel, i.e. all combinations of columns `valueOne`, `valueTwo` and `measurement`. Graph panel to the right visualizes what we want to achieve. To solve this we actually need to use two queries:
**First query:**
```sql
SELECT
$__timeGroup(time, '5m') as time,
measurement + ' - value one' as metric,
avg(valueOne) as valueOne
FROM
metric_values
WHERE
$__timeFilter(time)
GROUP BY
$__timeGroup(time, '5m'),
measurement
ORDER BY 1
```
**Second query:**
```sql
SELECT
$__timeGroup(time, '5m') as time,
measurement + ' - value two' as metric,
avg(valueTwo) as valueTwo
FROM
metric_values
GROUP BY
$__timeGroup(time, '5m'),
measurement
ORDER BY 1
```
#### Stored procedure using time in epoch format
We can define a stored procedure that will return all data we need to render 4 series in a graph panel like above.
In this case the stored procedure accepts two parameters `@from` and `@to` of `int` data types which should be a timerange (from-to) in epoch format
which will be used to filter the data to return from the stored procedure.
We're mimicking the `$__timeGroup(time, '5m')` in the select and group by expressions and that's why there's a lot of lengthy expressions needed -
these could be extracted to MSSQL functions, if wanted.
```sql
CREATE PROCEDURE sp_test_epoch(
@from int,
@to int
) AS
BEGIN
SELECT
cast(cast(DATEDIFF(second, {d '1970-01-01'}, DATEADD(second, DATEDIFF(second,GETDATE(),GETUTCDATE()), time))/600 as int)*600 as int) as time,
measurement + ' - value one' as metric,
avg(valueOne) as value
FROM
metric_values
WHERE
time >= DATEADD(s, @from, '1970-01-01') AND time <= DATEADD(s, @to, '1970-01-01')
GROUP BY
cast(cast(DATEDIFF(second, {d '1970-01-01'}, DATEADD(second, DATEDIFF(second,GETDATE(),GETUTCDATE()), time))/600 as int)*600 as int),
measurement
UNION ALL
SELECT
cast(cast(DATEDIFF(second, {d '1970-01-01'}, DATEADD(second, DATEDIFF(second,GETDATE(),GETUTCDATE()), time))/600 as int)*600 as int) as time,
measurement + ' - value two' as metric,
avg(valueTwo) as value
FROM
metric_values
WHERE
time >= DATEADD(s, @from, '1970-01-01') AND time <= DATEADD(s, @to, '1970-01-01')
GROUP BY
cast(cast(DATEDIFF(second, {d '1970-01-01'}, DATEADD(second, DATEDIFF(second,GETDATE(),GETUTCDATE()), time))/600 as int)*600 as int),
measurement
ORDER BY 1
END
```
Then we can use the following query for our graph panel.
```sql
DECLARE
@from int = $__unixEpochFrom(),
@to int = $__unixEpochTo()
EXEC dbo.sp_test_epoch @from, @to
```
#### Stored procedure using time in datetime format
We can define a stored procedure that will return all data we need to render 4 series in a graph panel like above.
In this case the stored procedure accepts two parameters `@from` and `@to` of `datetime` data types which should be a timerange (from-to)
which will be used to filter the data to return from the stored procedure.
We're mimicking the `$__timeGroup(time, '5m')` in the select and group by expressions and that's why there's a lot of lengthy expressions needed -
these could be extracted to MSSQL functions, if wanted.
```sql
CREATE PROCEDURE sp_test_datetime(
@from datetime,
@to datetime
) AS
BEGIN
SELECT
cast(cast(DATEDIFF(second, {d '1970-01-01'}, time)/600 as int)*600 as int) as time,
measurement + ' - value one' as metric,
avg(valueOne) as value
FROM
metric_values
WHERE
time >= @from AND time <= @to
GROUP BY
cast(cast(DATEDIFF(second, {d '1970-01-01'}, time)/600 as int)*600 as int),
measurement
UNION ALL
SELECT
cast(cast(DATEDIFF(second, {d '1970-01-01'}, time)/600 as int)*600 as int) as time,
measurement + ' - value two' as metric,
avg(valueTwo) as value
FROM
metric_values
WHERE
time >= @from AND time <= @to
GROUP BY
cast(cast(DATEDIFF(second, {d '1970-01-01'}, time)/600 as int)*600 as int),
measurement
ORDER BY 1
END
```
Then we can use the following query for our graph panel.
```sql
DECLARE
@from datetime = $__timeFrom(),
@to datetime = $__timeTo()
EXEC dbo.sp_test_datetime @from, @to
```
## Alerting
Time series queries should work in alerting conditions. Table formatted queries are not yet supported in alert rule
conditions.
## Configure the Datasource with Provisioning
It's now possible to configure datasources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
Here are some provisioning examples for this datasource.
```yaml
apiVersion: 1
datasources:
- name: MSSQL
type: mssql
url: localhost:1433
database: grafana
user: grafana
secureJsonData:
password: "Password!"
```

View File

@@ -12,6 +12,8 @@ weight = 7
# Using MySQL in Grafana
> Only available in Grafana v4.3+.
>
> Starting from Grafana v5.1 you can name the time column *time* in addition to earlier supported *time_sec*. Usage of *time_sec* will eventually be deprecated.
Grafana ships with a built-in MySQL data source plugin that allow you to query any visualize
data from a MySQL compatible database.
@@ -23,6 +25,17 @@ data from a MySQL compatible database.
3. Click the `+ Add data source` button in the top header.
4. Select *MySQL* from the *Type* dropdown.
### Data source options
Name | Description
------------ | -------------
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Host* | The IP address/hostname and optional port of your MySQL instance.
*Database* | Name of your MySQL database.
*User* | Database user's login/username
*Password* | Database user's password
### Database User Permissions (Important!)
The database user you specify when you add the data source should only be granted SELECT permissions on
@@ -46,10 +59,12 @@ To simplify syntax and to allow for dynamic parts, like date range filters, the
Macro example | Description
------------ | -------------
*$__time(dateColumn)* | Will be replaced by an expression to convert to a UNIX timestamp and rename the column to `time_sec`. For example, *UNIX_TIMESTAMP(dateColumn) as time_sec*
*$__timeEpoch(dateColumn)* | Will be replaced by an expression to convert to a UNIX timestamp and rename the column to `time_sec`. For example, *UNIX_TIMESTAMP(dateColumn) as time_sec*
*$__timeFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name. For example, *dateColumn > FROM_UNIXTIME(1494410783) AND dateColumn < FROM_UNIXTIME(1494497183)*
*$__timeFrom()* | Will be replaced by the start of the currently active time selection. For example, *FROM_UNIXTIME(1494410783)*
*$__timeTo()* | Will be replaced by the end of the currently active time selection. For example, *FROM_UNIXTIME(1494497183)*
*$__timeGroup(dateColumn,'5m')* | Will be replaced by an expression usable in GROUP BY clause. For example, *cast(cast(UNIX_TIMESTAMP(dateColumn)/(300) as signed)*300 as signed) as time_sec,*
*$__timeGroup(dateColumn,'5m')* | Will be replaced by an expression usable in GROUP BY clause. For example, *cast(cast(UNIX_TIMESTAMP(dateColumn)/(300) as signed)*300 as signed),*
*$__timeGroup(dateColumn,'5m',0)* | Same as above but with a fill parameter so all null values will be converted to the fill value (all null values would be set to zero using this example).
*$__unixEpochFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name with times represented as unix timestamp. For example, *dateColumn > 1494410783 AND dateColumn < 1494497183*
*$__unixEpochFrom()* | Will be replaced by the start of the currently active time selection as unix timestamp. For example, *1494410783*
*$__unixEpochTo()* | Will be replaced by the end of the currently active time selection as unix timestamp. For example, *1494497183*
@@ -84,39 +99,50 @@ The resulting table panel:
![](/img/docs/v43/mysql_table.png)
### Time series queries
## Time series queries
If you set `Format as` to `Time series`, for use in Graph panel for example, then there are some requirements for
what your query returns.
If you set `Format as` to `Time series`, for use in Graph panel for example, then the query must return a column named `time` that returns either a sql datetime or any numeric datatype representing unix epoch.
Any column except `time` and `metric` is treated as a value column.
You may return a column named `metric` that is used as metric name for the value column.
- Must be a column named `time_sec` representing a unix epoch in seconds.
- Must be a column named `value` representing the time series value.
- Must be a column named `metric` representing the time series name.
Example:
**Example with `metric` column:**
```sql
SELECT
min(UNIX_TIMESTAMP(time_date_time)) as time_sec,
max(value_double) as value,
metric1 as metric
FROM test_data
WHERE $__timeFilter(time_date_time)
GROUP BY metric1, UNIX_TIMESTAMP(time_date_time) DIV 300
ORDER BY time_sec asc
```
Example with $__timeGroup macro:
```sql
SELECT
$__timeGroup(time_date_time,'5m') as time_sec,
min(value_double) as value,
metric_name as metric
$__timeGroup(time_date_time,'5m'),
min(value_double),
'min' as metric
FROM test_data
WHERE $__timeFilter(time_date_time)
GROUP BY 1, metric_name
ORDER BY 1
GROUP BY time
ORDER BY time
```
**Example using the fill parameter in the $__timeGroup macro to convert null values to be zero instead:**
```sql
SELECT
$__timeGroup(createdAt,'5m',0),
sum(value_double) as value,
measurement
FROM test_data
WHERE
$__timeFilter(createdAt)
GROUP BY time, measurement
ORDER BY time
```
**Example with multiple columns:**
```sql
SELECT
$__timeGroup(time_date_time,'5m'),
min(value_double) as min_value,
max(value_double) as max_value
FROM test_data
WHERE $__timeFilter(time_date_time)
GROUP BY time
ORDER BY time
```
Currently, there is no support for a dynamic group by time based on time range & panel width.
@@ -180,7 +206,7 @@ There are two syntaxes:
```sql
SELECT
UNIX_TIMESTAMP(atimestamp) as time_sec,
UNIX_TIMESTAMP(atimestamp) as time,
aint as value,
avarchar as metric
FROM my_table
@@ -192,7 +218,7 @@ ORDER BY atimestamp ASC
```sql
SELECT
UNIX_TIMESTAMP(atimestamp) as time_sec,
UNIX_TIMESTAMP(atimestamp) as time,
aint as value,
avarchar as metric
FROM my_table
@@ -200,25 +226,47 @@ WHERE $__timeFilter(atimestamp) and hostname in([[hostname]])
ORDER BY atimestamp ASC
```
#### Disabling Quoting for Multi-value Variables
Grafana automatically creates a quoted, comma-separated string for multi-value variables. For example: if `server01` and `server02` are selected then it will be formatted as: `'server01', 'server02'`. Do disable quoting, use the csv formatting option for variables:
`${servers:csv}`
Read more about variable formatting options in the [Variables]({{< relref "reference/templating.md#advanced-formatting-options" >}}) documentation.
## Annotations
[Annotations]({{< relref "reference/annotations.md" >}}) allows you to overlay rich event information on top of graphs. You add annotation queries via the Dashboard menu / Annotations view.
[Annotations]({{< relref "reference/annotations.md" >}}) allow you to overlay rich event information on top of graphs. You add annotation queries via the Dashboard menu / Annotations view.
An example query:
**Example query using time column with epoch values:**
```sql
SELECT
UNIX_TIMESTAMP(atimestamp) as time_sec,
value as text,
epoch_time as time,
metric1 as text,
CONCAT(tag1, ',', tag2) as tags
FROM my_table
WHERE $__timeFilter(atimestamp)
ORDER BY atimestamp ASC
FROM
public.test_data
WHERE
$__unixEpochFilter(epoch_time)
```
**Example query using time column of native sql date/time data type:**
```sql
SELECT
native_date_time as time,
metric1 as text,
CONCAT(tag1, ',', tag2) as tags
FROM
public.test_data
WHERE
$__timeFilter(native_date_time)
```
Name | Description
------------ | -------------
time_sec | The name of the date/time field.
time | The name of the date/time field. Could be a column with a native sql date/time data type or epoch value.
text | Event description field.
tags | Optional field name to use for event tags as a comma separated string.
@@ -226,9 +274,9 @@ tags | Optional field name to use for event tags as a comma separated string.
Time series queries should work in alerting conditions. Table formatted queries is not yet supported in alert rule conditions.
## Configure datasource with provisioning
## Configure the Datasource with Provisioning
It's now possible to configure datasources using config files with Grafanas provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
It's now possible to configure datasources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
Here are some provisioning examples for this datasource.
@@ -242,4 +290,4 @@ datasources:
database: grafana
user: grafana
password: password
```
```

View File

@@ -28,11 +28,10 @@ Name | Description
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Url* | The http protocol, ip and port of you opentsdb server (default port is usually 4242)
*Access* | Proxy = access via Grafana backend, Direct = access directly from browser.
*Access* | Server (default) = URL needs to be accessible from the Grafana backend/server, Browser = URL needs to be accessible from the browser.
*Version* | Version = opentsdb version, either <=2.1 or 2.2
*Resolution* | Metrics from opentsdb may have datapoints with either second or millisecond resolution.
## Query editor
Open a graph in edit mode by click the title. Query editor will differ if the datasource has version <=2.1 or = 2.2.
@@ -89,9 +88,9 @@ Query | Description
For details on OpenTSDB metric queries checkout the official [OpenTSDB documentation](http://opentsdb.net/docs/build/html/index.html)
## Configure datasource with provisioning
## Configure the Datasource with Provisioning
It's now possible to configure datasources using config files with Grafanas provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
It's now possible to configure datasources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
Here are some provisioning examples for this datasource.

View File

@@ -20,6 +20,18 @@ Grafana ships with a built-in PostgreSQL data source plugin that allows you to q
3. Click the `+ Add data source` button in the top header.
4. Select *PostgreSQL* from the *Type* dropdown.
### Data source options
Name | Description
------------ | -------------
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Host* | The IP address/hostname and optional port of your PostgreSQL instance.
*Database* | Name of your PostgreSQL database.
*User* | Database user's login/username
*Password* | Database user's password
*SSL Mode* | This option determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server.
### Database User Permissions (Important!)
The database user you specify when you add the data source should only be granted SELECT permissions on
@@ -45,11 +57,12 @@ Macro example | Description
------------ | -------------
*$__time(dateColumn)* | Will be replaced by an expression to rename the column to `time`. For example, *dateColumn as time*
*$__timeSec(dateColumn)* | Will be replaced by an expression to rename the column to `time` and converting the value to unix timestamp. For example, *extract(epoch from dateColumn) as time*
*$__timeFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name. For example, *extract(epoch from dateColumn) BETWEEN 1494410783 AND 1494497183*
*$__timeFrom()* | Will be replaced by the start of the currently active time selection. For example, *to_timestamp(1494410783)*
*$__timeTo()* | Will be replaced by the end of the currently active time selection. For example, *to_timestamp(1494497183)*
*$__timeFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name. For example, *dateColumn BETWEEN '2017-04-21T05:01:17Z' AND '2017-04-21T05:06:17Z'*
*$__timeFrom()* | Will be replaced by the start of the currently active time selection. For example, *'2017-04-21T05:01:17Z'*
*$__timeTo()* | Will be replaced by the end of the currently active time selection. For example, *'2017-04-21T05:06:17Z'*
*$__timeGroup(dateColumn,'5m')* | Will be replaced by an expression usable in GROUP BY clause. For example, *(extract(epoch from dateColumn)/300)::bigint*300 AS time*
*$__unixEpochFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name with times represented as unix timestamp. For example, *dateColumn > 1494410783 AND dateColumn < 1494497183*
*$__timeGroup(dateColumn,'5m', 0)* | Same as above but with a fill parameter so all null values will be converted to the fill value (all null values would be set to zero using this example).
*$__unixEpochFilter(dateColumn)* | Will be replaced by a time range filter using the specified column name with times represented as unix timestamp. For example, *dateColumn >= 1494410783 AND dateColumn <= 1494497183*
*$__unixEpochFrom()* | Will be replaced by the start of the currently active time selection as unix timestamp. For example, *1494410783*
*$__unixEpochTo()* | Will be replaced by the end of the currently active time selection as unix timestamp. For example, *1494497183*
@@ -82,36 +95,50 @@ You can control the name of the Table panel columns by using regular `as ` SQL c
The resulting table panel:
![](/img/docs/v46/postgres_table.png)
![postgres table](/img/docs/v46/postgres_table.png)
### Time series queries
## Time series queries
If you set `Format as` to `Time series`, for use in Graph panel for example, then the query must return a column named `time` that returns either a sql datetime or any numeric datatype representing unix epoch in seconds.
If you set `Format as` to `Time series`, for use in Graph panel for example, then the query must return a column named `time` that returns either a sql datetime or any numeric datatype representing unix epoch.
Any column except `time` and `metric` is treated as a value column.
You may return a column named `metric` that is used as metric name for the value column.
Example with `metric` column
**Example with `metric` column:**
```sql
SELECT
$__timeGroup(time_date_time,'5m'),
min(value_double),
$__timeGroup("time_date_time",'5m'),
min("value_double"),
'min' as metric
FROM test_data
WHERE $__timeFilter(time_date_time)
WHERE $__timeFilter("time_date_time")
GROUP BY time
ORDER BY time
```
Example with multiple columns:
**Example using the fill parameter in the $__timeGroup macro to convert null values to be zero instead:**
```sql
SELECT
$__timeGroup(time_date_time,'5m'),
min(value_double) as min_value,
max(value_double) as max_value
$__timeGroup("createdAt",'5m',0),
sum(value) as value,
measurement
FROM test_data
WHERE $__timeFilter(time_date_time)
WHERE
$__timeFilter("createdAt")
GROUP BY time, measurement
ORDER BY time
```
**Example with multiple columns:**
```sql
SELECT
$__timeGroup("time_date_time",'5m'),
min("value_double") as "min_value",
max("value_double") as "max_value"
FROM test_data
WHERE $__timeFilter("time_date_time")
GROUP BY time
ORDER BY time
```
@@ -190,26 +217,47 @@ WHERE $__timeFilter(atimestamp) and hostname in([[hostname]])
ORDER BY atimestamp ASC
```
#### Disabling Quoting for Multi-value Variables
Grafana automatically creates a quoted, comma-separated string for multi-value variables. For example: if `server01` and `server02` are selected then it will be formatted as: `'server01', 'server02'`. Do disable quoting, use the csv formatting option for variables:
`${servers:csv}`
Read more about variable formatting options in the [Variables]({{< relref "reference/templating.md#advanced-formatting-options" >}}) documentation.
## Annotations
[Annotations]({{< relref "reference/annotations.md" >}}) allow you to overlay rich event information on top of graphs. You add annotation queries via the Dashboard menu / Annotations view.
An example query:
**Example query using time column with epoch values:**
```sql
SELECT
extract(epoch from time_date_time) AS time,
metric1 as text,
epoch_time as time,
metric1 as text,
concat_ws(', ', metric1::text, metric2::text) as tags
FROM
public.test_data
WHERE
$__timeFilter(time_date_time)
$__unixEpochFilter(epoch_time)
```
**Example query using time column of native sql date/time data type:**
```sql
SELECT
native_date_time as time,
metric1 as text,
concat_ws(', ', metric1::text, metric2::text) as tags
FROM
public.test_data
WHERE
$__timeFilter(native_date_time)
```
Name | Description
------------ | -------------
time | The name of the date/time field.
time | The name of the date/time field. Could be a column with a native sql date/time data type or epoch value.
text | Event description field.
tags | Optional field name to use for event tags as a comma separated string.
@@ -218,9 +266,9 @@ tags | Optional field name to use for event tags as a comma separated string.
Time series queries should work in alerting conditions. Table formatted queries is not yet supported in alert rule
conditions.
## Configure datasource with provisioning
## Configure the Datasource with Provisioning
It's now possible to configure datasources using config files with Grafanas provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
It's now possible to configure datasources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
Here are some provisioning examples for this datasource.
@@ -237,5 +285,4 @@ datasources:
password: "Password!"
jsonData:
sslmode: "disable" # disable/require/verify-ca/verify-full
```
```

View File

@@ -30,7 +30,7 @@ Name | Description
*Name* | The data source name. This is how you refer to the data source in panels & queries.
*Default* | Default data source means that it will be pre-selected for new panels.
*Url* | The http protocol, ip and port of you Prometheus server (default port is usually 9090)
*Access* | Proxy = access via Grafana backend, Direct = access directly from browser.
*Access* | Server (default) = URL needs to be accessible from the Grafana backend/server, Browser = URL needs to be accessible from the browser.
*Basic Auth* | Enable basic authentication to the Prometheus data source.
*User* | Name of your Prometheus user
*Password* | Database user's password
@@ -50,7 +50,7 @@ Name | Description
*Min step* | Set a lower limit for the Prometheus step option. Step controls how big the jumps are when the Prometheus query engine performs range queries. Sadly there is no official prometheus documentation to link to for this very important option.
*Resolution* | Controls the step option. Small steps create high-resolution graphs but can be slow over larger time ranges, lowering the resolution can speed things up. `1/2` will try to set step option to generate 1 data point for every other pixel. A value of `1/10` will try to set step option so there is a data point every 10 pixels.
*Metric lookup* | Search for metric names in this input field.
*Format as* | **(New in v4.3)** Switch between Table & Time series. Table format will only work in the Table panel.
*Format as* | Switch between Table, Time series or Heatmap. Table format will only work in the Table panel. Heatmap format is suitable for displaying metrics having histogram type on Heatmap panel. Under the hood, it converts cumulative histogram to regular and sorts series by the bucket bound.
## Templating
@@ -101,9 +101,9 @@ The step option is useful to limit the number of events returned from your query
Since 4.6.0 Grafana exposes metrics for Prometheus on the `/metrics` endpoint. We also bundle a dashboard within Grafana so you can get started viewing your metrics faster. You can import the bundled dashboard by going to the data source edit page and click the dashboard tab. There you can find a dashboard for Grafana and one for Prometheus. Import and start viewing all the metrics!
## Configure datasource with provisioning
## Configure the Datasource with Provisioning
It's now possible to configure datasources using config files with Grafanas provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
It's now possible to configure datasources using config files with Grafana's provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](/administration/provisioning/#datasources)
Here are some provisioning examples for this datasource.
@@ -115,4 +115,4 @@ datasources:
type: prometheus
access: proxy
url: http://localhost:9090
```
```

View File

@@ -22,15 +22,18 @@ options for the panel.
## General
{{< docs-imagebox img="/img/docs/v43/graph_general.png" max-width= "900px" >}}
{{< docs-imagebox img="/img/docs/v51/graph_general.png" max-width= "800px" >}}
The general tab allows customization of a panel's appearance and menu options.
### General Options
### Info
- **Title** - The panel title on the dashboard
- **Span** - The panel width in columns
- **Height** - The panel contents height in pixels
- **Title** - The panel title of the dashboard, displayed at the top.
- **Description** - The panel description, displayed on hover of info icon in the upper left corner of the panel.
- **Transparent** - If checked, removes the solid background of the panel (default not checked).
### Repeat
Repeat a panel for each value of a variable. Repeating panels are described in more detail [here]({{< relref "reference/templating.md#repeating-panels" >}}).
### Drilldown / detail link
@@ -54,47 +57,65 @@ options.
## Axes
{{< docs-imagebox img="/img/docs/v43/graph_axes_grid_options.png" max-width= "900px" >}}
{{< docs-imagebox img="/img/docs/v51/graph_axes_grid_options.png" max-width= "800px" >}}
The Axes tab controls the display of axes, grids and legend. The **Left Y** and **Right Y** can be customized using:
The Axes tab controls the display of axes.
### Left Y/Right Y
The **Left Y** and **Right Y** can be customized using:
- **Unit** - The display unit for the Y value
- **Scale** -
- **Scale** - The scale to use for the Y value, linear or logarithmic. (default linear)
- **Y-Min** - The minimum Y value. (default auto)
- **Y-Max** - The maximum Y value. (default auto)
- **Decimals** - Controls how many decimals are displayed for Y value (default auto)
- **Label** - The Y axis label (default "")
Axes can also be hidden by unchecking the appropriate box from **Show**.
### X-Axis Mode
### X-Axis
There are three options:
Axis can be hidden by unchecking **Show**.
For **Mode** there are three options:
- The default option is **Time** and means the x-axis represents time and that the data is grouped by time (for example, by hour or by minute).
- The **Series** option means that the data is grouped by series and not by time. The y-axis still represents the value.
{{< docs-imagebox img="/img/docs/v45/graph-x-axis-mode-series.png" max-width="700px">}}
{{< docs-imagebox img="/img/docs/v51/graph-x-axis-mode-series.png" max-width="800px">}}
- The **Histogram** option converts the graph into a histogram. A Histogram is a kind of bar chart that groups numbers into ranges, often called buckets or bins. Taller bars show that more data falls in that range. Histograms and buckets are described in more detail [here](http://docs.grafana.org/features/panels/heatmap/#histograms-and-buckets).
<img src="/img/docs/v43/heatmap_histogram.png" class="no-shadow">
### Legend
The legend hand be hidden by checking the **Show** checkbox. If it's shown, it can be
displayed as a table of values by checking the **Table** checkbox. Series with no
values can be hidden from the legend using the **Hide empty** checkbox.
### Y-Axes
### Legend Values
- **Align** - Check to align left and right Y-axes by value (default unchecked/false)
- **Level** - Available when *Align* is checked. Value to use for alignment of left and right Y-axes, starting from Y=0 (default 0)
## Legend
{{< docs-imagebox img="/img/docs/v51/graph-legend.png" max-width= "800px" >}}
### Options
- **Show** - Uncheck to hide the legend (default checked/true)
- **Table** - Check to display legend in table (default unchecked/false)
- **To the right** - Check to display legend to the right (default unchecked/false)
- **Width** - Available when *To the right* is checked. Value to control the minimum width for the legend (default 0)
### Values
Additional values can be shown along-side the legend names:
- **Total** - Sum of all values returned from metric query
- **Current** - Last value returned from the metric query
- **Min** - Minimum of all values returned from metric query
- **Max** - Maximum of all values returned from the metric query
- **Avg** - Average of all values returned from metric query
- **Current** - Last value returned from the metric query
- **Total** - Sum of all values returned from metric query
- **Decimals** - Controls how many decimals are displayed for legend values (and graph hover tooltips)
The legend values are calculated client side by Grafana and depend on what type of
@@ -103,63 +124,72 @@ be correct at the same time. For example if you plot a rate like requests/second
using average as aggregator, then the Total in the legend will not represent the total number of requests.
It is just the sum of all data points received by Grafana.
### Hide series
Hide series when all values of a series from a metric query are of a specific value:
- **With only nulls** - Value=*null* (default unchecked)
- **With only zeros** - Value=*zero* (default unchecked)
## Display styles
{{< docs-imagebox img="/img/docs/v43/graph_display_styles.png" max-width= "900px" >}}
{{< docs-imagebox img="/img/docs/v51/graph_display_styles.png" max-width= "800px" >}}
Display styles control visual properties of the graph.
### Thresholds
### Draw Options
Thresholds allow you to add arbitrary lines or sections to the graph to make it easier to see when
the graph crosses a particular threshold.
### Chart Options
#### Draw Modes
- **Bar** - Display values as a bar chart
- **Lines** - Display values as a line graph
- **Points** - Display points for values
### Line Options
#### Mode Options
- **Line Fill** - Amount of color fill for a series. 0 is none.
- **Line Width** - The width of the line for a series.
- **Null point mode** - How null values are displayed
- **Staircase line** - Draws adjacent points as staircase
- **Fill** - Amount of color fill for a series (default 1). 0 is none.
- **Line Width** - The width of the line for a series (default 1).
- **Staircase** - Draws adjacent points as staircase
- **Points Radius** - Adjust the size of points when *Points* are selected as *Draw Mode*.
### Multiple Series
#### Hover tooltip
- **Mode** - Controls how many series to display in the tooltip when hover over a point in time, All series or single (default All series).
- **Sort order** - Controls how series displayed in tooltip are sorted, None, Ascending or Descending (default None).
- **Stacked value** - Available when *Stack* are checked and controls how stacked values are displayed in tooltip (default Individual).
- Individual: the value for the series you hover over
- Cumulative - sum of series below plus the series you hover over
#### Stacking & Null value
If there are multiple series, they can be displayed as a group.
- **Stack** - Each series is stacked on top of another
- **Percent** - Each series is drawn as a percentage of the total of all series
- **Percent** - Available when *Stack* are checked. Each series is drawn as a percentage of the total of all series
- **Null value** - How null values are displayed
If you have stack enabled, you can select what the mouse hover feature should show.
### Series overrides
- Cumulative - Sum of series below plus the series you hover over
- Individual - Just the value for the series you hover over
### Rendering
- **Flot** - Render the graphs in the browser using Flot (default)
- **Graphite PNG** - Render the graph on the server using graphite's render API.
### Tooltip
- **All series** - Show all series on the same tooltip and a x crosshairs to help follow all series
### Series Specific Overrides
{{< docs-imagebox img="/img/docs/v51/graph_display_overrides.png" max-width= "800px" >}}
The section allows a series to be rendered differently from the others. For example, one series can be given
a thicker line width to make it stand out.
a thicker line width to make it stand out and/or be moved to the right Y-axis.
#### Dashes Drawing Style
There is an option under Series overrides to draw lines as dashes. Set Dashes to the value True to override the line draw setting for a specific series.
### Thresholds
{{< docs-imagebox img="/img/docs/v51/graph_display_thresholds.png" max-width= "800px" >}}
Thresholds allow you to add arbitrary lines or sections to the graph to make it easier to see when
the graph crosses a particular threshold.
## Time Range
The time range tab allows you to override the dashboard time range and specify a panel specific time. Either through a relative from now time option or through a timeshift.
{{< docs-imagebox img="/img/docs/v51/graph-time-range.png" max-width= "900px" >}}
{{< docs-imagebox img="/img/docs/v45/graph-time-range.png" max-width= "900px" >}}
The time range tab allows you to override the dashboard time range and specify a panel specific time.
Either through a relative from now time option or through a timeshift.
Panel time overrides & timeshift are described in more detail [here]({{< relref "reference/timerange.md#panel-time-overrides-timeshift" >}}).

View File

@@ -56,26 +56,39 @@ Data and bucket options can be found in the `Axes` tab.
Data format | Description
------------ | -------------
*Time series* | Grafana does the bucketing by going through all time series values. The bucket sizes & intervals will be determined using the Buckets options.
*Time series buckets* | Each time series already represents a Y-Axis bucket. The time series name (alias) needs to be a numeric value representing the upper interval for the bucket. Grafana does no bucketing so the bucket size options are hidden.
*Time series buckets* | Each time series already represents a Y-Axis bucket. The time series name (alias) needs to be a numeric value representing the upper or lower interval for the bucket. Grafana does no bucketing so the bucket size options are hidden.
### Bucket bound
When Data format is *Time series buckets* datasource returns series with names representing bucket bound. But depending
on datasource, a bound may be *upper* or *lower*. This option allows to adjust a bound type. If *Auto* is set, a bound
option will be chosen based on panels' datasource type.
### Bucket Size
The Bucket count & size options are used by Grafana to calculate how big each cell in the heatmap is. You can
define the bucket size either by count (the first input box) or by specifying a size interval. For the Y-Axis
the size interval is just a value but for the X-bucket you can specify a time range in the *Size* input, for example,
the time range `1h`. This will make the cells 1h wide on the X-axis.
the time range `1h`. This will make the cells 1h wide on the X-axis.
### Pre-bucketed data
If you have a data that is already organized into buckets you can use the `Time series buckets` data format. This format requires that your metric query return regular time series and that each time series has a numeric name
that represent the upper or lower bound of the interval.
If you have a data that is already organized into buckets you can use the `Time series buckets` data format. This format
requires that your metric query return regular time series and that each time series has a numeric name that represent
the upper or lower bound of the interval.
The only data source that supports histograms over time is Elasticsearch. You do this by adding a *Histogram*
bucket aggregation before the *Date Histogram*.
There are a number of datasources supporting histogram over time like Elasticsearch (by using a Histogram bucket
aggregation) or Prometheus (with [histogram](https://prometheus.io/docs/concepts/metric_types/#histogram) metric type
and *Format as* option set to Heatmap). But generally, any datasource could be used if it meets the requirements:
returns series with names representing bucket bound or returns sereis sorted by the bound in ascending order.
![](/img/docs/v43/elastic_histogram.png)
With Elasticsearch you control the size of the buckets using the Histogram interval (Y-Axis) and the Date Histogram interval (X-axis).
You control the size of the buckets using the Histogram interval (Y-Axis) and the Date Histogram interval (X-axis).
![Elastic histogram](/img/docs/v43/elastic_histogram.png)
With Prometheus you can only control X-axis by adjusting *Min step* and *Resolution* options.
![Prometheus histogram](/img/docs/v51/prometheus_histogram.png)
## Display Options
@@ -100,8 +113,8 @@ but include a group by time interval or maxDataPoints limit coupled with an aggr
This all depends on the time range of your query of course. But the important point is to know that the Histogram bucketing
that Grafana performs may be done on already aggregated and averaged data. To get more accurate heatmaps it is better
to do the bucketing during metric collection or store the data in Elasticsearch, which currently is the only data source
data supports doing Histogram bucketing on the raw data.
to do the bucketing during metric collection or store the data in Elasticsearch, or in the other data source which
supports doing Histogram bucketing on the raw data.
If you remove or lower the group by time (or raise maxDataPoints) in your query to return more data points your heatmap will be
more accurate but this can also be very CPU & Memory taxing for your browser and could cause hangs and crashes if the number of

View File

@@ -77,11 +77,11 @@ Gauges gives a clear picture of how high a value is in it's context. It's a grea
<div class="clearfix"></div>
### Value to text mapping
### Value/Range to text mapping
{{< docs-imagebox img="/img/docs/v45/singlestat-value-mapping.png" class="docs-image--right docs-image--no-shadow">}}
Value to text mapping allows you to translate the value of the summary stat into explicit text. The text will respect all styling, thresholds and customization defined for the value. This can be useful to translate the number of the main Singlestat value into a context-specific human-readable word or message.
Value/Range to text mapping allows you to translate the value of the summary stat into explicit text. The text will respect all styling, thresholds and customization defined for the value. This can be useful to translate the number of the main Singlestat value into a context-specific human-readable word or message.
<div class="clearfix"></div>

View File

@@ -14,11 +14,53 @@ weight = 2
<img class="screenshot" src="/assets/img/features/table-panel.png">
The new table panel is very flexible, supporting both multiple modes for time series as well as for
The table panel is very flexible, supporting both multiple modes for time series as well as for
table, annotation and raw JSON data. It also provides date formatting and value formatting and coloring options.
To view table panels in action and test different configurations with sample data, check out the [Table Panel Showcase in the Grafana Playground](http://play.grafana.org/dashboard/db/table-panel-showcase).
## Querying Data
The table panel displays the results of a query specified in the **Metrics** tab.
The result being displayed depends on the datasource and the query, but generally there is one row per datapoint, with extra columns for associated keys and values, as well as one column for the numeric value of the datapoint.
You can change the behavior in the section **Data to Table** below.
### Merge Multiple Queries per Table
> Only available in Grafana v5.0+.
Sometimes it is useful to display the results of multiple queries in the same table on corresponding rows, e.g., when comparing capacity and actual usage of resources.
In this example usage and capacity are metrics that will have corresponding datapoints, while their associated keys and values can be used to match them.
(This matching is only available with the **Table Transform** set to **Table**.)
In its simplest case, both queries return time-series data with a numeric value and a timestamp.
If the timestamps are the same, datapoints will be matched and rendered on the same row.
Some datasources return keys and values (labels, tags) associated with the datapoint.
These are being matched as well if they are present in both results and have the same value.
The following datapoints will end up on the same row with one time column, two label columns ("host" and "job") and two value columns:
```
Datapoint for query A: {time: 1, host: "node-2", job: "job-8", value: 3}
Datapoint for query B: {time: 1, host: "node-2", value: 4}
```
The following two results cannot be matched and will be rendered on separate rows:
```
Different time
Datapoint for query A: {time: 1, host: "node-2", job: "job-8", value: 3}
Datapoint for query B: {time: 2, host: "node-2", value: 4}
Different label "host"
Datapoint for query A: {time: 1, host: "node-2", job: "job-8", value: 3}
Datapoint for query B: {time: 1, host: "node-9", value: 4}
```
You can still merge both of the above cases by changing the conflicting column's **Type** to **hidden** in the **Column Styles**.
Note that if each datapoint of your query results have multiple value fields like max, min, mean, etc., they will likely have different values and therefore will not match and render on separate rows.
If you intend for rows to be merged but see them rendered on separate rows, check the query results in the **Query Inspector** for field values being identical across datapoints that should be merged into a row.
## Options overview
The table panel has many ways to manipulate your data for optimal presentation.
@@ -97,3 +139,14 @@ The column styles allow you control how dates and numbers are formatted.
4. **Thresholds and Coloring**: Specify color mode and thresholds limits.
5. **Type**: The three supported types of types are **Number**, **String** and **Date**. **Unit** and **Decimals**: Specify unit and decimal precision for numbers. **Format**: Specify date format for dates.
### String
#### Value/Range to text mapping
> Only available in Grafana v5.1+.
{{< docs-imagebox img="/img/docs/v51/table-value-mapping.png" class="docs-image--right docs-image--no-shadow">}}
Value/range to text mapping allows you to translate numeric values into explicit text. The text will respect all styling, thresholds and customization defined for the value. This can be useful to translate the numeric values into a context-specific human-readable word or message.
<div class="clearfix"></div>

View File

@@ -11,7 +11,7 @@ weight = 3
+++
## Whats new in Grafana v4.1
## What's new in Grafana v4.1
- **Graph**: Support for shared tooltip on all graphs as you hover over one graph. [#1578](https://github.com/grafana/grafana/pull/1578), [#6274](https://github.com/grafana/grafana/pull/6274)
- **Victorops**: Add VictorOps notification integration [#6411](https://github.com/grafana/grafana/issues/6411), thx [@ichekrygin](https://github.com/ichekrygin)
- **Opsgenie**: Add OpsGenie notification integratiion [#6687](https://github.com/grafana/grafana/issues/6687), thx [@kylemcc](https://github.com/kylemcc)
@@ -24,7 +24,7 @@ weight = 3
{{< imgbox max-width="60%" img="/img/docs/v41/shared_tooltip.gif" caption="Shared tooltip" >}}
Showing the tooltip on all panels at the same time has been a long standing request in Grafana and we are really happy to finally be able to release it.
Showing the tooltip on all panels at the same time has been a long standing request in Grafana and we are really happy to finally be able to release it.
You can enable/disable the shared tooltip from the dashboard settings menu or cycle between default, shared tooltip and shared crosshair by pressing `CTRL + O` or `CMD + O`.
<div class="clearfix"></div>
@@ -50,7 +50,7 @@ Panels with a help text available have a little indicator in the top left corner
In Grafana 4.1.0 you can configure your Cloudwatch data source with `access key` and `secret key` directly in the data source configuration page.
This enables people to use the Cloudwatch data source without having access to the filesystem where Grafana is running.
Once the `access key` and `secret key` have been saved the user will no longer be able to view them.
Once the `access key` and `secret key` have been saved the user will no longer be able to view them.
<div class="clearfix"></div>
## Upgrade & Breaking changes

View File

@@ -10,7 +10,7 @@ parent = "whatsnew"
weight = -1
+++
## Whats new in Grafana v4.2
## What's new in Grafana v4.2
Grafana v4.2 Beta is now [available for download](https://grafana.com/grafana/download/4.2.0).
Just like the last release this one contains lots bug fixes and minor improvements.

View File

@@ -64,7 +64,7 @@ This makes exploring and filtering Prometheus data much easier.
* **Dataproxy**: Allow grafan to renegotiate tls connection [#9250](https://github.com/grafana/grafana/issues/9250)
* **HTTP**: set net.Dialer.DualStack to true for all http clients [#9367](https://github.com/grafana/grafana/pull/9367)
* **Alerting**: Add diff and percent diff as series reducers [#9386](https://github.com/grafana/grafana/pull/9386), thx [@shanhuhai5739](https://github.com/shanhuhai5739)
* **Slack**: Allow images to be uploaded to slack when Token is precent [#7175](https://github.com/grafana/grafana/issues/7175), thx [@xginn8](https://github.com/xginn8)
* **Slack**: Allow images to be uploaded to slack when Token is present [#7175](https://github.com/grafana/grafana/issues/7175), thx [@xginn8](https://github.com/xginn8)
* **Opsgenie**: Use their latest API instead of old version [#9399](https://github.com/grafana/grafana/pull/9399), thx [@cglrkn](https://github.com/cglrkn)
* **Table**: Add support for displaying the timestamp with milliseconds [#9429](https://github.com/grafana/grafana/pull/9429), thx [@s1061123](https://github.com/s1061123)
* **Hipchat**: Add metrics, message and image to hipchat notifications [#9110](https://github.com/grafana/grafana/issues/9110), thx [@eloo](https://github.com/eloo)

View File

@@ -0,0 +1,125 @@
+++
title = "What's New in Grafana v5.1"
description = "Feature & improvement highlights for Grafana v5.1"
keywords = ["grafana", "new", "documentation", "5.1"]
type = "docs"
[menu.docs]
name = "Version 5.1"
identifier = "v5.1"
parent = "whatsnew"
weight = -7
+++
# What's New in Grafana v5.1
Grafana v5.1 brings new features, many enhancements and bug fixes. This article will detail the major new features and enhancements.
* [Improved scrolling experience]({{< relref "#improved-scrolling-experience" >}})
* [Improved docker image]({{< relref "#improved-docker-image-breaking-change" >}}) with a breaking change!
* [Heatmap support for Prometheus]({{< relref "#prometheus" >}})
* [Microsoft SQL Server]({{< relref "#microsoft-sql-server" >}}) as metric & table datasource!
* [Dashboards & Panels]({{< relref "#dashboards-panels" >}}) Improved adding panels to dashboards and enhancements to Graph and Table panels.
* [New variable interpolation syntax]({{< relref "#new-variable-interpolation-syntax" >}})
* [Improved workflow for provisioned dashboards]({{< relref "#improved-workflow-for-provisioned-dashboards" >}})
## Improved scrolling experience
In Grafana v5.0 we introduced a new scrollbar component. Unfortunately this introduced a lot of issues and in some scenarios removed
the native scrolling functionality. Grafana v5.1 ships with a native scrollbar for all pages together with a scrollbar component for
the dashboard grid and panels that's not overriding the native scrolling functionality. We hope that these changes and improvements should
make the Grafana user experience much better!
## Improved docker image (breaking change)
Grafana v5.1 brings an improved official docker image which should make it easier to run and use the Grafana docker image and at the same time give more control to the user how to use/run it.
We've switched the id of the grafana user running Grafana inside a docker container. Unfortunately this means that files created prior to 5.1 won't have the correct permissions for later versions and thereby this introduces a breaking change.
We made this change so that it would be easier for you to control what user Grafana is executed as (see examples below).
Version | User | User ID
--------|---------|---------
< 5.1 | grafana | 104
>= 5.1 | grafana | 472
Please read the [updated documentation](/installation/docker/#migration-from-a-previous-version-of-the-docker-container-to-5-1-or-later) which includes migration instructions and more information.
## Prometheus
{{< docs-imagebox img="/img/docs/v51/prometheus_heatmap.png" max-width="800px" class="docs-image--right" >}}
The Prometheus datasource now support transforming Prometheus histograms to the heatmap panel. Prometheus histogram is a powerful feature, and we're
really happy to finally allow our users to render those as heatmaps. Please read [Heatmap panel documentation](/features/panels/heatmap/#pre-bucketed-data)
for more information on how to use it.
Prometheus query editor also got support for autocomplete of template variables. More information in the [Prometheus data source documentation](/features/datasources/prometheus/).
<div class="clearfix"></div>
## Microsoft SQL Server
{{< docs-imagebox img="/img/docs/v51/mssql_query_editor_showcase.png" max-width= "800px" class="docs-image--right" >}}
Grafana v5.1 now ships with a built-in Microsoft SQL Server (MSSQL) data source plugin that allows you to query and visualize data from any
Microsoft SQL Server 2005 or newer, including Microsoft Azure SQL Database. Do you have metric or log data in MSSQL? You can now visualize
that data and define alert rules on it like with any of Grafana's other core datasources.
Please read [Using Microsoft SQL Server in Grafana documentation](/features/datasources/mssql/) for more detailed information on how to get started and use it.
<div class="clearfix"></div>
## Dashboards & Panels
### Adding new panels to dashboards
{{< docs-imagebox img="/img/docs/v51/dashboard_add_panel.png" max-width= "800px" class="docs-image--right" >}}
The control for adding new panels to dashboards have got some enhancements and now includes functionality to search for the type of panel
you want to add. Further, the control has tabs separating functionality for adding new panels and pasting
copied panels.
By copying a panel in a dashboard it will be displayed in the `Paste` tab in *any* dashboard and allows you to paste the
copied panel into the current dashboard.
{{< docs-imagebox img="/img/docs/v51/dashboard_panel_copy.png" max-width= "300px" >}}
<div class="clearfix"></div>
### Graph Panel
New enhancements includes support for multiple series stacking in histogram mode, thresholds for right Y axis, aligning left and right Y-axes to one level and additional units. More information in the [Graph panel documentation](/features/panels/graph/).
### Table Panel
New enhancements includes support for mapping a numeric value/range to text and additional units. More information in the [Table panel documentation](/features/panels/table_panel/#string).
## New variable interpolation syntax
We now support a new option for rendering variables that gives the user full control of how the value(s) should be rendered.
In the table below you can see some examples and you can find all different options in the [Variables documentation](http://docs.grafana.org/reference/templating/#advanced-formatting-options).
Filter Option | Example | Raw | Interpolated | Description
------------ | ------------- | ------------- | ------------- | -------------
`glob` | ${servers:glob} | `'test1', 'test2'` | `{test1,test2}` | Formats multi-value variable into a glob
`regex` | ${servers:regex} | `'test.', 'test2'` | <code>(test\.&#124;test2)</code> | Formats multi-value variable into a regex string
`pipe` | ${servers:pipe} | `'test.', 'test2'` | <code>test.&#124;test2</code> | Formats multi-value variable into a pipe-separated string
`csv`| ${servers:csv} | `'test1', 'test2'` | `test1,test2` | Formats multi-value variable as a comma-separated string
## Improved workflow for provisioned dashboards
{{< docs-imagebox img="/img/docs/v51/provisioning_cannot_save_dashboard.png" max-width="800px" class="docs-image--right" >}}
Grafana v5.1 brings an improved workflow for provisioned dashboards:
* A populated `id` property in JSON is now automatically removed when provisioning dashboards.
* When making changes to a provisioned dashboard you can `Save` the dashboard which now will bring up a *Cannot save provisioned dashboard* dialog like seen in the screenshot to the right.
Available options in the dialog will let you `Copy JSON to Clipboard` and/or `Save JSON to file` which can help you synchronize your dashboard changes back to the provisioning source.
More information in the [Provisioning documentation](/administration/provisioning/).
<div class="clearfix"></div>
## Changelog
Checkout the [CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md) file for a complete list
of new features, changes, and bug fixes.

View File

@@ -0,0 +1,70 @@
+++
title = "What's New in Grafana v5.2"
description = "Feature & improvement highlights for Grafana v5.2"
keywords = ["grafana", "new", "documentation", "5.2"]
type = "docs"
[menu.docs]
name = "Version 5.2"
identifier = "v5.2"
parent = "whatsnew"
weight = -8
+++
# What's New in Grafana v5.2
Grafana v5.2 brings new features, many enhancements and bug fixes. This article will detail the major new features and enhancements.
* [Elasticsearch alerting]({{< relref "#elasticsearch-alerting" >}}) it's finally here!
* [Cross platform build support]({{< relref "#cross-platform-build-support" >}}) enables native builds of Grafana for many more platforms!
* [Improved Docker image]({{< relref "#improved-docker-image" >}}) with support for docker secrets
* [Prometheus]({{< relref "#prometheus" >}}) with alignment enhancements
* [Alerting]({{< relref "#alerting" >}}) with alert notification channel type for Discord
* [Dashboards & Panels]({{< relref "#dashboards-panels" >}})
## Elasticsearch alerting
{{< docs-imagebox img="/img/docs/v52/elasticsearch_alerting.png" max-width="800px" class="docs-image--right" >}}
Grafana v5.2 ships with an updated Elasticsearch datasource with support for alerting. Alerting support for Elasticsearch has been one of
the most requested features by our community and now it's finally here. Please try it out and let us know what you think.
<div class="clearfix"></div>
## Cross platform build support
Grafana v5.2 brings an improved build pipeline with cross platform support. This enables native builds of Grafana for ARMv7 (x32), ARM64 (x64),
MacOS/Darwin (x64) and Windows (x64) in both stable and nightly builds.
We've been longing for native ARM build support for a long time. With the help from our amazing community this is now finally available.
## Improved Docker image
The Grafana docker image now includes support for Docker secrets which enables you to supply Grafana with configuration through files. More
information in the [Installing using Docker documentation](/installation/docker/#reading-secrets-from-files-support-for-docker-secrets).
## Prometheus
The Prometheus datasource now aligns the start/end of the query sent to Prometheus with the step, which ensures PromQL expressions with *rate*
functions get consistent results, and thus avoid graphs jumping around on reload.
## Alerting
By popular demand Grafana now includes support for an alert notification channel type for [Discord](https://discordapp.com/).
## Dashboards & Panels
### Modified time range and variables are no longer saved by default
{{< docs-imagebox img="/img/docs/v52/dashboard_save_modal.png" max-width="800px" class="docs-image--right" >}}
Starting from Grafana v5.2 a modified time range or variable are no longer saved by default. To save a modified
time range or variable you'll need to actively select that when saving a dashboard, see screenshot.
This should hopefully make it easier to have sane defaults of time and variables in dashboards and make it more explicit
when you actually want to overwrite those settings.
<div class="clearfix"></div>
## Changelog
Checkout the [CHANGELOG.md](https://github.com/grafana/grafana/blob/master/CHANGELOG.md) file for a complete list
of new features, changes, and bug fixes.

View File

@@ -35,10 +35,15 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
`/api/alerts?dashboardId=1`
- **dashboardId** Return alerts for a specified dashboard.
- **panelId** Return alerts for a specified panel on a dashboard.
- **limit** - Limit response to x number of alerts.
- **dashboardId** Limit response to alerts in specified dashboard(s). You can specify multiple dashboards, e.g. dashboardId=23&dashboardId=35.
- **panelId** Limit response to alert for a specified panel on a dashboard.
- **query** - Limit response to alerts having a name like this value.
- **state** - Return alerts with one or more of the following alert states: `ALL`,`no_data`, `paused`, `alerting`, `ok`, `pending`. To specify multiple states use the following format: `?state=paused&state=alerting`
- **limit** - Limit response to *X* number of alerts.
- **folderId** Limit response to alerts of dashboards in specified folder(s). You can specify multiple folders, e.g. folderId=23&folderId=35.
- **dashboardQuery** - Limit response to alerts having a dashboard name like this value.
- **dashboardTag** - Limit response to alerts of dashboards with specified tags. To do an "AND" filtering with multiple tags, specify the tags parameter multiple times e.g. dashboardTag=tag1&dashboardTag=tag2.
**Example Response**:
@@ -49,18 +54,15 @@ Content-Type: application/json
```
## Get one alert
`GET /api/alerts/:id`
**Example Request**:
```http
GET /api/alerts/1 HTTP/1.1
Accept: application/json
```http
GET /api/alerts/1 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
@@ -88,16 +90,35 @@ Content-Type: application/json
```http
POST /api/alerts/1/pause HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
HTTP/1.1 200
The :id query parameter is the id of the alert to be paused or unpaused.
JSON Body Schema:
- **paused** Can be `true` or `false`. True to pause an alert. False to unpause an alert.
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
{
```
## Pause all alerts
`POST /api/admin/pause-all-alerts`
```http
POST /api/admin/pause-all-alerts HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
JSON Body Schema:

View File

@@ -32,10 +32,12 @@ Query Parameters:
- `from`: epoch datetime in milliseconds. Optional.
- `to`: epoch datetime in milliseconds. Optional.
- `limit`: number. Optional - default is 10. Max limit for results returned.
- `limit`: number. Optional - default is 100. Max limit for results returned.
- `alertId`: number. Optional. Find annotations for a specified alert.
- `dashboardId`: number. Optional. Find annotations that are scoped to a specific dashboard
- `panelId`: number. Optional. Find annotations that are scoped to a specific panel
- `userId`: number. Optional. Find annotations created by a specific user
- `type`: string. Optional. `alert`|`annotation` Return alerts or user created annotations
- `tags`: string. Optional. Use this to filter global annotations. Global annotations are annotations from an annotation data source that are not connected specifically to a dashboard or panel. To do an "AND" filtering with multiple tags, specify the tags parameter multiple times e.g. `tags=tag1&tags=tag2`.
**Example Response**:

View File

@@ -106,6 +106,7 @@ Accept: application/json
- **200** - Ok
- **401** - Unauthorized
- **403** - Access denied
- **404** - Dashboard not found
"items": [
{
"role": "Viewer",

View File

@@ -331,6 +331,27 @@ Content-Type: application/json
```
## Update Users in Organisation
`PATCH /api/orgs/:orgId/users/:userId`
**Example Request**:
```http
PATCH /api/orgs/1/users/2 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
```
## Delete User in Organisation
@@ -380,6 +401,8 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
"role":"Viewer"
}
```
Note: The api will only work when you pass the admin name and password
to the request http url, like http://admin:admin@localhost:3000/api/orgs/1/users
**Example Response**:

View File

@@ -70,7 +70,7 @@ JSON Body schema:
Content-Type: application/json
{
"deleteKey":"XXXXXXX",
"deleteUrl":"myurl/dashboard/snapshot/XXXXXXX",
"deleteUrl":"myurl/api/snapshots-delete/XXXXXXX",
"key":"YYYYYYY",
"url":"myurl/dashboard/snapshot/YYYYYYY"
}
@@ -81,7 +81,46 @@ Keys:
- **deleteKey** Key generated to delete the snapshot
- **key** Key generated to share the dashboard
## Get Snapshot by Id
## Get list of Snapshots
`GET /api/dashboard/snapshots`
Query parameters:
- **query** Search Query
- **limit** Limit the number of returned results
**Example Request**:
```http
GET /api/dashboard/snapshots HTTP/1.1
Accept: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
```
## Get Snapshot by Key
`GET /api/snapshots/:key`
**Example Request**:
```http
GET /api/snapshots/YYYYYYY HTTP/1.1
Accept: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
@@ -90,7 +129,6 @@ Keys:
## Delete Snapshot by Key
`DELETE /api/snapshots/:key`
Content-Type: application/json
**Example Request**:
@@ -140,16 +178,15 @@ Content-Type: application/json
}
```
## Delete Snapshot by deleteKey
## Delete Snapshot by Key
`GET /api/snapshots-delete/:deleteKey`
`DELETE /api/snapshots/:key`
**Example Request**:
```http
GET /api/snapshots/YYYYYYY HTTP/1.1
DELETE /api/snapshots/YYYYYYY HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
```
@@ -159,5 +196,27 @@ Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
HTTP/1.1 200
Content-Type: application/json
{"message":"Snapshot deleted. It might take an hour before it's cleared from a CDN cache."}
{"message":"Snapshot deleted. It might take an hour before it's cleared from any CDN caches."}
```
## Delete Snapshot by deleteKey
This API call can be used without authentication by using the secret delete key for the snapshot.
`GET /api/snapshots-delete/:deleteKey`
**Example Request**:
```http
GET /api/snapshots-delete/XXXXXXX HTTP/1.1
Accept: application/json
```
**Example Response**:
```http
HTTP/1.1 200
Content-Type: application/json
{"message":"Snapshot deleted. It might take an hour before it's cleared from any CDN caches."}
```

View File

@@ -53,7 +53,7 @@ server {
```bash
[server]
domain = foo.bar
root_url = %(protocol)s://%(domain)s:/grafana
root_url = %(protocol)s://%(domain)s/grafana/
```
#### Nginx configuration with sub path
@@ -98,7 +98,7 @@ Given:
```bash
[server]
domain = localhost:8080
root_url = %(protocol)s://%(domain)s:/grafana
root_url = %(protocol)s://%(domain)s/grafana/
```
Create an Inbound Rule for the parent website (localhost:8080 in this example) in IIS Manager with the following settings:

View File

@@ -93,8 +93,6 @@ Directory where grafana will automatically scan and look for plugins
### provisioning
> This feature is available in 5.0+
Folder that contains [provisioning](/administration/provisioning) config files that grafana will apply on startup. Dashboards will be reloaded when the json files changes
## [server]
@@ -421,25 +419,33 @@ allowed_organizations = github google
## [auth.google]
You need to create a Google project. You can do this in the [Google
Developer Console](https://console.developers.google.com/project). When
you create the project you will need to specify a callback URL. Specify
this as callback:
First, you need to create a Google OAuth Client:
```bash
http://<my_grafana_server_name_or_ip>:<grafana_server_port>/login/google
```
1. Go to https://console.developers.google.com/apis/credentials
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/google`.
When the Google project is created you will get a Client ID and a Client
Secret. Specify these in the Grafana configuration file. For example:
2. Click the 'Create Credentials' button, then click 'OAuth Client ID' in the
menu that drops down
3. Enter the following:
- Application Type: Web Application
- Name: Grafana
- 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
5. Copy the Client ID and Client Secret from the 'OAuth Client' modal
Specify the Client ID and Secret in the Grafana configuration file. For example:
```bash
[auth.google]
enabled = true
client_id = YOUR_GOOGLE_APP_CLIENT_ID
client_secret = YOUR_GOOGLE_APP_CLIENT_SECRET
client_id = CLIENT_ID
client_secret = CLIENT_SECRET
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
auth_url = https://accounts.google.com/o/oauth2/auth
token_url = https://accounts.google.com/o/oauth2/token
@@ -659,6 +665,10 @@ Set to `true` to enable auto sign up of users who do not exist in Grafana DB. De
Limit where auth proxy requests come from by configuring a list of IP addresses. This can be used to prevent users spoofing the X-WEBAUTH-USER header.
### headers
Used to define additional headers for `Name`, `Email` and/or `Login`, for example if the user's name is sent in the X-WEBAUTH-NAME header and their email address in the X-WEBAUTH-EMAIL header, set `headers = Name:X-WEBAUTH-NAME Email:X-WEBAUTH-EMAIL`.
<hr>
## [session]
@@ -713,7 +723,7 @@ Analytics ID here. By default this feature is disabled.
## [dashboards]
### versions_to_keep (introduced in v5.0)
### versions_to_keep
Number dashboard versions to keep (per dashboard). Default: 20, Minimum: 1.

View File

@@ -15,7 +15,10 @@ weight = 1
Description | Download
------------ | -------------
Stable for Debian-based Linux | [grafana_5.0.4_amd64.deb](https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.0.4_amd64.deb)
Stable for Debian-based Linux | [grafana_5.1.3_amd64.deb](https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.1.3_amd64.deb)
<!--
Beta for Debian-based Linux | [grafana_5.1.0-beta1_amd64.deb](https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.1.0-beta1_amd64.deb)
-->
Read [Upgrading Grafana]({{< relref "installation/upgrading.md" >}}) for tips and guidance on updating an existing
installation.
@@ -24,11 +27,18 @@ installation.
```bash
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.0.4_amd64.deb
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.1.3_amd64.deb
sudo apt-get install -y adduser libfontconfig
sudo dpkg -i grafana_5.0.4_amd64.deb
sudo dpkg -i grafana_5.1.3_amd64.deb
```
<!-- ## Install Latest Beta
```bash
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_5.1.0-beta1_amd64.deb
sudo apt-get install -y adduser libfontconfig
sudo dpkg -i grafana_5.1.0-beta1_amd64.deb
``` -->
## APT Repository
Add the following line to your `/etc/apt/sources.list` file.

View File

@@ -18,28 +18,6 @@ Grafana is very easy to install and run using the official docker container.
$ docker run -d -p 3000:3000 grafana/grafana
```
All Grafana configuration settings can be defined using environment
variables, this is especially useful when using the above container.
## Docker volumes & ENV config
The Docker container exposes two volumes, the sqlite3 database in the
folder `/var/lib/grafana` and configuration files is in `/etc/grafana/`
folder. You can map these volumes to host folders when you start the
container:
```bash
$ docker run -d -p 3000:3000 \
-v /var/lib/grafana:/var/lib/grafana \
-e "GF_SECURITY_ADMIN_PASSWORD=secret" \
grafana/grafana
```
In the above example I map the data folder and sets a configuration option via
an `ENV` instruction.
See the [docker volumes documentation](https://docs.docker.com/engine/admin/volumes/volumes/) if you want to create a volume to use with the Grafana docker image instead of a bind mount (binding to a directory in the host system).
## Configuration
All options defined in conf/grafana.ini can be overridden using environment
@@ -56,15 +34,29 @@ $ docker run \
grafana/grafana
```
You can use your own grafana.ini file by using environment variable `GF_PATHS_CONFIG`.
The back-end web server has a number of configuration options. Go to the
[Configuration]({{< relref "configuration.md" >}}) page for details on all
those options.
## Running a Specific Version of Grafana
```bash
# specify right tag, e.g. 5.1.0 - see Docker Hub for available tags
$ docker run \
-d \
-p 3000:3000 \
--name grafana \
grafana/grafana:5.1.0
```
## Running of the master branch
For every successful commit we publish a Grafana container to [`grafana/grafana`](https://hub.docker.com/r/grafana/grafana/tags/) and [`grafana/grafana-dev`](https://hub.docker.com/r/grafana/grafana-dev/tags/). In `grafana/grafana` container we will always overwrite the `master` tag with the latest version. In `grafana/grafana-dev` we will include
the git commit in the tag. If you run Grafana master in production we **strongly** recommend that you use the later since different machines might run different version of grafana if they pull the master tag at different times.
## Installing Plugins for Grafana
Pass the plugins you want installed to docker with the `GF_INSTALL_PLUGINS` environment variable as a comma separated list. This will pass each plugin name to `grafana-cli plugins install ${plugin}`.
Pass the plugins you want installed to docker with the `GF_INSTALL_PLUGINS` environment variable as a comma separated list. This will pass each plugin name to `grafana-cli plugins install ${plugin}` and install them when Grafana starts.
```bash
docker run \
@@ -75,15 +67,22 @@ docker run \
grafana/grafana
```
## Running a Specific Version of Grafana
## Building a custom Grafana image with pre-installed plugins
In the [grafana-docker](https://github.com/grafana/grafana-docker/) there is a folder called `custom/` which includes a `Dockerfile` that can be used to build a custom Grafana image. It accepts `GRAFANA_VERSION` and `GF_INSTALL_PLUGINS` as build arguments.
Example of how to build and run:
```bash
# specify right tag, e.g. 4.5.2 - see Docker Hub for available tags
$ docker run \
cd custom
docker build -t grafana:latest-with-plugins \
--build-arg "GRAFANA_VERSION=latest" \
--build-arg "GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource" .
docker run \
-d \
-p 3000:3000 \
--name grafana \
grafana/grafana:5.0.2
--name=grafana \
grafana:latest-with-plugins
```
## Configuring AWS Credentials for CloudWatch Support
@@ -108,3 +107,108 @@ Supported variables:
- `GF_AWS_${profile}_ACCESS_KEY_ID`: AWS access key ID (required).
- `GF_AWS_${profile}_SECRET_ACCESS_KEY`: AWS secret access key (required).
- `GF_AWS_${profile}_REGION`: AWS region (optional).
## Grafana container with persistent storage (recommended)
```bash
# create a persistent volume for your data in /var/lib/grafana (database and plugins)
docker volume create grafana-storage
# start grafana
docker run \
-d \
-p 3000:3000 \
--name=grafana \
-v grafana-storage:/var/lib/grafana \
grafana/grafana
```
## Grafana container using bind mounts
You may want to run Grafana in Docker but use folders on your host for the database or configuration. When doing so it becomes important to start the container with a user that is able to access and write to the folder you map into the container.
```bash
mkdir data # creates a folder for your data
ID=$(id -u) # saves your user id in the ID variable
# starts grafana with your user id and using the data folder
docker run -d --user $ID --volume "$PWD/data:/var/lib/grafana" -p 3000:3000 grafana/grafana:5.1.0
```
## Reading secrets from files (support for Docker Secrets)
> Available in v5.2.0 and later
It's possible to supply Grafana with configuration through files. This works well with [Docker Secrets](https://docs.docker.com/engine/swarm/secrets/) as the secrets by default gets mapped into `/run/secrets/<name of secret>` of the container.
You can do this with any of the configuration options in conf/grafana.ini by setting `GF_<SectionName>_<KeyName>_FILE` to the path of the file holding the secret.
Let's say you want to set the admin password this way.
- Admin password secret: `/run/secrets/admin_password`
- Environment variable: `GF_SECURITY_ADMIN_PASSWORD_FILE=/run/secrets/admin_password`
## Migration from a previous version of the docker container to 5.1 or later
The docker container for Grafana has seen a major rewrite for 5.1.
**Important changes**
* file ownership is no longer modified during startup with `chown`
* default user id `472` instead of `104`
* no more implicit volumes
- `/var/lib/grafana`
- `/etc/grafana`
- `/var/log/grafana`
### Removal of implicit volumes
Previously `/var/lib/grafana`, `/etc/grafana` and `/var/log/grafana` were defined as volumes in the `Dockerfile`. This led to the creation of three volumes each time a new instance of the Grafana container started, whether you wanted it or not.
You should always be careful to define your own named volume for storage, but if you depended on these volumes you should be aware that an upgraded container will no longer have them.
**Warning**: when migrating from an earlier version to 5.1 or later using docker compose and implicit volumes you need to use `docker inspect` to find out which volumes your container is mapped to so that you can map them to the upgraded container as well. You will also have to change file ownership (or user) as documented below.
### User ID changes
In 5.1 we switched the id of the grafana user. Unfortunately this means that files created prior to 5.1 won't have the correct permissions for later versions. We made this change so that it would be more likely that the grafana users id would be unique to Grafana. For example, on Ubuntu 16.04 `104` is already in use by the syslog user.
Version | User | User ID
--------|---------|---------
< 5.1 | grafana | 104
>= 5.1 | grafana | 472
There are two possible solutions to this problem. Either you start the new container as the root user and change ownership from `104` to `472` or you start the upgraded container as user `104`.
#### Running docker as a different user
```bash
docker run --user 104 --volume "<your volume mapping here>" grafana/grafana:5.1.0
```
##### Specifying a user in docker-compose.yml
```yaml
version: "2"
services:
grafana:
image: grafana/grafana:5.1.0
ports:
- 3000:3000
user: "104"
```
#### Modifying permissions
The commands below will run bash inside the Grafana container with your volume mapped in. This makes it possible to modify the file ownership to match the new container. Always be careful when modifying permissions.
```bash
$ docker run -ti --user root --volume "<your volume mapping here>" --entrypoint bash grafana/grafana:5.1.0
# in the container you just started:
chown -R root:root /etc/grafana && \
chmod -R a+r /etc/grafana && \
chown -R grafana:grafana /var/lib/grafana && \
chown -R grafana:grafana /usr/share/grafana
```

View File

@@ -15,8 +15,10 @@ weight = 2
Description | Download
------------ | -------------
Stable for CentOS / Fedora / OpenSuse / Redhat Linux | [5.0.4 (x86-64 rpm)](https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.0.4-1.x86_64.rpm)
Stable for CentOS / Fedora / OpenSuse / Redhat Linux | [5.1.3 (x86-64 rpm)](https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.3-1.x86_64.rpm)
<!--
Latest Beta for CentOS / Fedora / OpenSuse / Redhat Linux | [5.1.0-beta1 (x86-64 rpm)](https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.0-beta1.x86_64.rpm)
-->
Read [Upgrading Grafana]({{< relref "installation/upgrading.md" >}}) for tips and guidance on updating an existing
installation.
@@ -26,23 +28,29 @@ installation.
You can install Grafana using Yum directly.
```bash
$ sudo yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.0.4-1.x86_64.rpm
$ sudo yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.3-1.x86_64.rpm
```
<!-- ## Install Beta
```bash
$ sudo yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.0-beta1.x86_64.rpm
``` -->
Or install manually using `rpm`.
#### On CentOS / Fedora / Redhat:
```bash
$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.0.4-1.x86_64.rpm
$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.3-1.x86_64.rpm
$ sudo yum install initscripts fontconfig
$ sudo rpm -Uvh grafana-5.0.4-1.x86_64.rpm
$ sudo rpm -Uvh grafana-5.1.3-1.x86_64.rpm
```
#### On OpenSuse:
```bash
$ sudo rpm -i --nodeps grafana-5.0.4-1.x86_64.rpm
$ sudo rpm -i --nodeps grafana-5.1.3-1.x86_64.rpm
```
## Install via YUM Repository

View File

@@ -12,7 +12,11 @@ weight = 3
Description | Download
------------ | -------------
Latest stable package for Windows | [grafana-5.0.4.windows-x64.zip](https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.0.4.windows-x64.zip)
Latest stable package for Windows | [grafana-5.1.3.windows-x64.zip](https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.3.windows-x64.zip)
<!--
Latest beta package for Windows | [grafana.5.1.0-beta1.windows-x64.zip](https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.0.0-beta5.windows-x64.zip)
-->
Read [Upgrading Grafana]({{< relref "installation/upgrading.md" >}}) for tips and guidance on updating an existing
installation.

View File

@@ -5,7 +5,7 @@ type = "docs"
[menu.docs]
name = "Developing App Plugins"
parent = "developing"
weight = 6
weight = 4
+++
# Grafana Apps

View File

@@ -5,7 +5,7 @@ type = "docs"
[menu.docs]
name = "Developing Datasource Plugins"
parent = "developing"
weight = 6
weight = 5
+++
# Datasources
@@ -25,7 +25,6 @@ To interact with the rest of grafana the plugins module file can export 5 differ
- Datasource (Required)
- QueryCtrl (Required)
- ConfigCtrl (Required)
- QueryOptionsCtrl
- AnnotationsQueryCtrl
## Plugin json
@@ -182,12 +181,6 @@ A JavaScript class that will be instantiated and treated as an Angular controlle
Requires a static template or templateUrl variable which will be rendered as the view for this controller.
## QueryOptionsCtrl
A JavaScript class that will be instantiated and treated as an Angular controller when the user edits metrics in a panel. This controller is responsible for handling panel wide settings for the datasource, such as interval, rate and aggregations if needed.
Requires a static template or templateUrl variable which will be rendered as the view for this controller.
## AnnotationsQueryCtrl
A JavaScript class that will be instantiated and treated as an Angular controller when the user choose this type of datasource in the templating menu in the dashboard.

View File

@@ -1,16 +1,11 @@
---
page_title: Plugin panel
page_description: Panel plugins for Grafana
page_keywords: grafana, plugins, documentation
---
+++
title = "Installing Plugins"
title = "Developing Panel Plugins"
keywords = ["grafana", "plugins", "panel", "documentation"]
type = "docs"
[menu.docs]
name = "Developing Panel Plugins"
parent = "developing"
weight = 1
weight = 4
+++
@@ -20,7 +15,21 @@ Panels are the main building blocks of dashboards.
## Panel development
Examples
### Scrolling
The grafana dashboard framework controls the panel height. To enable a scrollbar within the panel the PanelCtrl needs to set the scrollable static variable:
```javascript
export class MyPanelCtrl extends PanelCtrl {
static scrollable = true;
...
```
In this case, make sure the template has a single `<div>...</div>` root. The plugin loader will modify that element adding a scrollbar.
### Examples
- [clock-panel](https://github.com/grafana/clock-panel)
- [singlestat-panel](https://github.com/grafana/grafana/blob/master/public/app/plugins/panel/singlestat/module.ts)

View File

@@ -5,7 +5,7 @@ type = "docs"
[menu.docs]
name = "plugin.json Schema"
parent = "developing"
weight = 6
weight = 8
+++
# Plugin.json

View File

@@ -13,7 +13,7 @@ dev environment. Grafana ships with its own required backend server; also comple
## Dependencies
- [Go 1.9.2](https://golang.org/dl/)
- [Go 1.10](https://golang.org/dl/)
- [Git](https://git-scm.com/downloads)
- [NodeJS LTS](https://nodejs.org/download/)
- node-gyp is the Node.js native addon build tool and it requires extra dependencies: python 2.7, make and GCC. These are already installed for most Linux distros and MacOS. See the Building On Windows section or the [node-gyp installation instructions](https://github.com/nodejs/node-gyp#installation) for more details.
@@ -66,13 +66,13 @@ You can run a local instance of Grafana by running:
```bash
./bin/grafana-server
```
If you built the binary with `go run build.go build`, run `./bin/grafana-server`
Or, if you built the binary with `go run build.go build`, run `./bin/<os>-<architecture>/grafana-server`
If you built it with `go build .`, run `./grafana`
Open grafana in your browser (default [http://localhost:3000](http://localhost:3000)) and login with admin user (default user/pass = admin/admin).
## Developing Grafana
# Developing Grafana
To add features, customize your config, etc, you'll need to rebuild the backend when you change the source code. We use a tool named `bra` that
does this.
@@ -124,7 +124,7 @@ Learn more about Grafana config options in the [Configuration section](/installa
## Create a pull requests
Please contribute to the Grafana project and submit a pull request! Build new features, write or update documentation, fix bugs and generally make Grafana even more awesome.
## Troubleshooting
# Troubleshooting
**Problem**: PhantomJS or node-sass errors when running grunt

View File

@@ -50,6 +50,7 @@ When a user creates a new dashboard, a new dashboard JSON object is initialized
"annotations": {
"list": []
},
"refresh": "5s",
"schemaVersion": 16,
"version": 0,
"links": []
@@ -71,6 +72,7 @@ Each field in the dashboard JSON is explained below with its usage:
| **timepicker** | timepicker metadata, see [timepicker section](#timepicker) for details |
| **templating** | templating metadata, see [templating section](#templating) for details |
| **annotations** | annotations metadata, see [annotations section](#annotations) for details |
| **refresh** | auto-refresh interval
| **schemaVersion** | version of the JSON schema (integer), incremented each time a Grafana update brings changes to said schema |
| **version** | version of the dashboard (integer), incremented each time the dashboard is updated |
| **panels** | panels array, see below for detail. |

View File

@@ -36,6 +36,29 @@ interpolation the variable value might be **escaped** in order to conform to the
For example, a variable used in a regex expression in an InfluxDB or Prometheus query will be regex escaped. Read the data source specific
documentation article for details on value escaping during interpolation.
### Advanced Formatting Options
> Only available in Grafana v5.1+.
The formatting of the variable interpolation depends on the data source but there are some situations where you might want to change the default formatting. For example, the default for the MySql datasource is to join multiple values as comma-separated with quotes: `'server01','server02'`. In some cases you might want to have a comma-separated string without quotes: `server01,server02`. This is now possible with the advanced formatting options.
Syntax: `${var_name:option}`
Filter Option | Example | Raw | Interpolated | Description
------------ | ------------- | ------------- | ------------- | -------------
`glob` | ${servers:glob} | `'test1', 'test2'` | `{test1,test2}` | (Default) Formats multi-value variable into a glob (for Graphite queries)
`regex` | ${servers:regex} | `'test.', 'test2'` | <code>(test\.&#124;test2)</code> | Formats multi-value variable into a regex string
`pipe` | ${servers:pipe} | `'test.', 'test2'` | <code>test.&#124;test2</code> | Formats multi-value variable into a pipe-separated string
`csv`| ${servers:csv} | `'test1', 'test2'` | `test1,test2` | Formats multi-value variable as a comma-separated string
`distributed`| ${servers:distributed} | `'test1', 'test2'` | `test1,servers=test2` | Formats multi-value variable in custom format for OpenTSDB.
`lucene`| ${servers:lucene} | `'test', 'test2'` | `("test" OR "test2")` | Formats multi-value variable as a lucene expression.
Test the formatting options on the [Grafana Play site](http://play.grafana.org/d/cJtIfcWiz/template-variable-formatting-options?orgId=1).
If any invalid formatting option is specified, then `glob` is the default/fallback option.
An alternative syntax (that might be deprecated in the future) is `[[var_name:option]]`.
### Variable options
A variable is presented as a dropdown select box at the top of the dashboard. It has a current value and a set of **options**. The **options**
@@ -166,7 +189,7 @@ Option | Description
------- | --------
*Multi-value* | If enabled, the variable will support the selection of multiple options at the same time.
*Include All option* | Add a special `All` option whose value includes all options.
*Custom all value* | By default the `All` value will include all options in combined expression. This can become very long and can have performance problems. Many times it can be better to specify a custom all value, like a wildcard regex. To make it possible to have custom regex, globs or lucene syntax in the **Custom all value** option it is never escaped so you will have to think avbout what is a valid value for your data source.
*Custom all value* | By default the `All` value will include all options in combined expression. This can become very long and can have performance problems. Many times it can be better to specify a custom all value, like a wildcard regex. To make it possible to have custom regex, globs or lucene syntax in the **Custom all value** option it is never escaped so you will have to think about what is a valid value for your data source.
### Formatting multiple values
@@ -277,4 +300,3 @@ Variable values are always synced to the URL using the syntax `var-<varname>=val
- [Graphite Templated Dashboard](http://play.grafana.org/dashboard/db/graphite-templated-nested)
- [Elasticsearch Templated Dashboard](http://play.grafana.org/dashboard/db/elasticsearch-templated)
- [InfluxDB Templated Dashboard](http://play.grafana.org/dashboard/db/influxdb-templated-queries)

View File

@@ -16,7 +16,7 @@ Example:
- Parent site: http://localhost:8080
- Grafana: http://localhost:3000
Grafana as a subpath: http://localhost:8080/grafana
Grafana as a subpath: http://localhost:8080/grafana
## Setup
@@ -33,7 +33,7 @@ Given that the subpath should be `grafana` and the parent site is `localhost:808
```bash
[server]
domain = localhost:8080
root_url = %(protocol)s://%(domain)s:/grafana
root_url = %(protocol)s://%(domain)s/grafana/
```
Restart the Grafana server after changing the config file.
@@ -74,11 +74,11 @@ When navigating to the grafana url (`http://localhost:8080/grafana` in the examp
1. The `root_url` setting in the Grafana config file does not match the parent url with subpath. This could happen if the root_url is commented out by mistake (`;` is used for commenting out a line in .ini files):
`; root_url = %(protocol)s://%(domain)s:/grafana`
`; root_url = %(protocol)s://%(domain)s/grafana/`
2. or if the subpath in the `root_url` setting does not match the subpath used in the pattern in the Inbound Rule in IIS:
`root_url = %(protocol)s://%(domain)s:/grafana`
`root_url = %(protocol)s://%(domain)s/grafana/`
pattern in Inbound Rule: `wrongsubpath(/)?(.*)`

View File

@@ -94,7 +94,7 @@ weight = 10
</a>
<figcaption>
<a href="https://youtu.be/FC13uhFRsVw?list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2" target="_blank" rel="noopener noreferrer">
#3 Whats New In Grafana 2.0
#3 What's New In Grafana 2.0
</a>
</figcaption>
</figure>

View File

@@ -1,6 +1,6 @@
[
{ "version": "v5.1", "path": "/v5.1", "archived": false },
{ "version": "v5.0", "path": "/", "archived": false, "current": true },
{ "version": "v5.1", "path": "/", "archived": false, "current": true },
{ "version": "v5.0", "path": "/v5.0", "archived": true },
{ "version": "v4.6", "path": "/v4.6", "archived": true },
{ "version": "v4.5", "path": "/v4.5", "archived": true },
{ "version": "v4.4", "path": "/v4.4", "archived": true },

View File

@@ -1,4 +1,4 @@
{
"stable": "5.0.0",
"testing": "5.0.0"
"stable": "5.2.0",
"testing": "5.2.0"
}

View File

@@ -4,7 +4,7 @@
"company": "Grafana Labs"
},
"name": "grafana",
"version": "5.1.0-pre1",
"version": "5.2.3",
"repository": {
"type": "git",
"url": "http://github.com/grafana/grafana.git"
@@ -18,11 +18,12 @@
"@types/react-dom": "^16.0.3",
"angular-mocks": "^1.6.6",
"autoprefixer": "^6.4.0",
"awesome-typescript-loader": "^3.2.3",
"awesome-typescript-loader": "^4.0.0",
"axios": "^0.17.1",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-preset-es2015": "^6.24.1",
"clean-webpack-plugin": "^0.1.19",
"css-loader": "^0.28.7",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.1",
@@ -32,7 +33,7 @@
"expect.js": "~0.2.0",
"expose-loader": "^0.7.3",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^0.11.2",
"file-loader": "^1.1.11",
"gaze": "^1.1.2",
"glob": "~7.0.0",
"grunt": "1.0.1",
@@ -54,11 +55,11 @@
"grunt-usemin": "3.1.1",
"grunt-webpack": "^3.0.2",
"html-loader": "^0.5.1",
"html-webpack-harddisk-plugin": "^0.2.0",
"html-webpack-plugin": "^2.30.1",
"husky": "^0.14.3",
"jest": "^22.0.4",
"jshint-stylish": "~2.2.1",
"json-loader": "^0.5.7",
"karma": "1.7.0",
"karma-chrome-launcher": "~2.2.0",
"karma-expect": "~1.1.3",
@@ -80,25 +81,28 @@
"postcss-loader": "^2.0.6",
"postcss-reporter": "^5.0.0",
"prettier": "1.9.2",
"react-hot-loader": "^4.2.0",
"react-test-renderer": "^16.0.0",
"sass-lint": "^1.10.2",
"sass-loader": "^6.0.6",
"sass-loader": "^7.0.1",
"sinon": "1.17.6",
"style-loader": "^0.21.0",
"systemjs": "0.20.19",
"systemjs-plugin-css": "^0.1.36",
"ts-jest": "^22.0.0",
"ts-loader": "^3.2.0",
"tslint": "^5.8.0",
"tslint-loader": "^3.5.3",
"typescript": "^2.6.2",
"webpack": "^3.10.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-cleanup-plugin": "^0.5.1",
"webpack-dev-server": "2.11.1",
"webpack-merge": "^4.1.0",
"zone.js": "^0.7.2"
},
"scripts": {
"dev": "webpack --progress --colors --config scripts/webpack/webpack.dev.js",
"start": "webpack-dev-server --progress --colors --config scripts/webpack/webpack.hot.js",
"watch": "webpack --progress --colors --watch --config scripts/webpack/webpack.dev.js",
"build": "grunt build",
"test": "grunt test",
@@ -130,11 +134,11 @@
},
"license": "Apache-2.0",
"dependencies": {
"angular": "^1.6.6",
"angular": "1.6.6",
"angular-bindonce": "^0.3.1",
"angular-native-dragdrop": "^1.2.2",
"angular-route": "^1.6.6",
"angular-sanitize": "^1.6.6",
"angular-route": "1.6.6",
"angular-sanitize": "1.6.6",
"babel-polyfill": "^6.26.0",
"baron": "^3.0.3",
"brace": "^0.10.0",
@@ -144,6 +148,7 @@
"d3-scale-chromatic": "^1.1.1",
"eventemitter3": "^2.0.3",
"file-saver": "^1.3.3",
"immutable": "^3.8.2",
"jquery": "^3.2.1",
"lodash": "^4.17.4",
"mobx": "^3.4.1",
@@ -152,10 +157,11 @@
"moment": "^2.18.1",
"mousetrap": "^1.6.0",
"mousetrap-global-bind": "^1.1.0",
"prismjs": "^1.6.0",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-grid-layout-grafana": "0.16.0",
"react-grid-layout": "0.16.6",
"react-highlight-words": "^0.10.0",
"react-popper": "^0.7.5",
"react-select": "^1.1.0",
@@ -164,8 +170,14 @@
"remarkable": "^1.7.1",
"rst2html": "github:thoward/rst2html#990cb89",
"rxjs": "^5.4.3",
"slate": "^0.33.4",
"slate-plain-serializer": "^0.5.10",
"slate-react": "^0.12.4",
"tether": "^1.4.0",
"tether-drop": "https://github.com/torkelo/drop/tarball/master",
"tinycolor2": "^1.4.1"
},
"resolutions": {
"caniuse-db": "1.0.30000772"
}
}

View File

@@ -1,6 +1,6 @@
#! /usr/bin/env bash
deb_ver=5.0.0-beta5
rpm_ver=5.0.0-beta5
deb_ver=5.1.0-beta1
rpm_ver=5.1.0-beta1
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_${deb_ver}_amd64.deb

View File

@@ -12,7 +12,7 @@ import (
func AdminGetSettings(c *m.ReqContext) {
settings := make(map[string]interface{})
for _, section := range setting.Cfg.Sections() {
for _, section := range setting.Raw.Sections() {
jsonSec := make(map[string]interface{})
settings[section.Name()] = jsonSec

View File

@@ -2,12 +2,14 @@ package api
import (
"fmt"
"strconv"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/bus"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/alerting"
"github.com/grafana/grafana/pkg/services/guardian"
"github.com/grafana/grafana/pkg/services/search"
)
func ValidateOrgAlert(c *m.ReqContext) {
@@ -46,12 +48,64 @@ func GetAlertStatesForDashboard(c *m.ReqContext) Response {
// GET /api/alerts
func GetAlerts(c *m.ReqContext) Response {
dashboardQuery := c.Query("dashboardQuery")
dashboardTags := c.QueryStrings("dashboardTag")
stringDashboardIDs := c.QueryStrings("dashboardId")
stringFolderIDs := c.QueryStrings("folderId")
dashboardIDs := make([]int64, 0)
for _, id := range stringDashboardIDs {
dashboardID, err := strconv.ParseInt(id, 10, 64)
if err == nil {
dashboardIDs = append(dashboardIDs, dashboardID)
}
}
if dashboardQuery != "" || len(dashboardTags) > 0 || len(stringFolderIDs) > 0 {
folderIDs := make([]int64, 0)
for _, id := range stringFolderIDs {
folderID, err := strconv.ParseInt(id, 10, 64)
if err == nil {
folderIDs = append(folderIDs, folderID)
}
}
searchQuery := search.Query{
Title: dashboardQuery,
Tags: dashboardTags,
SignedInUser: c.SignedInUser,
Limit: 1000,
OrgId: c.OrgId,
DashboardIds: dashboardIDs,
Type: string(search.DashHitDB),
FolderIds: folderIDs,
Permission: m.PERMISSION_VIEW,
}
err := bus.Dispatch(&searchQuery)
if err != nil {
return Error(500, "List alerts failed", err)
}
for _, d := range searchQuery.Result {
if d.Type == search.DashHitDB && d.Id > 0 {
dashboardIDs = append(dashboardIDs, d.Id)
}
}
// if we didn't find any dashboards, return empty result
if len(dashboardIDs) == 0 {
return JSON(200, []*m.AlertListItemDTO{})
}
}
query := m.GetAlertsQuery{
OrgId: c.OrgId,
DashboardId: c.QueryInt64("dashboardId"),
PanelId: c.QueryInt64("panelId"),
Limit: c.QueryInt64("limit"),
User: c.SignedInUser,
OrgId: c.OrgId,
DashboardIDs: dashboardIDs,
PanelId: c.QueryInt64("panelId"),
Limit: c.QueryInt64("limit"),
User: c.SignedInUser,
Query: c.Query("query"),
}
states := c.QueryStrings("state")

View File

@@ -6,6 +6,7 @@ import (
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/bus"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/search"
. "github.com/smartystreets/goconvey/convey"
)
@@ -64,6 +65,60 @@ func TestAlertingApiEndpoint(t *testing.T) {
})
})
})
loggedInUserScenarioWithRole("When calling GET on", "GET", "/api/alerts?dashboardId=1", "/api/alerts", m.ROLE_EDITOR, func(sc *scenarioContext) {
var searchQuery *search.Query
bus.AddHandler("test", func(query *search.Query) error {
searchQuery = query
return nil
})
var getAlertsQuery *m.GetAlertsQuery
bus.AddHandler("test", func(query *m.GetAlertsQuery) error {
getAlertsQuery = query
return nil
})
sc.handlerFunc = GetAlerts
sc.fakeReqWithParams("GET", sc.url, map[string]string{}).exec()
So(searchQuery, ShouldBeNil)
So(getAlertsQuery, ShouldNotBeNil)
})
loggedInUserScenarioWithRole("When calling GET on", "GET", "/api/alerts?dashboardId=1&dashboardId=2&folderId=3&dashboardTag=abc&dashboardQuery=dbQuery&limit=5&query=alertQuery", "/api/alerts", m.ROLE_EDITOR, func(sc *scenarioContext) {
var searchQuery *search.Query
bus.AddHandler("test", func(query *search.Query) error {
searchQuery = query
query.Result = search.HitList{
&search.Hit{Id: 1},
&search.Hit{Id: 2},
}
return nil
})
var getAlertsQuery *m.GetAlertsQuery
bus.AddHandler("test", func(query *m.GetAlertsQuery) error {
getAlertsQuery = query
return nil
})
sc.handlerFunc = GetAlerts
sc.fakeReqWithParams("GET", sc.url, map[string]string{}).exec()
So(searchQuery, ShouldNotBeNil)
So(searchQuery.DashboardIds[0], ShouldEqual, 1)
So(searchQuery.DashboardIds[1], ShouldEqual, 2)
So(searchQuery.FolderIds[0], ShouldEqual, 3)
So(searchQuery.Tags[0], ShouldEqual, "abc")
So(searchQuery.Title, ShouldEqual, "dbQuery")
So(getAlertsQuery, ShouldNotBeNil)
So(getAlertsQuery.DashboardIDs[0], ShouldEqual, 1)
So(getAlertsQuery.DashboardIDs[1], ShouldEqual, 2)
So(getAlertsQuery.Limit, ShouldEqual, 5)
So(getAlertsQuery.Query, ShouldEqual, "alertQuery")
})
})
}

View File

@@ -2,7 +2,6 @@ package api
import (
"strings"
"time"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/components/simplejson"
@@ -15,9 +14,10 @@ import (
func GetAnnotations(c *m.ReqContext) Response {
query := &annotations.ItemQuery{
From: c.QueryInt64("from") / 1000,
To: c.QueryInt64("to") / 1000,
From: c.QueryInt64("from"),
To: c.QueryInt64("to"),
OrgId: c.OrgId,
UserId: c.QueryInt64("userId"),
AlertId: c.QueryInt64("alertId"),
DashboardId: c.QueryInt64("dashboardId"),
PanelId: c.QueryInt64("panelId"),
@@ -37,7 +37,7 @@ func GetAnnotations(c *m.ReqContext) Response {
if item.Email != "" {
item.AvatarUrl = dtos.GetGravatarUrl(item.Email)
}
item.Time = item.Time * 1000
item.Time = item.Time
}
return JSON(200, items)
@@ -68,16 +68,12 @@ func PostAnnotation(c *m.ReqContext, cmd dtos.PostAnnotationsCmd) Response {
UserId: c.UserId,
DashboardId: cmd.DashboardId,
PanelId: cmd.PanelId,
Epoch: cmd.Time / 1000,
Epoch: cmd.Time,
Text: cmd.Text,
Data: cmd.Data,
Tags: cmd.Tags,
}
if item.Epoch == 0 {
item.Epoch = time.Now().Unix()
}
if err := repo.Save(&item); err != nil {
return Error(500, "Failed to save annotation", err)
}
@@ -97,7 +93,7 @@ func PostAnnotation(c *m.ReqContext, cmd dtos.PostAnnotationsCmd) Response {
}
item.Id = 0
item.Epoch = cmd.TimeEnd / 1000
item.Epoch = cmd.TimeEnd
if err := repo.Save(&item); err != nil {
return Error(500, "Failed save annotation for region end time", err)
@@ -132,9 +128,6 @@ func PostGraphiteAnnotation(c *m.ReqContext, cmd dtos.PostGraphiteAnnotationsCmd
return Error(500, "Failed to save Graphite annotation", err)
}
if cmd.When == 0 {
cmd.When = time.Now().Unix()
}
text := formatGraphiteAnnotation(cmd.What, cmd.Data)
// Support tags in prior to Graphite 0.10.0 format (string of tags separated by space)
@@ -163,7 +156,7 @@ func PostGraphiteAnnotation(c *m.ReqContext, cmd dtos.PostGraphiteAnnotationsCmd
item := annotations.Item{
OrgId: c.OrgId,
UserId: c.UserId,
Epoch: cmd.When,
Epoch: cmd.When * 1000,
Text: text,
Tags: tagsArray,
}
@@ -191,7 +184,7 @@ func UpdateAnnotation(c *m.ReqContext, cmd dtos.UpdateAnnotationsCmd) Response {
OrgId: c.OrgId,
UserId: c.UserId,
Id: annotationID,
Epoch: cmd.Time / 1000,
Epoch: cmd.Time,
Text: cmd.Text,
Tags: cmd.Tags,
}
@@ -203,7 +196,7 @@ func UpdateAnnotation(c *m.ReqContext, cmd dtos.UpdateAnnotationsCmd) Response {
if cmd.IsRegion {
itemRight := item
itemRight.RegionId = item.Id
itemRight.Epoch = cmd.TimeEnd / 1000
itemRight.Epoch = cmd.TimeEnd
// We don't know id of region right event, so set it to 0 and find then using query like
// ... WHERE region_id = <item.RegionId> AND id != <item.RegionId> ...
@@ -301,19 +294,3 @@ func canSave(c *m.ReqContext, repo annotations.Repository, annotationID int64) R
return nil
}
func canSaveByRegionID(c *m.ReqContext, repo annotations.Repository, regionID int64) Response {
items, err := repo.Find(&annotations.ItemQuery{RegionId: regionID, OrgId: c.OrgId})
if err != nil || len(items) == 0 {
return Error(500, "Could not find annotation to update", err)
}
dashboardID := items[0].DashboardId
if canSave, err := canSaveByDashboardID(c, dashboardID); err != nil || !canSave {
return dashboardGuardianResponse(err)
}
return nil
}

View File

@@ -23,7 +23,7 @@ func (hs *HTTPServer) registerRoutes() {
// automatically set HEAD for every GET
macaronR.SetAutoHead(true)
r := newRouteRegister(middleware.RequestMetrics, middleware.RequestTracing)
r := hs.RouteRegister
// not logged in views
r.Get("/", reqSignedIn, Index)
@@ -77,6 +77,9 @@ func (hs *HTTPServer) registerRoutes() {
r.Get("/dashboards/", reqSignedIn, Index)
r.Get("/dashboards/*", reqSignedIn, Index)
r.Get("/explore/", reqEditorRole, Index)
r.Get("/explore/*", reqEditorRole, Index)
r.Get("/playlists/", reqSignedIn, Index)
r.Get("/playlists/*", reqSignedIn, Index)
r.Get("/alerting/", reqSignedIn, Index)
@@ -107,7 +110,8 @@ func (hs *HTTPServer) registerRoutes() {
r.Post("/api/snapshots/", bind(m.CreateDashboardSnapshotCommand{}), CreateDashboardSnapshot)
r.Get("/api/snapshot/shared-options/", GetSharingOptions)
r.Get("/api/snapshots/:key", GetDashboardSnapshot)
r.Get("/api/snapshots-delete/:key", reqEditorRole, wrap(DeleteDashboardSnapshot))
r.Get("/api/snapshots-delete/:deleteKey", wrap(DeleteDashboardSnapshotByDeleteKey))
r.Delete("/api/snapshots/:key", reqEditorRole, wrap(DeleteDashboardSnapshot))
// api renew session based on remember cookie
r.Get("/api/login/ping", quota("session"), LoginAPIPing)
@@ -374,7 +378,7 @@ func (hs *HTTPServer) registerRoutes() {
}, reqGrafanaAdmin)
// rendering
r.Get("/render/*", reqSignedIn, RenderToPng)
r.Get("/render/*", reqSignedIn, hs.RenderToPng)
// grafana.net proxy
r.Any("/api/gnet/*", reqSignedIn, ProxyGnetRequest)

View File

@@ -226,7 +226,7 @@ func (this *thunderTask) Fetch() {
this.Done()
}
var client *http.Client = &http.Client{
var client = &http.Client{
Timeout: time.Second * 2,
Transport: &http.Transport{Proxy: http.ProxyFromEnvironment},
}

View File

@@ -46,6 +46,31 @@ func loggedInUserScenarioWithRole(desc string, method string, url string, routeP
})
}
func anonymousUserScenario(desc string, method string, url string, routePattern string, fn scenarioFunc) {
Convey(desc+" "+url, func() {
defer bus.ClearBusHandlers()
sc := setupScenarioContext(url)
sc.defaultHandler = wrap(func(c *m.ReqContext) Response {
sc.context = c
if sc.handlerFunc != nil {
return sc.handlerFunc(sc.context)
}
return nil
})
switch method {
case "GET":
sc.m.Get(routePattern, sc.defaultHandler)
case "DELETE":
sc.m.Delete(routePattern, sc.defaultHandler)
}
fn(sc)
})
}
func (sc *scenarioContext) fakeReq(method, url string) *scenarioContext {
sc.resp = httptest.NewRecorder()
req, err := http.NewRequest(method, url, nil)

View File

@@ -91,11 +91,31 @@ func GetDashboardSnapshot(c *m.ReqContext) {
c.JSON(200, dto)
}
// GET /api/snapshots-delete/:key
// GET /api/snapshots-delete/:deleteKey
func DeleteDashboardSnapshotByDeleteKey(c *m.ReqContext) Response {
key := c.Params(":deleteKey")
query := &m.GetDashboardSnapshotQuery{DeleteKey: key}
err := bus.Dispatch(query)
if err != nil {
return Error(500, "Failed to get dashboard snapshot", err)
}
cmd := &m.DeleteDashboardSnapshotCommand{DeleteKey: query.Result.DeleteKey}
if err := bus.Dispatch(cmd); err != nil {
return Error(500, "Failed to delete dashboard snapshot", err)
}
return JSON(200, util.DynMap{"message": "Snapshot deleted. It might take an hour before it's cleared from any CDN caches."})
}
// DELETE /api/snapshots/:key
func DeleteDashboardSnapshot(c *m.ReqContext) Response {
key := c.Params(":key")
query := &m.GetDashboardSnapshotQuery{DeleteKey: key}
query := &m.GetDashboardSnapshotQuery{Key: key}
err := bus.Dispatch(query)
if err != nil {
@@ -118,13 +138,13 @@ func DeleteDashboardSnapshot(c *m.ReqContext) Response {
return Error(403, "Access denied to this snapshot", nil)
}
cmd := &m.DeleteDashboardSnapshotCommand{DeleteKey: key}
cmd := &m.DeleteDashboardSnapshotCommand{DeleteKey: query.Result.DeleteKey}
if err := bus.Dispatch(cmd); err != nil {
return Error(500, "Failed to delete dashboard snapshot", err)
}
return JSON(200, util.DynMap{"message": "Snapshot deleted. It might take an hour before it's cleared from a CDN cache."})
return JSON(200, util.DynMap{"message": "Snapshot deleted. It might take an hour before it's cleared from any CDN caches."})
}
// GET /api/dashboard/snapshots
@@ -154,7 +174,6 @@ func SearchDashboardSnapshots(c *m.ReqContext) Response {
Id: snapshot.Id,
Name: snapshot.Name,
Key: snapshot.Key,
DeleteKey: snapshot.DeleteKey,
OrgId: snapshot.OrgId,
UserId: snapshot.UserId,
External: snapshot.External,

View File

@@ -47,15 +47,30 @@ func TestDashboardSnapshotApiEndpoint(t *testing.T) {
Convey("When user has editor role and is not in the ACL", func() {
Convey("Should not be able to delete snapshot", func() {
loggedInUserScenarioWithRole("When calling GET on", "GET", "/api/snapshots-delete/12345", "/api/snapshots-delete/:key", m.ROLE_EDITOR, func(sc *scenarioContext) {
loggedInUserScenarioWithRole("When calling DELETE on", "DELETE", "/api/snapshots/12345", "/api/snapshots/:key", m.ROLE_EDITOR, func(sc *scenarioContext) {
sc.handlerFunc = DeleteDashboardSnapshot
sc.fakeReqWithParams("GET", sc.url, map[string]string{"key": "12345"}).exec()
sc.fakeReqWithParams("DELETE", sc.url, map[string]string{"key": "12345"}).exec()
So(sc.resp.Code, ShouldEqual, 403)
})
})
})
Convey("When user is anonymous", func() {
Convey("Should be able to delete snapshot by deleteKey", func() {
anonymousUserScenario("When calling GET on", "GET", "/api/snapshots-delete/12345", "/api/snapshots-delete/:deleteKey", func(sc *scenarioContext) {
sc.handlerFunc = DeleteDashboardSnapshotByDeleteKey
sc.fakeReqWithParams("GET", sc.url, map[string]string{"deleteKey": "12345"}).exec()
So(sc.resp.Code, ShouldEqual, 200)
respJSON, err := simplejson.NewJson(sc.resp.Body.Bytes())
So(err, ShouldBeNil)
So(respJSON.Get("message").MustString(), ShouldStartWith, "Snapshot deleted")
})
})
})
Convey("When user is editor and dashboard has default ACL", func() {
aclMockResp = []*m.DashboardAclInfoDTO{
{Role: &viewerRole, Permission: m.PERMISSION_VIEW},
@@ -63,9 +78,9 @@ func TestDashboardSnapshotApiEndpoint(t *testing.T) {
}
Convey("Should be able to delete a snapshot", func() {
loggedInUserScenarioWithRole("When calling GET on", "GET", "/api/snapshots-delete/12345", "/api/snapshots-delete/:key", m.ROLE_EDITOR, func(sc *scenarioContext) {
loggedInUserScenarioWithRole("When calling DELETE on", "DELETE", "/api/snapshots/12345", "/api/snapshots/:key", m.ROLE_EDITOR, func(sc *scenarioContext) {
sc.handlerFunc = DeleteDashboardSnapshot
sc.fakeReqWithParams("GET", sc.url, map[string]string{"key": "12345"}).exec()
sc.fakeReqWithParams("DELETE", sc.url, map[string]string{"key": "12345"}).exec()
So(sc.resp.Code, ShouldEqual, 200)
respJSON, err := simplejson.NewJson(sc.resp.Body.Bytes())
@@ -81,9 +96,9 @@ func TestDashboardSnapshotApiEndpoint(t *testing.T) {
mockSnapshotResult.UserId = TestUserID
Convey("Should be able to delete a snapshot", func() {
loggedInUserScenarioWithRole("When calling GET on", "GET", "/api/snapshots-delete/12345", "/api/snapshots-delete/:key", m.ROLE_EDITOR, func(sc *scenarioContext) {
loggedInUserScenarioWithRole("When calling DELETE on", "DELETE", "/api/snapshots/12345", "/api/snapshots/:key", m.ROLE_EDITOR, func(sc *scenarioContext) {
sc.handlerFunc = DeleteDashboardSnapshot
sc.fakeReqWithParams("GET", sc.url, map[string]string{"key": "12345"}).exec()
sc.fakeReqWithParams("DELETE", sc.url, map[string]string{"key": "12345"}).exec()
So(sc.resp.Code, ShouldEqual, 200)
respJSON, err := simplejson.NewJson(sc.resp.Body.Bytes())

View File

@@ -22,21 +22,22 @@ type LoginCommand struct {
}
type CurrentUser struct {
IsSignedIn bool `json:"isSignedIn"`
Id int64 `json:"id"`
Login string `json:"login"`
Email string `json:"email"`
Name string `json:"name"`
LightTheme bool `json:"lightTheme"`
OrgCount int `json:"orgCount"`
OrgId int64 `json:"orgId"`
OrgName string `json:"orgName"`
OrgRole m.RoleType `json:"orgRole"`
IsGrafanaAdmin bool `json:"isGrafanaAdmin"`
GravatarUrl string `json:"gravatarUrl"`
Timezone string `json:"timezone"`
Locale string `json:"locale"`
HelpFlags1 m.HelpFlags1 `json:"helpFlags1"`
IsSignedIn bool `json:"isSignedIn"`
Id int64 `json:"id"`
Login string `json:"login"`
Email string `json:"email"`
Name string `json:"name"`
LightTheme bool `json:"lightTheme"`
OrgCount int `json:"orgCount"`
OrgId int64 `json:"orgId"`
OrgName string `json:"orgName"`
OrgRole m.RoleType `json:"orgRole"`
IsGrafanaAdmin bool `json:"isGrafanaAdmin"`
GravatarUrl string `json:"gravatarUrl"`
Timezone string `json:"timezone"`
Locale string `json:"locale"`
HelpFlags1 m.HelpFlags1 `json:"helpFlags1"`
HasEditPermissionInFolders bool `json:"hasEditPermissionInFolders"`
}
type MetricRequest struct {
@@ -51,7 +52,7 @@ type UserStars struct {
func GetGravatarUrl(text string) string {
if setting.DisableGravatar {
return "/public/img/user_profile.png"
return setting.AppSubUrl + "/public/img/user_profile.png"
}
if text == "" {

View File

@@ -57,4 +57,5 @@ type ImportDashboardCommand struct {
Overwrite bool `json:"overwrite"`
Dashboard *simplejson.Json `json:"dashboard"`
Inputs []plugins.ImportDashboardInput `json:"inputs"`
FolderId int64 `json:"folderId"`
}

View File

@@ -140,6 +140,7 @@ func getFrontendSettingsMap(c *m.ReqContext) (map[string]interface{}, error) {
"authProxyEnabled": setting.AuthProxyEnabled,
"ldapEnabled": setting.LdapEnabled,
"alertingEnabled": setting.AlertingEnabled,
"exploreEnabled": setting.ExploreEnabled,
"googleAnalyticsId": setting.GoogleAnalyticsId,
"disableLoginForm": setting.DisableLoginForm,
"externalUserMngInfo": setting.ExternalUserMngInfo,

View File

@@ -26,27 +26,37 @@ import (
"github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/registry"
"github.com/grafana/grafana/pkg/services/rendering"
"github.com/grafana/grafana/pkg/setting"
)
func init() {
registry.RegisterService(&HTTPServer{})
}
type HTTPServer struct {
log log.Logger
macaron *macaron.Macaron
context context.Context
streamManager *live.StreamManager
cache *gocache.Cache
httpSrv *http.Server
httpSrv *http.Server
RouteRegister RouteRegister `inject:""`
Bus bus.Bus `inject:""`
RenderService rendering.Service `inject:""`
Cfg *setting.Cfg `inject:""`
}
func NewHTTPServer() *HTTPServer {
return &HTTPServer{
log: log.New("http.server"),
cache: gocache.New(5*time.Minute, 10*time.Minute),
}
func (hs *HTTPServer) Init() error {
hs.log = log.New("http.server")
hs.cache = gocache.New(5*time.Minute, 10*time.Minute)
return nil
}
func (hs *HTTPServer) Start(ctx context.Context) error {
func (hs *HTTPServer) Run(ctx context.Context) error {
var err error
hs.context = ctx
@@ -57,9 +67,20 @@ func (hs *HTTPServer) Start(ctx context.Context) error {
hs.streamManager.Run(ctx)
listenAddr := fmt.Sprintf("%s:%s", setting.HttpAddr, setting.HttpPort)
hs.log.Info("Initializing HTTP Server", "address", listenAddr, "protocol", setting.Protocol, "subUrl", setting.AppSubUrl, "socket", setting.SocketPath)
hs.log.Info("HTTP Server Listen", "address", listenAddr, "protocol", setting.Protocol, "subUrl", setting.AppSubUrl, "socket", setting.SocketPath)
hs.httpSrv = &http.Server{Addr: listenAddr, Handler: hs.macaron}
// handle http shutdown on server context done
go func() {
<-ctx.Done()
// Hacky fix for race condition between ListenAndServe and Shutdown
time.Sleep(time.Millisecond * 100)
if err := hs.httpSrv.Shutdown(context.Background()); err != nil {
hs.log.Error("Failed to shutdown server", "error", err)
}
}()
switch setting.Protocol {
case setting.HTTP:
err = hs.httpSrv.ListenAndServe()
@@ -96,12 +117,6 @@ func (hs *HTTPServer) Start(ctx context.Context) error {
return err
}
func (hs *HTTPServer) Shutdown(ctx context.Context) error {
err := hs.httpSrv.Shutdown(ctx)
hs.log.Info("Stopped HTTP server")
return err
}
func (hs *HTTPServer) listenAndServeTLS(certfile, keyfile string) error {
if certfile == "" {
return fmt.Errorf("cert_file cannot be empty when using HTTPS")
@@ -162,11 +177,12 @@ func (hs *HTTPServer) newMacaron() *macaron.Macaron {
hs.mapStatic(m, route.Directory, "", pluginRoute)
}
hs.mapStatic(m, setting.StaticRootPath, "build", "public/build")
hs.mapStatic(m, setting.StaticRootPath, "", "public")
hs.mapStatic(m, setting.StaticRootPath, "robots.txt", "robots.txt")
if setting.ImageUploadProvider == "local" {
hs.mapStatic(m, setting.ImagesDir, "", "/public/img/attachments")
hs.mapStatic(m, hs.Cfg.ImagesDir, "", "/public/img/attachments")
}
m.Use(macaron.Renderer(macaron.RenderOptions{
@@ -229,6 +245,12 @@ func (hs *HTTPServer) mapStatic(m *macaron.Macaron, rootDir string, dir string,
c.Resp.Header().Set("Cache-Control", "public, max-age=3600")
}
if prefix == "public/build" {
headers = func(c *macaron.Context) {
c.Resp.Header().Set("Cache-Control", "public, max-age=31536000")
}
}
if setting.Env == setting.DEV {
headers = func(c *macaron.Context) {
c.Resp.Header().Set("Cache-Control", "max-age=0, must-revalidate, no-cache")

View File

@@ -42,23 +42,29 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
settings["appSubUrl"] = ""
}
hasEditPermissionInFoldersQuery := m.HasEditPermissionInFoldersQuery{SignedInUser: c.SignedInUser}
if err := bus.Dispatch(&hasEditPermissionInFoldersQuery); err != nil {
return nil, err
}
var data = dtos.IndexViewData{
User: &dtos.CurrentUser{
Id: c.UserId,
IsSignedIn: c.IsSignedIn,
Login: c.Login,
Email: c.Email,
Name: c.Name,
OrgCount: c.OrgCount,
OrgId: c.OrgId,
OrgName: c.OrgName,
OrgRole: c.OrgRole,
GravatarUrl: dtos.GetGravatarUrl(c.Email),
IsGrafanaAdmin: c.IsGrafanaAdmin,
LightTheme: prefs.Theme == "light",
Timezone: prefs.Timezone,
Locale: locale,
HelpFlags1: c.HelpFlags1,
Id: c.UserId,
IsSignedIn: c.IsSignedIn,
Login: c.Login,
Email: c.Email,
Name: c.Name,
OrgCount: c.OrgCount,
OrgId: c.OrgId,
OrgName: c.OrgName,
OrgRole: c.OrgRole,
GravatarUrl: dtos.GetGravatarUrl(c.Email),
IsGrafanaAdmin: c.IsGrafanaAdmin,
LightTheme: prefs.Theme == "light",
Timezone: prefs.Timezone,
Locale: locale,
HelpFlags1: c.HelpFlags1,
HasEditPermissionInFolders: hasEditPermissionInFoldersQuery.Result,
},
Settings: settings,
Theme: prefs.Theme,
@@ -86,17 +92,23 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
data.Theme = "light"
}
if c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR {
if hasEditPermissionInFoldersQuery.Result {
children := []*dtos.NavLink{
{Text: "Dashboard", Icon: "gicon gicon-dashboard-new", Url: setting.AppSubUrl + "/dashboard/new"},
}
if c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR {
children = append(children, &dtos.NavLink{Text: "Folder", SubTitle: "Create a new folder to organize your dashboards", Id: "folder", Icon: "gicon gicon-folder-new", Url: setting.AppSubUrl + "/dashboards/folder/new"})
}
children = append(children, &dtos.NavLink{Text: "Import", SubTitle: "Import dashboard from file or Grafana.com", Id: "import", Icon: "gicon gicon-dashboard-import", Url: setting.AppSubUrl + "/dashboard/import"})
data.NavTree = append(data.NavTree, &dtos.NavLink{
Text: "Create",
Id: "create",
Icon: "fa fa-fw fa-plus",
Url: setting.AppSubUrl + "/dashboard/new",
Children: []*dtos.NavLink{
{Text: "Dashboard", Icon: "gicon gicon-dashboard-new", Url: setting.AppSubUrl + "/dashboard/new"},
{Text: "Folder", SubTitle: "Create a new folder to organize your dashboards", Id: "folder", Icon: "gicon gicon-folder-new", Url: setting.AppSubUrl + "/dashboards/folder/new"},
{Text: "Import", SubTitle: "Import dashboard from file or Grafana.com", Id: "import", Icon: "gicon gicon-dashboard-import", Url: setting.AppSubUrl + "/dashboard/import"},
},
Text: "Create",
Id: "create",
Icon: "fa fa-fw fa-plus",
Url: setting.AppSubUrl + "/dashboard/new",
Children: children,
})
}
@@ -117,6 +129,19 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
Children: dashboardChildNavs,
})
if setting.ExploreEnabled && (c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR) {
data.NavTree = append(data.NavTree, &dtos.NavLink{
Text: "Explore",
Id: "explore",
SubTitle: "Explore your data",
Icon: "fa fa-rocket",
Url: setting.AppSubUrl + "/explore",
Children: []*dtos.NavLink{
{Text: "New tab", Icon: "gicon gicon-dashboard-new", Url: setting.AppSubUrl + "/explore"},
},
})
}
if c.IsSignedIn {
// Only set login if it's different from the name
var login string
@@ -209,7 +234,7 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
}
}
if c.OrgRole == m.ROLE_ADMIN {
if c.IsGrafanaAdmin || c.OrgRole == m.ROLE_ADMIN {
cfgNode := &dtos.NavLink{
Id: "cfg",
Text: "Configuration",
@@ -263,10 +288,24 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
},
}
if c.IsGrafanaAdmin {
if c.OrgRole != m.ROLE_ADMIN {
cfgNode = &dtos.NavLink{
Id: "cfg",
Text: "Configuration",
SubTitle: "Organization: " + c.OrgName,
Icon: "gicon gicon-cog",
Url: setting.AppSubUrl + "/admin/users",
Children: make([]*dtos.NavLink, 0),
}
}
if c.OrgRole == m.ROLE_ADMIN && c.IsGrafanaAdmin {
cfgNode.Children = append(cfgNode.Children, &dtos.NavLink{
Divider: true, HideFromTabs: true, Id: "admin-divider", Text: "Text",
})
}
if c.IsGrafanaAdmin {
cfgNode.Children = append(cfgNode.Children, &dtos.NavLink{
Text: "Server Admin",
HideFromTabs: true,
@@ -289,7 +328,7 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
data.NavTree = append(data.NavTree, &dtos.NavLink{
Text: "Help",
SubTitle: fmt.Sprintf(`Grafana v%s (%s)`, setting.BuildVersion, setting.BuildCommit),
SubTitle: fmt.Sprintf(`%s v%s (%s)`, setting.ApplicationName, setting.BuildVersion, setting.BuildCommit),
Id: "help",
Url: "#",
Icon: "gicon gicon-question",

View File

@@ -78,7 +78,13 @@ func tryLoginUsingRememberCookie(c *m.ReqContext) bool {
user := userQuery.Result
// validate remember me cookie
if val, _ := c.GetSuperSecureCookie(user.Rands+user.Password, setting.CookieRememberName); val != user.Login {
signingKey := user.Rands + user.Password
if len(signingKey) < 10 {
c.Logger.Error("Invalid user signingKey")
return false
}
if val, _ := c.GetSuperSecureCookie(signingKey, setting.CookieRememberName); val != user.Login {
return false
}
@@ -155,5 +161,9 @@ func Logout(c *m.ReqContext) {
c.SetCookie(setting.CookieUserName, "", -1, setting.AppSubUrl+"/")
c.SetCookie(setting.CookieRememberName, "", -1, setting.AppSubUrl+"/")
c.Session.Destory(c.Context)
c.Redirect(setting.AppSubUrl + "/login")
if setting.SignoutRedirectUrl != "" {
c.Redirect(setting.SignoutRedirectUrl)
} else {
c.Redirect(setting.AppSubUrl + "/login")
}
}

View File

@@ -78,6 +78,7 @@ func OAuthLogin(ctx *m.ReqContext) {
// handle call back
tr := &http.Transport{
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: setting.OAuthService.OAuthInfos[name].TlsSkipVerify,
},

View File

@@ -74,6 +74,9 @@ func AddOrgInvite(c *m.ReqContext, inviteDto dtos.AddInviteForm) Response {
}
if err := bus.Dispatch(&emailCmd); err != nil {
if err == m.ErrSmtpNotEnabled {
return Error(412, err.Error(), err)
}
return Error(500, "Failed to send email invite", err)
}

View File

@@ -25,12 +25,9 @@ import (
)
var (
logger = log.New("data-proxy-log")
client = &http.Client{
Timeout: time.Second * 30,
Transport: &http.Transport{Proxy: http.ProxyFromEnvironment},
}
tokenCache = map[int64]*jwtToken{}
logger = log.New("data-proxy-log")
tokenCache = map[string]*jwtToken{}
client = newHTTPClient()
)
type jwtToken struct {
@@ -48,6 +45,10 @@ type DataSourceProxy struct {
plugin *plugins.DataSourcePlugin
}
type httpClient interface {
Do(req *http.Request) (*http.Response, error)
}
func NewDataSourceProxy(ds *m.DataSource, plugin *plugins.DataSourcePlugin, ctx *m.ReqContext, proxyPath string) *DataSourceProxy {
targetURL, _ := url.Parse(ds.Url)
@@ -60,6 +61,13 @@ func NewDataSourceProxy(ds *m.DataSource, plugin *plugins.DataSourcePlugin, ctx
}
}
func newHTTPClient() httpClient {
return &http.Client{
Timeout: time.Second * 30,
Transport: &http.Transport{Proxy: http.ProxyFromEnvironment},
}
}
func (proxy *DataSourceProxy) HandleRequest() {
if err := proxy.validateRequest(); err != nil {
proxy.ctx.JsonApiErr(403, err.Error(), nil)
@@ -311,7 +319,7 @@ func (proxy *DataSourceProxy) applyRoute(req *http.Request) {
}
func (proxy *DataSourceProxy) getAccessToken(data templateData) (string, error) {
if cachedToken, found := tokenCache[proxy.ds.Id]; found {
if cachedToken, found := tokenCache[proxy.getAccessTokenCacheKey()]; found {
if cachedToken.ExpiresOn.After(time.Now().Add(time.Second * 10)) {
logger.Info("Using token from cache")
return cachedToken.AccessToken, nil
@@ -350,12 +358,16 @@ func (proxy *DataSourceProxy) getAccessToken(data templateData) (string, error)
expiresOnEpoch, _ := strconv.ParseInt(token.ExpiresOnString, 10, 64)
token.ExpiresOn = time.Unix(expiresOnEpoch, 0)
tokenCache[proxy.ds.Id] = &token
tokenCache[proxy.getAccessTokenCacheKey()] = &token
logger.Info("Got new access token", "ExpiresOn", token.ExpiresOn)
return token.AccessToken, nil
}
func (proxy *DataSourceProxy) getAccessTokenCacheKey() string {
return fmt.Sprintf("%v_%v_%v", proxy.ds.Id, proxy.route.Path, proxy.route.Method)
}
func interpolateString(text string, data templateData) (string, error) {
t, err := template.New("content").Parse(text)
if err != nil {

View File

@@ -1,9 +1,13 @@
package pluginproxy
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"testing"
"time"
macaron "gopkg.in/macaron.v1"
@@ -100,6 +104,112 @@ func TestDSRouteRule(t *testing.T) {
})
})
Convey("Plugin with multiple routes for token auth", func() {
plugin := &plugins.DataSourcePlugin{
Routes: []*plugins.AppPluginRoute{
{
Path: "pathwithtoken1",
Url: "https://api.nr1.io/some/path",
TokenAuth: &plugins.JwtTokenAuth{
Url: "https://login.server.com/{{.JsonData.tenantId}}/oauth2/token",
Params: map[string]string{
"grant_type": "client_credentials",
"client_id": "{{.JsonData.clientId}}",
"client_secret": "{{.SecureJsonData.clientSecret}}",
"resource": "https://api.nr1.io",
},
},
},
{
Path: "pathwithtoken2",
Url: "https://api.nr2.io/some/path",
TokenAuth: &plugins.JwtTokenAuth{
Url: "https://login.server.com/{{.JsonData.tenantId}}/oauth2/token",
Params: map[string]string{
"grant_type": "client_credentials",
"client_id": "{{.JsonData.clientId}}",
"client_secret": "{{.SecureJsonData.clientSecret}}",
"resource": "https://api.nr2.io",
},
},
},
},
}
setting.SecretKey = "password"
key, _ := util.Encrypt([]byte("123"), "password")
ds := &m.DataSource{
JsonData: simplejson.NewFromAny(map[string]interface{}{
"clientId": "asd",
"tenantId": "mytenantId",
}),
SecureJsonData: map[string][]byte{
"clientSecret": key,
},
}
req, _ := http.NewRequest("GET", "http://localhost/asd", nil)
ctx := &m.ReqContext{
Context: &macaron.Context{
Req: macaron.Request{Request: req},
},
SignedInUser: &m.SignedInUser{OrgRole: m.ROLE_EDITOR},
}
Convey("When creating and caching access tokens", func() {
var authorizationHeaderCall1 string
var authorizationHeaderCall2 string
Convey("first call should add authorization header with access token", func() {
json, err := ioutil.ReadFile("./test-data/access-token-1.json")
So(err, ShouldBeNil)
client = newFakeHTTPClient(json)
proxy1 := NewDataSourceProxy(ds, plugin, ctx, "pathwithtoken1")
proxy1.route = plugin.Routes[0]
proxy1.applyRoute(req)
authorizationHeaderCall1 = req.Header.Get("Authorization")
So(req.URL.String(), ShouldEqual, "https://api.nr1.io/some/path")
So(authorizationHeaderCall1, ShouldStartWith, "Bearer eyJ0e")
Convey("second call to another route should add a different access token", func() {
json2, err := ioutil.ReadFile("./test-data/access-token-2.json")
So(err, ShouldBeNil)
req, _ := http.NewRequest("GET", "http://localhost/asd", nil)
client = newFakeHTTPClient(json2)
proxy2 := NewDataSourceProxy(ds, plugin, ctx, "pathwithtoken2")
proxy2.route = plugin.Routes[1]
proxy2.applyRoute(req)
authorizationHeaderCall2 = req.Header.Get("Authorization")
So(req.URL.String(), ShouldEqual, "https://api.nr2.io/some/path")
So(authorizationHeaderCall1, ShouldStartWith, "Bearer eyJ0e")
So(authorizationHeaderCall2, ShouldStartWith, "Bearer eyJ0e")
So(authorizationHeaderCall2, ShouldNotEqual, authorizationHeaderCall1)
Convey("third call to first route should add cached access token", func() {
req, _ := http.NewRequest("GET", "http://localhost/asd", nil)
client = newFakeHTTPClient([]byte{})
proxy3 := NewDataSourceProxy(ds, plugin, ctx, "pathwithtoken1")
proxy3.route = plugin.Routes[0]
proxy3.applyRoute(req)
authorizationHeaderCall3 := req.Header.Get("Authorization")
So(req.URL.String(), ShouldEqual, "https://api.nr1.io/some/path")
So(authorizationHeaderCall1, ShouldStartWith, "Bearer eyJ0e")
So(authorizationHeaderCall3, ShouldStartWith, "Bearer eyJ0e")
So(authorizationHeaderCall3, ShouldEqual, authorizationHeaderCall1)
})
})
})
})
})
Convey("When proxying graphite", func() {
plugin := &plugins.DataSourcePlugin{}
ds := &m.DataSource{Url: "htttp://graphite:8080", Type: m.DS_GRAPHITE}
@@ -214,3 +324,27 @@ func TestDSRouteRule(t *testing.T) {
})
}
type httpClientStub struct {
fakeBody []byte
}
func (c *httpClientStub) Do(req *http.Request) (*http.Response, error) {
bodyJSON, _ := simplejson.NewJson(c.fakeBody)
_, passedTokenCacheTest := bodyJSON.CheckGet("expires_on")
So(passedTokenCacheTest, ShouldBeTrue)
bodyJSON.Set("expires_on", fmt.Sprint(time.Now().Add(time.Second*60).Unix()))
body, _ := bodyJSON.MarshalJSON()
resp := &http.Response{
Body: ioutil.NopCloser(bytes.NewReader(body)),
}
return resp, nil
}
func newFakeHTTPClient(fakeBody []byte) httpClient {
return &httpClientStub{
fakeBody: fakeBody,
}
}

View File

@@ -0,0 +1,9 @@
{
"token_type": "Bearer",
"expires_in": "3599",
"ext_expires_in": "0",
"expires_on": "1528740417",
"not_before": "1528736517",
"resource": "https://api.nr1.io",
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6ImlCakwxUmNxemhpeTRmcHhJeGRacW9oTTJZayIsImtpZCI6ImlCakwxUmNxemhpeTRmcHhJeGRacW9oTTJZayJ9.eyJhdWQiOiJodHRwczovL2FwaS5sb2dhbmFseXRpY3MuaW8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC9lN2YzZjY2MS1hOTMzLTRiM2YtODE3Ni01MWM0Zjk4MmVjNDgvIiwiaWF0IjoxNTI4NzM2NTE3LCJuYmYiOjE1Mjg3MzY1MTcsImV4cCI6MTUyODc0MDQxNywiYWlvIjoiWTJkZ1lBaStzaWRsT3NmQ2JicGhLMSsremttN0NBQT0iLCJhcHBpZCI6IjdmMzJkYjdjLTZmNmYtNGU4OC05M2Q5LTlhZTEyNmMwYTU1ZiIsImFwcGlkYWNyIjoiMSIsImlkcCI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2U3ZjNmNjYxLWE5MzMtNGIzZi04MTc2LTUxYzRmOTgyZWM0OC8iLCJvaWQiOiI1NDQ5ZmJjOS1mYWJhLTRkNjItODE2Yy05ZmMwMzZkMWViN2UiLCJzdWIiOiI1NDQ5ZmJjOS1mYWJhLTRkNjItODE2Yy05ZmMwMzZkMWViN2UiLCJ0aWQiOiJlN2YzZjY2MS1hOTMzLTRiM2YtODE3Ni01MWM0Zjk4MmVjNDgiLCJ1dGkiOiJZQTlQa2lxUy1VV1hMQjhIRnU0U0FBIiwidmVyIjoiMS4wIn0.ga5qudt4LDMKTStAxUmzjyZH8UFBAaFirJqpTdmYny4NtkH6JT2EILvjTjYxlKeTQisvwx9gof0PyicZIab9d6wlMa2xiLzr2nmaOonYClY8fqBaRTgc1xVjrKFw5SCgpx3FnEyJhIWvVPIfaWaogSHcQbIpe4kdk4tz-ccmrx0D1jsziSI4BZcJcX04aJuHZGz9k4mQZ_AA5sQSeQaNuojIng6rYoIifAXFYBZPTbeeeqmiGq8v0IOLeNKbC0POeQCJC_KKBG6Z_MV2KgPxFEzQuX2ZFmRD_wGPteV5TUBxh1kARdqexA3e0zAKSawR9kmrAiZ21lPr4tX2Br_HDg"
}

View File

@@ -0,0 +1,9 @@
{
"token_type": "Bearer",
"expires_in": "3599",
"ext_expires_in": "0",
"expires_on": "1528662059",
"not_before": "1528658159",
"resource": "https://api.nr2.io",
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6ImlCakwxUmNxemhpeTRmcHhJeGRacW9oTTJZayIsImtpZCI6ImlCakwxUmNxemhpeTRmcHhJeGRacW9oTTJZayJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuYXp1cmUuY29tLyIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0L2U3ZjNmNjYxLWE5MzMtNGIzZi04MTc2LTUxYzRmOTgyZWM0OC8iLCJpYXQiOjE1Mjg2NTgxNTksIm5iZiI6MTUyODY1ODE1OSwiZXhwIjoxNTI4NjYyMDU5LCJhaW8iOiJZMmRnWUFpK3NpZGxPc2ZDYmJwaEsxKyt6a203Q0FBPSIsImFwcGlkIjoiODg5YjdlZDgtMWFlZC00ODZlLTk3ODktODE5NzcwYmJiNjFhIiwiYXBwaWRhY3IiOiIxIiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvZTdmM2Y2NjEtYTkzMy00YjNmLTgxNzYtNTFjNGY5ODJlYzQ4LyIsIm9pZCI6IjY0YzQxNjMyLTliOWUtNDczNy05MTYwLTBlNjAzZTg3NjljYyIsInN1YiI6IjY0YzQxNjMyLTliOWUtNDczNy05MTYwLTBlNjAzZTg3NjljYyIsInRpZCI6ImU3ZjNmNjYxLWE5MzMtNGIzZi04MTc2LTUxYzRmOTgyZWM0OCIsInV0aSI6IkQ1ODZHSGUySDBPd0ptOU0xeVlKQUEiLCJ2ZXIiOiIxLjAifQ.Pw8c8gpoZptw3lGreQoHQaMVOozSaTE5D38Vm2aCHRB3DvD3N-Qcm1x0ZCakUEV2sJd7jvx4XtPFuW7063T0V1deExL4rzzvIo0ZfMmURf9tCTiKFKYibqf8_PtfPSz0t9eNDEUGmWDh1Wgssb4W_H-wPqgl9VPMT7T6ynkfIm0-ODPZTBzgSHiY8C_L1-DkhsK7XiqbUlSDgx9FpfChZS3ah8QhA8geqnb_HVuSktg7WhpxmogSpK5QdrwSE3jsbItpzOfLJ4iBd2ExzS2C0y8H_Coluk3Y1YA07tAxJ6Y7oBv-XwGqNfZhveOCQOzX-U3dFod3fXXysjB0UB89WQ"
}

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