Compare commits

...
759 Commits
Author SHA1 Message Date
bergquist ffe0ecfaaa release 4.2.0 beta1 2017-02-27 10:33:26 +01:00
bergquist 05952688c5 tech: avoid using http.DefaultClient 2017-02-24 17:22:12 +01:00
bergquist 03354bc49a tech: replace context.TODO with background ctx 2017-02-24 09:20:28 +01:00
Torkel Ödegaard e73b306e0c fix(templating): fixed duplicate dashboard refresh when changing template variable, #7654 2017-02-24 08:16:37 +01:00
bergquist 46ac8c098f changelog: adds note about closing #7482 2017-02-24 07:42:30 +01:00
Carl Bergquist 5d3da99806 Merge pull request #7482 from dbrgn/master
Alerting: Add Threema Gateway integration
2017-02-24 07:40:36 +01:00
bergquist 785cecac26 changelog: adds note about closing #7526 2017-02-24 07:35:45 +01:00
Carl Bergquist bef216b6f4 Merge pull request #7526 from Mic92/master
Add Pushover alert notifications
2017-02-24 07:32:59 +01:00
bergquist 67b8b9743b changelog: note about closing #7602 2017-02-24 07:30:47 +01:00
Carl Bergquist 3ef1a60647 Merge pull request #7602 from Altoros/suppress-empty-results-in-table-plugin
Added suppressing of empty results to table plugin
2017-02-24 07:28:59 +01:00
Torkel Ödegaard d6eaaf3add refactor: minor refactoring 2017-02-23 15:57:36 +01:00
Mitsuhiro Tanda 68bb417db9 support [[var]] in cloudwatch datasource (#7649)
* support [[var]] form in cloudwatch datasource

* support multi variable in single dimension

* fix test
2017-02-23 15:02:35 +01:00
bergquist d88286ab81 orgs: set orgId as query param on load
ref #1613
2017-02-23 11:03:39 +01:00
bergquist 73830a44fe sharemodal: fixes broken unittests 2017-02-22 14:29:49 +01:00
bergquist fe223cbc96 changelog: adds note about closing #1613 2017-02-22 14:04:01 +01:00
bergquist fdb06c7c10 sharing: set orgId as query parameter when sharing a dashboard
to make sure an user opens the dashboard in the correct org, orgId will
always be added when sharing a dashboard. if the users current orgId
doesnt match the query parameter grafana will change it and redirect the
user.

closes #1613
2017-02-22 13:56:06 +01:00
bergquist dea2e5d743 changelog: adds note about closing #6948 2017-02-22 11:24:06 +01:00
bergquist 607ee635d1 alerting: adds deduping of alert notifications 2017-02-22 10:52:01 +01:00
Carl Bergquist b4fd6f2d45 Merge pull request #7632 from grafana/alerting_notification_dedupe
alerting: dedupe alert notifications when running multiple servers
2017-02-22 10:48:41 +01:00
bergquist c1d69358ba changelog: adds note about closing #552 2017-02-22 10:39:52 +01:00
bergquist 9ed1d12cc0 style: use for loops over _.each in typescript 2017-02-22 10:36:30 +01:00
bergquist c5a76fba87 shortcuts: add expand/collapse to shortcut help 2017-02-22 10:33:24 +01:00
bergquist e828f3a97b shortcuts: change init bind key to d 2017-02-22 10:32:30 +01:00
Mitsuhiro Tanda 5a30b08b14 add keyboard shotcuts for collapse/expand rows 2017-02-22 09:30:56 +01:00
Torkel Ödegaard e3b71ed95e docs(): updated CLA 2017-02-22 09:10:08 +01:00
Torkel Ödegaard 9c84b9f944 docs(): CLA fixes 2017-02-22 08:55:24 +01:00
Daniel Lee e5f5c1724a templating: check for default data source (#7636)
For data source template variables, check if the
selected value is default and if so load the
default data source.

Fixes #7586
2017-02-21 17:27:21 +01:00
bergquist 00dddca26a alerting: dedupe alert notifications when running multiple servers
alert notifications will only be sent if the database value
is updated.

ref #6957
2017-02-21 16:54:49 +01:00
Daniel Lee 96a3ed0ac3 docs: new /api/users/search route
ref #7469. Description of new route that
adds paging for the users list.
2017-02-21 16:09:15 +01:00
Torkel Ödegaard d5245fd19a docs(): updated changelog with #7612 2017-02-21 10:49:50 +01:00
Aaron Roydhouse 4039e5edbc Improve 'external_image_storage.s3' documentation (#7623)
Add documentation for 'external_image_storage.s3' to explain how to specify the AWS region for the S3 bucket, and the requires S3/IAM permissions.
2017-02-21 10:09:50 +01:00
bergquist 70b36a02af Revert "tech: use context package over xperimental version"
This reverts commit 99f1c30071.
2017-02-20 22:04:51 +01:00
bergquist 99f1c30071 tech: use context package over xperimental version 2017-02-20 21:44:15 +01:00
tamayika b01fd3d0b5 Support for all ad-hoc filter operators on Elasticsearch (#7612) 2017-02-20 21:01:52 +01:00
bergquist 072c1559ba middlware: prevent orgredirect to open body stream
the org redirecter opened the body stream by misstake. Causing
downstream code to start reading from an empty stream and raise errors.
2017-02-20 11:38:29 +01:00
Torkel Ödegaard b176f36889 docs(): updated CLA 2017-02-20 10:41:13 +01:00
Torkel Ödegaard 38126bc595 fix(templating): fixed issue detecting template variable dependency, fixes #7354 2017-02-20 09:31:50 +01:00
bergquist 492b2bd42f build: fixes golang 1.8 build on windows 2017-02-19 11:32:26 +01:00
Simon Effenberg a4318e41f8 fixing little spelling issue (#7603) 2017-02-18 17:21:29 +01:00
Tim De Pauw 48649951e4 Github → GitHub (#7607) 2017-02-18 17:20:44 +01:00
bergquist d2444cbed0 Merge branch 'paging-users' 2017-02-17 16:25:03 +01:00
bergquist 400bd8d2d3 build: reduce logs from npm install 2017-02-17 16:16:17 +01:00
Carl Bergquist 24474ba41a Merge pull request #7601 from grafana/redirect_on_new_orgid
middlware: change org when url contains orgid
2017-02-17 15:31:17 +01:00
bergquist 6115941df0 middleware: rename org-id -> orgId 2017-02-17 15:18:40 +01:00
bergquist 5174d050f2 middlware: change org when url contains orgid
closes #6948
ref #1613
2017-02-17 15:02:14 +01:00
Torkel Ödegaard ac0d09c419 fix(): fixed issue with syncing refresh interval to url 2017-02-17 14:07:15 +01:00
bergquist 12f1ea71fd chore: delete empty test 2017-02-17 12:07:46 +01:00
bergquist 76f617b862 build: disable setup for windows build 2017-02-17 12:06:24 +01:00
bergquist 774c1de892 changelog: adds note about closing #7319 2017-02-17 10:42:52 +01:00
bergquist 5fb4540358 changelog: adds note about closing #7382 2017-02-17 10:41:15 +01:00
bergquist 79daa71350 docs: update golang requirement to 1.8 2017-02-17 10:37:59 +01:00
bergquist defa81e4c1 Merge branch 'http_graceful' 2017-02-17 10:34:02 +01:00
bergquist cf871b1284 http: close http server gracefully. 2017-02-17 10:33:47 +01:00
bergquist 52566376b2 tech(server): remove unused code 2017-02-17 10:18:11 +01:00
bergquist a32b7dfb9d build: upgrade to golang 1.8 2017-02-17 09:05:52 +01:00
bergquist c924510deb alertlist: adds pause as filter option
closes #7400
2017-02-16 16:01:57 +01:00
bergquist a747d33373 templating: allow whitespace values
closes #7382
2017-02-16 15:58:01 +01:00
bergquist d72011589e templating: refactor sorting test 2017-02-16 14:22:38 +01:00
bergquist 927b39fa63 templating: adds test for sorting template values 2017-02-16 14:14:17 +01:00
Senkevich Alexsandr 17d02a7065 added suppressing of empty results in table plugin 2017-02-16 14:35:42 +03:00
bergquist 3c0f61511d build: deps-go is not required for building grafana
setup compiles the backend and caches it which is nice
when developing grafana since incremental compiles are
much faster. But its not required for building grafana.
2017-02-16 09:10:55 +01:00
bergquist 9b4d95ff25 changelog: note about closing #7347 2017-02-15 14:35:40 +01:00
Roman Vynar 4fcd5eab29 Add advanced TLS settings to harden setup. (#7347)
* Hardcoded the most secured TLS options.
2017-02-15 14:29:20 +01:00
Torkel Ödegaard 902cf5f889 fix(): google analytics fix 2017-02-15 14:26:57 +01:00
bergquist bd010289b2 alerting: images in alert notifications is now optional
its now possible to turn of image uploading in alert notifications
for those who operate on very sensitive data.

closes #7419
2017-02-15 14:17:36 +01:00
bergquist f14e25612e annotations: go vet fixes 2017-02-15 14:15:42 +01:00
bergquist c8c3021987 docs: tutorial for setting up grafana as HA
ref #7541
2017-02-15 12:38:50 +01:00
Daniel Lee 6dfdcd7ca5 email: change default from name to Grafana
Changes default from name in smtp settings
from Grafana Admin to Grafana.

Fix for integration test (which is skipped but that
did not work)
2017-02-15 11:02:46 +01:00
Daniel Lee 8144b73544 changelog: adds note about closing #2131 2017-02-15 10:44:43 +01:00
Daniel Lee 5fca4c7304 Merge pull request #7569 from jacobbednarz/add-sender-name-to-email
Updates mailer to include `from_name` value
2017-02-15 10:32:06 +01:00
Dennis Wiemer 8b25ba6a7c Added click events in graph to core eventbus (#7511) 2017-02-15 08:47:20 +01:00
Torkel Ödegaard e573006283 docs(): added cla 2017-02-15 08:40:34 +01:00
Jan Garaj 79cd48f64c Cloudwatch AWS/SES metrics (#7568) 2017-02-15 08:12:24 +01:00
Jacob Bednarz 6a9247500a Update documentation to include information about from_name values 2017-02-15 08:07:29 +11:00
Jacob Bednarz 7520b4f404 Update default configuration to include from_name values 2017-02-15 08:06:58 +11:00
Jacob Bednarz 796957c8c6 Update mailer tests to include FromName 2017-02-15 08:04:21 +11:00
Jacob Bednarz 66445faeb5 Format mailer From field to include name
Updates the messafe `From` field to include the name and email of the
sender.
2017-02-15 07:51:41 +11:00
Jacob Bednarz 90cbfacacf Add FromName to SmtpSettings struct
Updates the `SmtpSettings` struct to include a value for setting the
name of the email sender.
2017-02-15 07:45:28 +11:00
Jacob Bednarz 7dc6b69c8b s/smpt/SMTP 2017-02-15 07:43:59 +11:00
Jacob Bednarz c9d4654592 s/from_adress/from_address 2017-02-15 07:43:16 +11:00
bergquist 423e8686ef docs: fixes markdown formating 2017-02-14 12:56:49 +01:00
bergquist e97cab9964 docs: removes version selector from influxdb 2017-02-14 12:02:31 +01:00
Daniel Lee 5304e7b220 changelog: adds #7554 - minor enhancement to 4.2.0 2017-02-14 11:22:47 +01:00
Daniel Lee 76f82b00d7 Merge pull request #7554 from ryantxu/kbn_physics
Add more physics units
2017-02-14 11:16:20 +01:00
bergquist 73bec813fc docs: adds delete datasource by name 2017-02-14 10:41:08 +01:00
Daniel Lee 6861c6033c Changelog: add 7449 - minor enhancement to 4.2.0
Closes #7449
2017-02-14 10:21:07 +01:00
Ryuichi Sakai 0c9f664ea0 Make timeout for snapshot creation configurable 2017-02-14 10:10:51 +01:00
bergquist 9f80e8c03d changelog: rearrange closed issues 2017-02-14 10:06:31 +01:00
bergquist 6761661e10 changelog: adds note about closing #7542 2017-02-14 10:03:23 +01:00
bergquist 0523830716 changelog: add note about closing #7542 2017-02-14 08:56:00 +01:00
xginn8 1c8509ea58 wrap text in annotations modal (#7549)
annotation: wrap text in drop_element, fixes #7542
2017-02-14 08:49:43 +01:00
ryan 7867a24d87 Adding more physics units 2017-02-13 23:30:15 -08:00
Carl Bergquist 05a6cb3f76 Merge pull request #7548 from ryantxu/influxdb_logo
update datasource logos
2017-02-14 08:23:03 +01:00
ryan a1e071d3c5 missing space 2017-02-13 18:47:59 -08:00
ryan 2749dd8711 elasticsearch svg 2017-02-13 18:47:01 -08:00
ryan b46fac34d9 replace elastic logo 2017-02-13 18:38:13 -08:00
ryan fc0de84701 update influx logo 2017-02-13 18:19:14 -08:00
bergquist 2ad2b96133 build: avoid progress bar update on yarn install
this will save us ~100TB of unneeded data in the long term.
2017-02-13 15:26:10 +01:00
bergquist 2c68c071c0 changelog: update release of 2017-02-13 2017-02-13 15:11:45 +01:00
bergquist c7560edba5 docs: release 4.1.2 for windows 2017-02-13 14:17:26 +01:00
bergquist 89fdcc84de docs: release 4.1.2 2017-02-13 13:52:42 +01:00
Daniel Lee 193d468ed3 admin: adds paging to global user list
Currently there is a limit of 1000 users in the global
user list. This change introduces paging so that an
admin can see all users and not just the first 1000.

Adds a new route to the api - /api/users/search that
returns a list of users and a total count. It takes
two parameters perpage and page that enable paging.

Fixes #7469
2017-02-13 12:59:36 +01:00
Jörg Thalheim f069aae576 Add Pushover alert notifications
Pushover is a service for getting real-time
notifications on your mobile devices and desktop
computers: https://pushover.net
2017-02-10 22:44:33 +01:00
bergquist e80f673264 changelog: adds note about closing issues 2017-02-10 15:56:28 +01:00
Carl Bergquist 7f4f38e773 Merge pull request #7519 from huydx/master
(feat) support datasource delete by name api
2017-02-10 15:53:34 +01:00
huydx 143cbe921f (feat) support datasource delete by name api 2017-02-10 23:30:14 +09:00
bergquist f147ac053d Merge branch 'huydx-feat/sqlmax' 2017-02-10 15:30:12 +01:00
bergquist 5b7b3fef64 conf: adds sample values for db conn settings 2017-02-10 15:30:01 +01:00
huydx 28d93b574d (feat) support max connection setting for database configuration 2017-02-10 15:30:01 +01:00
bergquist 3c7cf3f728 docs: kairosdb is no longer supported by default 2017-02-10 14:42:19 +01:00
Daniel Lee 1294b203e6 admin: adds paging to global user list
Currently there is a limit of 1000 users in the global
user list. This change introduces paging so that an
admin can see all users and not just the first 1000.

Adds a new route to the api - /api/users/search that
returns a list of users and a total count. It takes
two parameters perpage and page that enable paging.

Fixes #7469
2017-02-10 11:00:04 +01:00
bergquist 900230890f changelog: adds note about closing #2385 2017-02-10 10:15:03 +01:00
Vladimir Kolobaev 8083079eea graph: set max width for legend tables.
ref #2385
2017-02-10 10:11:39 +01:00
bergquist dcf097a8b9 changelog: adds note about closing #6109 2017-02-10 08:57:46 +01:00
xginn8 3d4c3ff00d return an empty message if table contains no data #6109 (#7487) 2017-02-10 08:54:00 +01:00
bergquist 7bf570532f docs: adds note about closing #7493 2017-02-10 08:34:56 +01:00
Vladimir Kolobaev 6eda5604d2 Full metric description (#7493)
graph: add full metric description for graph-legend-alias title
2017-02-10 08:31:51 +01:00
bergquist 38c29d2209 changelog: adds note about closing #7513 2017-02-10 08:29:44 +01:00
Carl Bergquist 73d441450b Merge pull request #7516 from grafana/oauth-login-redirect
redirect user to requested url after login via oauth
2017-02-10 08:27:41 +01:00
bergquist 5dd961c0f5 settings: remove commented code 2017-02-10 07:39:26 +01:00
Dan Cech b22881c717 redirect user to requested url after login via oauth 2017-02-09 14:01:53 -05:00
bergquist c7febca447 mqe: fixes broken test for indexalias 2017-02-09 16:43:57 +01:00
bergquist aa7292fac6 mqe: adds support for wildcard and index aliases 2017-02-09 16:25:03 +01:00
Daniel Lee bccb650010 Adds Sorting for lists of data sources to 4.2.0 2017-02-08 12:06:00 +01:00
Daniel Lee 2b2368b189 Merge pull request #7491 from grafana/sorting-datasources
Sorting datasources with case insensitive order
2017-02-08 12:01:31 +01:00
Daniel Lee fbc3c3dd32 api: removes import alias + some unused fields 2017-02-08 11:57:05 +01:00
bergquist 10508d0238 docs(changelog): adds note about closing #6451 2017-02-08 11:28:26 +01:00
bergquist e8f191ef32 Merge branch 'jregovic-master' 2017-02-08 11:25:41 +01:00
bergquist 00549f393c style(hipchat): improves code style 2017-02-08 11:24:49 +01:00
Daniel Lee 8aa5b62d6d fix(panel): case insensitive sort metric sources
Sorts the list of metric sources that is used in dropdown for Panel
Data Source on the Metrics tab so that it is case insensitive and
so that the built data sources are last in the list.
2017-02-08 00:01:42 +01:00
Daniel Lee cbd1455c42 fix(api): case insensitive sort for datasources
The data source list is case sensitive when sorted. This changes the
sort to be case insensitive. The test only tests the handler, not the
routing or database query.
2017-02-07 22:15:52 +01:00
James Regovich 53942f7987 Adding HipChat Notifier 2017-02-07 10:50:49 -06:00
bergquist 5bba0c2a94 tech(build): upgrade dist builder to golang1.8rc3 2017-02-07 12:45:06 +01:00
bergquist b3db5aae4b docs(changelog): adds note about closing #6799 2017-02-07 11:21:20 +01:00
Carl Bergquist 7d205ae2b8 Merge pull request #7466 from hagen1778/prometheus-basicauth-query
allow setting basic auth headers for prometheus datasource
2017-02-07 11:18:17 +01:00
bergquist 8ca4afaf22 docs(changelog): adds note about closing #7459 2017-02-07 11:17:20 +01:00
Danilo Bargen 689f5cb686 feat(alerting): Text formatting for Threema alert messages 2017-02-07 11:14:57 +01:00
Danilo Bargen d1a5d9c15c feat(alerting): Add Threema Gateway integration
This commit adds alerting support for Threema Gateway. It supports all
Simple IDs (managed by the Gateway server).

More information can be found on https://gateway.threema.ch/
2017-02-07 11:14:57 +01:00
bergquist 9ece10ef24 style(dataproxy): simplify expression 2017-02-07 11:03:57 +01:00
bergquist b386920abb Merge branch 'prometheus_secure' of https://github.com/mtanda/grafana into mtanda-prometheus_secure 2017-02-07 11:01:02 +01:00
hagen1778 a1e835884b use configured Transport instead of defaultHttpTransport 2017-02-07 11:56:59 +02:00
Daniel Lee 5e9653f935 docs(): adds missing index pages + link fix 2017-02-07 10:22:14 +01:00
bergquist 285918caf6 tech(build): switch to golang 1.8rc3 2017-02-07 10:13:21 +01:00
Daniel Lee abd9233f86 Docs for developing plugins (#7475)
* docs(plugins): new developing plugins section

Creates new section called Developing Plugins in
the plugin section of the docs.

1. Some changes to the Development guide page
2. Converted defaults/editor mode blog post
to new page
3. Converted snapshots blog post to new page
4. Adds new code styleguide page
5. Updates to apps and datasources pages
6. Adds plugin.json schema

* docs(links): fixes broken links

Fixes broken links to other pages as
well as broken image links.
2017-02-07 07:48:01 +01:00
Torkel Ödegaard 3398c28ab2 docs(): fixing redirects for moved doc pages, updating links to point to new urls 2017-02-06 18:04:53 +01:00
r.khavronenko 25be602dce go fmt 2017-02-06 17:17:16 +02:00
bergquist 5a7abe365c tech(build): echo before running go fmt/vet 2017-02-06 15:55:22 +01:00
bergquist 57d36b3d42 feat(alerting): transform labels into tags for prometheus tsdb 2017-02-06 15:25:15 +01:00
r.khavronenko 80b92335bb allow setting basic auth headers for prometheus datasource 2017-02-06 16:22:09 +02:00
Mitsuhiro Tanda 69566a23fc improve security of Prometheus datasource 2017-02-06 23:10:10 +09:00
bergquist 3827c0a69c tech(alerting): adds tags to alerting data model 2017-02-06 14:59:29 +01:00
Torkel Ödegaard 982dc276d3 Update building docs readme 2017-02-06 10:19:47 +01:00
jifwin 9e7df648b5 Fix requests cancelling (#7457)
* fix backendSrv request cancelling

* revert imports

* formatting
2017-02-06 06:42:26 +01:00
bergquist a36b1d9dce tech(build): require go vet to pass 2017-02-05 21:21:05 +01:00
bergquist c05bc0cb17 chore(vet): fixes invalid fmt.Sprintf format 2017-02-05 21:19:39 +01:00
bergquist d9b5628126 docs: update nodejs version requirement in readme 2017-02-03 16:15:37 +01:00
Carl Bergquist 282b1bc73a Merge pull request #7442 from lucapette/patch-1
Fix typo
2017-02-03 14:06:54 +01:00
lucapette 032ecad3b7 Fix typo 2017-02-03 12:10:22 +01:00
bergquist 457d6c8f81 tech(build): fixes broken build 2017-02-02 17:25:33 +01:00
Torkel Ödegaard 65cf0d0e5c fix(graph legend): fixed legend table mode scrollbar visible when it needs to to, fixes #6828 2017-02-02 16:29:11 +01:00
bergquist 3e62b1b2d7 tech(build): use build number as iteration number 2017-02-02 15:55:37 +01:00
bergquist a580113de4 feat(alerting): changes default timerange to 15min 2017-02-02 12:05:44 +01:00
bergquist 63aa436997 tech(build): slimdown the size of the build container 2017-02-02 11:33:34 +01:00
bergquist 3cbca80d3c tech(build): starts docker build for latest build 2017-02-02 10:41:11 +01:00
bergquist aef4195493 tech(build): fixes invalid script file usage 2017-02-01 07:09:36 +01:00
bergquist ea6d996abc tech(build): enable windows build trigger 2017-01-31 21:43:18 +01:00
bergquist 74c5c5368c tech(build): update windows trigger 2017-01-31 21:36:52 +01:00
bergquist afd135944a tech(build): upgrade golang to 1.7.4 2017-01-31 21:11:34 +01:00
bergquist 18f20a3357 tech(build): deploy to new s3 buckets 2017-01-31 20:26:19 +01:00
bergquist b600e1c50b docs(changelog): adds note about closing #7417 2017-01-31 15:24:00 +01:00
Mitsuhiro Tanda 91999851cb support regex expansion in templating "Regex" field (#6565) 2017-01-31 15:21:53 +01:00
Carl Bergquist 4f5dc6104f Merge pull request #7417 from Erliz/patch-1
Add image url to telegram alert notifier
2017-01-31 15:13:21 +01:00
Kevin Bowling 0c46def1a0 Add an idiomatic plugin path for FreeBSD (#7410) 2017-01-31 14:54:53 +01:00
Stanislav Vetlovskiy 0e892e9f86 Add image url to telegram alert notifier
If public image url of alert is exist add it to the telegram message
2017-01-31 16:47:14 +03:00
bergquist 513fcdeeb8 tech(build): prepare for tag builds 2017-01-31 11:00:23 +01:00
Torkel Ödegaard f602752bdc fix(packaging): fixed issue in deb package post install script that made it think upgrade was happening, fixes #7403 2017-01-31 10:56:04 +01:00
bergquist d72f257f27 tech(build): disable package iteration for release builds 2017-01-31 09:40:26 +01:00
Torkel Ödegaard fce2e341d2 mergefix(): fixed issue with master merge 2017-01-31 09:00:36 +01:00
Torkel Ödegaard 8a95c563bb Merge branch 'master' into websocket 2017-01-31 08:56:49 +01:00
Torkel Ödegaard 2594041eed hiding grafana live ds 2017-01-31 08:56:46 +01:00
Torkel Ödegaard 9ba1ea0179 fix(): another unit test fix attempt 2017-01-31 08:52:48 +01:00
Torkel Ödegaard 0c5abc1615 Merge branch 'xginn8-master' 2017-01-31 08:27:53 +01:00
Torkel Ödegaard 5fc5971145 refactor(): refactoring PR #7124 2017-01-31 08:27:48 +01:00
Torkel Ödegaard 436e35c845 fix(): fixed unit test broken in last PR merge 2017-01-31 07:59:14 +01:00
Torkel Ödegaard 9a61d43dc6 refactor(): refactoring PR #7141 2017-01-31 07:57:39 +01:00
Torkel Ödegaard c400b5cf63 Merge branch 'master' of github.com:grafana/grafana 2017-01-31 07:48:44 +01:00
Torkel Ödegaard 1a9aaa4138 feat(server side png rendering): added timezone parameter for server side rendering, refactoring PR #7264 2017-01-31 07:48:10 +01:00
Torkel Ödegaard 830491fa66 Merge branch 'time-offset-to-image' of https://github.com/ryu1-sakai/grafana into ryu1-sakai-time-offset-to-image 2017-01-31 06:28:54 +01:00
Pavlos Daoglou 3e741315b4 [3743] Adds support for user search based on login or email (#7334)
* [3743] Adds support for user search based on login or email

* Use query parameter instead

* Use macaron Query() instead
2017-01-31 06:25:55 +01:00
Stanislav Vetlovskiy bd4eadf69c #7383 Fix factory typo in telegram notifier (#7406) 2017-01-31 06:23:19 +01:00
bergquist 3c304b9b88 tech(build): disable builds for master 2017-01-30 16:24:50 +01:00
bergquist cefb4103a7 tech(build): disable build based on tag 2017-01-30 16:03:55 +01:00
bergquist dd982ac9a2 tech(build): dont include buildnumber when building tags 2017-01-30 15:23:38 +01:00
bergquist ac6b5ea796 tech(build): option to not include buildIteration in package name 2017-01-30 15:21:39 +01:00
bergquist 163036591d tech(build): fixes broken build 2017-01-30 15:04:55 +01:00
bergquist 2de8cdb85c tech(build): remove unused deps 2017-01-30 14:28:39 +01:00
bergquist 7307e6345b tech(build): remove sha calc from build step 2017-01-30 13:58:39 +01:00
bergquist 6de13e081b tech(build): deploy builds for each commit to master 2017-01-30 10:37:14 +01:00
Jay Linski 91513f0bc0 Remove deprecated dataproxy logging setting (#7398)
This should have been removed in 06440ef57b, but was probably forgotten.

Solves #6718.
2017-01-30 08:14:44 +01:00
Torkel Ödegaard b191638f41 feat(packaging): Make config file not part of package to simplify upgrade, made commit always a short sha, changed RESTART_ON_UPGRADE to true by default, #7399, #7227 2017-01-30 08:08:37 +01:00
Torkel Ödegaard 2a09d4a5a6 fix(): conf file had left over of old config key, #7395 2017-01-30 07:11:12 +01:00
Oleksandr Kushchenko edba465a75 add DeliveryStreamName dimension to AWS/Firehose Cloudwatch namespace (#7388) 2017-01-28 08:30:57 +01:00
lpic 5b699dbf0d Set time when testing ES datasource, fixes #7044 (#7390) 2017-01-28 08:30:33 +01:00
Kit Westneat cddc9ac0a7 file_export.ts: #5325 missed exportTableDataToCsv when adding sep (#7391) 2017-01-28 08:29:57 +01:00
bergquist 1fee26925f Merge branch 'new_deploy' 2017-01-27 15:55:42 +01:00
bergquist 4b6aaec880 tech(build): create sha files after signing packages 2017-01-27 15:54:19 +01:00
bergquist a634bd0ce8 tech(build): sign and deploy packages to s3 2017-01-27 15:21:16 +01:00
bergquist feed804a0e tech(build): updates path to signing file 2017-01-27 15:21:16 +01:00
bergquist 0cc21669f4 tech(build): adds package signing step 2017-01-27 15:21:16 +01:00
bergquist 46e4a54a6e style: go fmt with simplify 2017-01-27 15:21:02 +01:00
bergquist 1df9c2cab3 docs(changelog): adds note about closing #7377 2017-01-27 08:54:23 +01:00
Carl Bergquist b3847a3738 Merge pull request #7377 from solugebefola/patch-3
Disable sign out for AuthProxyEnabled
2017-01-27 08:51:32 +01:00
Solar Olugebefola de7edb40f5 Disable sign out for AuthProxyEnabled
Sign out was disabled for AuthProxyEnabled in #3122.  This is to catch the one other instance of a sign out link in the side menu.
2017-01-26 13:10:33 -05:00
Torkel Ödegaard 2f4da15264 fix(http api): throw validation error if missing property in call to /api/admin/users/123/permissions, #7365 2017-01-26 08:54:51 +01:00
Ryan McKinley a656d01bf5 append windows phantomjs with .exe (#7065) 2017-01-25 14:49:09 +01:00
Torkel Ödegaard 9b8760bad7 packaging(): fix rpm & SUSE compatability issue, #7293 2017-01-25 14:42:19 +01:00
Torkel Ödegaard 7c5ef2c75a Merge branch 'connection-reset-shared_tooltip' 2017-01-25 14:35:02 +01:00
Torkel Ödegaard 28f890e42f refactor(): removed commented out code 2017-01-25 14:34:55 +01:00
Torkel Ödegaard 23eab81cbe fix(): fixed minor issue with single stat tooltip, #7357 2017-01-25 14:11:30 +01:00
Torkel Ödegaard e073d20731 updated sample config 2017-01-25 13:34:02 +01:00
Torkel Ödegaard f196ffa07d updated docs 2017-01-25 13:33:27 +01:00
Torkel Ödegaard 40d39f8a3e refactor(): renaming alerting hide ui option, #7318 2017-01-25 13:32:26 +01:00
Torkel Ödegaard fee4846429 Merge branch 'alerting_ui' of https://github.com/smalik03/grafana into smalik03-alerting_ui 2017-01-25 13:16:48 +01:00
Torkel Ödegaard 4e30aa9da2 docs(): changelog updated with #7112 2017-01-25 12:32:59 +01:00
Naoufel JAMALI 4e1d8c9ced Elasticsearch - Term aggregation limit fix (should fix #7112) (#7338)
* Elasticsearch - Term aggregation limit fix  (should fix #7112)

* Elasticsearch - Term aggregation limit fix
2017-01-25 12:29:41 +01:00
bergquist b6305a6577 tech(build): dont upload packages from master 2017-01-24 15:24:43 +01:00
bergquist d5e753adbc tech(build): fixes circle.yml format issue 2017-01-24 14:01:50 +01:00
bergquist 3d6698389b tech(build): adds s3 bucket for nightly 2017-01-24 13:58:37 +01:00
bergquist f7993db73c tech(build): installs yarn in build image 2017-01-24 11:26:03 +01:00
bergquist 66fa12835a tech(build): replace grafana_branch with circle_branch; 2017-01-24 11:26:03 +01:00
bergquist 6b70fb2729 tech(build): fixes broken yum installer 2017-01-24 11:26:03 +01:00
bergquist 5f0033f3eb tech(build): path to build relative 2017-01-24 11:26:03 +01:00
bergquist ac111bc238 tech(build): cache golang downloads. DUH! 2017-01-24 11:26:03 +01:00
bergquist 5be00191ec tech(build): Dockerfile for building grafana 2017-01-24 11:26:03 +01:00
bergquist e504e5aaf6 tech(build): avoids setup since all deps should be in /vendor 2017-01-24 11:26:03 +01:00
bergquist 1339ce80f5 tech(build): moves builds script into main repo 2017-01-24 11:26:03 +01:00
Chris Burkhart b1888fb8eb Update building_from_source.md (#7340)
Add a note about the `go get` warning that the user sees when following the setup instructions.
2017-01-24 08:31:10 +01:00
bergquist 9b57005540 tech(build): makes npm paths absolute 2017-01-23 15:53:47 +01:00
bergquist 3d5efd3350 tech(build): removes coveralls 2017-01-23 15:53:16 +01:00
Carl Bergquist 3d3958e694 Merge pull request #7328 from jubicoy/master
Added commonly used kilo-prefixed energy units
2017-01-23 13:56:35 +01:00
Torkel Ödegaard 697d0867fa fix(Elasticsearch): fix for alias patterns that refers to term that is numeric zero, fixes #7323 2017-01-23 10:15:02 +01:00
Teemu Huhtala 03eb98e94d Added commonly used kilo-prefixed energy units
Kilovolt-ampere reactive (kvar)
Kilovolt (kV)
Kiloampere (kA)
2017-01-23 10:20:11 +02:00
Torkel Ödegaard 8eae09e5e6 docs(): updated changelog with info on #7324 2017-01-23 07:29:16 +01:00
lpic cf9790fc4c ES - Support for min_doc_count on group by terms (#7324) 2017-01-23 07:26:42 +01:00
lpic a0c8380baf ES: Change bool queries to use 'filter' clause (#7313)
Change all bool queries to use 'filter' clause instead of 'must' for
better performance
2017-01-21 08:31:29 +01:00
Chris Bentivenga 9151b4034a annotationsQuery -> annotationQuery (#7321)
Documentation calls for `annotationQuery` but the [example](https://github.com/grafana/simple-json-datasource/blob/205cf4cfbce95cd455da97c7972b64538cc80ab3/src/datasource.js#L41) uses the method name `annotationQuery`
2017-01-21 08:29:21 +01:00
smalik 9862c9ff40 feat(alerting): Show/hide alerting UI using configuration variable
Use configuration variable "show_alerting_ui" to show/hide alerting UI
2017-01-20 10:43:29 -05:00
Axel Pirek 4b8f2aeb36 Fix tooltips sometimes rendering outside of graph panel
I noticed tooltips on other panels rendering outside of their panel or
even the browser window when hovering on the very edge of graphs with
relative time overrides.
2017-01-19 13:33:49 +01:00
Axel Pirek 138a79c2fb Clear highlight when clearing tooltip and crosshair 2017-01-19 11:08:32 +01:00
Axel Pirek ee58a6ee2b Speed up tooltip value retrieval 2017-01-19 10:16:28 +01:00
Axel Pirek a2e6408be1 Only render tooltip if position is in viewport 2017-01-19 10:16:20 +01:00
bergquist 57099f0273 docs(changelog): adds note about closing #7301 2017-01-19 09:33:53 +01:00
bergquist 09b61caa65 Merge branch 'huydx-notify-line' 2017-01-19 09:30:13 +01:00
bergquist f5d8a75381 tech(webhook): remove redundant if statement 2017-01-19 09:29:40 +01:00
huydx 376d2d56bf (feature) add LINE notify to notifier 2017-01-19 17:26:53 +09:00
Adrián López e1b82e72eb Fix empty value tags and comma separated values (#7289)
When a tag doesn't have a value it was showing a empty 'bubble'.
If value has several values separated by commas, make a 'bubble' for
each one.
2017-01-18 16:02:40 +01:00
bergquist 94e901793a docs(guides): rearranges menu order 2017-01-17 14:56:11 +01:00
bergquist 96fbe404f8 docs(changelog): adds note about closing #7268 2017-01-17 12:19:46 +01:00
bergquist 55af92eba1 fix(table): fixes broken annotation rendering
closes #7268
2017-01-17 12:17:18 +01:00
bergquist 2dd1eb81cd docs(changelog): adds note about closing #7223 2017-01-17 10:49:31 +01:00
bergquist 4ea4e0436a feat(mailer): set localname to hostname
Some email providers does not accept localhost
in the HELO message. So we set it to hostname
instead. Our hope is that should be enough for
those providers who does not accept localhost.

closes #7223
2017-01-17 10:36:04 +01:00
bergquist 276916cd5d docs(changelog): note about closing #7035 2017-01-17 10:05:56 +01:00
bergquist ed9595a20d Merge branch 'show_no_data_in_list' 2017-01-17 09:53:38 +01:00
bergquist e78da57e4d feat(alerting): shows when no_data triggered alerts
closes #7035
ref #7257
2017-01-17 09:49:25 +01:00
Torkel Ödegaard 0683742e83 tech(library upgrade): fixed unit test broken by angularjs upgrade, #7274 2017-01-16 22:27:35 +01:00
Torkel Ödegaard 6f87f88690 tech(lib upgrade): upgraded angularjs from 1.5.8 to 1.6.1, closes #7274 2017-01-16 21:31:55 +01:00
Torkel Ödegaard 710d07d7a5 Merge branch 'mtanda-clipboard_js' 2017-01-16 21:08:47 +01:00
Torkel Ödegaard c5955bacd2 refactor(): minor refactor 2017-01-16 21:08:39 +01:00
Torkel Ödegaard 09cec8535e Merge branch 'clipboard_js' of https://github.com/mtanda/grafana into mtanda-clipboard_js 2017-01-16 20:57:16 +01:00
Mitsuhiro Tanda d683b0379b fix monkey patch for clipboard.js 2017-01-17 01:12:37 +09:00
bergquist f29f83ca75 chore: adds comment out why the code was added 2017-01-16 15:04:53 +01:00
bergquist 3c9357a2e9 fix(alerting): supports lowercase metrics
this fix is due to EvalMatch now serailize as lower case.

ref #7257
2017-01-16 15:01:57 +01:00
bergquist 01c6658a7a docs(changelog): adds note about closing #7269 2017-01-16 14:42:31 +01:00
bergquist bfa3c590e7 fix(alertlist): changes scroll to auto
close #7269
2017-01-16 14:38:01 +01:00
bergquist 22601fa736 docs(changelog): adds note about closing #7209 2017-01-16 12:48:29 +01:00
bergquist 76c9f62265 Merge branch 'Ricky-N-feature/dataProxyAuditLog' 2017-01-16 12:44:40 +01:00
bergquist 06440ef57b tech(dataproxy): moves cfg to [dataproxy] 2017-01-16 12:43:59 +01:00
bergquist d4a96b9741 tech(dataproxy): make the code a little bit more defensive 2017-01-16 12:24:08 +01:00
bergquist dd84fb563a style(dataproxy): renames log functions 2017-01-16 12:23:49 +01:00
bergquist 51bca7d84b tech(dataproxy): moves all parameters to Info call 2017-01-16 12:16:41 +01:00
bergquist 839eb97061 Merge branch 'feature/dataProxyAuditLog' of https://github.com/Ricky-N/grafana into Ricky-N-feature/dataProxyAuditLog 2017-01-16 12:02:43 +01:00
xginn8 873a8bc520 wrap the title of a panel and dashboard search results. fixes #7203 (#7213) 2017-01-16 12:02:07 +01:00
bergquist ee1c15b9cc docs(changelog): adds note about closing #7234 2017-01-16 11:54:38 +01:00
bergquist 99f18f9d69 merge branch 'oliverpool-diff-aggregate' 2017-01-16 11:52:34 +01:00
bergquist 480a58d377 Merge branch 'diff-aggregate' of https://github.com/oliverpool/grafana into oliverpool-diff-aggregate 2017-01-16 11:52:22 +01:00
bergquist 8a8de91a8b Merge branch 'andrewhowdencom-master' 2017-01-16 11:50:23 +01:00
bergquist 2fdb47ae97 docs(prometheus): rewrote and shorten the note about templates 2017-01-16 11:50:12 +01:00
bergquist 2696d6cd3f Merge branch 'master' of https://github.com/andrewhowdencom/grafana into andrewhowdencom-master 2017-01-16 11:47:13 +01:00
bergquist c73e86e557 docs(testdata): some minor changes 2017-01-16 11:21:23 +01:00
bergquist ae08386ce3 docs(testdata): adds docs page about test datasource 2017-01-16 11:13:52 +01:00
bergquist 92f0a22fd7 docs: moves datsources pages to feature folder 2017-01-16 11:13:27 +01:00
bergquist bd414c1793 docs: moves panels to panel folder 2017-01-16 08:17:37 +01:00
bergquist 20bdc48f13 docs(guides): remove (Latest) from menu name 2017-01-16 08:15:47 +01:00
bergquist f4713956f0 tech: updates latest.json to 4.1.1 2017-01-16 07:07:32 +01:00
bergquist eb8d1dfa34 docs(smtp): adds info about how to use passwords with #
closes #7265
2017-01-16 07:03:35 +01:00
bergquist 62eaa683c0 docs(changelog): note about closing #7256 2017-01-16 07:00:51 +01:00
And^Cw Howden 6edbc4604c Add additional documentation about Prometheus + Templated queries 2017-01-15 20:56:53 +01:00
Ryuichi Sakai 1bc55a2d38 Enable image rendering to use browser time offset 2017-01-15 22:01:28 +09:00
Torkel Ödegaard e5a6c523d7 Merge branch 'master' of github.com:grafana/grafana 2017-01-13 17:39:41 +01:00
Torkel Ödegaard 49fe74228b fix(browser history): fixes and enhancements to browser history, it now works properly again AND it can restore previous time ranges in dashboards, closes #7259 2017-01-13 17:37:53 +01:00
Carl Bergquist c43bb7fb99 Extractor should not modify dashboard json (#7256)
* test(dashboard): tests that he extractor does not modify original json

* feat(extractor): validate a cloned version of the dashboard json
2017-01-13 15:46:23 +01:00
bergquist 2d441bfb37 docs(changelog): note about closing #7149 2017-01-13 15:20:15 +01:00
Carl Bergquist 1efeaafdbf Merge pull request #7249 from grafana/alerting_test_alertrule
Enable error and no_data overrides when testing alerting.
2017-01-13 15:18:02 +01:00
Torkel Ödegaard deff24d2c1 Merge branch 'clipboard_js' of https://github.com/mtanda/grafana into mtanda-clipboard_js 2017-01-13 14:57:23 +01:00
Torkel Ödegaard d354f3a8af fix(alerting): fixed evaluation for no_value condition, fixes #7244 (#7247)
* fix(alerting): fixed evaluation for no_value condition, fixes #7244

* feat(alerting): moving null library into grafana, fixing handling on no value / no series
2017-01-13 12:32:30 +01:00
bergquist 0873d493c2 feat(alerting): moves getNewState to evalHandler
closes #7149
2017-01-13 11:02:24 +01:00
rrickardt bccdd7cad1 Update postinst (#7233)
With present postinst script on Centos 7, restart after upgrade is not working with Warning: grafana-server.service changed on disk. Run 'systemctl daemon-reload' to reload units.

So i added systemctl daemon-reload.
2017-01-13 06:27:36 +01:00
Tomas Varneckas 54c456ec5b Make API key usage example meaningfully runable (#7243) 2017-01-13 06:25:49 +01:00
Mitsuhiro Tanda 1672ca4edb call clipboard destroy() 2017-01-13 02:58:44 +09:00
Mitsuhiro Tanda 3df119002d patch for clipboard.js work 2017-01-13 02:19:02 +09:00
Carl Bergquist 13178d99d4 Merge pull request #7240 from tomasv/fix-tags-api-doc
Fix typo in tags API documentation example request
2017-01-12 17:08:14 +01:00
Tomas Varneckas 9449e93e1e Fix typo in tags API documentation example request 2017-01-12 17:55:43 +02:00
oliverpool 80c67267e8 Add the diff option on the singlestat panel 2017-01-12 16:23:57 +01:00
oliverpool 92a0b402c5 Add diff documentation 2017-01-12 16:22:41 +01:00
oliverpool 2b932492c2 Add a diff aggregate
`diff = current - first` (when available)
2017-01-12 16:19:18 +01:00
bergquist 60a2041065 tech(build): yarn install should use --pure-lockfile 2017-01-12 15:36:44 +01:00
bergquist 915b1efab9 tech(build): updates deps in yarn 2017-01-12 15:33:07 +01:00
bergquist 9a35d82e51 docs(singlestat): its called avg in grafana
ref #7234
2017-01-12 13:36:10 +01:00
bergquist 35db025b0a docs(installation): updates docs for 4.1.1 2017-01-12 10:38:23 +01:00
Torkel Ödegaard 821876a85b Merge branch 'master' of github.com:grafana/grafana 2017-01-11 19:48:17 +01:00
Torkel Ödegaard b8b517cd3f docs(): updated changelog 2017-01-11 19:48:06 +01:00
Mitsuhiro Tanda 4b567e35d5 suppress refresh when user is inactive (#7219) 2017-01-11 19:46:34 +01:00
Torkel Ödegaard f045fbf267 Merge branch 'master' of github.com:grafana/grafana 2017-01-11 19:40:59 +01:00
Torkel Ödegaard 9c0f7f547b fix(alerts): added alert listener for appEvents 2017-01-11 19:40:05 +01:00
Mitsuhiro Tanda db2718a699 remove zero_clipboard.js 2017-01-12 02:37:32 +09:00
Mitsuhiro Tanda 1571072c18 use clipboard.js 2017-01-12 02:37:29 +09:00
Mitsuhiro Tanda 5ccbe6d40b add clipboard.js 2017-01-12 02:22:56 +09:00
Ricky Niemi 0b48e48e3d Small whitespace fix on setting file 2017-01-11 07:51:46 -08:00
Ricky Niemi 269d16301a Rename to audit logging to data proxy logging 2017-01-11 07:40:06 -08:00
Ricky Niemi 0fee7c863a Gate data proxy audit logging behind audit_logging server setting 2017-01-11 07:22:57 -08:00
Torkel Ödegaard 61214899bd docs(): updated changelog 2017-01-11 15:26:08 +01:00
Torkel Ödegaard bd8899b37d fix(graph): fixed table legend min-height, fixes #7221 2017-01-11 15:24:43 +01:00
Torkel Ödegaard edae622d8f docs(): updated changelog 2017-01-11 14:04:34 +01:00
Mitsuhiro Tanda 7e4c101d02 S3 IAM support (#7058)
* add s3 dependencly

* rewrite image uploader by aws-sdk-go

* improve backward compatibility of s3 image uploading

* set default for expires option

* remove acl and expires
2017-01-11 14:00:49 +01:00
Lee Briggs 2e796da441 Add support for sensu notifications (#7207) 2017-01-11 13:57:07 +01:00
Torkel Ödegaard 64f5146a62 change(text panel): removed rarely used (and not properly working), text mode option, closes #6389, closes #7214 2017-01-11 12:33:12 +01:00
Torkel Ödegaard cdc7da3ae1 docs(): updated changelog 2017-01-11 12:16:34 +01:00
Torkel Ödegaard b48273d1cf Merge branch 'master' of github.com:grafana/grafana 2017-01-11 12:11:38 +01:00
Torkel Ödegaard 149dd78298 Merge branch 'built_in_template_variables' 2017-01-11 12:10:33 +01:00
Torkel Ödegaard b475f91387 feat(templating): completed work on built in template variables and , closes #7190, refactors #7170 2017-01-11 12:10:26 +01:00
bergquist 5e14f4a16e tech(build): changes build for 4.1 release 2017-01-11 11:07:01 +01:00
bergquist 8574f100aa docs(guides): removes beta info for 4.1 2017-01-11 10:50:41 +01:00
Torkel Ödegaard 44b7a26119 fix(graph): fix for table legend and scroll, fixes #7204, fixes #6628 2017-01-11 10:35:52 +01:00
Torkel Ödegaard 8c39cd35f0 progress on interval built in variable 2017-01-11 10:18:21 +01:00
bergquist f4e9bd507b tech(build): updates packagecloud script 2017-01-11 08:59:44 +01:00
Utkarsh Bhatnagar 7e3ccdf983 Fixed opentsdb templating bug (#7208) 2017-01-10 21:35:05 +01:00
Ricky Niemi d9cbb994b8 Clean up audit log formatting and code 2017-01-10 11:42:03 -08:00
bergquist 6518a0f765 Merge branch 'docs-4.1' 2017-01-10 15:37:07 +01:00
bergquist 50b937dcb1 tech(build): updates docs to 4.1.0 2017-01-10 15:36:54 +01:00
bergquist 4d0b5ca14a tech(build): upgrades appveyour nodejs version 2017-01-10 15:01:53 +01:00
bergquist 381f8d4475 docs(changelog): adds note about closing #7195 2017-01-10 10:30:28 +01:00
Ricky Niemi d03977ac0e Add initial audit logging to data proxy 2017-01-09 22:59:43 -08:00
Carl Bergquist edf868d46b Merge pull request #7195 from theisenmark/webhook-username
Fix webhook username mismatch
2017-01-09 18:03:34 +01:00
Mark Theisen afda9cbb2d Fix webhook username mismatch
Fixing variable name mismatch so that the Authorization HTTP header is added to webhook notifications.
2017-01-09 17:18:53 +01:00
bergquist 4f216f22e9 docs(http): fixes typos 2017-01-09 16:49:06 +01:00
Torkel Ödegaard e218837380 began work on built in template variables, #7190 2017-01-09 15:31:19 +01:00
Carl Bergquist bcfe048aae Merge pull request #7184 from simnv/git-via-https
Use HTTPS instead of git to download tether-drop package
2017-01-09 07:15:01 +01:00
Valeriy Simonov 1aa1f7b12c Use https instead of git for tether-drop
git protocol (tcp/udp/9418) is forbidden when using some corporate
proxies. HTTPS is used more widely.
2017-01-09 10:00:07 +05:00
Valeriy Simonov 5bfe0ab237 Merge remote-tracking branch 'grafana/master' 2017-01-09 09:37:19 +05:00
Vitaliy Fuks 7c376f2bda Fixed typo. (#7181) 2017-01-08 09:43:17 +01:00
Mekal Zheng e57c764410 check validation of interval string before converting to seconds 2017-01-07 18:17:44 +08:00
Mekal Zheng 333aeb43c4 use methods of kbn to convert interval string to both second and millisecond 2017-01-07 16:33:40 +08:00
Mekal Zheng af798092b7 add variable $intervalSecond 2017-01-07 00:28:32 +08:00
Torkel Ödegaard 53fbb8b074 docs(changelog): added entry for telegram notifier, #7098 2017-01-06 12:19:39 +01:00
Torkel Ödegaard 31bd725559 Merge branch 'notifier-refactor' 2017-01-06 12:17:34 +01:00
Torkel Ödegaard eca918c0e7 Merge branch 'master' of github.com:grafana/grafana 2017-01-06 12:15:12 +01:00
Torkel Ödegaard 69d31c560d bumped master to 4.2 2017-01-06 12:14:58 +01:00
Mitsuhiro Tanda dfaefe34a4 add cloudwatch region (#7161) 2017-01-06 12:05:27 +01:00
Torkel Ödegaard b8f559aecb feat(plugins): made notifiers more pluggable and easier to support many of them, new ones can now be added without modifying any existing file, #7162 2017-01-06 12:04:25 +01:00
Torkel Ödegaard d6a2431767 Merge branch 'notifier-telegram-messenger' of https://github.com/leonoff/grafana into leonoff-notifier-telegram-messenger 2017-01-06 10:27:20 +01:00
Torkel Ödegaard 45d2e70ba7 feat(dashboard): sorting dashboard model kekeys, refactoring PR #7139 2017-01-06 10:09:11 +01:00
Torkel Ödegaard c472054f21 Merge branch 'master' into dashboard-export 2017-01-06 07:50:16 +01:00
Carl Bergquist e61d049623 tech(build): replace npm with yarn (#7108)
* tech(build): replace npm with yarn

* tech(build): change node version for CI
2017-01-06 07:28:43 +01:00
Torkel Ödegaard 7433e8c58f docs(changelog): updated changelog with ES PR #7154 2017-01-06 07:24:56 +01:00
Torkel Ödegaard 20b7c2f2e2 feat(ES): refactoring PR #7154 2017-01-06 07:22:37 +01:00
Torkel Ödegaard 293fd93e6c fix(elasticsearch): fixed predict default value, fixes #7145 2017-01-06 07:06:41 +01:00
Torkel Ödegaard 6960fb46c2 fix(build): remove triggering full package release on every commit, #6970 2017-01-06 06:51:17 +01:00
Torkel Ödegaard 813232315e fix(testdata): fixed test data source build issue 2017-01-06 06:50:02 +01:00
Torkel Ödegaard 63f6e86e46 feat(ES): better support for text type, closes #7151 2017-01-06 06:35:08 +01:00
Torkel Ödegaard 658d39944b feat(elasticsearch): add support for Elasticsearch scaled_type number type, closes #7155 2017-01-06 06:12:48 +01:00
Vaibhav Tandon b97e784555 Moving average support for all models along with additional settings associated with each model 2017-01-05 23:17:24 +00:00
Matthew McGinn 870c5f8cef adding refresh url param to pass refresh interval #7124 2017-01-05 00:15:52 -05:00
Dan Cech df1e90c723 export sorted dashboard json 2017-01-04 18:13:33 -05:00
Torkel Ödegaard 36929c2a92 fix(elasticsearch): add support for text type filter in templating query, fixes #7136, fixes #7135 2017-01-04 20:14:56 +01:00
Utkarsh Bhatnagar 65057212e7 Org update should throw error if not found (#7066)
* Org update should give error if not found

* Used affected rows
2017-01-03 09:21:18 +01:00
bergquist d8ebebc612 docs(http_api): adds docs for alerting in http api 2017-01-03 08:12:18 +01:00
bergquist 9a3e51894b tech(alerting): remove unused property 2017-01-03 08:11:17 +01:00
Torkel Ödegaard 9dc42648cf fix(templating): fixed issue with experimental feature template variable value groups tags, fixes #6752 2017-01-02 13:32:20 +01:00
bergquist 2e7d222f6e Revert "tech: remove unused code"
This reverts commit d9131be0a5.
2017-01-02 13:22:37 +01:00
bergquist d9131be0a5 tech: remove unused code 2017-01-02 13:11:09 +01:00
Torkel Ödegaard 2be5ee0bd5 fix(graph): fixed graph legend issue with always visible scrollbar, fixes #6828 2017-01-02 12:22:56 +01:00
Torkel Ödegaard 083a42942f fix(phantomsj): fixed issue with y axis label rotation in phantomjs rendered graphs, fixes #6924 2017-01-02 12:01:48 +01:00
Torkel Ödegaard 8030b56bba fix(panel): fixed panel help text for panels that set background color, fixes #7085 2017-01-02 11:14:00 +01:00
Mitsuhiro Tanda 9855ea8c6c handle sts error (#7088) 2016-12-30 16:59:06 +01:00
bergquist 08bad530dc tech(build): fail when go fmt fails 2016-12-30 15:08:31 +01:00
Mikhail Leonov e32a653cb6 Added Telegram Messenger notification destination 2016-12-30 15:57:12 +03:00
Julie Lee 8ed8922525 Update _tabbed_view.scss (#7078)
repeated style statement
2016-12-28 12:28:05 +01:00
Carl Bergquist c97131d1a0 Merge pull request #7074 from ksatirli/master
Adds London and Canada AWS Regions
2016-12-27 16:32:56 +01:00
Kerim Satirli 48b57afe84 Adds London and Canada AWS Regions 2016-12-27 14:25:12 +01:00
Kerim Satirli 797e2ea25d Adds London and Canada AWS Regions 2016-12-27 14:10:36 +01:00
Vitaliy Fuks 716d6473b7 Fixed typo. (#7064) 2016-12-27 11:35:00 +01:00
Darrian d662961ebe Added 'linear' to fill types for InfluxDB (#7042) 2016-12-23 09:43:47 +01:00
Ryan McKinley 27d83f414e Add influx 'mode' and 'cumulative_sum' (#7045) 2016-12-23 09:43:15 +01:00
James Blackburn f98e07e012 Fix auto_assign_org_role = Read Only Editor docs (#7057)
`auto_assign_org_role` should be `Read Only Editor` rather than `Read-Only Editor`
2016-12-23 09:41:28 +01:00
bergquist fef511d403 docs(conf): adds docs about supporting database_url
closes #1878
2016-12-21 23:39:08 +01:00
bergquist c18741c605 docs(ldap): adds note about special chars in password
closes #5337
2016-12-21 22:02:34 +01:00
bergquist 02bf83b37e docs: fixes broken code formating 2016-12-21 15:35:55 +01:00
Torkel Ödegaard fad07f0d15 refactor(http): refactoring http server 2016-12-21 14:36:32 +01:00
bergquist 8859eeb151 docs(readme): adds link to 4.1 beta release 2016-12-21 12:35:54 +01:00
bergquist a7b3ef06a8 docs: update image in github repo 2016-12-21 12:31:25 +01:00
Carl Bergquist 70f37651be Merge pull request #7034 from Timosha/add-ruble-sign
add Russian ruble sign
2016-12-21 11:10:01 +01:00
Timon 1ab66ac5d7 add Russian ruble sign 2016-12-21 12:59:09 +03:00
bergquist cb21b20905 docs(changelog): adds note about closing #6997 2016-12-21 10:05:56 +01:00
bergquist 4e306590f8 Merge branch 'v4.0.x' 2016-12-21 10:02:28 +01:00
Torkel Ödegaard 8bccbdafd2 feat(live): minor progress on stream manager 2016-12-21 09:16:29 +01:00
bergquist c3005397f5 docs: adds guide for whats new in 4.1 beta 2016-12-21 08:33:35 +01:00
bergquist c18b410104 docs: updates release date for 4.1.0 2016-12-20 20:11:38 +01:00
Trent White 5440804109 add new grabber icon and tweak styles to better fit space (#7019) 2016-12-20 17:49:04 +01:00
Torkel Ödegaard b7827962dc feat(live): just wanted to checkout how far I got on the websocket data source 2016-12-20 16:09:04 +01:00
bergquist 1c8865e702 docs: updates links to windows beta build 2016-12-20 16:08:05 +01:00
Torkel Ödegaard 1507d6c872 Merge branch 'master' of github.com:grafana/grafana 2016-12-20 15:30:10 +01:00
Torkel Ödegaard 4c5bdd9da4 fix(panel): need to check if panel has links 2016-12-20 15:24:53 +01:00
bergquist 48fbd7e134 docs: add note about closing #4079 2016-12-20 14:46:05 +01:00
bergquist afa5e9507a docs: updates install links for 4.1.0 beta 2016-12-20 13:15:59 +01:00
Utkarsh Bhatnagar 13c4ce68ee Added name and id in response of create/update (#7016) 2016-12-20 13:02:26 +01:00
Torkel Ödegaard fa01022494 fix(ux): fixed css issue with add row button, fixes #7017 2016-12-20 13:00:46 +01:00
Torkel Ödegaard e81e4ad06f updated websocket lib 2016-12-20 11:36:11 +01:00
bergquist 034db646ab release v4.1.0-beta1 2016-12-20 11:25:58 +01:00
bergquist 2660609c40 tech(build): adds scripts for only uploading to testing 2016-12-20 11:12:19 +01:00
bergquist ba96b88b66 feat(alerting): adds 24h and 48h duration as pre defined values
ref #7007
2016-12-20 09:23:05 +01:00
bergquist 80d438ca49 chore(alerting): removes double logging 2016-12-20 08:34:44 +01:00
bergquist 0c857e0ed8 docs(http): adds info about mass pausing alerts 2016-12-19 16:45:46 +01:00
bergquist a230ff65a9 fix(alerting): typo 2016-12-19 16:44:59 +01:00
bergquist 8d6c94b9f9 docs(changelog): adds note about closing #6589 2016-12-19 16:42:11 +01:00
Carl Bergquist 9135abf3ae Merge pull request #6996 from bergquist/pause_all_alerts
Pause all alerts
2016-12-19 16:38:44 +01:00
Torkel Ödegaard 164de5e3ce Merge branch 'master' of github.com:grafana/grafana 2016-12-19 16:36:26 +01:00
Torkel Ödegaard a2baec8592 fix(panel): fixed panel help tooltip issue, #4079 2016-12-19 16:36:09 +01:00
bergquist 6c2c3c7e24 Revert "fix(alerting): pause dto can only pause one"
This reverts commit b2c5a6a037.
2016-12-19 16:07:55 +01:00
bergquist b2c5a6a037 fix(alerting): pause dto can only pause one 2016-12-19 16:05:24 +01:00
bergquist 71f406558e tech(alerting): remove comments 2016-12-19 15:40:09 +01:00
bergquist a2257ec3d0 tech(alerting): renames pause all method 2016-12-19 15:17:49 +01:00
bergquist ecf44d4d9c tech(): go fmt code 2016-12-19 13:26:42 +01:00
bergquist ecdf1888c4 feat(alerting): removes pause per datasource 2016-12-19 13:24:45 +01:00
Torkel Ödegaard 090db9401c fix(graph): fix for when data min/max delta is zero and negative and grid y min/max is auto, fixes #6980 2016-12-19 09:30:52 +01:00
Torkel Ödegaard 3be77ad293 fix(docs): fixed spelling in docs article 2016-12-19 08:42:37 +01:00
bergquist 6b9db0c0c5 style(alerting): simplify support for pausing multiple alerts 2016-12-19 08:18:42 +01:00
Torkel Ödegaard 0a0b4f5533 Merge branch 'info-corner-refinements' 2016-12-16 21:17:47 +01:00
Torkel Ödegaard 2fc2cc721e change(panel): changed hover delay for #6998 2016-12-16 21:16:35 +01:00
Matt 594207b6d3 Polish on icon placement, incorporated torkel's better idea for going slightly lighter, make sure error icon color was white now 2016-12-16 12:51:22 -05:00
Matt 0c85e845df Softened the color a bit by mixing in the panel-bg, so it's not introducing any new variables. Was too start as pure body-bg 2016-12-16 12:11:29 -05:00
bergquist 86f148be48 docs(paths): updates relative path on /installation/ page 2016-12-16 17:42:40 +01:00
bergquist 30022b0d0b docs(paths): adds aliase for rpm and debian install
got reports on twitter about broken links.
2016-12-16 17:36:01 +01:00
bergquist 686f598d44 docs(changelog): adds note about closing #6473 2016-12-16 17:11:33 +01:00
bergquist 4244551a87 fix(influxdb): removes quotes for field key queries
fixes #6473
2016-12-16 17:09:17 +01:00
Torkel Ödegaard 3a9680939e Merge branch 'master' of github.com:grafana/grafana 2016-12-16 16:09:59 +01:00
Torkel Ödegaard a361d1f488 feat(panel): refinements for panel help text, made the inspector the home for the model version 2016-12-16 16:09:02 +01:00
bergquist 4ef95cfd31 style(api): reduce code complexity 2016-12-16 16:07:23 +01:00
bergquist c45ad965d1 chore(github): typo 2016-12-16 15:50:29 +01:00
bergquist 1f8f3ed038 style(api): extracts filter logic for mass pause 2016-12-16 15:19:13 +01:00
bergquist fb6aa0e026 feat(api): adds endpoint for mass pausing alerts
ref #6589
2016-12-16 15:00:58 +01:00
Torkel Ödegaard 2c05237d90 Merge branch 'master' of github.com:grafana/grafana 2016-12-16 13:47:22 +01:00
Torkel Ödegaard c04590784b Merge branch 'utkarshcmu-help-text' 2016-12-16 13:43:51 +01:00
Torkel Ödegaard af363ab478 fix(panel): build fixes 2016-12-16 13:43:43 +01:00
Torkel Ödegaard 62f3b16671 feat(panel): working on panel help text and unifying panel links, panel errors, and panel help into a single panel feature, #4079 , #6847 2016-12-16 13:06:04 +01:00
Torkel Ödegaard ac9ae52cea feat(panel): working on panel help text and unifying panel links, panel errors, and panel help into a single panel feature, #4079 , #6847 2016-12-16 12:46:29 +01:00
Torkel Ödegaard b9043c915e feat(panel): working on panel help text, #4079 , #6847 2016-12-16 11:48:32 +01:00
Mitsuhiro Tanda bc8d27737f fix cloudwatch docs (#6992) 2016-12-16 11:31:02 +01:00
Mitsuhiro Tanda 81394fcaa4 add cloudwatch internal metrics (#6990) 2016-12-16 10:48:05 +01:00
Mitsuhiro Tanda f8d6902428 fix cloudwatch percentile (#6989) 2016-12-16 10:47:41 +01:00
Torkel Ödegaard ca7bc25c83 feat(panel): working on panel help text, #4079 , #6847 2016-12-16 10:34:00 +01:00
bergquist df3adbc0f8 refactor(mqe): reduce duplication 2016-12-16 08:01:58 +01:00
bergquist 830bf5a91c docs(changelog): adds note about closing #6676 2016-12-15 16:31:30 +01:00
bergquist faa3b5f4e8 feat(alertlist): adds sorting on state
closes #6676
2016-12-15 16:29:40 +01:00
bergquist 2264addd9d docs(changelog): adds notes about closing #6905 2016-12-15 14:29:06 +01:00
bergquist c467e48940 feat(notifications): removes html escaping subject
closes #6905
2016-12-15 14:27:33 +01:00
Torkel Ödegaard 597ebb1161 fix(config): fixed issue setting generic oauth name via ENV variable, fixes #6974 2016-12-15 14:08:39 +01:00
Torkel Ödegaard 0c94194a5b Merge branch 'master' of github.com:grafana/grafana 2016-12-15 13:57:05 +01:00
Torkel Ödegaard b50490f080 docs(): changelog updated 2016-12-15 13:56:49 +01:00
Torkel Ödegaard 35b970347a Merge branch 'v4.0.x' 2016-12-15 13:55:26 +01:00
bergquist 0c8193a6af docs(changelog): adds note about closing #6866 2016-12-15 11:15:06 +01:00
bergquist ca7baca21d feat(alerting): adds ok as no data option
closes #6866
2016-12-15 11:13:19 +01:00
bergquist 6a161216de fix(influxdb): fixes bug with empty tagColumn for annotations 2016-12-15 10:54:22 +01:00
bergquist 51c4385c92 fix(mqe): only parse none empty functions 2016-12-15 08:52:43 +01:00
bergquist f907330c9e tech(mailer): improves error when grafana cannot read open cert/key file
ref #6949
2016-12-15 08:27:21 +01:00
bergquist e3b53fe599 test(mqe): adds test for double function usage 2016-12-15 07:36:06 +01:00
bergquist 7dece3ff0c test(mqe): solves brittle unit test 2016-12-15 07:36:06 +01:00
Torkel Ödegaard 19552450fa Merge branch 'master' of github.com:grafana/grafana 2016-12-14 22:31:11 +01:00
Torkel Ödegaard 435f474e8a docs(): minor fix for docker docs 2016-12-14 22:30:20 +01:00
bergquist dde6e73fed feat(mqe): add basic support for functions list 2016-12-14 22:29:17 +01:00
Solar Olugebefola 1e6210dd41 update broken links (#6961) 2016-12-14 22:20:22 +01:00
Torkel Ödegaard 8fc6e4cfb0 fix(auth proxy, ldap): fixed so users cannot change password when ldap or auth proxy is enabled, fixes #2495, do not allow user to change email or username depending on what property auth proxy is using, fixes #6903 2016-12-14 22:19:25 +01:00
Torkel Ödegaard df562e23cf feat(ldap): better ldap logging, closes #6918 2016-12-14 22:01:02 +01:00
Torkel Ödegaard 6e27db148c Merge branch 'authproxy_ldap' of https://github.com/seuf/grafana into seuf-authproxy_ldap 2016-12-14 21:45:15 +01:00
Torkel Ödegaard 9f69a4d34d clean(): removed old docs file 2016-12-14 21:22:01 +01:00
Torkel Ödegaard c59fd2e8f6 fix(docs): fixed support for old docs url, fixes #6960 2016-12-14 21:21:21 +01:00
Torkel Ödegaard 330c1b945e refactor(datasource): refactoring datasource secure json fields handling, #6697, #6692 2016-12-14 21:06:10 +01:00
Torkel Ödegaard b38e9b0cac fix(cloudwatch): removed debugger statement 2016-12-14 20:40:02 +01:00
Torkel Ödegaard c3920bfba1 fix(cloudwatch): fixed broken cloudwatch edit page, #6697 2016-12-14 20:38:35 +01:00
Torkel Ödegaard 467ddc19c3 feat(panel): worked on panel description tooltip, #6847 2016-12-14 17:22:19 +01:00
bergquist ca6a667555 feat(mqe): renames app tag into cluster 2016-12-14 16:49:16 +01:00
Torkel Ödegaard 5f7ad9ddb6 Merge branch 'help-text' of https://github.com/utkarshcmu/grafana into utkarshcmu-help-text 2016-12-14 16:20:36 +01:00
bergquist f8871f9e4a chore(mqe): remove comments 2016-12-14 16:16:42 +01:00
bergquist 6d57e42246 feat(mqe): restricts the executor to max 4 concurrent outgoing requests 2016-12-14 15:40:15 +01:00
Torkel Ödegaard 7425c63528 fix(dashboard): fixed unit test 2016-12-14 14:42:25 +01:00
Torkel Ödegaard e72a60bbf5 feat(graph): shared graph tooltip is not a select option with 3 options, normal, shared crosshair & shared tooltip, CTRL+O or CMD+O cycles option, closes #6894 2016-12-14 14:33:33 +01:00
Torkel Ödegaard baec2bbe8a fix(firefox): fixed table options tab UX issues, fixes #6900 2016-12-14 13:16:54 +01:00
Torkel Ödegaard 488fe62f15 fix(singletat): fixed/polished layout in singlestat ui options tab 2016-12-14 12:58:20 +01:00
Torkel Ödegaard faf6a5fd36 fixed issue in metric segment and option lookup, #6912 2016-12-14 10:50:48 +01:00
Carl Bergquist 38d8ba8faa Merge pull request #6952 from huydx/format-gofmt
(format) run go fmt in pkg
2016-12-14 09:26:38 +01:00
Carl Bergquist 9cd04768f7 Merge pull request #6953 from huydx/typo-execution
(typo) Exeuction -> Execution
2016-12-14 09:24:54 +01:00
bergquist 9510f21304 docs(changelog): fixes invalid ticket ref 2016-12-14 09:12:22 +01:00
huydx b97f4fd8b9 (typo) Exeuction -> Execution 2016-12-14 12:21:41 +09:00
huydx adb441e5c8 (format) run go fmt in pkg 2016-12-14 12:17:38 +09:00
bergquist 63bf332023 Merge branch 'alerting_mqe' 2016-12-13 16:15:22 +01:00
bergquist e6c557bb91 Merge branch 'master' into alerting_mqe 2016-12-13 16:15:04 +01:00
bergquist 362162d6fa feat(mqe): add token cache 2016-12-13 14:01:48 +01:00
bergquist 69d6316512 style(mqe): instance dependencies in ctor func 2016-12-13 12:47:57 +01:00
bergquist 549c3ab78b tech(mqe): update todo 2016-12-13 11:42:06 +01:00
bergquist b620c7457d test(query_editor): adds test for nesting queries in targetFull 2016-12-13 10:46:09 +01:00
Utkarsh Bhatnagar bd20dc6c4c Fixed failing tests (#6941) 2016-12-13 10:00:33 +01:00
bergquist 76f78c0f72 test(alert_tab): basic test skeleton
I created this test by misstake. But instead of deleting it I thought it
might be good to keep it to make it easier to add tests for the alert
tab
2016-12-13 09:50:38 +01:00
Torkel Ödegaard 62d18cd493 docs(): updated changelog with PR #6940 2016-12-13 09:18:10 +01:00
Utkarsh Bhatnagar 5777f65d05 Basic Auth now supports LDAP username and password (#6940) 2016-12-13 09:15:52 +01:00
Torkel Ödegaard 0841e841f5 cleanup(): removed docker/production folder as it was old and unused (ie grafana-docker repo is the place for the offical production docker container 2016-12-12 22:12:27 +01:00
bergquist e1703166f0 docs(changelog): add thank you note to contributor 2016-12-12 19:06:21 +01:00
bergquist 99e3db8208 Merge branch 'master' into alerting_mqe 2016-12-12 19:01:50 +01:00
Torkel Ödegaard 46c161b104 Merge branch 'master' of github.com:grafana/grafana 2016-12-12 16:35:59 +01:00
Torkel Ödegaard 80d88d302c fix(config): changed default for oauth and allow_sign_up setting, #6928 2016-12-12 16:35:42 +01:00
Hans Kristian Flaatten 1060b99810 docs(configuration): set allow_sign_up to true for gerneric OAuth (#6928)
This enables Grafana to accept new users authenticated through OAuth, without this set to true only previously authenticated users may log in with OAuth - and thus defeating the purpose.
2016-12-12 16:27:51 +01:00
Torkel Ödegaard 9da44141f1 fix(git): removed external submodule, accedentially included in PR, fixes #6929 2016-12-12 15:43:04 +01:00
bergquist 0e03c43174 docs(changelog): adds note about merging #4550 2016-12-12 14:59:02 +01:00
bergquist f33aeb6591 Merge branch 'adrianlzt-bug/show_multiple_tags_with_influxdb' 2016-12-12 14:56:51 +01:00
bergquist 530e1b358a Merge branch 'master' into adrianlzt-bug/show_multiple_tags_with_influxdb 2016-12-12 14:55:56 +01:00
bergquist ce4e71364c test(influxdb): adds tests for supporting multiple tags 2016-12-12 14:55:39 +01:00
Torkel Ödegaard 5ec7dea81a Merge branch 'v4.0.x' 2016-12-12 14:39:53 +01:00
Torkel Ödegaard 40b359334b fix(typescript): fixed sourcemap issue, #6904 2016-12-12 14:24:36 +01:00
bergquist d599f45707 Merge branch 'bug/show_multiple_tags_with_influxdb' of https://github.com/adrianlzt/grafana into adrianlzt-bug/show_multiple_tags_with_influxdb 2016-12-12 13:30:27 +01:00
bergquist ba848cffb4 docs(cli): add page for the cli 2016-12-12 13:15:35 +01:00
Torkel Ödegaard ee6cd727ea Merge branch 'master' of github.com:grafana/grafana 2016-12-12 11:38:31 +01:00
Torkel Ödegaard 3bb9d47a45 minor change to #6904 2016-12-12 11:38:10 +01:00
bergquist 413a187119 docs(notification): add message property to notification 2016-12-12 11:28:16 +01:00
Carl Bergquist a5c41fe7cb Merge pull request #6921 from huydx/master
fix(alert): alert test should return error when it failed to dispatch
2016-12-12 11:02:14 +01:00
Torkel Ödegaard 815722c3cc Merge branch 'upgrade_typescript' of https://github.com/Nepomuceno/grafana into Nepomuceno-upgrade_typescript 2016-12-12 10:53:19 +01:00
bergquist 3cbc325f18 tech(github): asks ppl to remove placeholder text 2016-12-12 10:39:45 +01:00
huydx 015fa82cf5 fix(alert): alert test should return error when it failed to dispatch 2016-12-12 18:22:58 +09:00
Seuf 12a82bc0d4 Auth Proxy improvements - adds the option to use ldap groups for authorization in combination with an auth proxy - adds an option to limit where auth proxy requests come from by configure a list of ip's - fixes a security issue, session could be reused 2016-12-12 09:53:02 +01:00
Seuf ae27c17c68 Auth Proxy improvements
- adds the option to use ldap groups for authorization in combination with an auth proxy
- adds an option to limit where auth proxy requests come from by configure a list of ip's
- fixes a security issue, session could be reused
2016-12-12 09:43:17 +01:00
bergquist 06b4dacaa4 docs(changelog): add note about closing #5479 2016-12-12 08:37:29 +01:00
Carl Bergquist 73ec529688 Merge pull request #6897 from grafana/cli_db_commands
Enable the CLI to do change the grafana admin password in the database
2016-12-12 08:30:20 +01:00
Gabriel Nepomuceno cbf0d571f5 Removing task from other build sources 2016-12-10 09:00:58 +00:00
Gabriel Nepomuceno 2f46c56672 removing type validation because copy needs to be done first 2016-12-09 23:41:07 +00:00
Gabriel Nepomuceno 7ff07aa7b1 Revoming old files 2016-12-09 22:05:11 +00:00
Gabriel Nepomuceno a8ae0a5b79 fixing compilation of grunt 2016-12-09 21:53:00 +00:00
Gabriel Nepomuceno f3ebd2d849 upgrading bases and correcting identation missing tslint 2016-12-09 14:57:25 +00:00
Axel 2adbe3e13e Prettify duration value format (#6875)
* Prettify duration unit format

Format duration like "2 days, 19 hours, 48 minutes" and make Decimals useful e.g.
0 decimals: 2 days
2 decimals: 2 days, 19 hours, 48 minutes
3 decimals: 2 days, 19 hours, 48 minutes, 27 seconds

Previous code did some rounding that is now gone so numbers might be
different.

* Rewrite kbn.toDuration without moment.js

Because https://github.com/moment/moment/issues/3653

* Add tests for kbn.toDuration
2016-12-09 15:55:25 +01:00
bergquist 96e8ecfa7b feat(cli): adds command to reset admin password
closes #5479
2016-12-09 15:25:02 +01:00
bergquist cd85e1f651 Merge branch 'master' into cli_db_commands 2016-12-09 12:36:05 +01:00
bergquist ba7a990f86 tech: bump version in server cli 2016-12-09 12:30:36 +01:00
bergquist 02392e5189 docs(changelog): adds PR contributors name to release notes 2016-12-09 12:19:41 +01:00
bergquist 64f22e7037 docs(changelog): add note about closing #6356 2016-12-09 11:49:23 +01:00
bergquist cfb6033765 Merge branch 'elastic5_support' 2016-12-09 11:42:15 +01:00
bergquist 619c5c4f1b Merge branch 'master' into elastic5_support 2016-12-09 11:41:23 +01:00
bergquist ebec02ffae style(elastic): minor code style changes 2016-12-09 11:40:00 +01:00
bergquist 99c5f7d571 feat(elastic): remove support for ES 1.x 2016-12-09 11:34:19 +01:00
bergquist 873024b917 tech(elastic): use bool conditions for all es queries 2016-12-09 11:13:28 +01:00
Matt Toback e58b6989c2 Small refactor to make hover highlighting proper, added a title tag for the completed grafana step. (#6882) 2016-12-09 09:42:24 +01:00
Matt Toback f39f77692b Adjusted the active state to fix the faint line showing. Probably related to the font change going into 4.0 (#6886) 2016-12-09 09:41:54 +01:00
Carl Bergquist 20e4cb9a0b Merge pull request #6885 from utkarshcmu/patch-1
Fixed Create org API in docs
2016-12-09 08:53:33 +01:00
Utkarsh Bhatnagar db3ac79015 Fixed Create org API in docs 2016-12-08 12:08:04 -08:00
bergquist 6265afd8b6 docs: updat latest to 4.0.2 2016-12-08 15:17:13 +01:00
bergquist 7c3c8bc4c9 docs(changelog): add date for 4.0.2 release 2016-12-08 15:14:44 +01:00
bergquist 49827de278 docs: release 4.0.2 2016-12-08 15:05:37 +01:00
bergquist f68350acbf docs(alerting): link fix to issue rather then commit 2016-12-08 14:01:59 +01:00
Torkel Ödegaard 22bf6420f1 Merge branch 'master' of github.com:grafana/grafana 2016-12-08 10:25:26 +01:00
Torkel Ödegaard 05772b30d7 feat(ux): completed work on getting started panel, #6466 2016-12-08 10:25:05 +01:00
Carl Bergquist 249b82d28b Merge pull request #6873 from dec5e/reference_typos
Fix some typos in Reference docs
2016-12-08 09:49:10 +01:00
Andrey Artemov c97e95227a Fix some typos in "Export & Import" reference 2016-12-08 10:34:53 +02:00
Andrey Artemov c94805d4c2 Fix typo in Singlestat page title 2016-12-08 10:34:31 +02:00
Torkel Ödegaard dee6b7d150 Merge branch 'master' into getting-started-panel 2016-12-08 08:51:40 +01:00
Matt Toback 6ae6a5d312 Polished some styles, updated issue 6466 2016-12-07 14:51:00 -05:00
bergquist 8ee85626f2 fix(api): return correct json info after updating datasource
closes #6869
2016-12-07 18:09:17 +01:00
bergquist c871212d6c docs(changelog): adds note about fixing avg() reducer bug 2016-12-07 15:58:03 +01:00
Torkel Ödegaard 924535c6d0 change(graph): changed null value graph option to default to null, closes #6868 2016-12-07 15:27:20 +01:00
bergquist 2bdd2a59cb test(alerting): improve naming for test scenario 2016-12-07 15:19:58 +01:00
Adrian Lopez 395b834a23 Better match for culumn inside tagsColumn 2016-12-07 12:23:57 +01:00
Torkel Ödegaard e082d78697 fix(elasticsearch): removed unused code 2016-12-07 12:07:56 +01:00
Torkel Ödegaard 7b68e6ea3b feat(elasticsearch): Added support for Missing option (bucket) for terms aggregation, refactoring PR #4244, thx @shanielh 2016-12-07 12:06:47 +01:00
bergquist dd432e671e docs(changelog): note about closing #6687 2016-12-07 11:28:18 +01:00
Carl Bergquist 0294446af9 Merge pull request #6856 from kylemcc/opsgenie-alerting
alerting: add support for OpsGenie
2016-12-07 11:23:54 +01:00
Carl Bergquist 2c7adccf12 Use cache for http.client in tsdb package. (#6833)
* datasource: move caching closer to datasource struct

* tsdb: use cached version of datasource http transport

closes #6825
2016-12-07 11:10:42 +01:00
vaibhavinbayarea 24172fca01 Added feature request "predict value" in moving averages pipeline agg (#5689)
issue-id: #5688
2016-12-07 10:47:46 +01:00
Matt Toback d28726be06 Moved ADD ROW to left to consolidate row actions along the same vertical area. (#6852) 2016-12-07 10:45:23 +01:00
Carl Bergquist b0679b610f Merge pull request #6857 from SaaldjorMike/typo
Fix docs typo
2016-12-06 23:36:55 +01:00
Mike Rostermund c5b29228ee Add missing char/typo 2016-12-06 22:26:43 +01:00
Kyle McCullough 4ef940482c alerting: add support for OpsGenie 2016-12-06 14:48:13 -06:00
utkarshcmu 6b26a0f91d Fixed hover position 2016-12-06 05:53:33 -08:00
utkarshcmu 13f0b32a8f Added sanitizer to help text 2016-12-06 05:24:03 -08:00
bergquist 6440d884db elastic: make sure old tests are for es2 2016-12-06 14:17:03 +01:00
utkarshcmu 034d84354e Fixed HelpText input box 2016-12-06 03:58:38 -08:00
utkarshcmu 42de27a2cb Added help text for users 2016-12-06 03:54:44 -08:00
Torkel Ödegaard 83afbd4262 Merge branch 'master' of github.com:grafana/grafana 2016-12-06 11:58:51 +01:00
Torkel Ödegaard e1b25b3999 changelog(): updated changelog with info on shared tooltip feature merged via PR #6274, closes #1578 2016-12-06 11:58:39 +01:00
Torkel Ödegaard fa393c282a feat(graph): refactoring shared tooltip PR #6274 2016-12-06 11:55:20 +01:00
bergquist 005a17d52f Merge branch 'master' of https://github.com/lpic10/grafana into lpic10-master 2016-12-06 10:15:36 +01:00
bergquist 464553a453 docs: explains how to use comment chars in passwords 2016-12-06 09:48:56 +01:00
Torkel Ödegaard 51165e76ba Merge branch 'shared_tooltip' of https://github.com/connection-reset/grafana into connection-reset-shared_tooltip 2016-12-06 09:32:22 +01:00
bergquist 8f1ed07275 metrics: 64bit fields should come first in structs
https://golang.org/pkg/sync/atomic/#pkg-note-BUG
2016-12-06 09:08:51 +01:00
bergquist 21353f4ba5 docs: adds note about closing #6779 2016-12-06 09:08:50 +01:00
Torkel Ödegaard 9bb440bc82 Merge branch 'master' of github.com:grafana/grafana 2016-12-06 09:02:51 +01:00
Torkel Ödegaard 62269bb894 change(influxdb): always specify absolute time range in milliseconds, refactoring #6571 2016-12-06 08:56:01 +01:00
Torkel Ödegaard c6bb86d833 Merge branch 'master' of https://github.com/ryantxu/grafana into ryantxu-master 2016-12-06 08:38:29 +01:00
jifwin e73b82d54f Disable web-security for phantomjs rendering (#6469) 2016-12-06 08:37:36 +01:00
Ben RUBSON e51525dbde Only take bar series to calculate barWidth (#6756)
* Only take bar series to calculate barWidth

solves #6751

* Typo

* Typo

* Typo

* Typo

* Refactor

* Simplify
2016-12-06 08:36:23 +01:00
Mitsuhiro Tanda 5f6a3ecd56 (cloudwatch) don't expand variable when panel or row repeat is used (#6618)
* (cloudwatch) don't expand variable when panel or row repeat is used

* fix test
2016-12-06 08:16:41 +01:00
Mitsuhiro Tanda be26c017f6 (cloudwatch) percentile support (#6634)
* support extended statistics

* handle different response format for extended statistics
2016-12-06 08:12:30 +01:00
Torkel Ödegaard d56b9a720a feat(alerting): added confirm text when removing panel with alert rule 2016-12-06 08:11:21 +01:00
Adrian Muraru f91fcaf5cf Dashboard PNG export (#6644) 2016-12-06 08:05:13 +01:00
Torkel Ödegaard 167936f9b9 updated changelog 2016-12-06 07:43:39 +01:00
Torkel Ödegaard ee36234196 Merge branch 'v4.0.x' 2016-12-06 07:42:35 +01:00
Torkel Ödegaard 88e1d56bc2 fix(logging): added extra logging when default config file is not found (ie homepath is not correct), fixes #6829 2016-12-06 07:36:10 +01:00
Torkel Ödegaard 4c406dec2f cleanup(): removed unused (old) migrate stuff 2016-12-05 12:52:34 +01:00
Torkel Ödegaard aea3093d85 change(Timepicker): removed last 90 days to make room for Last 2 days, #6758 2016-12-05 11:52:00 +01:00
Jaime Soriano Pastor f2d5829944 Add 'Last 2 days' option to quick ranges (#6758) 2016-12-05 11:51:02 +01:00
Torkel Ödegaard 37c1a49dc9 updated changelog 2016-12-05 11:44:50 +01:00
Torkel Ödegaard 50022253bd Merge branch 'v4.0.x' 2016-12-05 11:44:02 +01:00
Torkel Ödegaard 80f7a6a896 updated changelog 2016-12-05 11:20:54 +01:00
Torkel Ödegaard 1f50c6d76f Merge branch 'v4.0.x' 2016-12-05 11:20:14 +01:00
Torkel Ödegaard c5ff1e4584 Merge branch 'v4.0.x' 2016-12-05 11:04:24 +01:00
Torkel Ödegaard e1d52902c1 Merge branch 'master' of github.com:grafana/grafana 2016-12-05 10:54:40 +01:00
Torkel Ödegaard d1feaaf4f3 Merge branch 'v4.0.x' 2016-12-05 10:54:01 +01:00
silvestre-abruzzo 48a14cb4c6 Use correct domain in render.js (#6813)
Phantomjs is always rendering login page because domain is not considered. According to http://phantomjs.org/api/webpage/method/add-cookie.html a correct domain must be passed. Probably this change is now necessary due to https://github.com/grafana/grafana/issues/6660
2016-12-05 10:50:23 +01:00
bergquist 4a2a935c8f changelog: adds note about closing #6822 2016-12-05 10:45:22 +01:00
bergquist 87dbdb8300 webhook: adds json content-type
closes #6822
2016-12-05 10:44:31 +01:00
bergquist 1b68116922 changelog: add bugfix header 2016-12-05 09:42:31 +01:00
bergquist ea829988da changelog: add note about closing #6807 2016-12-05 09:39:20 +01:00
bergquist b88478a7e5 docs(readme): remove link to old CLA page 2016-12-03 03:46:51 +01:00
Carl Bergquist fbf2113904 Merge pull request #6795 from hvnsweeting/patch-1
Use space to separate multiple modes
2016-12-03 03:15:31 +01:00
bergquist 6c9cf87080 feat(alerting): calculate avg of valid points 2016-12-02 23:44:14 +01:00
bergquist c9b7f8603e tech(): replace spaces to handle input more graceful 2016-12-02 23:43:02 +01:00
bergquist 9dd6cf45ac feat(webhook): adds alert rule message to webhook
close #6807
2016-12-02 22:24:36 +01:00
bergquist 96cd13044b change to golang 1.7.4 2016-12-02 21:27:12 +01:00
bergquist f70d7ff3a3 fix(influxdb): align tsdb.influxdb with dataproxy
ref #6784
2016-12-02 21:10:29 +01:00
bergquist 368889828d update latest.json to 4.0.1 2016-12-02 21:10:11 +01:00
Torkel Ödegaard a5f7edbe40 Update CHANGELOG.md 2016-12-02 11:29:12 -05:00
Torkel Ödegaard bc0fdc1f8e Update CHANGELOG.md 2016-12-02 11:28:06 -05:00
bergquist 8134724b8a docs: update links to 4.0.1 2016-12-02 17:17:33 +01:00
bergquist b4b7156f42 fix(webdav): adds missing auth headers
closes #6779
2016-12-02 16:20:15 +01:00
Carl Bergquist c206c04399 Merge pull request #6796 from hvnsweeting/patch-2
Update sample.ini
2016-12-02 16:10:39 +01:00
bergquist 04fa86fdde docs(changelog): note about closing #6759 2016-12-02 15:43:39 +01:00
stuart nelson 9ed21c6a16 Add transport cache for reverse proxy (#6776)
* Add transport cache for reverse proxy
* Use updated at in cache
2016-12-02 15:39:28 +01:00
Viet Hung Nguyen c6e66ec15e Update sample.ini
Use space to separate multiple modes
2016-12-02 13:48:08 +07:00
Viet Hung Nguyen b00fc73242 Use space to separate multiple modes 2016-12-02 13:46:41 +07:00
bergquist 158656f570 docs(changelog): add note about closing #6749 2016-12-01 21:23:55 +01:00
Carl Bergquist 6c03c64c79 Merge pull request #6768 from fg2it/fix6749
fix 6749 by swapping member in StandardGauge to avoid problem with atomic
2016-12-01 21:16:16 +01:00
Carl Bergquist ae171357fc Merge pull request #6783 from solugebefola/patch-1
typo?
2016-12-01 18:16:10 +01:00
Solar Olugebefola 1c234c6089 typo? 2016-12-01 11:54:07 -05:00
Axel Pirek e6c8e75d62 Make tooltip shareable like crosshair 2016-12-01 10:10:23 +01:00
fg2it 834e3f1c29 swap member declaration in StandardGauge to avoid problem with atomic on arm and x86-32 2016-11-30 21:57:18 +00:00
bergquist 09e49f0a17 docs: adds note about closing #5677 2016-11-30 00:10:29 +01:00
Carl Bergquist d11b17b8fe Merge pull request #5677 from bmundt/remove_columns
Added Hidden Column Style for Table Panel
2016-11-30 00:08:17 +01:00
bergquist 4543bfe5aa docs: add note about closing cloudwatch 2016-11-29 23:38:44 +01:00
Carl Bergquist 3c662ade8c Merge pull request #6698 from grafana/cloudwatch_configurable_keys
Cloudwatch configurable keys from config page.
2016-11-29 23:37:13 +01:00
bergquist 180940a378 fix(singlestat): align width for gauge settings 2016-11-29 23:25:45 +01:00
bergquist 0d41b1294a fix(singlestat): align width for gauge settings 2016-11-29 23:24:46 +01:00
bergquist 16f6339327 docs: add note about closing #6740 2016-11-29 23:20:48 +01:00
Carl Bergquist c2ed24b788 Merge pull request #6740 from dirk-leroux/new_aggregation_on_singlestat_panel
New aggregation on singlestat panel
2016-11-29 23:18:01 +01:00
bergquist aa14d9d893 docs: add note about closing #6411 2016-11-29 22:30:05 +01:00
bergquist 87824d2be7 Merge branch 'ichekrygin-victorops' 2016-11-29 22:28:39 +01:00
bergquist 83e90325c9 chore(victorops): remove unused code 2016-11-29 22:26:42 +01:00
bergquist a6ea2f4fdb Merge branch 'victorops' of https://github.com/ichekrygin/grafana into ichekrygin-victorops 2016-11-29 22:22:25 +01:00
bergquist bb6248a51a docs: remove link to CLA since we use CLA assistance 2016-11-29 21:51:51 +01:00
bergquist a3a07b7191 docs(changelog): add note about closing #6655 2016-11-29 21:43:31 +01:00
Carl Bergquist b47410af6a Merge pull request #6670 from tomkozlowski/feature/postgres-certs
generalized database connection cert support and added to postgres
2016-11-29 21:40:27 +01:00
bergquist 9f4d06e8e2 docs(changelog): add note about closing #5443 2016-11-29 21:24:45 +01:00
bergquist 253324fc32 style(sqlstore): remove comment 2016-11-29 21:24:45 +01:00
Carl Bergquist f6557f14b7 Merge pull request #6741 from dpavlos/fix_5443
[5443] Check if title is empty before save a new dashboard
2016-11-29 21:22:07 +01:00
bergquist 3b4e55216c docs(changelog): add note about fixing #6679 2016-11-29 21:14:37 +01:00
Carl Bergquist 5a0fc434f3 Merge pull request #6722 from dpavlos/fix_6679
[6679] Check if org exists before delete it
2016-11-29 21:12:02 +01:00
bergquist b00e9390d3 docs(v4): update docs for v4 2016-11-29 19:03:33 +01:00
bergquist aed695ebe0 tech(build): set master to 4.1.0 pre 2016-11-29 18:03:20 +01:00
Torkel Ödegaard 7276b00fc7 fix(row): fixed dropping new panels onto panels, should split target panel 2016-11-29 11:37:06 -05:00
Pavlos Daoglou 7f7f080ad8 [5443] Check if title is empty before save a new dashboard 2016-11-29 12:25:20 +02:00
Dirk le Roux e0073d7e54 Fixed spelling error 2016-11-29 08:32:51 +02:00
Dirk le Roux 6412bd2f57 oAdded value type documentation to singlestat panel
Signed-off-by: Dirk le Roux <dirk.leroux@gmail.com>
2016-11-29 08:26:32 +02:00
Dirk le Roux 49dda7e5c1 first, delta, range passing unit tests
Signed-off-by: Dirk le Roux <dirk.leroux@gmail.com>
2016-11-29 08:26:31 +02:00
Ryan McKinley 0534d43a6e use ms when query less then 5 mins 2016-11-28 14:57:36 -08:00
Ryan McKinley 1ce0d81736 Merge remote-tracking branch 'grafana/master' 2016-11-28 13:38:18 -08:00
Pavlos Daoglou 0064331bbf [6679] Check if org exists before delete it 2016-11-28 00:09:01 +02:00
bergquist 7bc1c3cc1c feat(cloudwatch): make it possible to reset keys
closes #6697
2016-11-24 16:37:33 +01:00
bergquist 3d21f06d5b tech(cloudwatch): store keys in secure json blob 2016-11-24 14:16:52 +01:00
bergquist 0ea6537916 tech(cloudwatch): refactoring 2016-11-24 14:00:05 +01:00
bergquist f7e12e5f93 test(cloudwatch): fixes failing tests 2016-11-24 14:00:05 +01:00
bergquist 1695aece0c feat(cloudwatch): add authtype dropdown to config page 2016-11-24 14:00:05 +01:00
bergquist 64784db870 feat(cloudwatch): adds access and secret key to edit config page 2016-11-24 14:00:05 +01:00
Torkel Ödegaard 2f354ed926 fix(getting started panel): some more work on this, #6466 2016-11-24 13:58:51 +01:00
Torkel Ödegaard 2233938ba7 Merge branch 'master' into getting-started-panel 2016-11-24 13:17:22 +01:00
Tom Kozlowski c21ffcc6c9 generalized database connection cert support and added to postgres 2016-11-22 15:29:22 -08:00
Torkel Ödegaard c1a15648c7 Merge branch 'master' of github.com:grafana/grafana into getting-started-panel 2016-11-21 09:00:40 +01:00
Torkel Ödegaard 1dc581bdfa ux(gettingstarted): progress on getting started panel, #6466 2016-11-18 17:42:14 +01:00
Torkel Ödegaard fd512457d8 Merge remote-tracking branch 'origin/master' into getting-started-panel-css2 2016-11-18 16:31:54 +01:00
Torkel Ödegaard 0c9001c7ae ux(gettingstarted): progress on getting started panel, #6466 2016-11-18 16:31:19 +01:00
bergquist 1b0005a9e5 feat(mqe): add support for app and host alias 2016-11-18 11:40:38 +01:00
Ryan McKinley 7958615097 Use ms rather than second precision 2016-11-17 09:21:25 -08:00
bergquist 5c153f0383 Merge branch 'master' into alerting_mqe 2016-11-17 09:57:56 +01:00
bergquist 0a0f558c48 style(mqe): improve code 2016-11-17 08:52:27 +01:00
bergquist 23387bd39b feat(mqe): simplify timestamp parsing 2016-11-17 08:42:09 +01:00
ichekrygin f6b70c7d82 Fix formatting 2016-11-16 17:30:42 -08:00
ichekrygin acc729131a Add VictorOps Test. 2016-11-16 16:14:02 -08:00
ichekrygin 8f0d51171d Resolve rebase w/ upstream conflicts.
Remove: `Alert on Exec Error` (no longer needed)
Add: `ruleUrl` to VictorOps message body.
2016-11-16 16:13:33 -08:00
ichekrygin bbca9861fb Fix return on nil and cleanup debug messages 2016-11-16 14:02:34 -08:00
ichekrygin b46cbc5fbe Add option to alert on ExecutionError 2016-11-16 14:02:34 -08:00
ichekrygin 4ca304b756 Change VictorOps fa from fa-exclamation-triangle -> fa-pagelines 2016-11-16 14:02:34 -08:00
ichekrygin 1e558e3936 Fix user-facing text 2016-11-16 14:02:34 -08:00
ichekrygin b0620a9d4b Add VictorOps alert notification capability 2016-11-16 14:02:34 -08:00
bergquist 9572f086ae feat(mqe): add timerange to query 2016-11-16 17:09:34 +01:00
bergquist fa8213d8d5 feat(mqe): send http requests 2016-11-16 15:28:31 +01:00
bergquist f1897b7e96 feat(mqe): add response parser 2016-11-16 14:42:43 +01:00
bergquist c6ad0cc5ec test(mqe): basic test for response parser 2016-11-16 13:00:25 +01:00
bergquist 113020aabe feat(mqe): support basic aliases 2016-11-16 11:04:15 +01:00
bergquist 430104aaac feat(mqe): add support for wildcard series 2016-11-16 10:03:22 +01:00
bergquist fa92dfb7b2 feat(mqe): add support for apps in where clause 2016-11-16 09:54:45 +01:00
bergquist ab7263579f Merge branch 'master' into alerting_mqe 2016-11-16 09:28:26 +01:00
bergquist 4739608ffb tests(mqe): add query builder 2016-11-15 18:37:34 +01:00
Ryan McKinley 04356f31d2 missing space 2016-11-14 14:56:11 -08:00
Ryan McKinley 3588b9732f round the seconds 2016-11-14 13:40:33 -08:00
bergquist 1bdda76ba9 tests(mqe): parse mqe query model 2016-11-14 15:03:49 +01:00
bergquist c973241435 feat(mqe): add token request 2016-11-14 14:00:35 +01:00
bergquist 118e2a6364 WIP: more boilerplate 2016-11-13 13:51:54 +01:00
Torkel Ödegaard 18a37a9eef ux(getting started): struggleing witch cleaning up the css, #6466 2016-11-10 14:21:37 +01:00
Torkel Ödegaard 575828f1e9 Merge branch 'getting-started-panel' of github.com:grafana/grafana into getting-started-panel 2016-11-10 13:25:18 +01:00
Torkel Ödegaard de74bf0c33 Merge branch 'master' into getting-started-panel 2016-11-10 13:24:10 +01:00
bergquist bd3259d07a feat(mqe): init commit 2016-11-09 15:55:47 +01:00
Torkel Ödegaard fb57bf77da ux(getting started): progress on getting started panel and persited help flag states, #6466 2016-11-09 10:41:39 +01:00
Leandro Piccilli 717a96ab8d Fix raw document query on ES 5.x 2016-11-08 22:18:59 +01:00
Leandro Piccilli a5ee705b89 Merge branch 'master' of https://github.com/grafana/grafana 2016-11-08 22:18:30 +01:00
Torkel Ödegaard 5f2cb8e193 Merge branch 'master' into getting-started-panel 2016-11-08 16:23:01 +01:00
Torkel Ödegaard d92bb677df docs(): fix title 2016-11-08 16:15:34 +01:00
Torkel Ödegaard 4c891e3758 docs(): minor spelling fix 2016-11-08 15:06:07 +01:00
Matt Toback 15e369ec02 First pass of getting started panel for home dashboard 2016-11-02 17:21:11 -04:00
Leandro Piccilli c9a69c3ed9 Merge branch 'master' of https://github.com/grafana/grafana 2016-10-27 19:00:23 +02:00
Leandro Piccilli 538e1fbc64 Fix templating using query 2016-10-27 18:59:24 +02:00
Leandro Piccilli 0000065053 Merge branch 'master' of https://github.com/grafana/grafana 2016-10-02 16:59:25 +02:00
Leandro Piccilli 128de86d49 Merge branch 'master' of github.com:grafana/grafana 2016-09-19 20:12:02 +02:00
bergquist 5d821d3492 style(cli): minor fix 2016-08-24 20:27:41 +02:00
bergquist c087445d51 feat(cli): add db command to cli. 2016-08-24 15:46:26 +02:00
Leandro Piccilli f844cd844b Fix for annotations query on ES 5.x 2016-08-11 22:24:58 +02:00
slqgsm e17b1548e8 Release there were some issues with the way removing columns was being implemented.
So I decided to scrap that, and go for just having a hidden column style. This is what
@madshall did in his enhanced table pull request, so this is basically the hidden
column style feature form his pull request.
2016-07-29 20:21:59 +00:00
slqgsm 93cb08d9d0 fixed typo and issue of not being able to add fields in table transformation 2016-07-29 16:30:38 +00:00
slqgsm afb55fb3bd fixed to allow adding columns back in 2016-07-29 12:25:36 +00:00
slqgsm e420bee2ab First commit for this branch, to allow removing of columns in table transformation 2016-07-28 21:44:07 +00:00
Leandro Piccilli 3057c9747c Change size on terms aggregation for ES 5.x 2016-07-26 22:05:49 +02:00
Leandro Piccilli df9ace8ac2 Change annotations query for ES 5.x 2016-07-21 00:42:36 +02:00
Leandro Piccilli 2a501d6cdb Merge branch 'master' of https://github.com/grafana/grafana 2016-07-18 10:34:11 +02:00
Leandro Piccilli 0ebf469f5f Merge branch 'master' of https://github.com/grafana/grafana 2016-07-07 00:58:26 +02:00
Leandro Piccilli 2205ce5354 Add some tests for ES 5.x 2016-06-20 00:40:16 +02:00
Leandro Piccilli 0d34740a62 Add support to ElasticSearch 5.0 2016-05-10 19:38:22 +02:00
Adrian Lopez 9fbb1214ae Allow to show multiple tags with annotations with InfluxDB datasource 2016-04-04 16:57:34 +02:00
Valeriy Simonov 8bf4d3fb7f Merge remote-tracking branch 'refs/remotes/grafana/master' 2016-03-31 15:54:00 +05:00
Shani Elharrar f121e8309d ElasticSearch Terms & Date Histogram: Support 'missing' setting 2016-03-03 22:34:28 +02:00
552 changed files with 40858 additions and 10836 deletions
+3 -1
View File
@@ -1,2 +1,4 @@
* Link the PR to an issue for new features
* Rebase your PR if it gets out of sync with master
* Rebase your PR if it gets out of sync with master
**REMOVE THE TEXT ABOVE BEFORE CREATING THE PULL REQUEST**
+132 -1
View File
@@ -1,4 +1,135 @@
# 4.0-stable (unreleased)
# 4.2.0 (unreleased)
## Enhancements
* **Telegram**: Added Telegram alert notifier [#7098](https://github.com/grafana/grafana/pull/7098), thx [@leonoff](https://github.com/leonoff)
* **Templating**: Make $__interval and $__interval_ms global built in variables that can be used in by any datasource (in panel queries), closes [#7190](https://github.com/grafana/grafana/issues/7190), closes [#6582](https://github.com/grafana/grafana/issues/6582)
* **S3 Image Store**: External s3 image store (used in alert notifications) now support AWS IAM Roles, closes [#6985](https://github.com/grafana/grafana/issues/6985), [#7058](https://github.com/grafana/grafana/issues/7058) thx [@mtanda](https://github.com/mtanda)
* **SingleStat**: Implements diff aggregation method for singlestat [#7234](https://github.com/grafana/grafana/issues/7234), thx [@oliverpool](https://github.com/oliverpool)
* **Dataproxy**: Added setting to enable more verbose logging in dataproxy [#7209](https://github.com/grafana/grafana/pull/7209), thx [@Ricky-N](https://github.com/Ricky-N)
* **Alerting**: Better information about why an alert triggered [#7035](https://github.com/grafana/grafana/issues/7035)
* **LINE**: Add LINE as alerting notification channel [#7301](https://github.com/grafana/grafana/pull/7301), thx [@huydx](https://github.com/huydx)
* **LINE**: Adds image to notification message [#7417](https://github.com/grafana/grafana/pull/7417), thx [@Erliz](https://github.com/Erliz)
* **Hipchat**: Adds support for sending alert notifications to hipchat [#6451](https://github.com/grafana/grafana/issues/6451), thx [@jregovic](https://github.com/jregovic)
* **Alerting**: Uploading images for alert notifications is now optional [#7419](https://github.com/grafana/grafana/issues/7419)
* **Dashboard**: Adds shortcut for collapsing/expanding all rows [#552](https://github.com/grafana/grafana/issues/552), thx [@mtanda](https://github.com/mtanda)
* **Alerting**: Adds de duping of alert notifications [#7632](https://github.com/grafana/grafana/pull/7632)
* **Orgs**: Sharing dashboards using Grafana share feature will not redirect to correct org. [#1613](https://github.com/grafana/grafana/issues/1613)
* **Pushover**: Add Pushover alert notifications [#7526](https://github.com/grafana/grafana/pull/7526) thx [@devkid](https://github.com/devkid)
* **Threema**: Add Threema Gateway alert notification integration [#7482](https://github.com/grafana/grafana/pull/7482) thx [@dbrgn](https://github.com/dbrgn)
## Minor Enhancements
* **Optimzation**: Never issue refresh event when Grafana tab is not visible [#7218](https://github.com/grafana/grafana/issues/7218), thx [@mtanda](https://github.com/mtanda)
* **Browser History**: Browser back/forward now works time ranges / zoom, [#7259](https://github.com/grafana/grafana/issues/7259)
* **Elasticsearch**: Support for Min Doc Count options in Terms aggregation [#7324](https://github.com/grafana/grafana/pull/7324), thx [@lpic10](https://github.com/lpic10)
* **Elasticsearch**: Term aggregation limit can now be changed in template queries [#7112](https://github.com/grafana/grafana/issues/7112), thx [@FFalcon](https://github.com/FFalcon)
* **Elasticsearch**: Ad-hoc filters now support all operators [#7612](https://github.com/grafana/grafana/issues/7612), thx [@tamayika](https://github.com/tamayika)
* **Graph**: Add full series name as title for legends. [#7493](https://github.com/grafana/grafana/pull/7493), thx [@kolobaev](https://github.com/kolobaev)
* **Table**: Add a message when queries returns no data. [#6109](https://github.com/grafana/grafana/issues/6109), thx [@xginn8](https://github.com/xginn8)
* **Graph**: Set max width for series names in legend tables. [#2385](https://github.com/grafana/grafana/issues/2385), thx [@kolobaev](https://github.com/kolobaev)
* **Database**: Allow max db connection pool configuration [#7427](https://github.com/grafana/grafana/issues/7427), thx [@huydx](https://github.com/huydx)
* **Datasources** Delete datsource by name [#7476](https://github.com/grafana/grafana/issues/7476), thx [@huydx](https://github.com/huydx)
* **Dataproxy**: Only allow get that begins with api/ to access Prometheus [#7459](https://github.com/grafana/grafana/pull/7459), thx [@mtanda](https://github.com/mtanda)
* **Snapshot**: Make timeout for snapshot creation configurable [#7449](https://github.com/grafana/grafana/pull/7449) thx [@ryu1-sakai](https://github.com/ryu1-sakai)
* **Panels**: Add more physics units [#7554](https://github.com/grafana/grafana/pull/7554) thx [@ryantxu](https://github.com/ryantxu)
* **Email**: Add sender's name on email [#2131](https://github.com/grafana/grafana/issues/2131) thx [@jacobbednarz](https://github.com/jacobbednarz)
* **HTTPS**: Set tls 1.2 as lowest tls version. [#7347](https://github.com/grafana/grafana/pull/7347) thx [@roman-vynar](https://github.com/roman-vynar)
* **Table**: Added suppressing of empty results to table plugin. [#7602](https://github.com/grafana/grafana/pull/7602) thx [@LLIyRiK](https://github.com/LLIyRiK)
## Tech
* **Library Upgrade**: Upgraded angularjs from 1.5.8 to 1.6.1 [#7274](https://github.com/grafana/grafana/issues/7274)
* **Backend**: Grafana is now built using golang 1.8
## Bugfixes
* **Alerting**: Fixes missing support for no_data and execution error when testing alerts [#7149](https://github.com/grafana/grafana/issues/7149)
* **Dashboard**: Avoid duplicate data in dashboard json for panels with alerts [#7256](https://github.com/grafana/grafana/pull/7256)
* **Alertlist**: Only show scrollbar when required [#7269](https://github.com/grafana/grafana/issues/7269)
* **SMTP**: Set LocalName to hostname [#7223](https://github.com/grafana/grafana/issues/7223)
* **Sidemenu**: Disable sign out in sidemenu for AuthProxyEnabled [#7377](https://github.com/grafana/grafana/pull/7377), thx [@solugebefola](https://github.com/solugebefola)
* **Prometheus**: Add support for basic auth in Prometheus tsdb package [#6799](https://github.com/grafana/grafana/issues/6799), thx [@hagen1778](https://github.com/hagen1778)
* **OAuth**: Redirect to original page when logging in with OAuth [#7513](https://github.com/grafana/grafana/issues/7513)
* **Annotations**: Wrap text in annotations tooltip [#7542](https://github.com/grafana/grafana/pull/7542), thx [@xginn8](https://github.com/xginn8)
* **Templating**: Fixes error when using numeric sort on empty strings [#7382](https://github.com/grafana/grafana/issues/7382)
* **Templating**: Fixed issue detecting template variable dependency [#7354](https://github.com/grafana/grafana/issues/7354)
# 4.1.2 (2017-02-13)
### Bugfixes
* **Table**: Fixes broken annotation rendering mode in the table panel [#7268](https://github.com/grafana/grafana/issues/7268)
* **Data Sources**: Sorting for lists of data sources in UI is now case insensitive [#7491](https://github.com/grafana/grafana/issues/7491)
* **Admin**: Support more then 1000 users in global users list [#7469](https://github.com/grafana/grafana/issues/7469)
# 4.1.1 (2017-01-11)
### Bugfixes
* **Graph Panel**: Fixed issue with legend height in table mode [#7221](https://github.com/grafana/grafana/issues/7221)
# 4.1.0 (2017-01-11)
### Bugfixes
* **Server side PNG rendering**: Fixed issue with y-axis label rotation in phantomjs rendered images [#6924](https://github.com/grafana/grafana/issues/6924)
* **Graph**: Fixed centering of y-axis label [#7099](https://github.com/grafana/grafana/issues/7099)
* **Graph**: Fixed graph legend table mode and always visible scrollbar [#6828](https://github.com/grafana/grafana/issues/6828)
* **Templating**: Fixed template variable value groups/tags feature [#6752](https://github.com/grafana/grafana/issues/6752)
* **Webhook**: Fixed webhook username mismatch [#7195](https://github.com/grafana/grafana/pull/7195), thx [@theisenmark](https://github.com/theisenmark)
* **Influxdb**: Handles time(auto) the same way as time($interval) [#6997](https://github.com/grafana/grafana/issues/6997)
## Enhancements
* **Elasticsearch**: Added support for all moving average options [#7154](https://github.com/grafana/grafana/pull/7154), thx [@vaibhavinbayarea](https://github.com/vaibhavinbayarea)
# 4.1-beta1 (2016-12-21)
### Enhancements
* **Postgres**: Add support for Certs for Postgres database [#6655](https://github.com/grafana/grafana/issues/6655)
* **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)
* **Singlestat**: New aggregation on singlestat panel [#6740](https://github.com/grafana/grafana/pull/6740), thx [@dirk-leroux](https://github.com/dirk-leroux)
* **Cloudwatch**: Make it possible to specify access and secret key on the data source config page [#6697](https://github.com/grafana/grafana/issues/6697)
* **Table**: Added Hidden Column Style for Table Panel [#5677](https://github.com/grafana/grafana/pull/5677), thx [@bmundt](https://github.com/bmundt)
* **Graph**: Shared crosshair option renamed to shared tooltip, shows 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)
* **Elasticsearch**: Added support for Missing option (bucket) for terms aggregation [#4244](https://github.com/grafana/grafana/pull/4244), thx [@shanielh](https://github.com/shanielh)
* **Elasticsearch**: Added support for Elasticsearch 5.x [#5740](https://github.com/grafana/grafana/issues/5740), thx [@lpic10](https://github.com/lpic10)
* **CLI**: Make it possible to reset the admin password using the grafana-cli. [#5479](https://github.com/grafana/grafana/issues/5479)
* **Influxdb**: Support multiple tags in InfluxDB annotations. [#4550](https://github.com/grafana/grafana/pull/4550), thx [@adrianlzt](https://github.com/adrianlzt)
* **LDAP**: Basic Auth now supports LDAP username and password, [#6940](https://github.com/grafana/grafana/pull/6940), thx [@utkarshcmu](https://github.com/utkarshcmu)
* **LDAP**: Now works with Auth Proxy, role and organisation mapping & sync will regularly be performed. [#6895](https://github.com/grafana/grafana/pull/6895), thx [@Seuf](https://github.com/seuf)
* **Alerting**: Adds OK as no data option. [#6866](https://github.com/grafana/grafana/issues/6866)
* **Alert list**: Order alerts based on state. [#6676](https://github.com/grafana/grafana/issues/6676)
* **Alerting**: Add api endpoint for pausing all alerts. [#6589](https://github.com/grafana/grafana/issues/6589)
* **Panel**: Added help text for panels. [#4079](https://github.com/grafana/grafana/issues/4079), thx [@utkarshcmu](https://github.com/utkarshcmu)
### Bugfixes
* **API**: HTTP API for deleting org returning incorrect message for a non-existing org [#6679](https://github.com/grafana/grafana/issues/6679)
* **Dashboard**: Posting empty dashboard result in corrupted dashboard [#5443](https://github.com/grafana/grafana/issues/5443)
* **Logging**: Fixed logging level confing issue [#6978](https://github.com/grafana/grafana/issues/6978)
* **Notifications**: Remove html escaping the email subject. [#6905](https://github.com/grafana/grafana/issues/6905)
* **Influxdb**: Fixes broken field dropdown when using template vars as measurement. [#6473](https://github.com/grafana/grafana/issues/6473)
# 4.0.2 (2016-12-08)
### Enhancements
* **Playlist**: Add support for kiosk mode [#6727](https://github.com/grafana/grafana/issues/6727)
### Bugfixes
* **Alerting**: Add alert message to webhook notifications [#6807](https://github.com/grafana/grafana/issues/6807)
* **Alerting**: Fixes a bug where avg() reducer treated null as zero. [#6879](https://github.com/grafana/grafana/issues/6879)
* **PNG Rendering**: Fix for server side rendering when using non default http addr bind and domain setting [#6813](https://github.com/grafana/grafana/issues/6813)
* **PNG Rendering**: Fix for server side rendering when setting enforce_domain to true [#6769](https://github.com/grafana/grafana/issues/6769)
* **Webhooks**: Add content type json to outgoing webhooks [#6822](https://github.com/grafana/grafana/issues/6822)
* **Keyboard shortcut**: Fixed zoom out shortcut [#6837](https://github.com/grafana/grafana/issues/6837)
* **Webdav**: Adds basic auth headers to webdav uploader [#6779](https://github.com/grafana/grafana/issues/6779)
# 4.0.1 (2016-12-02)
> **Notice**
4.0.0 had serious connection pooling issue when using a data source in proxy access. This bug caused lots of resource issues
due to too many connections/file handles on the data source backend. This problem is fixed in this release.
### Bugfixes
* **Metrics**: Fixes nil pointer dereference on my arm build [#6749](https://github.com/grafana/grafana/issues/6749)
* **Data proxy**: Fixes a tcp pooling issue in the datasource reverse proxy [#6759](https://github.com/grafana/grafana/issues/6759)
# 4.0-stable (2016-11-29)
### Bugfixes
* **Server-side rendering**: Fixed address used when rendering panel via phantomjs and using non default http_addr config [#6660](https://github.com/grafana/grafana/issues/6660)
+2 -2
View File
@@ -4,9 +4,9 @@ deps-go:
go run build.go setup
deps-js:
npm install
yarn install --pure-lockfile --no-progress
deps: deps-go deps-js
deps: deps-js
build-go:
go run build.go build
+8 -10
View File
@@ -1,4 +1,4 @@
[Grafana](http://grafana.org) [![Circle CI](https://circleci.com/gh/grafana/grafana.svg?style=svg)](https://circleci.com/gh/grafana/grafana) [![Coverage Status](https://coveralls.io/repos/grafana/grafana/badge.png)](https://coveralls.io/r/grafana/grafana)
[Grafana](http://grafana.org) [![Circle CI](https://circleci.com/gh/grafana/grafana.svg?style=svg)](https://circleci.com/gh/grafana/grafana)
================
[Website](http://grafana.org) |
[Twitter](https://twitter.com/grafana) |
@@ -10,14 +10,15 @@
Grafana is an open source, feature rich metrics dashboard and graph editor for
Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB.
![](http://grafana.org/assets/img/start_page_bg.png)
![](http://grafana.org/assets/img/features/dashboard_ex1.png)
- [Install instructions](http://docs.grafana.org/installation/)
- [What's New in Grafana 2.0](http://docs.grafana.org/guides/whats-new-in-v2/)
- [What's New in Grafana 2.1](http://docs.grafana.org/guides/whats-new-in-v2-1/)
- [What's New in Grafana 2.5](http://docs.grafana.org/guides/whats-new-in-v2-5/)
- [What's New in Grafana 3.0](http://docs.grafana.org/guides/whats-new-in-v3/)
- [What's New in Grafana 4.0 Beta](http://docs.grafana.org/guides/whats-new-in-v4/)
- [What's New in Grafana 4.0](http://docs.grafana.org/guides/whats-new-in-v4/)
- [What's New in Grafana 4.1](http://docs.grafana.org/guides/whats-new-in-v4-1/)
## Features
### Graphite Target Editor
@@ -79,7 +80,7 @@ the latest master builds [here](http://grafana.org/builds)
### Dependencies
- Go 1.7.3
- Go 1.8
- NodeJS v4+
### Get Code
@@ -109,11 +110,12 @@ go run build.go build
### Building frontend assets
To build less to css for the frontend you will need a recent version of **node (v4+)**,
To build less to css for the frontend you will need a recent version of **node (v6+)**,
npm (v2.5.0) and grunt (v0.4.5). Run the following:
```bash
npm install
npm install -g yarn
yarn install --pure-lockfile
npm run build
```
@@ -155,10 +157,6 @@ If you have any idea for an improvement or found a bug do not hesitate to open a
And if you have time clone this repo and submit a pull request and help me make Grafana
the kickass metrics & devops dashboard we all dream about!
Before creating a pull request be sure that "grunt test" runs without any style or unit test errors, also
please [sign the CLA](http://docs.grafana.org/project/cla/)
## License
Grafana is distributed under Apache 2.0 License.
Work in progress Grafana 2.0 (with included Grafana backend)
+19 -4
View File
@@ -5,14 +5,19 @@ os: Windows Server 2012 R2
clone_folder: c:\gopath\src\github.com\grafana\grafana
environment:
nodejs_version: "5"
nodejs_version: "6"
GOPATH: c:\gopath
GOVERSION: 1.8
install:
- rmdir c:\go /s /q
# install nodejs and npm
- ps: Install-Product node $env:nodejs_version
- npm install
- npm install -g yarn --silent
- yarn install --pure-lockfile --no-progress
- npm install -g grunt-cli
- appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.zip
- 7z x go%GOVERSION%.windows-amd64.zip -y -oC:\ > NUL
# install gcc (needed for sqlite3)
- choco install -y --limit-output mingw
- set PATH=C:\tools\mingw64\bin;%PATH%
@@ -20,7 +25,7 @@ install:
- echo %GOPATH%
- go version
- go env
- go run build.go setup
# - go run build.go setup
build_script:
- go run build.go build
@@ -31,7 +36,17 @@ build_script:
artifacts:
- path: grafana-*windows-*.*
name: binzip
type: zip
deploy:
- provider: Environment
name: GrafanaBuildsS3
name: GrafanaReleaseMaster
on:
buildType: master
- provider: Environment
name: GrafanaReleaseRelease
on:
buildType: release
+6 -5
View File
@@ -15,11 +15,12 @@
"dependencies": {
"jquery": "3.1.0",
"lodash": "4.15.0",
"angular": "1.5.8",
"angular-route": "1.5.8",
"angular-mocks": "1.5.8",
"angular-sanitize": "1.5.8",
"angular": "1.6.1",
"angular-route": "1.6.1",
"angular-mocks": "1.6.1",
"angular-sanitize": "1.6.1",
"angular-native-dragdrop": "1.2.2",
"angular-bindonce": "0.3.3"
"angular-bindonce": "0.3.3",
"clipboard": "^1.5.16"
}
}
+38 -30
View File
@@ -37,19 +37,18 @@ var (
race bool
phjsToRelease string
workingDir string
includeBuildNumber bool = true
buildNumber int = 0
binaries []string = []string{"grafana-server", "grafana-cli"}
)
const minGoVersion = 1.7
const minGoVersion = 1.8
func main() {
log.SetOutput(os.Stdout)
log.SetFlags(0)
ensureGoPath()
readVersionFromPackageJson()
log.Printf("Version: %s, Linux Version: %s, Package Iteration: %s\n", version, linuxPackageVersion, linuxPackageIteration)
flag.StringVar(&goarch, "goarch", runtime.GOARCH, "GOARCH")
flag.StringVar(&goos, "goos", runtime.GOOS, "GOOS")
@@ -59,8 +58,14 @@ func main() {
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.IntVar(&buildNumber, "buildNumber", 0, "Build number from CI system")
flag.Parse()
readVersionFromPackageJson()
log.Printf("Version: %s, Linux Version: %s, Package Iteration: %s\n", version, linuxPackageVersion, linuxPackageIteration)
if flag.NArg() == 0 {
log.Println("Usage: go run build.go build")
return
@@ -73,6 +78,10 @@ func main() {
case "setup":
setup()
case "build-cli":
clean()
build("grafana-cli", "./pkg/cmd/grafana-cli", []string{})
case "build":
clean()
for _, binary := range binaries {
@@ -86,24 +95,20 @@ func main() {
case "package":
grunt(gruntBuildArg("release")...)
createLinuxPackages()
sha1FilesInDist()
case "pkg-rpm":
grunt(gruntBuildArg("release")...)
createRpmPackages()
sha1FilesInDist()
case "pkg-deb":
grunt(gruntBuildArg("release")...)
createDebPackages()
sha1FilesInDist()
case "sha1-dist":
sha1FilesInDist()
case "sha1-dist":
sha1FilesInDist()
case "latest":
makeLatestDistCopies()
sha1FilesInDist()
case "clean":
clean()
@@ -153,7 +158,13 @@ func readVersionFromPackageJson() {
}
// add timestamp to iteration
linuxPackageIteration = fmt.Sprintf("%d%s", time.Now().Unix(), linuxPackageIteration)
if includeBuildNumber {
if buildNumber != 0 {
linuxPackageIteration = fmt.Sprintf("%d%s", buildNumber, linuxPackageIteration)
} else {
linuxPackageIteration = fmt.Sprintf("%d%s", time.Now().Unix(), linuxPackageIteration)
}
}
}
type linuxPackageOptions struct {
@@ -163,7 +174,6 @@ type linuxPackageOptions struct {
serverBinPath string
cliBinPath string
configDir string
configFilePath string
ldapFilePath string
etcDefaultPath string
etcDefaultFilePath string
@@ -184,8 +194,6 @@ func createDebPackages() {
homeDir: "/usr/share/grafana",
binPath: "/usr/sbin",
configDir: "/etc/grafana",
configFilePath: "/etc/grafana/grafana.ini",
ldapFilePath: "/etc/grafana/ldap.toml",
etcDefaultPath: "/etc/default",
etcDefaultFilePath: "/etc/default/grafana-server",
initdScriptFilePath: "/etc/init.d/grafana-server",
@@ -206,8 +214,6 @@ func createRpmPackages() {
homeDir: "/usr/share/grafana",
binPath: "/usr/sbin",
configDir: "/etc/grafana",
configFilePath: "/etc/grafana/grafana.ini",
ldapFilePath: "/etc/grafana/ldap.toml",
etcDefaultPath: "/etc/sysconfig",
etcDefaultFilePath: "/etc/sysconfig/grafana-server",
initdScriptFilePath: "/etc/init.d/grafana-server",
@@ -218,7 +224,7 @@ func createRpmPackages() {
defaultFileSrc: "packaging/rpm/sysconfig/grafana-server",
systemdFileSrc: "packaging/rpm/systemd/grafana-server.service",
depends: []string{"initscripts", "fontconfig"},
depends: []string{"/sbin/service", "fontconfig"},
})
}
@@ -252,10 +258,6 @@ func createPackage(options linuxPackageOptions) {
runPrint("cp", "-a", filepath.Join(workingDir, "tmp")+"/.", filepath.Join(packageRoot, options.homeDir))
// remove bin path
runPrint("rm", "-rf", filepath.Join(packageRoot, options.homeDir, "bin"))
// copy sample ini file to /etc/grafana
runPrint("cp", "conf/sample.ini", filepath.Join(packageRoot, options.configFilePath))
// copy sample ldap toml config file to /etc/grafana/ldap.toml
runPrint("cp", "conf/ldap.toml", filepath.Join(packageRoot, options.ldapFilePath))
args := []string{
"-s", "dir",
@@ -265,8 +267,6 @@ func createPackage(options linuxPackageOptions) {
"--url", "http://grafana.org",
"--license", "\"Apache 2.0\"",
"--maintainer", "contact@grafana.org",
"--config-files", options.configFilePath,
"--config-files", options.ldapFilePath,
"--config-files", options.initdScriptFilePath,
"--config-files", options.etcDefaultFilePath,
"--config-files", options.systemdServiceFilePath,
@@ -330,7 +330,12 @@ func grunt(params ...string) {
}
func gruntBuildArg(task string) []string {
args := []string{task, fmt.Sprintf("--pkgVer=%v-%v", linuxPackageVersion, linuxPackageIteration)}
args := []string{task}
if includeBuildNumber {
args = append(args, fmt.Sprintf("--pkgVer=%v-%v", linuxPackageVersion, linuxPackageIteration))
} else {
args = append(args, fmt.Sprintf("--pkgVer=%v", linuxPackageVersion))
}
if pkgArch != "" {
args = append(args, fmt.Sprintf("--arch=%v", pkgArch))
}
@@ -425,14 +430,10 @@ func setBuildEnv() {
}
func getGitSha() string {
v, err := runError("git", "describe", "--always", "--dirty")
v, err := runError("git", "rev-parse", "--short", "HEAD")
if err != nil {
return "unknown-dev"
}
v = versionRe.ReplaceAllFunc(v, func(s []byte) []byte {
s[0] = '+'
return s
})
return string(v)
}
@@ -512,8 +513,15 @@ func md5File(file string) error {
func sha1FilesInDist() {
filepath.Walk("./dist", func(path string, f os.FileInfo, err error) error {
if path == "./dist" {
return nil
}
if strings.Contains(path, ".sha1") == false {
sha1File(path)
err := sha1File(path)
if err != nil {
log.Printf("Failed to create sha file. error: %v\n", err)
}
}
return nil
})
+33 -8
View File
@@ -1,31 +1,56 @@
machine:
node:
version: 5.11.1
version: 6.9.2
python:
version: 2.7.3
services:
- docker
environment:
GOPATH: "/home/ubuntu/.go_workspace"
ORG_PATH: "github.com/grafana"
REPO_PATH: "${ORG_PATH}/grafana"
GODIST: "go1.7.3.linux-amd64.tar.gz"
GODIST: "go1.8.linux-amd64.tar.gz"
post:
- mkdir -p download
- mkdir -p ~/download
- mkdir -p ~/docker
- test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST
- sudo rm -rf /usr/local/go
- sudo tar -C /usr/local -xzf download/$GODIST
dependencies:
cache_directories:
- "~/docker"
- "~/download"
override:
- rm -rf ${GOPATH}/src/${REPO_PATH}
- mkdir -p ${GOPATH}/src/${ORG_PATH}
- cp -r ~/grafana ${GOPATH}/src/${ORG_PATH}
pre:
- pip install awscli
- sudo apt-get update; sudo apt-get install rpm; sudo apt-get install expect
- ./scripts/build/build_container.sh
test:
override:
- bash scripts/circle-test.sh
deployment:
v4.0.x:
branch: v4.0.x
owner: grafana
gh_branch:
branch: master
commands:
- ./scripts/trigger_grafana_packer.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN}
- ./scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN}
- ./scripts/build/deploy.sh
- ./scripts/build/sign_packages.sh
- go run build.go sha1-dist
- aws s3 sync ./dist s3://$BUCKET_NAME/master
- ./scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} master
- ./scripts/trigger_docker_build.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN}
gh_tag:
tag: /^v[0-9]+(\.[0-9]+){2}(-.+|[^-.]*)$/
commands:
- ./scripts/build/deploy.sh
- ./scripts/build/sign_packages.sh
- go run build.go sha1-dist
- aws s3 sync ./dist s3://$BUCKET_NAME/release
- ./scripts/trigger_windows_build.sh ${APPVEYOR_TOKEN} ${CIRCLE_SHA1} release
+25 -6
View File
@@ -67,11 +67,17 @@ type = sqlite3
host = 127.0.0.1:3306
name = grafana
user = root
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
password =
# Use either URL or the previous fields to configure the database
# Example: mysql://user:secret@host:port/database
url =
# Max conn setting default is 0 (mean not set)
max_conn =
max_idle_conn =
max_open_conn =
# For "postgres", use either "disable", "require" or "verify-full"
# For "mysql", use either "true", "false", or "skip-verify".
ssl_mode = disable
@@ -112,6 +118,12 @@ cookie_secure = false
session_life_time = 86400
gc_interval_time = 86400
#################################### Data proxy ###########################
[dataproxy]
# This enables data proxy logging, default is false
logging = false
#################################### Analytics ###########################
[analytics]
# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
@@ -208,7 +220,7 @@ org_role = Viewer
#################################### Github Auth #########################
[auth.github]
enabled = false
allow_sign_up = false
allow_sign_up = true
client_id = some_id
client_secret = some_secret
scopes = user:email
@@ -221,7 +233,7 @@ allowed_organizations =
#################################### Google Auth #########################
[auth.google]
enabled = false
allow_sign_up = false
allow_sign_up = true
client_id = some_client_id
client_secret = some_client_secret
scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
@@ -234,7 +246,7 @@ hosted_domain =
#################################### Grafana.net Auth ####################
[auth.grafananet]
enabled = false
allow_sign_up = false
allow_sign_up = true
client_id = some_id
client_secret = some_secret
scopes = user:email
@@ -242,8 +254,9 @@ allowed_organizations =
#################################### Generic OAuth #######################
[auth.generic_oauth]
name = OAuth
enabled = false
allow_sign_up = false
allow_sign_up = true
client_id = some_id
client_secret = some_secret
scopes = user:email
@@ -263,6 +276,8 @@ enabled = false
header_name = X-WEBAUTH-USER
header_property = username
auto_sign_up = true
ldap_sync_ttl = 60
whitelist =
#################################### Auth LDAP ###########################
[auth.ldap]
@@ -275,11 +290,13 @@ allow_sign_up = true
enabled = false
host = localhost:25
user =
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
password =
cert_file =
key_file =
skip_verify = false
from_address = admin@grafana.localhost
from_name = Grafana
[emails]
welcome_email_on_sign_up = false
@@ -289,7 +306,7 @@ templates_pattern = emails/*.html
[log]
# Either "console", "file", "syslog". Default is console and file
# Use space to separate multiple modes, e.g. "console file"
mode = console, file
mode = console file
# Either "debug", "info", "warn", "error", "critical", default is "info"
level = info
@@ -391,7 +408,9 @@ global_session = -1
#################################### Alerting ############################
[alerting]
# Makes it possible to turn off alert rule execution.
# Disable alerting engine & UI features
enabled = true
# Makes it possible to turn off alert rule execution but alerting UI is visible
execute_alerts = true
#################################### Internal Grafana Metrics ############
+4 -2
View File
@@ -1,5 +1,6 @@
# Set to true to log user information returned from LDAP
verbose_logging = false
# To troubleshoot and get more log info enable ldap debug logging in grafana.ini
# [log]
# filters = ldap:debug
[[servers]]
# Ldap server host (specify multiple hosts space separated)
@@ -18,6 +19,7 @@ ssl_skip_verify = false
# Search user bind dn
bind_dn = "cn=admin,dc=grafana,dc=org"
# Search user bind password
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
bind_password = 'grafana'
# User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)"
+28 -7
View File
@@ -69,6 +69,7 @@
;host = 127.0.0.1:3306
;name = grafana
;user = root
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
;password =
# Use either URL or the previous fields to configure the database
@@ -81,6 +82,12 @@
# For "sqlite3" only, path relative to data_path setting
;path = grafana.db
# Max conn setting default is 0 (mean not set)
;max_conn =
;max_idle_conn =
;max_open_conn =
#################################### Session ####################################
[session]
# Either "memory", "file", "redis", "mysql", "postgres", default is "file"
@@ -103,6 +110,13 @@
# Session life time, default is 86400
;session_life_time = 86400
#################################### Data proxy ###########################
[dataproxy]
# This enables data proxy logging, default is false
;logging = false
#################################### Analytics ####################################
[analytics]
# Server reporting, sends usage counters to stats.grafana.org every 24 hours.
@@ -193,7 +207,7 @@
#################################### Github Auth ##########################
[auth.github]
;enabled = false
;allow_sign_up = false
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = user:email,read:org
@@ -206,7 +220,7 @@
#################################### Google Auth ##########################
[auth.google]
;enabled = false
;allow_sign_up = false
;allow_sign_up = true
;client_id = some_client_id
;client_secret = some_client_secret
;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email
@@ -218,7 +232,8 @@
#################################### Generic OAuth ##########################
[auth.generic_oauth]
;enabled = false
;allow_sign_up = false
;name = OAuth
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = user:email,read:org
@@ -231,7 +246,7 @@
#################################### Grafana.net Auth ####################
[auth.grafananet]
;enabled = false
;allow_sign_up = false
;allow_sign_up = true
;client_id = some_id
;client_secret = some_secret
;scopes = user:email
@@ -243,6 +258,8 @@
;header_name = X-WEBAUTH-USER
;header_property = username
;auto_sign_up = true
;ldap_sync_ttl = 60
;whitelist = 192.168.1.1, 192.168.2.1
#################################### Basic Auth ##########################
[auth.basic]
@@ -259,11 +276,13 @@
;enabled = false
;host = localhost:25
;user =
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
;password =
;cert_file =
;key_file =
;skip_verify = false
;from_address = admin@grafana.localhost
;from_name = Grafana
[emails]
;welcome_email_on_sign_up = false
@@ -272,7 +291,7 @@
[log]
# Either "console", "file", "syslog". Default is console and file
# Use space to separate multiple modes, e.g. "console file"
;mode = console, file
;mode = console file
# Either "trace", "debug", "info", "warn", "error", "critical", default is "info"
;level = info
@@ -338,9 +357,11 @@
;enabled = false
;path = /var/lib/grafana/dashboards
#################################### Alerting ######################################
#################################### Alerting ############################
[alerting]
# Makes it possible to turn off alert rule execution.
# Disable alerting engine & UI features
;enabled = true
# Makes it possible to turn off alert rule execution but alerting UI is visible
;execute_alerts = true
#################################### Internal Grafana Metrics ##########################
+2
View File
@@ -0,0 +1,2 @@
script.inline: on
script.indexed: on
+8
View File
@@ -0,0 +1,8 @@
elasticsearch1:
image: elasticsearch:1.7.6
command: elasticsearch -Des.network.host=0.0.0.0
ports:
- "11200:9200"
- "11300:9300"
volumes:
- ./blocks/elastic/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
+2 -2
View File
@@ -4,5 +4,5 @@ elasticsearch5:
image: elasticsearch:5
command: elasticsearch
ports:
- "9200:9200"
- "9300:9300"
- "10200:9200"
- "10300:9300"
-16
View File
@@ -1,16 +0,0 @@
FROM debian:jessie
RUN apt-get -y update
RUN apt-get -y install libfontconfig
RUN mkdir -p /opt/grafana
ADD tmp/ /opt/grafana/
EXPOSE 3000
VOLUME ["/opt/grafana/data"]
VOLUME ["/opt/grafana/conf"]
WORKDIR /opt/grafana/
ENTRYPOINT ["./grafana", "web"]
-31
View File
@@ -1,31 +0,0 @@
# Grafana docker image
This container currently only contains the in development alpha of Grafana 2.0 (ie non production use). The
`#develop` tag is constantly updated as we make progress towards a beta release.
## Running your Grafana image
--------------------------
Start your image binding the external port `3000`.
docker run -i -p 3000:3000 grafana/grafana
Try it out, default admin user is admin/admin.
## Configuring your Grafana container
All options defined in conf/grafana.ini can be overridden using environment variables, for example:
```
docker run -i -p 3000:3000 \
-e "GF_SERVER_ROOT_URL=http://grafana.server.name" \
-e "GF_SECURITY_ADMIN_PASSWORD=secret" \
grafana/grafana:develop
```
-15
View File
@@ -1,15 +0,0 @@
#!/bin/bash
cp Dockerfile ../../
cd ../../
go run build.go build
grunt release
docker build --tag "grafana/grafana:develop" .
rm Dockerfile
cd docker/production
-5
View File
@@ -1,5 +0,0 @@
#!/bin/bash
docker run -i -p 3001:3000 \
-e "GF_SERVER_ROOT_URL=http://grafana.server.name" \
grafana/grafana:develop
+4 -30
View File
@@ -6,14 +6,13 @@ and the [mkdocs](http://www.mkdocs.org/) tool.
**Prepare the Docker Image**:
Build the `grafana/docs-base:latest` image. Run these commands in the
same directory this file is in. **Note** that you may require ``sudo``
Git clone `grafana/grafana.org` repo. Run these commands in the root of that repo. **Note** that you may require ``sudo``
when running ``make docs-build`` depending on how your system's docker
service is configured):
```
$ git clone https://github.com/grafana/docs-base
$ cd docs-base
$ git clone https://github.com/grafana/grafana.org
$ cd grafana.org
$ make docs-build
```
@@ -31,31 +30,6 @@ This command will not return control of the shell to the user. Instead
the command is now running a new docker container built from the image
we created in the previous step.
Open [localhost:8180](http://localhost:8180) to view the docs.
**Note** that after running ``make docs`` you may notice a message
like this in the console output
> Running at: http://0.0.0.0:8000/
This is misleading. That is **not** the port the documentation is
served from. You must browse to port **8180** to view the new
documentation.
Open [localhost:3004](http://localhost:3004) to view the docs.
# Adding a New Page
Adding a new page requires updating the ``mkdocs.yml`` file which is
located in this directory.
For example, if you are adding documentation for a new HTTP API called
``preferences`` you would:
1. Create the file ``docs/sources/http_api/preferences.md``
1. Add a reference to it in ``docs/sources/http_api/overview.md``
1. Update the list under the **pages** key in the ``docs/mkdocs.yml`` file with a reference to your new page:
```yaml
- ['http_api/preferences.md', 'API', 'Preferences API']
```
-102
View File
@@ -1,102 +0,0 @@
site_name: Grafana Documentation
site_url: /
site_description: Documentation for Grafana, The Graphite and Influxdb dashboard and graph composer
site_favicon: img/fav32.png
dev_addr: '0.0.0.0:8000'
repo_url: https://github.com/grafana/grafana/
docs_dir: sources
include_search: true
use_absolute_urls: true
# theme: docker
theme_dir: ./theme/mkdocs/
theme_center_lead: false
copyright: Copyright &copy; 2014-2015, Coding Instinct AB.
google_analytics: ['UA-47280256-1', 'grafana.org']
pages:
# Introduction:
# - ['index.md', 'Project', 'About Grafana']
# - ['project/cla.md', 'Project', 'Contributor License Agreement']
- ['index.md', '**HIDDEN**']
- ['installation/index.md', 'Installation', 'Installation']
- ['installation/debian.md', 'Installation', 'Installing on Debian / Ubuntu']
- ['installation/rpm.md', 'Installation', 'Installing on RPM-based Linux']
- ['installation/mac.md', 'Installation', 'Installing on Mac OS X']
- ['installation/windows.md', 'Installation', 'Installing on Windows']
- ['installation/docker.md', 'Installation', 'Installing on Docker']
- ['project/building_from_source.md', 'Installation', 'Building from Source']
- ['installation/configuration.md', 'Installation', 'Configuration']
- ['installation/ldap.md', 'Installation', 'LDAP Integration']
- ['installation/provisioning.md', 'Installation', 'Provisioning']
- ['installation/performance.md', 'Installation', 'Performance Tips']
- ['installation/troubleshooting.md', 'Installation', 'Troubleshooting']
- ['installation/migrating_to2.md', 'Installation', 'Migrating from v1.x to v2.x']
- ['installation/behind_proxy.md', 'Installation', 'Grafana behind reverse proxy']
- ['guides/basic_concepts.md', 'User Guides', 'Basic Concepts']
- ['guides/gettingstarted.md', 'User Guides', 'Getting Started']
- ['guides/whats-new-in-v3-1.md', 'User Guides', "What's New in Grafana v3.1"]
- ['guides/whats-new-in-v3.md', 'User Guides', "What's New in Grafana v3.0"]
- ['guides/whats-new-in-v2-6.md', 'User Guides', "What's New in Grafana v2.6"]
- ['guides/whats-new-in-v2-5.md', 'User Guides', "What's New in Grafana v2.5"]
- ['guides/whats-new-in-v2-1.md', 'User Guides', "What's New in Grafana v2.1"]
- ['guides/whats-new-in-v2.md', 'User Guides', "What's New in Grafana v2.0"]
- ['guides/screencasts.md', 'User Guides', 'Screencasts']
- ['reference/graph.md', 'Reference', 'Graph Panel']
- ['reference/singlestat.md', 'Reference', 'Singlestat Panel']
- ['reference/table_panel.md', 'Reference', 'Table Panel']
- ['reference/dashlist.md', 'Reference', 'Dashboard List Panel']
- ['reference/sharing.md', 'Reference', 'Sharing']
- ['reference/annotations.md', 'Reference', 'Annotations']
- ['reference/timerange.md', 'Reference', 'Time Range']
- ['reference/search.md', 'Reference', 'Search']
- ['reference/templating.md', 'Reference', 'Templating']
- ['reference/scripting.md', 'Reference', 'Scripting']
- ['reference/playlist.md', 'Reference', 'Playlist']
- ['reference/export_import.md', 'Reference', 'Import & Export']
- ['reference/admin.md', 'Reference', 'Administration']
- ['reference/keyboard_shortcuts.md', 'Reference', 'Keyboard Shortcuts']
- ['datasources/overview.md', 'Data Sources', 'Overview']
- ['datasources/graphite.md', 'Data Sources', 'Graphite']
- ['datasources/elasticsearch.md', 'Data Sources', 'Elasticsearch']
- ['datasources/cloudwatch.md', 'Data Sources', 'CloudWatch']
- ['datasources/influxdb.md', 'Data Sources', 'InfluxDB']
- ['datasources/opentsdb.md', 'Data Sources', 'OpenTSDB']
- ['datasources/kairosdb.md', 'Data Sources', 'KairosDB']
- ['datasources/prometheus.md', 'Data Sources', 'Prometheus']
- ['http_api/overview.md', 'API', 'Overview']
- ['http_api/auth.md', 'API', 'Authentication API']
- ['http_api/dashboard.md', 'API', 'Dashboard API']
- ['http_api/data_source.md', 'API', 'Data Source API']
- ['http_api/org.md', 'API', 'Organisation API']
- ['http_api/user.md', 'API', 'User API']
- ['http_api/admin.md', 'API', 'Admin API']
- ['http_api/snapshot.md', 'API', 'Snapshot API']
- ['http_api/preferences.md', 'API', 'Preferences API']
- ['http_api/other.md', 'API', 'Other API']
- ['plugins/index.md', 'Plugins', 'Overview']
- ['plugins/installation.md', 'Plugins', 'Installation']
- ['plugins/development.md', 'Plugins', 'Development']
- ['plugins/apps.md', 'Plugins', 'Apps']
- ['plugins/datasources.md', 'Plugins', 'Datasources']
- ['plugins/panels.md', 'Plugins', 'Panels']
- ['tutorials/index.md', 'Tutorials', 'Tutorials']
- ['tutorials/hubot_howto.md', 'Tutorials', 'How To integrate Hubot and Grafana']
- ['jsearch.md', '**HIDDEN**']
+32
View File
@@ -0,0 +1,32 @@
+++
title = "Grafana CLI"
description = "Guide to using grafana-cli"
keywords = ["grafana", "cli", "grafana-cli", "command line interface"]
type = "docs"
[menu.docs]
parent = "admin"
weight = 8
+++
# Grafana CLI
Grafana cli is a small executable that is bundled with grafana server and is suppose to be executed on the same machine as grafana runs.
## Plugins
The CLI helps you install, upgrade and manage your plugins on the same machine it CLI is running.
You can find more information about how to install and manage your plugins at the
[plugin page]({{< relref "plugins/installation.md" >}}).
## Admin
> This feature is only available in grafana 4.1 and above.
To show all admin commands:
`grafana-cli admin`
### Reset admin password
You can reset the password for the admin user using the CLI.
`grafana-cli admin reset-admin-password ...`
+1 -1
View File
@@ -13,7 +13,7 @@ weight = 2
> Alerting is only available in Grafana v4.0 and above.
The alert engine publish some internal metrics about itself. You can read more about how Grafana published [interal metrics](/installation/configuration/#metrics)
The alert engine publishes some internal metrics about itself. You can read more about how Grafana published [internal metrics](/installation/configuration/#metrics).
Description | Type | Metric name
---------- | ----------- | ----------
+2 -1
View File
@@ -69,6 +69,7 @@ Example json body:
"ruleUrl": "http://url.to.grafana/db/dashboard/my_dashboard?panelId=2",
"state": "Alerting",
"imageUrl": "http://s3.image.url",
"message": "Load is peaking. Make sure the traffic is real and spin up more webfronts",
"evalMatches": [
{
"metric": "requests",
@@ -91,7 +92,7 @@ Auto resolve incidents | Resolve incidents in pagerduty once the alert goes back
# Enable images in notifications {#external-image-store}
Grafan can render the panel associated with the alert rule and include that in the notification. Some types
Grafana can render the panel associated with the alert rule and include that in the notification. Some types
of notifications require that this image be publicly accessable (Slack for example). In order to support
images in notifications like Slack Grafana can upload the image to an image store. It currently supports
Amazon S3 for this and Webdav. So to set that up you need to configure the
+1 -1
View File
@@ -33,7 +33,7 @@ of core Grafana. Only some data soures are supported right now. They include `Gr
### Clustering
We have not implemented clustering yet. So if you run multiple instances of grafana-server
you have to make sure [execute_alerts]({{< relref "/installation/configuration.md#alerting" >}})
you have to make sure [execute_alerts]({{< relref "installation/configuration.md#alerting" >}})
is true on only one instance or otherwise you will get duplicated notifications.
<div class="clearfix"></div>
+104
View File
@@ -0,0 +1,104 @@
+++
title = "Contributor Licence Agreement (CLA)"
description = "Contributer Licence Agreement (CLA)"
type = "docs"
aliases = ["/project/cla"]
[menu.docs]
parent = "contribute"
weight = 1
+++
# Grafana Labs Contributor License Agreement
Thank you for your interest in contributing to Grafana Labs ("We" or "Us").
This contributor agreement ("Agreement") documents the rights granted by contributors to Us.
To make this document effective, please sign it following the instructions at
[cla-assistant](https://cla-assistant.io/grafana/grafana). This is a legally binding document,
so please read it carefully before agreeing to it. The Agreement may cover more than
one software project managed by Us.
## 1. Definitions
"You" (Individual) means the individual who Submits a Contribution to Us.
"You" (Entity) means any Legal Entity on behalf of whom a Contribution has been received by Us. "Legal Entity" means an entity which is not a natural person. "Affiliates" means other Legal Entities that control, are controlled by, or under common control with that Legal Entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such Legal Entity, whether by contract or otherwise, (ii) ownership of fifty percent (50%) or more of the outstanding shares or securities which vote to elect the management or other persons who direct such Legal Entity or (iii) beneficial ownership of such entity.
"Contribution" means any work of authorship that is Submitted by You to Us in which You own or assert ownership of the Copyright. If You do not own the Copyright in the entire work of authorship, you must notify us at contact@grafana.com before Submitting such a Contribution.
"Copyright" means all rights protecting works of authorship owned or controlled by You [or Your Affiliates], including copyright, moral and neighboring rights, as appropriate, for the full term of their existence including any extensions by You.
"Material" means the work of authorship which is made available by Us to third parties. When this Agreement covers more than one software project, the Material means the work of authorship to which the Contribution was Submitted. After You Submit the Contribution, it may be included in the Material.
"Submit" means any form of electronic, verbal, or written communication sent to Us or our representatives, including but not limited to electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Us for the purpose of discussing and improving the Material, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
"Submission Date" means the date on which You Submit a Contribution to Us.
"Effective Date" means the date You execute this Agreement or the date You first Submit a Contribution to Us, whichever is earlier.
"Media" means any portion of a Contribution which is not software.
## 2. Grant of Rights
### 2.1 Copyright License
(a) You retain ownership of the Copyright in Your Contribution and have the same rights to use or license the Contribution which You would have had without entering into the Agreement.
(b) To the maximum extent permitted by the relevant law, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable license under the Copyright covering the Contribution, with the right to sublicense such rights through multiple tiers of sublicensees, to reproduce, modify, display, perform and distribute the Contribution as part of the Material; provided that this license is conditioned upon compliance with Section 2.3.
### 2.2 Patent License
For patent claims including, without limitation, method, process, and apparatus claims which You [or Your Affiliates] own, control or have the right to grant, now or in the future, You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable patent license, with the right to sublicense these rights to multiple tiers of sublicensees, to make, have made, use, sell, offer for sale, import and otherwise transfer the Contribution and the Contribution in combination with the Material (and portions of such combination). This license is granted only to the extent that the exercise of the licensed rights infringes such patent claims; and provided that this license is conditioned upon compliance with Section 2.3.
### 2.3 Outbound License
As a condition on the grant of rights in Sections 2.1 and 2.2, We agree to license the Contribution only under the terms of the license or licenses which We are using on the Submission Date for the Material or any licenses which are approved by the Open Source Initiative on or after the Effective Date, including both permissive and copyleft licenses, whether or not such licenses are subsequently disapproved (including any right to adopt any future version of a license if permitted).
In addition, We may use the following licenses for Media in the Contribution: GNU Free Documentation License v1.3, Creative Commons Attribution 3.0, or Creative Commons Attribution No Derivatives 3.0 (including any right to adopt any future version of a license if permitted).
2.4 Moral Rights. If moral rights apply to the Contribution, to the maximum extent permitted by law, You waive and agree not to assert such moral rights against Us or our successors in interest, or any of our licensees, either direct or indirect.
2.5 Our Rights. You acknowledge that We are not obligated to use Your Contribution as part of the Material and may decide to include any Contribution We consider appropriate.
2.6 Reservation of Rights. Any rights not expressly [assigned or] licensed under this section are expressly reserved by You.
## 3. Agreement
You confirm that:
(a) You have the legal authority to enter into this Agreement.
(b) You [or Your Affiliates] own the Copyright and patent claims covering the Contribution which are required to grant the rights under Section 2.
\(c)(Individual) The grant of rights under Section 2 does not violate any grant of rights which You have made to third parties, including Your employer. If You are an employee, You have had Your employer approve this Agreement or sign the Entity version of this document. If You are less than eighteen years old, please have Your parents or guardian sign the Agreement.
\(c)(Entity) The grant of rights under Section 2 does not violate any grant of rights which You or Your Affiliates have made to third parties.
## 4. Disclaimer
EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED "AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US [AND BY US TO YOU]. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW.
## 5. Consequential Damage Waiver
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU [OR US] BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED.
## 6. Miscellaneous
6.1 This Agreement will be governed by and construed in accordance with the laws of New York State, United States excluding its conflicts of law provisions. Under certain circumstances, the governing law in this section might be superseded by the United Nations Convention on Contracts for the International Sale of Goods ("UN Convention") and the parties intend to avoid the application of the UN Convention to this Agreement and, thus, exclude the application of the UN Convention in its entirety to this Agreement.
6.2 This Agreement sets out the entire agreement between You and Us for Your Contributions to Us and overrides all other agreements or understandings.
6.3 If You or We assign the rights or obligations received through this Agreement to a third party, as a condition of the assignment, that third party must agree in writing to abide by all the rights and obligations in the Agreement.
6.4 The failure of either party to require performance by the other party of any provision of this Agreement in one situation shall not affect the right of a party to require such performance at any time in the future. A waiver of performance under a provision in one situation shall not be considered a waiver of the performance of the provision in the future or a waiver of the provision in its entirety.
6.5 If any provision of this Agreement is found void and unenforceable, such provision will be replaced to the extent possible with a provision that comes closest to the meaning of the original provision and which is enforceable. The terms and conditions set forth in this Agreement shall apply notwithstanding any failure of essential purpose of this Agreement or any limited remedy to the maximum extent possible under law.
### Sign using CLA-Assistant
[https://cla-assistant.io/grafana/grafana](https://cla-assistant.io/grafana/grafana)
<br>
<br>
<br>
This CLA aggreement is based on the [Harmony Contributor Aggrement Template (combined)](http://www.harmonyagreements.org/agreements.html), [Creative Commons Attribution 3.0 Unported License](https://creativecommons.org/licenses/by/3.0/)
+12
View File
@@ -0,0 +1,12 @@
+++
title = "Contribute"
description = "Contribute"
type = "docs"
[menu.docs]
name = "Contribute"
identifier = "contribute"
weight = 20
+++
### Contribute info
-52
View File
@@ -1,52 +0,0 @@
---
page_title: KairosDB Guide
page_description: KairosDB guide for Grafana
page_keywords: grafana, kairosdb, documentation
---
# KairosDB Guide
Grafana v2.1 brings initial support for KairosDB Datasources. While the process of adding the datasource is similar to adding a Graphite or OpenTSDB datasource type, Kairos DB does have a few different options for building queries.
## Adding the data source to Grafana
![](/img/v2/add_KairosDB.jpg)
1. Open the side menu by clicking the the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
> NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization.
3. Click the `Add new` link in the top header.
4. Select `KairosDB` from the dropdown.
Name | Description
------------ | -------------
Name | The data source name, important that this is the same as in Grafana v1.x if you plan to import old dashboards.
Default | Default data source means that it will be pre-selected for new panels.
Url | The http protocol, ip and port of your kairosdb server (default port is usually 8080)
Access | Proxy = access via Grafana backend, Direct = access directly from browser.
## Query editor
Open a graph in edit mode by click the title.
![](/img/v2/kairos_query_editor.jpg)
For details on KairosDB metric queries checkout the official.
- [Query Metrics - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/QueryMetrics.html).
## Templated queries
KairosDB Datasource Plugin provides following functions in `Variables values query` field in Templating Editor to query `metric names`, `tag names`, and `tag values` to kairosdb server.
Name | Description
| ------- | --------|
`metrics(query)` | Returns a list of metric names matching `query`. If nothing is given, returns a list of all metric names.
`tag_names(query)` | Returns a list of tag names matching `query`. If nothing is given, returns a list of all tag names.
`tag_values(metric,tag)` | Returns a list of values for `tag` from the given `metric`.
For details of `metric names`, `tag names`, and `tag values`, please refer to the KairosDB documentations.
- [List Metric Names - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/ListMetricNames.html)
- [List Tag Names - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/ListTagNames.html)
- [List Tag Values - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/ListTagValues.html)
- [Query Metrics - KairosDB 0.9.4 documentation](http://kairosdb.github.io/kairosdocs/restapi/QueryMetrics.html).
-34
View File
@@ -1,34 +0,0 @@
----
page_title: Data source Plugin API
page_description: Data Source Plugin Description
page_keywords: grafana, data source, plugin, api, docs
---
# Data source plugin API
All data sources in Grafana are implemented as plugins.
## Breaking change in 2.2
In Grafana 2.2 a breaking change was introduced for how data source query editors
are structured, defined and loaded. This was in order to support mixing multiple data sources
in the same panel.
In Grafana 2.2, the query editor is no longer defined using the partials section in
`plugin.json`, but defined via an angular directive named using convention naming
scheme like `metricQueryEditor<data source type name>`. For example
Graphite defines a directive like this:
```javascript
module.directive('metricQueryEditorGraphite', function() {
return {controller: 'GraphiteQueryCtrl', templateUrl: 'app/plugins/datasource/graphite/partials/query.editor.html'};
});
```
Even though the data source type name is with lowercase `g`, the directive uses capital `G` in `Graphite` because
that is how angular directives needs to be named in order to match an element with name `<metric-query-editor-graphite />`.
You also specify the query controller here instead of in the query.editor.html partial like before.
@@ -3,6 +3,7 @@ title = "AWS CloudWatch"
description = "Guide for using CloudWatch in Grafana"
keywords = ["grafana", "cloudwatch", "guide"]
type = "docs"
aliases = ["/datasources/cloudwatch"]
[menu.docs]
name = "AWS Cloudwatch"
identifier = "cloudwatch"
@@ -71,7 +72,7 @@ Name | Description
------- | --------
`regions()` | Returns a list of regions AWS provides their service.
`namespaces()` | Returns a list of namespaces CloudWatch support.
`metrics(namespace)` | Returns a list of metrics in the namespace.
`metrics(namespace, [region])` | Returns a list of metrics in the namespace. (specify region for custom metrics)
`dimension_keys(namespace)` | Returns a list of dimension keys in the namespace.
`dimension_values(region, namespace, metric, dimension_key)` | Returns a list of dimension values matching the specified `region`, `namespace`, `metric` and `dimension_key`.
`ebs_volume_ids(region, instance_id)` | Returns a list of volume id matching the specified `region`, `instance_id`.
@@ -3,6 +3,7 @@ title = "Using Elasticsearch in Grafana"
description = "Guide for using Elasticsearch in Grafana"
keywords = ["grafana", "elasticsearch", "guide"]
type = "docs"
aliases = ["/datasources/elasticsearch"]
[menu.docs]
name = "Elasticsearch"
parent = "datasources"
@@ -3,6 +3,7 @@ title = "Using Graphite in Grafana"
description = "Guide for using graphite in Grafana"
keywords = ["grafana", "graphite", "guide"]
type = "docs"
aliases = ["/datasources/graphite"]
[menu.docs]
name = "Graphite"
identifier = "graphite"
@@ -9,13 +9,16 @@ weight = 5
+++
# Data Source Overview
Grafana supports many different storage backends for your time series data (Data Source). Each Data Source has a specific Query Editor that is customized for the features and capabilities that the particular Data Source exposes.
## Querying
The query language and capabilities of each Data Source are obviously very different. You can combine data from multiple Data Sources onto a single Dashboard, but each Panel is tied to a specific Data Source that belongs to a particular Organization.
## Supported Data Sources
The following datasources are officially supported:
* [Graphite]({{< relref "graphite.md" >}})
@@ -3,6 +3,7 @@ title = "Using InfluxDB in Grafana"
description = "Guide for using InfluxDB in Grafana"
keywords = ["grafana", "influxdb", "guide"]
type = "docs"
aliases = ["/datasources/influxdb"]
[menu.docs]
name = "InfluxDB"
parent = "datasources"
@@ -11,7 +12,7 @@ weight = 3
# Using InfluxDB in Grafana
Grafana ships with very a feature data source plugin for InfluxDB. Supporting a feature rich query editor, annotation and templating queries.
Grafana ships with very feature rich data source plugin for InfluxDB. Supporting a feature rich query editor, annotation and templating queries.
## Adding the data source
![](/img/docs/v2/add_Influx.jpg)
@@ -22,7 +23,6 @@ Grafana ships with very a feature data source plugin for InfluxDB. Supporting a
> NOTE: If this link is missing in the side menu it means that your current user does not have the `Admin` role for the current organization.
3. Click the `Add new` link in the top header.
4. Select `InfluxDB 0.9.x` or `InfluxDB 0.8.x` from the dropdown.
Name | Description
------------ | -------------
@@ -3,6 +3,7 @@ title = "Using OpenTSDB in Grafana"
description = "Guide for using OpenTSDB in Grafana"
keywords = ["grafana", "opentsdb", "guide"]
type = "docs"
aliases = ["/datasources/opentsdb"]
[menu.docs]
name = "OpenTSDB"
parent = "datasources"
@@ -3,6 +3,7 @@ title = "Using Prometheus in Grafana"
description = "Guide for using Prometheus in Grafana"
keywords = ["grafana", "prometheus", "guide"]
type = "docs"
aliases = ["/datasources/prometheus"]
[menu.docs]
name = "Prometheus"
parent = "datasources"
@@ -15,7 +16,8 @@ weight = 2
Grafana includes support for Prometheus Datasources. While the process of adding the datasource is similar to adding a Graphite or OpenTSDB datasource type, Prometheus does have a few different options for building queries.
## Adding the data source to Grafana
![](/img/v2/add_Prometheus.png)
![](/img/docs/v2/add_Prometheus.png)
1. Open the side menu by clicking the the Grafana icon in the top header.
2. In the side menu under the `Dashboards` link you should find a link named `Data Sources`.
@@ -48,6 +50,7 @@ For details on Prometheus metric queries check out the Prometheus documentation
- [Query Metrics - Prometheus documentation](http://prometheus.io/docs/querying/basics/).
## Templated queries
Prometheus Datasource Plugin provides the following functions in `Variables values query` field in Templating Editor to query `metric names` and `labels names` on the Prometheus server.
Name | Description
@@ -64,12 +67,17 @@ For details of `metric names` & `label names`, and `label values`, please refer
You can create a template variable in Grafana and have that variable filled with values from any Prometheus metric exploration query.
You can then use this variable in your Prometheus metric queries.
For example you can have a variable that contains all values for label `hostname` if you specify a query like this
in the templating edit view.
For example you can have a variable that contains all values for label `hostname` if you specify a query like this in the templating edit view.
```sql
label_values(hostname)
```
You can also use raw queries & regular expressions to extract anything you might need.
![](/img/v2/prometheus_templating.png)
### Using templated variables in queries
When the `Include All` option or `Multi-Value` option is enabled, Grafana converts the labels from plain text to a regex compatible string.
Which means you have to use `=~` instead of `=` in your Prometheus queries. For example `ALERTS{instance=~$instance}` instead of `ALERTS{instance=$instance}`.
![](/img/docs/v2/prometheus_templating.png)
@@ -0,0 +1,54 @@
+++
title = "TestData"
keywords = ["grafana", "dashboard", "documentation", "panels", "testdata"]
type = "docs"
[menu.docs]
name = "TestData"
parent = "datasources"
weight = 20
+++
# Grafana TestData
> NOTE: This plugin is disable by default.
The purpose of this data sources is to make it easier to create fake data for any panel.
Using `Grafana TestData` you can build your own time series and have any panel render it.
This make is much easier to verify functionally since the data can be shared very
## Enable
`Grafana TestData` is not enabled by default. To enable it you have to go to `/plugins/testdata/edit` and click the enable button to enable it for each server.
## Create mock data.
Once `Grafana TestData` is enabled you use it as a datasource in the metric panel.
![](/img/docs/v41/test_data_add.png)
## Scenarios
You can now choose different scenario that you want rendered in the drop down menu. If you have scenarios that you think should be added, please add them to `` and submit a pull request.
## CSV
The comma separated values scenario is the most powerful one since it lets you create any kind of graph you like.
Once you provided the numbers `Grafana TestData` will distribute them evenly based on the time range of your query.
![](/img/docs/v41/test_data_csv_example.png)
## Dashboards
`Grafana TestData` also contains some dashboards with example. `/plugins/testdata/edit`
### Commit updates to the dashboards
If you want to submit a change to one of the current dashboards bundled with `Grafana TestData` you have to update the revision property.
Otherwise the dashboard will not be updated automatically for other Grafana users.
## Using test data in issues
If you post an issue on github regarding time series data or rendering of time series data we strongly advice you to use this data source to replicate the data.
That makes it much easier for the developers to replicate and solve the issue you have.
@@ -1,5 +1,5 @@
+++
title = "Singletat Panel"
title = "Singlestat Panel"
keywords = ["grafana", "dashboard", "documentation", "panels", "singlestat"]
type = "docs"
[menu.docs]
@@ -23,7 +23,16 @@ The singlestat panel has a normal query editor to allow you define your exact me
1. `Big Value`: Big Value refers to how we display the main stat for the Singlestat Panel. This is always a single value that is displayed in the Panel in between two strings, `Prefix` and `Suffix`. The single number is calculated by choosing a function (min,max,average,current,total) of your metric query. This functions reduces your query into a single numeric value.
2. `Font Size`: You can use this section to select the font size of the different texts in the Singlestat Panel, i.e. prefix, value and postfix.
3. `Values`: The Value fields let you set the function (min, max, average, current, total) that your entire query is reduced into a single value with. You can also set the font size of the Value field and font-size (as a %) of the metric query that the Panel is configured with. This reduces the entire query into a single summary value that is displayed.
3. `Values`: The Value fields let you set the function (min, max, average, current, total, first, delta, range) that your entire query is reduced into a single value with. You can also set the font size of the Value field and font-size (as a %) of the metric query that the Panel is configured with. This reduces the entire query into a single summary value that is displayed.
* `min` - The smallest value in the series
* `max` - The largest value in the series
* `avg` - The average of all the non-null values in the series
* `current` - The last value in the series. If the series ends on null the previous value will be used.
* `total` - The sum of all the non-null values in the series
* `first` - The first value in the series
* `delta` - The total incremental increase (of a counter) in the series. An attempt is made to account for counter resets, but this will only be accurate for single instance metrics. Used to show total counter increase in time series.
* `diff` - The difference betwen 'current' (last value) and 'first'.
* `range` - The difference between 'min' and 'max'. Useful the show the range of change for a gauge.
4. `Postfixes`: The Postfix fields let you define a custom label and font-size (as a %) to appear *after* the value
5. `Units`: Units are appended to the the Singlestat within the panel, and will respect the color and threshold settings for the value.
6. `Decimals`: The Decimal field allows you to override the automatic decimal precision, and set it explicitly.
+4 -1
View File
@@ -14,13 +14,15 @@ parent = "guides"
This document is a “bottom up” introduction to basic concepts in Grafana, and can be used as a starting point to get familiar with core features.
### Data Source
Grafana supports many different storage backends for your time series data (Data Source). Each Data Source has a specific Query Editor that is customized for the features and capabilities that the particular Data Source exposes.
The following datasources are officially supported: [Graphite](/datasources/graphite/), [InfluxDB](/datasources/influxdb/), [OpenTSDB](/datasources/opentsdb/), [Prometheus](/datasources/prometheus/), [Elasticsearch](/datasources/elasticsearch/), [CloudWatch](/datasources/cloudwatch/), and [KairosDB](/datasources/kairosdb)
The following datasources are officially supported: [Graphite]({{< relref "features/datasources/graphite.md" >}}), [InfluxDB]({{< relref "features/datasources/influxdb.md" >}}), [OpenTSDB]({{< relref "features/datasources/opentsdb.md" >}}), [Prometheus]({{< relref "features/datasources/prometheus.md" >}}), [Elasticsearch]({{< relref "features/datasources/elasticsearch.md" >}}), [CloudWatch]({{< relref "features/datasources/cloudwatch.md" >}}).
The query language and capabilities of each Data Source are obviously very different. You can combine data from multiple Data Sources onto a single Dashboard, but each Panel is tied to a specific Data Source that belongs to a particular Organization.
### Organization
Grafana supports multiple organizations in order to support a wide variety of deployment models, including using a single Grafana instance to provide service to multiple potentially untrusted Organizations.
In many cases, Grafana will be deployed with a single Organization.
@@ -34,6 +36,7 @@ All Dashboards are owned by a particular Organization.
For more details on the user model for Grafana, please refer to [Admin](/reference/admin/)
### User
A User is a named account in Grafana. A user can belong to one or more Organizations, and can be assigned different levels of privileges through roles.
Grafana supports a wide variety of internal and external ways for Users to authenticate themselves. These include from its own integrated database, from an external SQL server, or from an external LDAP server.
+6 -2
View File
@@ -10,12 +10,15 @@ parent = "guides"
+++
# Getting started
This guide will help you get started and acquainted with Grafana. It assumes you have a working Grafana server up and running and have added at least one [Data Source](/datasources/overview).
This guide will help you get started and acquainted with Grafana. It assumes you have a working Grafana server up and running and have added at least one [Data Source](/features/datasources/).
## Beginner guides
Watch the 10min [beginners guide to building dashboards](https://www.youtube.com/watch?v=sKNZMtoSHN4&index=7&list=PLDGkOdUX1Ujo3wHw9-z5Vo12YLqXRjzg2) to get a quick intro to setting up Dashboards and Panels.
## Basic Concepts
Read the [Basic Concepts](/guides/basic_concepts) document to get a crash course in key Grafana concepts.
### Top header
@@ -34,7 +37,8 @@ The image above shows you the top header for a Dashboard.
6. Settings: Manage Dashboard settings and features such as Templating and Annotations.
## Dashboards, Panels, Rows, the building blocks of Grafana...
Dashboards are at the core of what Grafana is all about. Dashboards are composed of individual Panels arranged on a number of Rows. Grafana ships with a variety of Panels. Grafana makes it easy to construct the right queries, and customize the display properties so that you can create the perfect Dashboard for your need. Each Panel can interact with data from any configured Grafana Data Source (currently InfluxDB, Graphite, OpenTSDB, and KairosDB). The [Basic Concepts](/guides/basic_concepts) guide explores these key ideas in detail.
Dashboards are at the core of what Grafana is all about. Dashboards are composed of individual Panels arranged on a number of Rows. Grafana ships with a variety of Panels. Grafana makes it easy to construct the right queries, and customize the display properties so that you can create the perfect Dashboard for your need. Each Panel can interact with data from any configured Grafana Data Source (currently InfluxDB, Graphite, OpenTSDB, Prometheus and Cloudwatch). The [Basic Concepts](/guides/basic_concepts) guide explores these key ideas in detail.
## Adding & Editing Graphs and Panels
+1 -1
View File
@@ -7,7 +7,7 @@ type = "docs"
name = "Version 3.1"
identifier = "v3.1"
parent = "whatsnew"
weight = 1
weight = 5
+++
# What's New in Grafana v3.1
+1 -1
View File
@@ -7,7 +7,7 @@ type = "docs"
name = "Version 3.0"
identifier = "v3.0"
parent = "whatsnew"
weight = 2
weight = 6
+++
# What's New in Grafana v3.0
+70
View File
@@ -0,0 +1,70 @@
+++
title = "What's New in Grafana v4.1"
description = "Feature & improvement highlights for Grafana v4.1"
keywords = ["grafana", "new", "documentation", "4.1.0"]
type = "docs"
[menu.docs]
name = "Version 4.1"
identifier = "v4.1"
parent = "whatsnew"
weight = -1
+++
## Whats 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)
- **Cloudwatch**: Make it possible to specify access and secret key on the data source config page [#6697](https://github.com/grafana/grafana/issues/6697)
- **Elasticsearch**: Added support for Elasticsearch 5.x [#5740](https://github.com/grafana/grafana/issues/5740), thx [@lpic10](https://github.com/lpic10)
- **Panel**: Added help text for panels. [#4079](https://github.com/grafana/grafana/issues/4079), thx [@utkarshcmu](https://github.com/utkarshcmu)
- [Full changelog](https://github.com/grafana/grafana/blob/master/CHANGELOG.md)
### Shared tooltip
{{< 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.
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>
### Help text for panel
{{< imgbox max-width="60%" img="/img/docs/v41/helptext_for_panel_settings.png" caption="Hovering help text" >}}
You can set a help text in the general tab on any panel. The help text is using Markdown to enable better formating and linking to other sites that can provide more information.
<div class="clearfix"></div>
{{< imgbox max-width="60%" img="/img/docs/v41/helptext_hover.png" caption="Hovering help text" >}}
Panels with a help text available have a little indicator in the top left corner. You can show the help text by hovering the icon.
<div class="clearfix"></div>
### Easier Cloudwatch configuration
{{< imgbox max-width="60%" img="/img/docs/v41/cloudwatch_settings.png" caption="Cloudwatch configuration" >}}
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.
<div class="clearfix"></div>
## Upgrade & Breaking changes
Elasticsearch 1.x is no longer supported. Please upgrade to Elasticsearch 2.x or 5.x. Otherwise Grafana 4.1.0 contains no breaking changes.
## 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.
## Download
Head to [v4.1 download page](/download/4_1_0/) for download links & instructions.
## Thanks
A big thanks to all the Grafana users who contribute by submitting PRs, bug reports & feedback!
+2 -2
View File
@@ -4,10 +4,10 @@ description = "Feature & improvement highlights for Grafana v4.0"
keywords = ["grafana", "new", "documentation", "4.0"]
type = "docs"
[menu.docs]
name = "Version 4.0 (Latest)"
name = "Version 4.0"
identifier = "v4.0"
parent = "whatsnew"
weight = -1
weight = 4
+++
# What's New in Grafana v4.0
+19
View File
@@ -143,6 +143,7 @@ with Grafana admin permission.
"protocol":"http",
"root_url":"%(protocol)s://%(domain)s:%(http_port)s/",
"router_logging":"true",
"data_proxy_logging":"true",
"static_root_path":"public"
},
"session":{
@@ -157,6 +158,7 @@ with Grafana admin permission.
"cert_file":"",
"enabled":"false",
"from_address":"admin@grafana.localhost",
"from_name":"Grafana",
"host":"localhost:25",
"key_file":"",
"password":"************",
@@ -275,3 +277,20 @@ Change password for specific user
Content-Type: application/json
{message: "User deleted"}
## Pause all alerts
`DELETE /api/admin/pause-all-alerts`
**Example Request**:
DELETE /api/admin/pause-all-alerts HTTP/1.1
Accept: application/json
Content-Type: application/json
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{state: "new state", message: "alerts pause/un paused", "alertsAffected": 100}
+216
View File
@@ -0,0 +1,216 @@
+++
title = "Alerting HTTP API "
description = "Grafana Alerting HTTP API"
keywords = ["grafana", "http", "documentation", "api", "alerting"]
aliases = ["/http_api/alerting/"]
type = "docs"
[menu.docs]
name = "Alerting"
parent = "http_api"
+++
# Alerting API
You can use the Alerting API to get information about alerts and their states but this API cannot be used to modify the alert.
To create new alerts or modify them you need to update the dashboard json that contains the alerts.
This API can also be used to create, update and delete alert notifications.
## Get alerts
`GET /api/alerts/`
**Example Request**:
GET /api/alerts HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
[
{
"id": 1,
"dashboardId": 1,
"panelId": 1,
"name": "fire place sensor",
"message": "Someone is trying to break in through the fire place",
"state": "alerting",
"newStateDate": "2016-12-25",
"executionError": "",
"dashboardUri": "http://grafana.com/dashboard/db/sensors"
}
]
## Get one alert
`GET /api/alerts/:id`
**Example Request**:
GET /api/alerts/1 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"id": 1,
"dashboardId": 1,
"panelId": 1,
"name": "fire place sensor",
"message": "Someone is trying to break in through the fire place",
"state": "alerting",
"newStateDate": "2016-12-25",
"executionError": "",
"dashboardUri": "http://grafana.com/dashboard/db/sensors"
}
## Pause alert
`POST /api/alerts/:id/pause`
**Example Request**:
POST /api/alerts/1/pause HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
{
"alertId": 1,
"paused: true
}
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"alertId": 1,
"state": "Paused",
"message": "alert paused"
}
## Get alert notifications
`GET /api/alert-notifications`
**Example Request**:
GET /api/alert-notifications HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"id": 1,
"name": "Team A",
"type": "email",
"isDefault": true,
"created": "2017-01-01 12:45",
"updated": "2017-01-01 12:45"
}
## Create alert notification
`POST /api/alerts-notifications`
**Example Request**:
POST /api/alerts-notifications HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
{
"name": "new alert notification", //Required
"type": "email", //Required
"isDefault": false,
"settings": {
"addresses": "carl@grafana.com;dev@grafana.com"
}
}
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"id": 1,
"name": "new alert notification",
"type": "email",
"isDefault": false,
"settings": { addresses: "carl@grafana.com;dev@grafana.com"} }
"created": "2017-01-01 12:34",
"updated": "2017-01-01 12:34"
}
## Update alert notification
`PUT /api/alerts-notifications/1`
**Example Request**:
PUT /api/alerts-notifications/1 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
{
"id": 1,
"name": "new alert notification", //Required
"type": "email", //Required
"isDefault": false,
"settings": {
"addresses: "carl@grafana.com;dev@grafana.com"
}
}
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"id": 1,
"name": "new alert notification",
"type": "email",
"isDefault": false,
"settings": { addresses: "carl@grafana.com;dev@grafana.com"} }
"created": "2017-01-01 12:34",
"updated": "2017-01-01 12:34"
}
## Delete alert notification
`DELETE /api/alerts-notifications/:notificationId`
**Example Request**:
DELETE /api/alerts-notifications/1 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"message": "Notification deleted"
}
+2 -2
View File
@@ -18,7 +18,7 @@ Currently you can authenticate via an `API Token` or via a `Session cookie` (acq
## Basic Auth
If basic auth is enabled (it is enabled by default) you can authenticate your HTTP request via
standard basic auth.
standard basic auth. Basic auth will also authenticate LDAP users.
curl example:
```
@@ -30,7 +30,7 @@ curl example:
Open the sidemenu and click the organization dropdown and select the `API Keys` option.
![](/img/v2/orgdropdown_api_keys.png)
![](/img/docs/v2/orgdropdown_api_keys.png)
You use the token in all requests in the `Authorization` header, like this:
+1 -1
View File
@@ -200,7 +200,7 @@ Get all tags of dashboards
**Example Request**:
GET /api/dashboards/home HTTP/1.1
GET /api/dashboards/tags HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
+21 -3
View File
@@ -158,7 +158,7 @@ parent = "http_api"
HTTP/1.1 200
Content-Type: application/json
{"id":1,"message":"Datasource added"}
{"id":1,"message":"Datasource added", "name": "test_datasource"}
## Update an existing data source
@@ -193,9 +193,9 @@ parent = "http_api"
HTTP/1.1 200
Content-Type: application/json
{"message":"Datasource updated"}
{"message":"Datasource updated", "id": 1, "name": "test_datasource"}
## Delete an existing data source
## Delete an existing data source by id
`DELETE /api/datasources/:datasourceId`
@@ -213,6 +213,24 @@ parent = "http_api"
{"message":"Data source deleted"}
## Delete an existing data source by name
`DELETE /api/datasources/name/:datasourceName`
**Example Request**:
DELETE /api/datasources/name/test_datasource HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{"message":"Data source deleted"}
## Data source proxy calls
`GET /api/datasources/proxy/:datasourceId/*`
+2 -2
View File
@@ -93,11 +93,11 @@ parent = "http_api"
## Create Organisation
`POST /api/org`
`POST /api/orgs`
**Example Request**:
POST /api/org HTTP/1.1
POST /api/orgs HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
+75 -1
View File
@@ -13,7 +13,7 @@ parent = "http_api"
## Search Users
`GET /api/users`
`GET /api/users?perpage=10&page=1`
**Example Request**:
@@ -22,6 +22,8 @@ parent = "http_api"
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
Default value for the `perpage` parameter is `1000` and for the `page` parameter is `1`.
**Example Response**:
HTTP/1.1 200
@@ -44,6 +46,45 @@ parent = "http_api"
}
]
## Search Users with Paging
`GET /api/users/search?perpage=10&page=1`
**Example Request**:
GET /api/users/search?perpage=10&page=1 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
Default value for the `perpage` parameter is `1000` and for the `page` parameter is `1`. The `totalCount` field in the response can be used for pagination of the user list E.g. if `totalCount` is equal to 100 users and the `perpage` parameter is set to 10 then there are 10 pages of users.
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"totalCount": 2,
"users": [
{
"id": 1,
"name": "Admin",
"login": "admin",
"email": "admin@mygraf.com",
"isAdmin": true
},
{
"id": 2,
"name": "User",
"login": "user",
"email": "user@mygraf.com",
"isAdmin": false
}
],
"page": 1,
"perPage": 10
}
## Get single user by Id
`GET /api/users/:id`
@@ -69,6 +110,39 @@ parent = "http_api"
"isGrafanaAdmin": true
}
## Get single user by Username(login) or Email
`GET /api/users/lookup?loginOrEmail=user@mygraf.com`
**Example Request using the email as option**:
GET /api/users/lookup?loginOrEmail=user@mygraf.com HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Request using the username as option**:
GET /api/users/lookup?loginOrEmail=admin HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
**Example Response**:
HTTP/1.1 200
Content-Type: application/json
{
"email": "user@mygraf.com"
"name": "admin",
"login": "admin",
"theme": "light",
"orgId": 1,
"isGrafanaAdmin": true
}
## User Update
`PUT /api/users/:id`
+4 -4
View File
@@ -42,9 +42,9 @@ those options.
## Data sources guides
- [Graphite](datasources/graphite)
- [Elasticsearch](datasources/elasticsearch)
- [InfluxDB](datasources/influxdb)
- [OpenTSDB](datasources/opentsdb)
- [Graphite]({{< relref "features/datasources/graphite.md" >}})
- [Elasticsearch]({{< relref "features/datasources/elasticsearch.md" >}})
- [InfluxDB]({{< relref "features/datasources/influxdb.md" >}})
- [OpenTSDB]({{< relref "features/datasources/opentsdb.md" >}})
+32 -9
View File
@@ -55,6 +55,7 @@ Then you can override them using:
<hr />
## instance_name
Set the name of the grafana-server instance. Used in logging and internal metrics and in
clustering info. Defaults to: `${HOSTNAME}`, which will be replaced with
environment variable `HOSTNAME`, if that is empty or does not exist Grafana will try to use
@@ -144,6 +145,11 @@ Grafana needs a database to store users and dashboards (and other
things). By default it is configured to use `sqlite3` which is an
embedded database (included in the main Grafana binary).
### url
Use either URL or or the other fields below to configure the database
Example: `mysql://user:secret@host:port/database`
### type
Either `mysql`, `postgres` or `sqlite3`, it's your choice.
@@ -170,7 +176,7 @@ The database user (not applicable for `sqlite3`).
### password
The database user's password (not applicable for `sqlite3`).
The database user's password (not applicable for `sqlite3`). If the password contains `#` or `;` you have to wrap it with trippel quotes. Ex `"""#password;"""`
### ssl_mode
@@ -227,7 +233,7 @@ Default is `false`.
Set to `false` to prohibit users from being able to sign up / create
user accounts. Defaults to `true`. The admin user can still create
users from the [Grafana Admin Pages](../reference/admin.md)
users from the [Grafana Admin Pages](../../reference/admin)
### allow_org_create
@@ -244,7 +250,10 @@ organization to be created for that new user.
The role new users will be assigned for the main organization (if the
above setting is set to true). Defaults to `Viewer`, other valid
options are `Admin` and `Editor` and `Read-Only Editor`.
options are `Admin` and `Editor` and `Read Only Editor`. e.g. :
`auto_assign_org_role = Read Only Editor`
<hr>
@@ -289,6 +298,7 @@ example:
[auth.github]
enabled = true
allow_sign_up = true
client_id = YOUR_GITHUB_APP_CLIENT_ID
client_secret = YOUR_GITHUB_APP_CLIENT_SECRET
scopes = user:email
@@ -323,7 +333,7 @@ Grafana instance. For example:
team_ids = 150,300
auth_url = https://github.com/login/oauth/authorize
token_url = https://github.com/login/oauth/access_token
allow_sign_up = false
allow_sign_up = true
### allowed_organizations
@@ -367,7 +377,7 @@ Secret. Specify these in the Grafana configuration file. For example:
auth_url = https://accounts.google.com/o/oauth2/auth
token_url = https://accounts.google.com/o/oauth2/token
allowed_domains = mycompany.com mycompany.org
allow_sign_up = false
allow_sign_up = true
Restart the Grafana back-end. You should now see a Google login button
on the login page. You can now login or sign up with your Google
@@ -394,7 +404,7 @@ browser to access Grafana, but with the prefix path of `/login/generic_oauth`.
token_url =
api_url =
allowed_domains = mycompany.com mycompany.org
allow_sign_up = false
allow_sign_up = true
Set api_url to the resource that returns basic user info.
@@ -532,6 +542,9 @@ Verify SSL for smtp server? defaults to `false`
### from_address
Address used when sending out emails, defaults to `admin@grafana.localhost`
### from_name
Name to be used when sending out emails, defaults to `Grafana`
## [log]
### mode
@@ -589,13 +602,18 @@ You can choose between (s3, webdav). If left empty Grafana will ignore the uploa
## [external_image_storage.s3]
### bucket_url
bucket url for s3. ex http://grafana.s3.amazonaws.com/
Bucket URL for S3. AWS region can be specified within URL or defaults to 'us-east-1', e.g.
- http://grafana.s3.amazonaws.com/
- https://grafana.s3-ap-southeast-2.amazonaws.com/
- https://grafana.s3-cn-north-1.amazonaws.com.cn
### access_key
access key. ex AAAAAAAAAAAAAAAAAAAA
Access key. e.g. AAAAAAAAAAAAAAAAAAAA
Access key requires permissions to the S3 bucket for the 's3:PutObject' and 's3:PutObjectAcl' actions.
### secret_key
secret key. ex AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Secret key. e.g. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
## [external_image_storage.webdav]
@@ -610,6 +628,11 @@ basic auth password
## [alerting]
### enabled
Defaults to true. Set to false to disable alerting engine and hide Alerting from UI.
### execute_alerts
### execute_alerts = true
Makes it possible to turn off alert rule execution.
+8 -14
View File
@@ -3,6 +3,7 @@ title = "Installing on Debian / Ubuntu"
description = "Install guide for Grafana"
keywords = ["grafana", "installation", "documentation"]
type = "docs"
aliases = ["/installation/installation/debian"]
[menu.docs]
name = "Installing on Ubuntu / Debian"
identifier = "debian"
@@ -14,23 +15,16 @@ weight = 1
Description | Download
------------ | -------------
Stable for Debian-based Linux | [3.1.1 (x86-64 deb)](https://grafanarel.s3.amazonaws.com/builds/grafana_3.1.1-1470047149_amd64.deb)
Latest Beta for Debian-based Linux | [4.0.0-beta2 (x86-64 deb)](https://grafanarel.s3.amazonaws.com/builds/grafana_4.0.0-1479719016beta2_amd64.deb)
Stable for Debian-based Linux | [4.1.2 (x86-64 deb)](https://grafanarel.s3.amazonaws.com/builds/grafana_4.1.2-1486989747_amd64.deb)
## Install Stable
```
$ wget https://grafanarel.s3.amazonaws.com/builds/grafana_3.1.1-1470047149_amd64.deb
$ wget https://grafanarel.s3.amazonaws.com/builds/grafana_4.1.2-1486989747_amd64.deb
$ sudo apt-get install -y adduser libfontconfig
$ sudo dpkg -i grafana_3.1.1-1470047149_amd64.deb
$ sudo dpkg -i grafana_4.1.2-1486989747_amd64.deb
```
## Install Latest Beta
$ wget https://grafanarel.s3.amazonaws.com/builds/grafana_4.0.0-1479719016beta2_amd64.deb
$ sudo apt-get install -y adduser libfontconfig
$ sudo dpkg -i grafana_4.0.0-1479719016beta2_amd64.deb
## APT Repository
Add the following line to your `/etc/apt/sources.list` file.
@@ -120,10 +114,10 @@ those options.
### Adding data sources
- [Graphite]({{< relref "datasources/graphite.md" >}})
- [InfluxDB]({{< relref "datasources/influxdb.md" >}})
- [OpenTSDB]({{< relref "datasources/opentsdb.md" >}})
- [Prometheus]({{< relref "datasources/prometheus.md" >}})
- [Graphite]({{< relref "features/datasources/graphite.md" >}})
- [InfluxDB]({{< relref "features/datasources/influxdb.md" >}})
- [OpenTSDB]({{< relref "features/datasources/opentsdb.md" >}})
- [Prometheus]({{< relref "features/datasources/prometheus.md" >}})
## Installing from binary tar file
+1 -1
View File
@@ -29,7 +29,7 @@ container:
$ docker run -d -p 3000:3000 \
-v /var/lib/grafana:/var/lib/grafana \
-e "GF_SECURITY_ADMIN_PASSWORD=secret" \
grafana/grafana:develop
grafana/grafana
In the above example I map the data folder and sets a configuration option via
an `ENV` instruction.
+12
View File
@@ -3,8 +3,20 @@ title = "Installation"
description = "Install guide for Grafana"
keywords = ["grafana", "installation", "documentation"]
type = "docs"
aliases = ["installation/installation/"]
[menu.docs]
name = "Installation"
identifier = "installation"
+++
## Installing Grafana
- [Installing on Debian / Ubuntu](debian)
- [Installing on RPM-based Linux (CentOS, Fedora, OpenSuse, RedHat)](rpm)
- [Installing on Mac OS X](mac)
- [Installing on Windows](windows)
- [Installing on Docker](docker)
- [Installing using Provisioning (Chef, Puppet, Salt, Ansible, etc)](provisioning)
- [Nightly Builds](http://grafana.org/builds)
+1
View File
@@ -43,6 +43,7 @@ ssl_skip_verify = false
# Search user bind dn
bind_dn = "cn=admin,dc=grafana,dc=org"
# Search user bind password
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
bind_password = 'grafana'
# User search filter, for example "(cn=%s)" or "(sAMAccountName=%s)" or "(uid=%s)"
+9 -24
View File
@@ -2,6 +2,7 @@
title = "Installing on RPM-based Linux"
description = "Grafana Installation guide for Centos, Fedora, OpenSuse, Redhat."
keywords = ["grafana", "installation", "documentation", "centos", "fedora", "opensuse", "redhat"]
aliases = ["installation/installation/rpm"]
type = "docs"
[menu.docs]
name = "Installing on Centos / Redhat"
@@ -14,40 +15,24 @@ weight = 2
Description | Download
------------ | -------------
Stable for CentOS / Fedora / OpenSuse / Redhat Linux | [3.1.1 (x86-64 rpm)](https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.1-1470047149.x86_64.rpm)
Latest Beta for CentOS / Fedora / OpenSuse / Redhat Linux | [4.0.0-beta2 (x86-64 rpm)](https://grafanarel.s3.amazonaws.com/builds/grafana-4.0.0-1479719016beta2.x86_64.rpm)
Stable for CentOS / Fedora / OpenSuse / Redhat Linux | [4.1.2 (x86-64 rpm)](https://grafanarel.s3.amazonaws.com/builds/grafana-4.1.2-1486989747.x86_64.rpm)
## Install Stable
You can install Grafana using Yum directly.
$ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.1-1470047149.x86_64.rpm
$ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-4.1.2-1486989747.x86_64.rpm
Or install manually using `rpm`.
#### On CentOS / Fedora / Redhat:
$ sudo yum install initscripts fontconfig
$ sudo rpm -Uvh grafana-3.1.1-1470047149.x86_64.rpm
$ sudo rpm -Uvh grafana-4.1.2-1486989747.x86_64.rpm
#### On OpenSuse:
$ sudo rpm -i --nodeps grafana-3.1.1-1470047149.x86_64.rpm
## Or Install Latest Beta
$ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-4.0.0-1479719016beta2.x86_64.rpm
Or install manually using `rpm`.
#### On CentOS / Fedora / Redhat:
$ sudo yum install initscripts fontconfig
$ sudo rpm -Uvh grafana-4.0.0-1479719016beta2.x86_64.rpm
#### On OpenSuse:
$ sudo rpm -i --nodeps grafana-4.0.0-1479719016beta2.x86_64.rpm
$ sudo rpm -i --nodeps grafana-4.1.2-1486989747.x86_64.rpm
## Install via YUM Repository
@@ -136,10 +121,10 @@ those options.
### Adding data sources
- [Graphite]({{< relref "datasources/graphite.md" >}})
- [InfluxDB]({{< relref "datasources/influxdb.md" >}})
- [OpenTSDB]({{< relref "datasources/opentsdb.md" >}})
- [Prometheus]({{< relref "datasources/prometheus.md" >}})
- [Graphite]({{< relref "features/datasources/graphite.md" >}})
- [InfluxDB]({{< relref "features/datasources/influxdb.md" >}})
- [OpenTSDB]({{< relref "features/datasources/opentsdb.md" >}})
- [Prometheus]({{< relref "features/datasources/prometheus.md" >}})
### Server side image rendering
+1 -3
View File
@@ -13,9 +13,7 @@ weight = 3
Description | Download
------------ | -------------
Latest stable package for Windows | [grafana.3.1.1.windows-x64.zip](https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.1.windows-x64.zip)
Latest beta package for Windows | [grafana.4.0.0-beta2.windows-x64.zip](https://grafanarel.s3.amazonaws.com/builds/grafana-4.0.0-beta2.windows-x64.zip)
Latest stable package for Windows | [grafana.4.1.2.windows-x64.zip](https://grafanarel.s3.amazonaws.com/builds/grafana-4.1.2.windows-x64.zip)
## Configure
-24
View File
@@ -1,24 +0,0 @@
---
page_title: App plugin
page_description: App plugin for Grafana
page_keywords: grafana, plugins, documentation
---
# Apps
App plugins is a new kind of grafana plugin that can bundle datasource and panel plugins within one package. It also enable the plugin author to create custom pages within grafana. The custom pages enables the plugin author to include things like documentation, sign up forms or controlling other services using HTTP requests.
Datasource and panel plugins will show up like normal plugins. The app pages will be available in the main menu.
<img class="no-shadow" src="/img/v3/app-in-main-menu.png">
## Enabling app plugins
After installing an app it have to be enabled before it show up as an datasource or panel. You can do that on the app page in the config tab.
### Develop your own App
> Our goal is not to have a very extensive documentation but rather have actual
> code that people can look at. An example implementation of an app can be found
> in this [example app repo](https://github.com/grafana/example-app)
+63
View File
@@ -0,0 +1,63 @@
+++
title = "Developing App Plugins"
keywords = ["grafana", "plugins", "documentation"]
type = "docs"
[menu.docs]
name = "Developing App Plugins"
parent = "developing"
weight = 6
+++
# Grafana Apps
App plugins are a new kind of grafana plugin that can bundle datasource and panel plugins within one package. It also enable the plugin author to create custom pages within grafana. The custom pages enable the plugin author to include things like documentation, sign up forms or controlling other services using HTTP requests.
Datasource and panel plugins will show up like normal plugins. The app pages will be available in the main menu.
{{< imgbox img="/img/docs/v3/app-in-main-menu.png" caption="App in Main Menu" >}}
## Enabling app plugins
After installing an app, it has to be enabled before it shows up as a datasource or panel. You can do that on the app page in the config tab.
## Developing an App Plugin
An App is a bundle of panels, dashboards and/or data source(s). There is nothing different about developing panels and data sources for an app.
Apps have to be enabled in Grafana and should import any included dashboards when the user enables it. A ConfigCtrl class should be created and the dashboards imported in the postUpdate hook. See example below:
```javascript
export class ConfigCtrl {
/** @ngInject */
constructor($scope, $injector, $q) {
this.$q = $q;
this.enabled = false;
this.appEditCtrl.setPostUpdateHook(this.postUpdate.bind(this));
}
postUpdate() {
if (!this.appModel.enabled) {
return this.$q.resolve();
}
return this.appEditCtrl.importDashboards().then(() => {
this.enabled = true;
return {
url: "plugins/raintank-kubernetes-app/page/clusters",
message: "Kubernetes App enabled!"
};
});
}
}
ConfigCtrl.templateUrl = 'components/config/config.html';
```
If possible a link to a dashboard or custom page should be shown after enabling the app to guide the user to the appropriate place.
{{< imgbox img="/img/docs/app_plugin_after_enable.png" caption="After enabling" >}}
### Develop your own App
> Our goal is not to have a very extensive documentation but rather have actual
> code that people can look at. An example implementation of an app can be found
> in this [example app repo](https://github.com/grafana/example-app)
@@ -0,0 +1,182 @@
+++
title = "Plugin Code Styleguide"
type = "docs"
[menu.docs]
name = "Plugin Code Styleguide"
parent = "developing"
weight = 2
+++
# Grafana Plugin Code Styleguide
This guide has two parts. The first part describes the metadata and the second part is a styleguide for HTML/CSS and JavaScript in Grafana plugins and applies if you are using ES6 in your plugin. If using TypeScript then the [Angular TypeScript styleguide](https://angular.io/styleguide) is recommended.
## Metadata
The plugin metadata consists of a plugin.json file and the README.md file. These two files are used by Grafana and Grafana.net.
### Plugin.json (mandatory)
The plugin.json file is the same concept as the package.json file for an npm package. When Grafana starts it will scan the plugin folders and mount every folder that contains a plugin.json file unless the folder contains a subfolder named `dist`. In that case grafana will mount the `dist` folder instead.
The most important fields are the first three, especially the id. The convention for the plugin id is **[github username/org]-[plugin name]-[datasource|app|panel]** and it has to be unique.
Examples:
```
raintank-worldping-app
grafana-simple-json-datasource
grafana-piechart-panel
mtanda-histogram-panel
```
The full file format for plugin.json is described [here]({{< relref "plugin.json.md" >}}).
Minimal plugin.json:
```javascript
{
"type": "panel",
"name": "Clock",
"id": "yourorg-clock-panel",
"info": {
"description": "Clock panel for grafana",
"author": {
"name": "Raintank Inc.",
"url": "http://raintank.io"
},
"keywords": ["clock", "panel"],
"version": "1.0.0",
"updated": "2015-03-24"
},
"dependencies": {
"grafanaVersion": "3.x.x",
"plugins": [ ]
}
}
```
### README.md
The README.md file is rendered both on Grafana.net and in the plugins section in Grafana. The only difference from how GitHub renders markdown is that html is not allowed.
## File and Directory Structure Conventions
Here is a typical directory structure for a plugin.
```
johnnyb-awesome-datasource
|-- dist
|-- spec
| |-- datasource_spec.js
| |-- query_ctrl_spec.js
| |-- test-main.js
|-- src
| |-- img
| | |-- logo.svg
| |-- partials
| | |-- annotations.editor.html
| | |-- config.html
| | |-- query.editor.html
| |-- datasource.js
| |-- module.js
| |-- plugin.json
| |-- query_ctrl.js
|-- Gruntfile.js
|-- LICENSE
|-- package.json
|-- README.md
```
Most JavaScript projects have a build step and most Grafana plugins are built using Babel and ES6. The generated JavaScript should be placed in the `dist` directory and the source code in the `src` directory. We recommend that the plugin.json file be placed in the src directory and then copied over to the dist directory when building. The `README.md` can be placed in the root or in the dist directory.
Directories:
- `src/` contains plugin source files.
- `src/partials` contains html templates.
- `src/img` contains plugin logos and other images.
- `spec/` contains tests (optional).
- `dist/` contains built content.
## HTML and CSS
For the HTML on editor tabs, we recommend using the inbuilt Grafana styles rather than defining your own. This makes plugins feel like a more natural part of Grafana. If done correctly, the html will also be responsive and adapt to smaller screens. The `gf-form` css classes should be used for labels and inputs.
Below is a minimal example of an editor row with one form group and two fields, a dropdown and a text input:
```html
<div class="editor-row">
<div class="section gf-form-group">
<h5 class="section-heading">My Plugin Options</h5>
<div class="gf-form">
<label class="gf-form-label width-10">Label1</label>
<div class="gf-form-select-wrapper max-width-10">
<select class="input-small gf-form-input" ng-model="ctrl.panel.mySelectProperty" ng-options="t for t in ['option1', 'option2', 'option3']" ng-change="ctrl.onSelectChange()"></select>
</div>
<div class="gf-form">
<label class="gf-form-label width-10">Label2</label>
<input type="text" class="input-small gf-form-input width-10" ng-model="ctrl.panel.myProperty" ng-change="ctrl.onFieldChange()" placeholder="suggestion for user" ng-model-onblur />
</div>
</div>
</div>
</div>
```
Use the `width-x` and `max-width-x` classes to control the width of your labels and input fields. Try to get labels and input fields to line up neatly by having the same width for all the labels in a group and the same width for all inputs in a group if possible.
## Build Scripts
Our recommendation is to use whatever you usually use - Grunt, Gulp or npm scripts. Most plugins seems to use Grunt so that is probably the easiest to get started with if you do not have a preferred build system. The only requirement is that it supports systemjs which is required by Grafana to load plugins.
## Linting
We recommend that you use a linter for your JavaScript. For ES6, the standard linter is [eslint](http://eslint.org/). Rules for linting are described in an .eslintrc that is placed in the root directory. [Here is an example](https://github.com/grafana/worldmap-panel/blob/master/.eslintrc) of linting rules in a plugin.
### ES6 features
1. Use `const` if a variable is not going to be reassigned.
2. Prefer to use `let` instead `var` ([Exploring ES6](http://exploringjs.com/es6/ch_core-features.html#_from-var-to-letconst))
3. Use arrow functions, which dont shadow `this` ([Exploring ES6](http://exploringjs.com/es6/ch_core-features.html#_from-function-expressions-to-arrow-functions)):
```js
testDatasource() {
return this.getServerStatus()
.then(status => {
return this.doSomething(status);
})
}
```
better than
```js
testDatasource() {
var self = this;
return this.getServerStatus()
.then(function(status) {
return self.doSomething(status);
})
}
```
4. Use native _Promise_ object:
```js
metricFindQuery(query) {
if (!query) {
return Promise.resolve([]);
}
}
```
better than
```js
metricFindQuery(query) {
if (!query) {
return this.$q.when([]);
}
}
```
5. If using Lodash, then be consequent and prefer that to the native ES6 array functions.
@@ -1,3 +1,12 @@
+++
title = "Developing Datasource Plugins"
keywords = ["grafana", "plugins", "documentation"]
type = "docs"
[menu.docs]
name = "Developing Datasource Plugins"
parent = "developing"
weight = 6
+++
# Datasources
@@ -31,19 +40,26 @@ There are two datasource specific settings for the plugin.json
These settings indicates what kind of data the plugin can deliver. At least one of them have to be true
## Datasource
The javascript object that communicates with the database and transforms data to times series.
The Datasource should contain the following functions.
The Datasource should contain the following functions:
```
query(options) //used by panels to get data
testDatasource() //used by datasource configuration page to make sure the connection is working
annotationsQuery(options) // used dashboards to get annotations
annotationQuery(options) // used by dashboards to get annotations
metricFindQuery(options) // used by query editor to get metric suggestions.
```
### testDatasource
When a user clicks on the *Save & Test* button when adding a new data source, the details are first saved to the database and then the `testDatasource` function that is defined in your data source plugin will be called. It is recommended that this function makes a query to the data source that will also test that the authentication details are correct. This is so the data source is correctly configured when the user tries to write a query in a new dashboard.
### Query
Request object passed to datasource.query function
Request object passed to datasource.query function:
```json
{
"range": { "from": "2015-12-22T03:06:13.851Z", "to": "2015-12-22T06:48:24.137Z" },
@@ -57,11 +73,12 @@ Request object passed to datasource.query function
}
```
There are two different kind of results for datasources.
Time series and table. Time series is the most common format and is supported by all datasources and panels. Table format is only support by the Influxdb datasource and table panel. But we might see more of this in the future.
There are two different kinds of results for datasources;
time series and table. Time series is the most common format and is supported by all datasources and panels. Table format is only supported by the InfluxDB datasource and table panel. But we might see more of this in the future.
Time series response from datasource.query.
An array of:
Time series response from datasource.query
An array of
```json
[
{
@@ -81,8 +98,9 @@ An array of
]
```
Table response from datasource.query
An array of
Table response from datasource.query.
An array of:
```json
[
{
@@ -119,7 +137,8 @@ An array of
### Annotation Query
Request object passed to datasource.annotationsQuery function
Request object passed to datasource.annotationQuery function:
```json
{
"range": { "from": "2016-03-04T04:07:55.144Z", "to": "2016-03-04T07:07:55.144Z" },
@@ -132,7 +151,8 @@ Request object passed to datasource.annotationsQuery function
}
```
Expected result from datasource.annotationQuery
Expected result from datasource.annotationQuery:
```json
[
{
@@ -152,24 +172,24 @@ Expected result from datasource.annotationQuery
## QueryCtrl
A javascript class that will be instantiated and treated as an Angular controller when the user edits metrics in a panel. This class have to inherit from the app/plugins/sdk.QueryCtrl class.
A JavaScript class that will be instantiated and treated as an Angular controller when the user edits metrics in a panel. This class has to inherit from the app/plugins/sdk.QueryCtrl class.
Requires a static template or templateUrl variable which will be rendered as the view for this controller.
## ConfigCtrl
A javascript class that will be instantiated and treated as an Angular controller when a user tries to edit or create a new datasource of this type.
A JavaScript class that will be instantiated and treated as an Angular controller when a user tries to edit or create a new datasource of this type.
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.
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.
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.
Requires a static template or templateUrl variable which will be rendered as the view for this controller. The fields that are bound to this controller is then sent to the Database objects annotationsQuery function.
Requires a static template or templateUrl variable which will be rendered as the view for this controller. The fields that are bound to this controller are then sent to the Database objects annotationQuery function.
@@ -0,0 +1,128 @@
+++
title = "Plugin Defaults and Editor Mode"
type = "docs"
[menu.docs]
name = "Plugin Defaults and Editor Mode"
parent = "developing"
weight = 3
+++
# Plugin Defaults and Editor Mode
Most plugins allow users to customize the behavior by changing settings on an editor tab. These setting fields are saved in the dashboard json.
## Defaults
We define fields to be saved in Grafana by creating values on the panel object of the controller. You can see these values for any panel by choosing View JSON from the settings menu in Grafana. Here is an excerpt from the clock panel json (with some fields removed), the panel data is saved in the panels array:
```json
{
"id": 4,
"title": "Clock",
...
"rows": [
{
...
"panels": [
{
"bgColor": "rgb(132, 151, 130)",
"clockType": "24 hour",
```
You can define panel data by first creating a variable with default values for the fields and then setting them on the panel object:
```javascript
const panelDefaults = {
clockType: '24 hour',
fontSize: '60px',
fontWeight: 'normal',
bgColor: null
};
constructor($scope, $injector) {
super($scope, $injector);
_.defaults(this.panel, panelDefaults);
this.updateClock();
}
```
The Lodash function [defaults](https://lodash.com/docs/4.17.4#defaults), which is called in the code above: `_.defaults`, sets a default value only if the value is not already set. This way values that have been changed by the user will not be overwritten.
These panel fields can be used in the controller or module.html template:
```html
<h2 style="font-size: {{ctrl.panel.fontSize}};">{{ctrl.time}}</h2>
```
If you want your users to be able to change these panel values then you need to expose them in the Grafana editor.
## Editor Mode
Editor mode is when a user clicks Edit on a panel. Every panel has a general tab where you change the title and width and some panels have more inbuilt tabs like the Metrics tab or Time Range tab. A panel plugin can add its own tab(s) so that a user can customize the panel.
Grafana conventions mean all you need to do is to hook up an Angular template with input fields and Grafana will automatically save the values to the dashboard json and load them on dashboard load.
## Using Events
To add an editor tab you need to hook into the event model so that the tab is added when the *init-edit-mode* event is triggered. The following code should be added to the constructor of the plugin Ctrl class:
```javascript
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
```
Then you need to create a handler function that is bound to the event. In the example above, the handler is called onInitEditMode. The tab is added by calling the controller function, *addEditorTab*. This function has three parameters; the tab name, the path to a html template for the new editor tab and the tab number. It can be a bit tricky to figure out the path, the path name will be based on the id that is specified in the plugin.json file - for example **grafana-clock-panel**. The code below hooks up an Angular template called editor.html that is located in the `src/partials` directory.
```javascript
onInitEditMode() {
this.addEditorTab('Options', 'public/plugins/grafana-clock-panel/editor.html', 2);
}
```
## Editor HTML and CSS
For editor tabs html, it is best to use Grafana css styles rather than custom styles. This is to preserve the look and feel of other tabs in Grafana.
Most editor tabs should use the [gf-form css class](https://github.com/grafana/grafana/blob/master/public/sass/components/_gf-form.scss) from Grafana. The example below has one row with a couple of columns and each column is wrapped in a div like this:
```html
<div class="section gf-form-group">
```
Then each pair, label and field is wrapped in a div with a gf-form class.
```html
<div class="gf-form">
<label class="gf-form-label width-8">Font Size</label>
<input type="text" class="gf-form-input width-4" ng-model="ctrl.panel.fontSize" ng-change="ctrl.render()" ng-model-onblur>
</div>
```
Note that there are some Angular attributes here. *ng-model* will update the panel data. *ng-change* will render the panel when you change the value. This change will occur on the onblur event due to the *ng-model-onblur* attribute. This means you can see the effect of your changes on the panel while editing.
{{< imgbox img="/assets/img/blog/clock-panel-editor.png" caption="Panel Editor" >}}
On the editor tab we use a drop down for 12/24 hour clock, an input field for font size and a color picker for the background color.
The drop down/select has its own *gf-form-select-wrapper* css class and looks like this:
```html
<div class="gf-form">
<label class="gf-form-label width-9">12 or 24 hour</label>
<div class="gf-form-select-wrapper max-width-9">
<select class="input-small gf-form-input" ng-model="ctrl.panel.clockType" ng-options="t for t in ['12 hour', '24 hour', 'custom']" ng-change="ctrl.render()"></select>
</div>
</div>
```
The color picker (or spectrum picker) is a component that already exists in Grafana. We use it like this for the background color:
```html
<spectrum-picker class="gf-form-input" ng-model="ctrl.panel.bgColor" ng-change="ctrl.render()" ></spectrum-picker>
```
## Editor Tab Finished
To reiterate, this all ties together quite neatly. We specify properties and panel defaults in the constructor for the panel controller and these can then be changed in the editor. Grafana takes care of saving the changes.
One thing to be aware of is that panel defaults are used the first time a panel is created to set the initial values of the panel properties. After the panel is saved then the saved value will be used instead. So beware if you update panel defaults they will not automatically update the property in an existing panel. For example, if you set the default font size to 60px first and then in version 2 of the plugin change it to 50px, existing panels will still have 60px and only new panels will get the new 50px value.
@@ -0,0 +1,120 @@
+++
title = "Developer Guide"
type = "docs"
aliases = ["/plugins/development/", "/plugins/datasources/", "/plugins/apps/", "/plugins/panels/"]
[menu.docs]
name = "Developer Guide"
parent = "developing"
weight = 1
+++
# Developer Guide
From grafana 3.0 it's very easy to develop your own plugins and share them with other grafana users.
There are two blog posts about authoring a plugin that might also be of interest to any plugin authors, [Timing is Everything. Writing the Clock Panel Plugin for Grafana 3.0- part 1](http://grafana.org/blog/2016/04/08/timing-is-everything.-writing-the-clock-panel-plugin-for-grafana-3.0/) and [Timing is Everything. Editor Mode in Grafana 3.0 for the Clock Panel Plugin](http://grafana.org/blog/2016/04/15/timing-is-everything.-editor-mode-in-grafana-3.0-for-the-clock-panel-plugin/).
## Short version
1. [Setup grafana](http://docs.grafana.org/project/building_from_source/)
2. Clone an example plugin into ```/var/lib/grafana/plugins``` or `data/plugins` (relative to grafana git repo if your running development version from source dir)
3. Code away!
## What languages?
Since everything turns into javascript it's up to you to choose which language you want. That said it's probably a good idea to choose es6 or typescript since we use es6 classes in Grafana. So it's easier to get inspiration from the Grafana repo is you choose one of those languages.
## Buildscript
You can use any build system you like that support systemjs. All the built content should end up in a folder named ```dist``` and committed to the repository.By committing the dist folder the person who installs your plugin does not have to run any buildscript.
All our example plugins have build scripted configured.
## Metadata
See the [coding styleguide]({{< relref "code-styleguide.md" >}}) for details on the metadata.
## module.(js|ts)
This is the entry point for every plugin. This is the place where you should export
your plugin implementation. Depending on what kind of plugin you are developing you
will be expected to export different things. You can find what's expected for [datasource]({{< relref "datasources.md" >}}), [panels]({{< relref "panels.md" >}})
and [apps]({{< relref "apps.md" >}}) plugins in the documentation.
The Grafana SDK is quite small so far and can be found here:
- [SDK file in Grafana](https://github.com/grafana/grafana/blob/master/public/app/plugins/sdk.ts)
- [SDK Readme](https://github.com/grafana/grafana/blob/master/public/app/plugins/plugin_api.md)
The SDK contains three different plugin classes: PanelCtrl, MetricsPanelCtrl and QueryCtrl. For plugins of the panel type, the module.js file should export one of these. There are some extra classes for [data sources]({{< relref "datasources.md" >}}).
Example:
```javascript
import {ClockCtrl} from './clock_ctrl';
export {
ClockCtrl as PanelCtrl
};
```
The module class is also where css for the dark and light themes is imported:
```javascript
import {loadPluginCss} from 'app/plugins/sdk';
import WorldmapCtrl from './worldmap_ctrl';
loadPluginCss({
dark: 'plugins/grafana-worldmap-panel/css/worldmap.dark.css',
light: 'plugins/grafana-worldmap-panel/css/worldmap.light.css'
});
export {
WorldmapCtrl as PanelCtrl
};
```
## Start developing your plugin
There are three ways that you can start developing a Grafana plugin.
1. Setup a Grafana development environment. [(described here)](http://docs.grafana.org/project/building_from_source/) and place your plugin in the ```data/plugins``` folder.
2. Install Grafana and place your plugin in the plugins directory which is set in your [config file](/installation/configuration). By default this is `/var/lib/grafana/plugins` on Linux systems.
3. Place your plugin directory anywhere you like and specify it grafana.ini.
We encourage people to setup the full Grafana environment so that you can get inspiration from the rest of grafana code base.
When Grafana starts it will scan the plugin folders and mount every folder that contains a plugin.json file unless
the folder contains a subfolder named dist. In that case grafana will mount the dist folder instead.
This makes it possible to have both built and src content in the same plugin git repo.
## Grafana Events
There are a number of Grafana events that a plugin can hook into:
- `init-edit-mode` can be used to add tabs when editing a panel
- `panel-teardown` can be used for clean up
- `data-received` is an event in that is triggered on data refresh and can be hooked into
- `data-snapshot-load` is an event triggered to load data when in snapshot mode.
- `data-error` is used to handle errors on dashboard refresh.
If a panel receives data and hooks into the `data-received` event then it should handle snapshot mode too. Otherwise the panel will not work if saved as a snapshot. [Getting Plugins to work in Snapshot Mode]({{< relref "snapshot-mode.md" >}}) describes how to add support for this.
## Examples
We currently have three different examples that you can fork/download to get started developing your grafana plugin.
- [simple-json-datasource](https://github.com/grafana/simple-json-datasource) (small datasource plugin for querying json data from backends)
- [example-app](https://github.com/grafana/example-app)
- [clock-panel](https://github.com/grafana/clock-panel)
- [singlestat-panel](https://github.com/grafana/grafana/blob/master/public/app/plugins/panel/singlestat/module.ts)
- [piechart-panel](https://github.com/grafana/piechart-panel)
## Other Articles
- [Getting Plugins to work in Snapshot Mode]({{< relref "snapshot-mode.md" >}})
- [Plugin Defaults and Editor Mode]({{< relref "defaults-and-editor-mode.md" >}})
- [Grafana Plugin Code Styleguide]({{< relref "code-styleguide.md" >}})
- [Grafana Apps]({{< relref "apps.md" >}})
- [Grafana Datasources]({{< relref "datasources.md" >}})
- [plugin.json Schema]({{< relref "plugin.json.md" >}})
+8
View File
@@ -0,0 +1,8 @@
+++
title = "Developing Plugins"
type = "docs"
[menu.docs]
parent = "plugins"
identifier = "developing"
weight = 3
+++
@@ -9,7 +9,7 @@ page_keywords: grafana, plugins, documentation
title = "Installing Plugins"
type = "docs"
[menu.docs]
parent = "plugins"
parent = "developing"
weight = 1
+++
@@ -0,0 +1,28 @@
+++
title = "plugin.json Schema"
keywords = ["grafana", "plugins", "documentation"]
type = "docs"
[menu.docs]
name = "plugin.json Schema"
parent = "developing"
weight = 6
+++
# Plugin.json
The plugin.json file is mandatory for all plugins. When Grafana starts it will scan the plugin folders and mount every folder that contains a plugin.json file unless the folder contains a subfolder named `dist`. In that case grafana will mount the `dist` folder instead.
## Plugin JSON Schema
| Property | Description |
| ------------- |-------------|
| id | unique name of the plugin - [conventions described in styleguide]({{< relref "code-styleguide.md" >}}) |
| type | panel/datasource/app |
| name | Human readable name of the plugin |
| info.description | Description of plugin. Used for searching grafana net plugins |
| info.author | |
| info.keywords | plugin keywords. Used for search on grafana net|
| info.logos | link to project logos |
| info.version | project version of this commit. Must be semver |
| dependencies.grafanaVersion | Required grafana backend version for this plugin |
| dependencies.plugins | required plugins for this plugin. |
@@ -0,0 +1,79 @@
+++
title = "Snapshot Mode"
type = "docs"
[menu.docs]
name = "Snapshot Mode"
parent = "developing"
weight = 6
+++
# Getting Plugins to work in Snapshot Mode
{{< imgbox img="/img/docs/Grafana-snapshot-example.png" caption="A dashboard using snapshot data and not live data." >}}
Grafana has this great feature where you can [save a snapshot of your dashboard](http://docs.grafana.org/reference/sharing/). Instead of sending a screenshot of a dashboard to someone, you can send them a working, interactive Grafana dashboard with the snapshot data embedded inside it. The snapshot can be saved on your Grafana server and is available to all your co-workers. Raintank also hosts a [snapshot server](http://snapshot.raintank.io/) if you want to send the snapshot to someone who does not have access to your Grafana server.
{{< imgbox img="/img/docs/animated_gifs/snapshots.gif" caption="Selecting a snapshot" >}}
This all works because Grafana saves a snapshot of the current data in the dashboard json instead of fetching the data from a data source. However, if you are building a custom panel plugin then this will not work straight out of the box. You will need to make some small (and easy!) changes first.
## Enabling support for loading snapshot data
Grafana automatically saves data from data sources in the dashboard json when the snapshot is created so we do not have to write any code for that. Enabling snapshot support for reading time series data is very simple. First in the constructor, we need to add an event handler for `data-snapshot-load`. This event is triggered by Grafana when the snapshot data is loaded from the dashboard json.
```javascript
constructor($scope, $injector, contextSrv) {
super($scope, $injector);
...
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
this.events.on('data-received', this.onDataReceived.bind(this));
this.events.on('panel-teardown', this.onPanelTeardown.bind(this));
this.events.on('data-snapshot-load', this.onDataSnapshotLoad.bind(this));
```
Then we need to create a simple event handler that just forwards the data on to our regular `data-received` handler:
```javascript
onDataSnapshotLoad(snapshotData) {
this.onDataReceived(snapshotData);
}
```
This will cover most use cases for snapshot support. Sometimes you will want to save data that is not time series data from a Grafana data source and then you have to do a bit more work to get snapshot support.
## Saving custom data for snapshots
Data that is not time series data from a Grafana data source is not saved automatically by Grafana. Saving custom data for snapshot mode has to be done manually.
{{< imgbox img="/img/docs/Grafana-save-snapshot.png" caption="Save snapshot" >}}
Grafana gives us a chance to save data to the dashboard json when it is creating a snapshot. In the 'data-received' event handler, you can check the snapshot flag on the dashboard object. If this is true, then Grafana is creating a snapshot and you can manually save custom data to the panel json. In the example, a new field called snapshotLocationData in the panel json is initialized with a snapshot of the custom data.
```javascript
onDataReceived(dataList) {
if (!dataList) return;
if (this.dashboard.snapshot && this.locations) {
this.panel.snapshotLocationData = this.locations;
}
```
Now the location data is saved in the dashboard json but we will have to load it manually as well.
## Loading custom data for snapshots
The example below shows a function that loads the custom data. The data source for the custom data (an external api in this case) is not available in snapshot mode so a guard check is made to see if there is any snapshot data available first. If there is, then the snapshot data is used instead of trying to load the data from the external api.
```javascript
loadLocationDataFromFile(reload) {
if (this.map && !reload) return;
if (this.panel.snapshotLocationData) {
this.locations = this.panel.snapshotLocationData;
return;
}
```
It is really easy to forget to add this support but it enables a great feature and can be used to demo your panel.
If there is a panel plugin that you would like to be installed on the Raintank Snapshot server then please contact us via [Slack](https://raintank.slack.com) or [GitHub](https://github.com/grafana/grafana).
-60
View File
@@ -1,60 +0,0 @@
+++
title = "Developer Guide"
type = "docs"
aliases = ["/plugins/datasources/", "/plugins/apps/", "/plugins/panels/"]
[menu.docs]
name = "Developer Guide"
parent = "plugins"
weight = 5
+++
# Developer Guide
From grafana 3.0 it's very easy to develop your own plugins and share them with other grafana users.
## Short version
1. [Setup grafana](http://docs.grafana.org/project/building_from_source/)
2. Clone an example plugin into ```/var/lib/grafana/plugins``` or `data/plugins` (relative to grafana git repo if your running development version from source dir)
3. Code away!
## What languages?
Since everything turns into javascript it's up to you to choose which language you want. That said it's probably a good idea to choose es6 or typescript since we use es6 classes in Grafana. So it's easier to get inspiration from the Grafana repo is you choose one of those languages.
## Buildscript
You can use any build system you like that support systemjs. All the built content should end up in a folder named ```dist``` and committed to the repository.By committing the dist folder the person who installs your plugin does not have to run any buildscript.
All our example plugins have build scripted configured.
## module.(js|ts)
This is the entry point for every plugin. This is the place where you should export
your plugin implementation. Depending on what kind of plugin you are developing you
will be expected to export different things. You can find what's expected for [datasource](./datasources.md), [panels](./panels.md)
and [apps](./apps.md) plugins in the documentation.
## Start developing your plugin
There are three ways that you can start developing a Grafana plugin.
1. Setup a Grafana development environment. [(described here)](http://docs.grafana.org/project/building_from_source/) and place your plugin in the ```data/plugins``` folder.
2. Install Grafana and place your plugin in the plugins directory which is set in your [config file](../installation/configuration.md). By default this is `/var/lib/grafana/plugins` on Linux systems.
3. Place your plugin directory anywhere you like and specify it grafana.ini.
We encourage people to setup the full Grafana environment so that you can get inspiration from the rest of grafana code base.
When Grafana starts it will scan the plugin folders and mount every folder that contains a plugin.json file unless
the folder contains a subfolder named dist. In that case grafana will mount the dist folder instead.
This makes it possible to have both built and src content in the same plugin git repo.
## Examples
We currently have three different examples that you can fork/download to get started developing your grafana plugin.
- [simple-json-datasource](https://github.com/grafana/simple-json-datasource) (small datasource plugin for querying json data from backends)
- [example-app](https://github.com/grafana/example-app)
- [clock-panel](https://github.com/grafana/clock-panel)
- [singlestat-panel](https://github.com/grafana/grafana/blob/master/public/app/plugins/panel/singlestat/module.ts)
- [piechart-panel](https://github.com/grafana/piechart-panel)
-10
View File
@@ -1,10 +0,0 @@
---
page_title: Plugin json file
page_description: Plugin json for Grafana
page_keywords: grafana, plugins, documentation
---
# Plugin.json
TODO
+5 -5
View File
@@ -13,7 +13,7 @@ dev environment. Grafana ships with its own required backend server; also comple
## Dependencies
- [Go 1.7](https://golang.org/dl/)
- [Go 1.8](https://golang.org/dl/)
- [NodeJS](https://nodejs.org/download/)
## Get Code
@@ -23,6 +23,8 @@ export GOPATH=`pwd`
go get github.com/grafana/grafana
```
You may see an error such as: `package github.com/grafana/grafana: no buildable Go source files`. This is just a warning, and you can proceed with the directions.
## Building the backend
```
cd $GOPATH/src/github.com/grafana/grafana
@@ -40,7 +42,8 @@ To build less to css for the frontend you will need a recent version of node (v0
npm (v2.5.0) and grunt (v0.4.5). Run the following:
```
npm install
npm install -g yarn
yarn install --pure-lockfile
npm install -g grunt-cli
grunt
```
@@ -91,6 +94,3 @@ 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.
Before or after you create a pull request, sign the [contributor license agreement](/project/cla.html).
Together we can build amazing software faster.
-85
View File
@@ -1,85 +0,0 @@
---
page_title: Grafana CLA
page_description: Grafana Contributor License Agreement
page_keywords: grafana, cla, contribute, documentation
---
# Grafana Contributor License Agreement
## Why is this agreement necessary?
We very much appreciate your wanting to contribute to Grafana,
but we need to add you to the contributors list first.
Note that the following agreement is not a transfer of copyright ownership,
this simply is a license agreement for contributions. You also do not change
your rights to use your own contributions for any other purpose.
For some background on why contributor license agreements are necessary,
you can read FAQs from many other open source projects:
- [Django's excellent CLA FAQ](https://www.djangoproject.com/foundation/cla/faq/)
- [A well-written chapter from Karl Fogel's Producing Open Source Software on CLAs](http://producingoss.com/en/copyright-assignment.html)
- [The Wikipedia article on CLAs](http://en.wikipedia.org/wiki/Contributor_license_agreement)
This is part of the legal framework of the open-source ecosystem that adds some red tape,
but protects both the contributor and the company / foundation behind the project.
It also gives us the option to relicense the code with a more permissive license in the future.
If you have more questions, shoot us an [email](mailto:torkel@grafana.org) or drop by #grafana on IRC (freenode).
Many thanks to [RethinkDB](http://rethinkdb.com) for permission to re-use their CLA!
## Terms of the Agreement
<hr>
This Contributor License Agreement (“Agreement”) is entered into between Coding Instinct AB,
a Swedish corporation (“Grafana,” “we” or “us” etc.) and you (as defined and further identified below).
Accordingly, you hereby agree to the following terms for your past, present and future contributions
submitted to Grafana:
**1. Definitions:**
<strong>(a)</strong> "You" (or "your") shall mean the contribution copyright owner (whether an individual or organization) or legal entity authorized by the copyright owner that is making this Agreement with Grafana.
<strong>(b)</strong> "Contribution(s)" shall mean the code, documentation or other original works of authorship, including any modifications or additions to an existing work, submitted by you to Grafana for inclusion in, or documentation of, any of the products or projects owned or managed by Grafana (the "work(s)"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Grafana or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Grafana for the purpose of discussing and/or improving the work, but excluding communication that is conspicuously marked or otherwise designated in writing by you as "Not a Contribution."
**2. Grant of Copyright License.**
You hereby grant to Grafana and to recipients of software distributed by Grafana a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your contributions and such derivative works.
**3. Grant of Patent License.**
With respect to any patents you own, or that you can license without payment to any third party, you hereby grant Grafana a perpetual, irrevocable, non-exclusive, worldwide, no-charge, royalty-free license to: (i) make, have made, use, sell, offer to sell, import, and otherwise distribute and exploit your contributions in whole or in part, alone or in combination with or included in any product, work or materials arising out of or relating to the Works to which your contributions were submitted; and (ii) sublicense these same rights to third parties through multiple levels of sublicensees or other licensing arrangements.
**4. Rights.**
Except as set out above, you keep all right, title, and interest in your contribution. The rights that you grant to us under this agreement are effective on the date you first submitted a contribution to us, even if your submission took place before the date you entered this agreement.
**5. You represent and warrant that:**
<strong>(i)</strong> the contributions are an original work and that you can legally grant the rights set out in this agreement;
<strong>(ii)</strong> the contributions and Grafanas exercise of any license rights granted hereunder, does not and will not, infringe the rights of any third party;
<strong>(iii)</strong> you are not aware of any pending or threatened claims, suits, actions, or charges pertaining to the contributions, including without limitation any claims or allegations that any or all of the contributions infringes, violates, or misappropriate the intellectual property rights of any third party (you further agree that you will notify Grafana immediately if you become aware of any such actual or potential claims, suits, actions, allegations or charges).
**6. Employer Rights.**
If your employer(s) has rights to intellectual property that you create that includes your contributions, you represent and warrant that your employer has waived such rights for your contributions to Grafana, or that you have received permission to make contributions on behalf of that employer and that you are authorized to execute this agreement on behalf of your employer.
**7. Support.**
You are not expected to provide support for your contributions, except to the extent you desire to provide support. You may provide support for free, for a fee, or not at all. Except as set forth herein, and unless required by applicable law or agreed to in writing, you provide your contributions on an "as is" basis, without warranties or conditions of any kind.
**8. Enforcement.**
The failure of either party to enforce its rights under this agreement for any period shall not be construed as a waiver of such rights. No changes or modifications or waivers to this Agreement will be effective unless in writing and signed by both parties. In the event that any provision of this agreement shall be determined to be illegal or unenforceable, that provision will be limited or eliminated to the minimum extent necessary so that this agreement shall otherwise remain in full force and effect and enforceable. This agreement shall be governed by and construed in accordance with the laws of the State of California in the United States without regard to the conflicts of laws provisions thereof. In any action or proceeding to enforce rights under this agreement, the prevailing party will be entitled to recover costs and attorneys fees.
<iframe src="https://docs.google.com/forms/d/1iagLZBotC4IIrz7TXvEdPU5tCtFDk__C5Rs92afXpCE/viewform?embedded=true" width="800" height="820" frameborder="0" marginheight="0" marginwidth="0">Loading CLA...</iframe>
+7
View File
@@ -0,0 +1,7 @@
+++
title = "Project"
type = "docs"
identifier = "project"
weight = 6
+++
+11 -11
View File
@@ -33,7 +33,7 @@ When a user creates a new dashboard, a new dashboard JSON object is initialized
"timezone": "browser",
"editable": true,
"hideControls": false,
"sharedCrosshair": false,
"graphTooltip": 1,
"rows": [],
"time": {
"from": "now-6h",
@@ -65,12 +65,12 @@ Each field in the dashboard JSON is explained below with its usage:
| **timezone** | timezone of dashboard, i.e. `utc` or `browser` |
| **editable** | whether a dashboard is editable or not |
| **hideControls** | whether row controls on the left in green are hidden or not |
| **sharedCrosshair** | TODO |
| **rows** | row metadata, see [rows section](/docs/sources/reference/dashboard.md/#rows) for details |
| **graphTooltip** | TODO |
| **rows** | row metadata, see [rows section](#rows) for details |
| **time** | time range for dashboard, i.e. last 6 hours, last 7 days, etc |
| **timepicker** | timepicker metadata, see [timepicker section](/docs/sources/reference/dashboard.md/#timepicker) for details |
| **templating** | templating metadata, see [templating section](/docs/sources/reference/dashboard.md/#templating) for details |
| **annotations** | annotations metadata, see [annotations section](/docs/sources/reference/dashboard.md/#annotations) for details |
| **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 |
| **schemaVersion** | TODO |
| **version** | TODO |
| **links** | TODO |
@@ -79,7 +79,7 @@ Each field in the dashboard JSON is explained below with its usage:
`rows` field consists of an array of JSON object representing each row in a dashboard, such as shown below:
```
```json
"rows": [
{
"collapse": false,
@@ -105,14 +105,14 @@ Usage of the fields is explained below:
| **collapse** | whether row is collapsed or not |
| **editable** | whether a row is editable or not |
| **height** | height of the row in pixels |
| **panels** | panels metadata, see [panels section](/docs/sources/reference/dashboard.md/#panels) for details |
| **panels** | panels metadata, see [panels section](#panels) for details |
| **title** | title of row |
#### panels
Panels are the building blocks a dashboard. It consists of datasource queries, type of graphs, aliases, etc. Panel JSON consists of an array of JSON objects, each representing a different panel in a row. Most of the fields are common for all panels but some fields depends on the panel type. Following is an example of panel JSON representing a `graph` panel type:
```
```json
"panels": [
{
"aliasColors": {},
@@ -276,7 +276,7 @@ Usage of each field is explained below:
Description: TODO
```
```json
"timepicker": {
"collapse": false,
"enable": true,
@@ -330,7 +330,7 @@ Usage of the fields is explained below:
`templating` fields contains array of template variables with their saved values along with some other metadata, for example:
```
```json
"templating": {
"enable": true,
"list": [
+4 -4
View File
@@ -9,7 +9,7 @@ weight = 8
# Export and Import
Grafana Dashboads can easily be exported and imported, either from the UI or from the HTTP API.
Grafana Dashboards can easily be exported and imported, either from the UI or from the HTTP API.
## Exporting a dashboard
@@ -22,9 +22,9 @@ The export feature is accessed from the share menu.
### Making a dashboard portable
If you want to export a dashboard for others to use then it could be a good idea to
add template variables for things like a metric prefix (use contant variable) and server name.
add template variables for things like a metric prefix (use constant variable) and server name.
A template varible of the type `Constant` will automatically be hidden in
A template variable of the type `Constant` will automatically be hidden in
the dashboard, and will also be added as an required input when the dashboard is imported.
## Importing a dashboard
@@ -43,7 +43,7 @@ data source you want the dashboard to use and specify any metric prefixes (if th
## Discover dashboards on Grafana.net
Find dashboads for common server applications at [Grafana.net/dashboards](https://grafana.net/dashboards).
Find dashboards for common server applications at [Grafana.net/dashboards](https://grafana.net/dashboards).
<img src="/img/docs/v31/gnet_dashboards_list.png">
+7
View File
@@ -0,0 +1,7 @@
+++
title = "reference"
type = "docs"
identifier = "reference"
weight = 6
+++
+1 -1
View File
@@ -16,7 +16,7 @@ Since Grafana automatically scales Dashboards to any resolution they're perfect
## Creating a Playlist
{{< docs-imagebox img="img/docs/v3/playlist.png" max-width="25rem" >}}
{{< docs-imagebox img="/img/docs/v3/playlist.png" max-width="25rem" >}}
The Playlist feature can be accessed from Grafana's sidemenu, in the Dashboard submenu.
+40
View File
@@ -0,0 +1,40 @@
+++
title = "Setup Grafana for High availability"
type = "docs"
keywords = ["grafana", "tutorials", "HA", "high availability"]
[menu.docs]
parent = "tutorials"
weight = 10
+++
# How to setup Grafana for high availability
> Alerting does not support high availability yet.
Setting up Grafana for high availability is fairly simple. It comes down to two things:
* Use a shared database for multiple grafana instances.
* Consider how user sessions are stored.
## Configure multiple servers to use the same database
First you need to do is to setup mysql or postgres on another server and configure Grafana to use that database.
You can find the configuration for doing that in the [[database]]({{< relref "configuration.md" >}}#database) section in the grafana config.
Grafana will now persist all long term data in the database.
It also worth considering how to setup the database for high availability but thats outside the scope of this guide.
## User sessions
The second thing to consider is how to deal with user sessions and how to balance the load between servers.
By default Grafana stores user sessions on disk which works fine if you use `sticky sessions` in your load balancer.
Grafana also supports storing the session data in the database, redis or memcache which makes it possible to use round robin in your load balancer.
If you use mysql/postgres for session storage you first need a table to store the session data in. More details about that in [[sessions]]({{< relref "configuration.md" >}}#session)
For Grafana itself it doesn't really matter if you store your sessions on disk or database/redis/memcache.
But we suggest that you store the session in redis/memcache since it makes it easier to add/remote instances from the group.
## Alerting
Currently alerting does not support high availability. But this is something that we will be working on in the future.
+9 -3
View File
@@ -22,15 +22,17 @@ take you to the graph.
> is so Hipchat and Slack can show them reliably (they require the image to be publicly available).
<div class="text-center">
<img src="/img/tutorials/hubot_grafana.png" class="center"></a>
<img src="/img/docs/tutorials/hubot_grafana.png" class="center"></a>
</div>
## What is Hubot?
[Hubot](https://hubot.github.com/) is an universal and extensible chat bot that can be used with many chat
services and has a huge library of third party plugins that allow you to automate anything from your
chat rooms.
## Install Hubot
Hubot is very easy to install and host. If you do not already have a bot up and running please
read the official [Getting Started With Hubot](https://hubot.github.com/docs/) guide.
@@ -63,6 +65,7 @@ The `hubot-grafana` plugin requires a number of environment variables to be set
export HUBOT_GRAFANA_S3_REGION=us-standard
### Grafana server side rendering
The hubot plugin will take advantage of the Grafana server side rendering feature that can
render any panel on the server using phantomjs. Grafana ships with a phantomjs binary (linux only).
@@ -70,11 +73,13 @@ To verify that this feature works try the `Direct link to rendered image` link i
If you do not get an image when opening this link verify that the required font packages are installed for phantomjs to work.
### Grafana API Key
<img src="/img/v2/orgdropdown_api_keys.png" style="width: 150px" class="right"></img>
<img src="/img/docs/v2/orgdropdown_api_keys.png" style="width: 150px" class="right"></img>
You need to set the environment variable `HUBOT_GRAFANA_API_KEY` to a Grafana API Key.
You can add these from the API Keys page which you find in the Organization dropdown.
### Amazon S3
The `S3` options are optional but for the images to work properly in services like Slack and Hipchat they need
to publicly available. By specifying the `S3` options the hubot-grafana script will publish the rendered
panel to `S3` and it will use that URL when it posts to Slack or Hipchat.
@@ -99,6 +104,7 @@ panel to `S3` and it will use that URL when it posts to Slack or Hipchat.
- Get a templated dashboard with the `$host` parameter set to `carbon-a`
## Aliases
Some of the hubot commands above can lengthy and you might have to remember the dashboard slug (url id).
If you have a few favorite graphs you want to be able check up on often (let's say from your mobile) you
can create hubot command aliases with the hubot script `hubot-alias`.
@@ -115,7 +121,7 @@ Now you can add an alias like this:
<div class="text-center">
Using the alias:<br>
<img src="/img/tutorials/hubot_grafana2.png" class="center"></a>
<img src="/img/docs/tutorials/hubot_grafana2.png" class="center"></a>
</div>
## Summary
+2 -2
View File
@@ -1,5 +1,5 @@
## Example plugin implementations
datasource:[simple-json-datasource](https://github.com/grafana/grafana-simple-json-datasource)
app: [example-app](https://github.com/grafana/grafana-example-app)
datasource:[simple-json-datasource](https://github.com/grafana/simple-json-datasource)
app: [example-app](https://github.com/grafana/example-app)
panel: [grafana-piechart-panel](https://github.com/grafana/piechart-panel)
+2 -2
View File
@@ -1,4 +1,4 @@
{
"stable": "3.1.1",
"testing": "3.1.1"
"stable": "4.1.1",
"testing": "4.1.1"
}
+52 -56
View File
@@ -4,84 +4,80 @@
"company": "Coding Instinct AB"
},
"name": "grafana",
"version": "4.0.2",
"version": "4.2.0-beta1",
"repository": {
"type": "git",
"url": "http://github.com/grafana/grafana.git"
},
"devDependencies": {
"zone.js": "^0.6.6",
"autoprefixer": "^6.4.0",
"es6-promise": "^3.0.2",
"es6-shim": "^0.35.1",
"expect.js": "~0.2.0",
"glob": "~7.1.1",
"grunt": "~0.4.0",
"grunt-angular-templates": "^0.5.5",
"grunt-cli": "~0.1.13",
"grunt-contrib-clean": "~0.7.0",
"glob": "~7.0.0",
"grunt": "^0.4.5",
"grunt-angular-templates": "^1.1.0",
"grunt-cli": "~1.2.0",
"grunt-contrib-clean": "~1.0.0",
"grunt-contrib-compress": "^1.3.0",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-copy": "~0.8.2",
"grunt-contrib-cssmin": "~0.14.0",
"grunt-contrib-htmlmin": "~0.6.0",
"grunt-contrib-jshint": "~1.0.0",
"grunt-contrib-uglify": "~0.11.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-filerev": "^0.2.1",
"grunt-git-describe": "~2.3.2",
"grunt-karma": "~0.12.2",
"grunt-ng-annotate": "^1.0.1",
"grunt-notify": "^0.4.3",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-copy": "~1.0.0",
"grunt-contrib-cssmin": "~1.0.2",
"grunt-contrib-htmlmin": "~2.0.0",
"grunt-contrib-jshint": "~1.1.0",
"grunt-contrib-uglify": "~2.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-exec": "^1.0.1",
"grunt-filerev": "^2.3.1",
"grunt-karma": "~2.0.0",
"grunt-ng-annotate": "^3.0.0",
"grunt-notify": "^0.4.5",
"grunt-postcss": "^0.8.0",
"grunt-sass": "^1.1.0",
"grunt-string-replace": "~1.2.1",
"grunt-systemjs-builder": "^0.2.6",
"grunt-tslint": "^3.0.2",
"grunt-typescript": "^0.8.0",
"grunt-usemin": "3.0.0",
"jshint-stylish": "~2.1.0",
"karma": "0.13.22",
"karma-chrome-launcher": "~0.2.2",
"karma-coverage": "0.5.3",
"karma-coveralls": "1.1.2",
"karma-expect": "~1.1.0",
"karma-mocha": "~0.2.1",
"karma-phantomjs-launcher": "1.0.0",
"load-grunt-tasks": "3.4.0",
"mocha": "2.3.4",
"phantomjs-prebuilt": "^2.1.7",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.4",
"sass-lint": "^1.7.0",
"systemjs": "0.19.24"
"grunt-sass": "^1.2.1",
"grunt-string-replace": "~1.3.1",
"grunt-systemjs-builder": "^0.2.7",
"grunt-usemin": "3.1.1",
"jshint-stylish": "~2.2.1",
"karma": "1.3.0",
"karma-chrome-launcher": "~2.0.0",
"karma-coverage": "1.1.1",
"karma-expect": "~1.1.3",
"karma-mocha": "~1.3.0",
"karma-phantomjs-launcher": "1.0.2",
"load-grunt-tasks": "3.5.2",
"mocha": "3.2.0",
"phantomjs-prebuilt": "^2.1.14",
"reflect-metadata": "0.1.8",
"rxjs": "^5.0.0-rc.5",
"sass-lint": "^1.10.2",
"systemjs": "0.19.41",
"zone.js": "^0.7.2"
},
"engines": {
"node": "4.x",
"npm": "2.14.x"
},
"scripts": {
"build": "grunt",
"test": "grunt test",
"coveralls": "grunt karma:coveralls && rm -rf ./coverage"
"build": "./node_modules/grunt-cli/bin/grunt",
"test": "./node_modules/grunt-cli/bin/grunt test"
},
"license": "Apache-2.0",
"dependencies": {
"eventemitter3": "^1.2.0",
"eventemitter3": "^2.0.2",
"gaze": "^1.1.2",
"grunt-jscs": "~1.5.x",
"grunt-sass-lint": "^0.2.0",
"grunt-sync": "^0.4.1",
"karma-sinon": "^1.0.3",
"lodash": "^2.4.1",
"grunt-jscs": "3.0.1",
"grunt-sass-lint": "^0.2.2",
"grunt-sync": "^0.6.2",
"karma-sinon": "^1.0.5",
"lodash": "^4.17.2",
"mousetrap": "^1.6.0",
"remarkable": "^1.6.2",
"sinon": "1.16.1",
"systemjs-builder": "^0.15.13",
"tether": "^1.2.0",
"tether-drop": "^1.4.2",
"tslint": "^3.4.0",
"typescript": "^1.7.5",
"remarkable": "^1.7.1",
"sinon": "1.17.6",
"systemjs-builder": "^0.15.34",
"tether": "^1.4.0",
"tether-drop": "https://github.com/torkelo/drop",
"tslint": "^4.0.2",
"typescript": "^2.1.4",
"virtual-scroll": "^1.1.1"
}
}
+40 -36
View File
@@ -4,18 +4,7 @@ set -e
[ -f /etc/default/grafana-server ] && . /etc/default/grafana-server
startGrafana() {
if [ -x /bin/systemctl ]; then
/bin/systemctl daemon-reload
/bin/systemctl restart grafana-server
elif [ -x "/etc/init.d/grafana-server" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d grafana-server restart || true
else
/etc/init.d/grafana-server restart || true
fi
fi
}
IS_UPGRADE=false
case "$1" in
configure)
@@ -30,42 +19,57 @@ case "$1" in
"$GRAFANA_USER"
fi
if [ -x /opt/grafana/ ]; then
echo "### Upgrading Notice ### "
echo "-- New grafana install home is /usr/share/grafana"
echo "-- Please move sqlite3 database to /var/lib/grafana/"
echo "-- Notice: service name && binary changed to grafana-server"
fi
# Set user permissions on /var/log/grafana, /var/lib/grafana
mkdir -p /var/log/grafana /var/lib/grafana
chown -R $GRAFANA_USER:$GRAFANA_GROUP /var/log/grafana /var/lib/grafana
chmod 755 /var/log/grafana /var/lib/grafana
# copy user config files
if [ ! -f $CONF_FILE ]; then
cp /usr/share/grafana/conf/sample.ini $CONF_FILE
cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml
fi
# configuration files should not be modifiable by grafana user, as this can be a security issue
chown -Rh root:$GRAFANA_GROUP /etc/grafana/*
chmod 755 /etc/grafana
find /etc/grafana -type f -exec chmod 640 {} ';'
find /etc/grafana -type d -exec chmod 755 {} ';'
# if $2 is set, this is an upgrade
if ( [ -n $2 ] && [ "$RESTART_ON_UPGRADE" = "true" ] ) ; then
startGrafana
# this is a fresh installation
elif [ -z $2 ] ; then
if [ -x /bin/systemctl ] ; then
echo "### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd"
echo " sudo /bin/systemctl daemon-reload"
echo " sudo /bin/systemctl enable grafana-server"
echo "### You can start grafana-server by executing"
echo " sudo /bin/systemctl start grafana-server"
# If $1=configure and $2 is set, this is an upgrade
if [ "$2" != "" ]; then
IS_UPGRADE=true
fi
if [ "x$IS_UPGRADE" != "xtrue" ]; then
if command -v systemctl >/dev/null; then
echo "### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd"
echo " sudo /bin/systemctl daemon-reload"
echo " sudo /bin/systemctl enable grafana-server"
echo "### You can start grafana-server by executing"
echo " sudo /bin/systemctl start grafana-server"
elif command -v update-rc.d >/dev/null; then
echo "### NOT starting grafana-server by default on bootup, please execute"
echo " sudo update-rc.d grafana-server defaults 95 10"
echo "### In order to start grafana-server, execute"
echo " sudo service grafana-server start"
fi
elif [ "$RESTART_ON_UPGRADE" = "true" ]; then
echo -n "Restarting grafana-server service..."
if command -v systemctl >/dev/null; then
systemctl daemon-reload
systemctl restart grafana-server || true
elif [ -x /etc/init.d/grafana-server ]; then
if command -v invoke-rc.d >/dev/null; then
invoke-rc.d grafana-server restart || true
else
/etc/init.d/grafana-server restart || true
fi
fi
echo " OK"
elif [ -x /usr/sbin/update-rc.d ] ; then
echo "### NOT starting grafana-server by default on bootup, please execute"
echo " sudo update-rc.d grafana-server defaults 95 10"
echo "### In order to start grafana-server, execute"
echo " sudo service grafana-server start"
fi
fi
;;
esac
+1 -1
View File
@@ -14,6 +14,6 @@ CONF_DIR=/etc/grafana
CONF_FILE=/etc/grafana/grafana.ini
RESTART_ON_UPGRADE=false
RESTART_ON_UPGRADE=true
PLUGINS_DIR=/var/lib/grafana/plugins
@@ -1,6 +1,6 @@
#! /usr/bin/env bash
deb_ver=4.0.0-1480439068
rpm_ver=4.0.0-1480439068
deb_ver=4.1.2-1486989747
rpm_ver=4.1.2-1486989747
wget https://grafanarel.s3.amazonaws.com/builds/grafana_${deb_ver}_amd64.deb
+14
View File
@@ -0,0 +1,14 @@
#! /usr/bin/env bash
deb_ver=4.1.0-1482230757beta1
rpm_ver=4.1.0-1482230757beta1
wget https://grafanarel.s3.amazonaws.com/builds/grafana_${deb_ver}_amd64.deb
package_cloud push grafana/testing/debian/jessie grafana_${deb_ver}_amd64.deb
package_cloud push grafana/testing/debian/wheezy grafana_${deb_ver}_amd64.deb
wget https://grafanarel.s3.amazonaws.com/builds/grafana-${rpm_ver}.x86_64.rpm
package_cloud push grafana/testing/el/6 grafana-${rpm_ver}.x86_64.rpm
package_cloud push grafana/testing/el/7 grafana-${rpm_ver}.x86_64.rpm
+7
View File
@@ -6,6 +6,7 @@ set -e
startGrafana() {
if [ -x /bin/systemctl ] ; then
/bin/systemctl daemon-reload
/bin/systemctl start grafana-server.service
elif [ -x /etc/init.d/grafana-server ] ; then
/etc/init.d/grafana-server start
@@ -37,6 +38,12 @@ if [ $1 -eq 1 ] ; then
-c "grafana user" grafana
fi
# copy user config files
if [ ! -f $CONF_FILE ]; then
cp /usr/share/grafana/conf/sample.ini $CONF_FILE
cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml
fi
# Set user permissions on /var/log/grafana, /var/lib/grafana
mkdir -p /var/log/grafana /var/lib/grafana
chown -R $GRAFANA_USER:$GRAFANA_GROUP /var/log/grafana /var/lib/grafana
+1 -1
View File
@@ -14,6 +14,6 @@ CONF_DIR=/etc/grafana
CONF_FILE=/etc/grafana/grafana.ini
RESTART_ON_UPGRADE=false
RESTART_ON_UPGRADE=true
PLUGINS_DIR=/var/lib/grafana/plugins
+37 -6
View File
@@ -73,9 +73,9 @@ func GetAlerts(c *middleware.Context) Response {
Name: alert.Name,
Message: alert.Message,
State: alert.State,
EvalDate: alert.EvalDate,
NewStateDate: alert.NewStateDate,
ExecutionError: alert.ExecutionError,
EvalData: alert.EvalData,
})
}
@@ -121,10 +121,10 @@ func AlertTest(c *middleware.Context, dto dtos.AlertTestCommand) Response {
}
res := backendCmd.Result
dtoRes := &dtos.AlertTestResult{
Firing: res.Firing,
ConditionEvals: res.ConditionEvals,
State: res.Rule.State,
}
if res.Error != nil {
@@ -173,6 +173,10 @@ func DelAlert(c *middleware.Context) Response {
return Json(200, resp)
}
func GetAlertNotifiers(c *middleware.Context) Response {
return Json(200, alerting.GetNotifiers())
}
func GetAlertNotifications(c *middleware.Context) Response {
query := &models.GetAllAlertNotificationsQuery{OrgId: c.OrgId}
@@ -259,10 +263,11 @@ func NotificationTest(c *middleware.Context, dto dtos.NotificationTestCommand) R
//POST /api/alerts/:alertId/pause
func PauseAlert(c *middleware.Context, dto dtos.PauseAlertCommand) Response {
alertId := c.ParamsInt64("alertId")
cmd := models.PauseAlertCommand{
OrgId: c.OrgId,
AlertId: c.ParamsInt64("alertId"),
Paused: dto.Paused,
OrgId: c.OrgId,
AlertIds: []int64{alertId},
Paused: dto.Paused,
}
if err := bus.Dispatch(&cmd); err != nil {
@@ -277,10 +282,36 @@ func PauseAlert(c *middleware.Context, dto dtos.PauseAlertCommand) Response {
}
result := map[string]interface{}{
"alertId": cmd.AlertId,
"alertId": alertId,
"state": response,
"message": "alert " + pausedState,
}
return Json(200, result)
}
//POST /api/admin/pause-all-alerts
func PauseAllAlerts(c *middleware.Context, dto dtos.PauseAllAlertsCommand) Response {
updateCmd := models.PauseAllAlertCommand{
Paused: dto.Paused,
}
if err := bus.Dispatch(&updateCmd); err != nil {
return ApiError(500, "Failed to pause alerts", err)
}
var response models.AlertStateType = models.AlertStatePending
pausedState := "un paused"
if updateCmd.Paused {
response = models.AlertStatePaused
pausedState = "paused"
}
result := map[string]interface{}{
"state": response,
"message": "alerts " + pausedState,
"alertsAffected": updateCmd.ResultCount,
}
return Json(200, result)
}
+16 -9
View File
@@ -4,14 +4,13 @@ import (
"github.com/go-macaron/binding"
"github.com/grafana/grafana/pkg/api/avatar"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/api/live"
"github.com/grafana/grafana/pkg/middleware"
m "github.com/grafana/grafana/pkg/models"
"gopkg.in/macaron.v1"
)
// Register adds http routes
func Register(r *macaron.Macaron) {
func (hs *HttpServer) registerRoutes() {
r := hs.macaron
reqSignedIn := middleware.Auth(&middleware.AuthOptions{ReqSignedIn: true})
reqGrafanaAdmin := middleware.Auth(&middleware.AuthOptions{ReqSignedIn: true, ReqGrafanaAdmin: true})
reqEditorRole := middleware.RoleAuth(m.ROLE_EDITOR, m.ROLE_ADMIN)
@@ -113,6 +112,9 @@ func Register(r *macaron.Macaron) {
r.Put("/password", bind(m.ChangeUserPasswordCommand{}), wrap(ChangeUserPassword))
r.Get("/quotas", wrap(GetUserQuotas))
r.Put("/helpflags/:id", wrap(SetHelpFlag))
// For dev purpose
r.Get("/helpflags/clear", wrap(ClearHelpFlags))
r.Get("/preferences", wrap(GetUserPreferences))
r.Put("/preferences", bind(dtos.UpdatePrefsCmd{}), wrap(UpdateUserPreferences))
@@ -121,8 +123,11 @@ func Register(r *macaron.Macaron) {
// users (admin permission required)
r.Group("/users", func() {
r.Get("/", wrap(SearchUsers))
r.Get("/search", wrap(SearchUsersWithPaging))
r.Get("/:id", wrap(GetUserById))
r.Get("/:id/orgs", wrap(GetUserOrgList))
// query parameters /users/lookup?loginOrEmail=admin@example.com
r.Get("/lookup", wrap(GetUserByLoginOrEmail))
r.Put("/:id", bind(m.UpdateUserCommand{}), wrap(UpdateUser))
r.Post("/:id/using/:orgId", wrap(UpdateUserActiveOrg))
}, reqGrafanaAdmin)
@@ -191,10 +196,11 @@ func Register(r *macaron.Macaron) {
// Data sources
r.Group("/datasources", func() {
r.Get("/", GetDataSources)
r.Get("/", wrap(GetDataSources))
r.Post("/", quota("data_source"), bind(m.AddDataSourceCommand{}), AddDataSource)
r.Put("/:id", bind(m.UpdateDataSourceCommand{}), UpdateDataSource)
r.Delete("/:id", DeleteDataSource)
r.Put("/:id", bind(m.UpdateDataSourceCommand{}), wrap(UpdateDataSource))
r.Delete("/:id", DeleteDataSourceById)
r.Delete("/name/:name", DeleteDataSourceByName)
r.Get("/:id", wrap(GetDataSourceById))
r.Get("/name/:name", wrap(GetDataSourceByName))
}, reqOrgAdmin)
@@ -259,6 +265,7 @@ func Register(r *macaron.Macaron) {
})
r.Get("/alert-notifications", wrap(GetAlertNotifications))
r.Get("/alert-notifiers", wrap(GetAlertNotifiers))
r.Group("/alert-notifications", func() {
r.Post("/test", bind(dtos.NotificationTestCommand{}), wrap(NotificationTest))
@@ -286,6 +293,7 @@ func Register(r *macaron.Macaron) {
r.Get("/users/:id/quotas", wrap(GetUserQuotas))
r.Put("/users/:id/quotas/:target", bind(m.UpdateUserQuotaCmd{}), wrap(UpdateUserQuota))
r.Get("/stats", AdminGetStats)
r.Post("/pause-all-alerts", bind(dtos.PauseAllAlertsCommand{}), wrap(PauseAllAlerts))
}, reqGrafanaAdmin)
// rendering
@@ -299,11 +307,10 @@ func Register(r *macaron.Macaron) {
r.Get("/avatar/:hash", avt.ServeHTTP)
// Websocket
liveConn := live.New()
r.Any("/ws", liveConn.Serve)
r.Any("/ws", hs.streamManager.Serve)
// streams
r.Post("/api/streams/push", reqSignedIn, bind(dtos.StreamMessage{}), liveConn.PushToStream)
//r.Post("/api/streams/push", reqSignedIn, bind(dtos.StreamMessage{}), liveConn.PushToStream)
InitAppPluginRoutes(r)
-35
View File
@@ -1,35 +0,0 @@
package api
import (
"testing"
)
func TestHttpApi(t *testing.T) {
// Convey("Given the grafana api", t, func() {
// ConveyApiScenario("Can sign up", func(c apiTestContext) {
// c.PostJson()
// So(c.Resp, ShouldEqualJsonApiResponse, "User created and logged in")
// })
//
// m := macaron.New()
// m.Use(middleware.GetContextHandler())
// m.Use(middleware.Sessioner(&session.Options{}))
// Register(m)
//
// var context *middleware.Context
// m.Get("/", func(c *middleware.Context) {
// context = c
// })
//
// resp := httptest.NewRecorder()
// req, err := http.NewRequest("GET", "/", nil)
// So(err, ShouldBeNil)
//
// m.ServeHTTP(resp, req)
//
// Convey("should red 200", func() {
// So(resp.Code, ShouldEqual, 200)
// })
// })
}
+115 -37
View File
@@ -17,7 +17,7 @@ import (
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/metrics"
"github.com/grafana/grafana/pkg/middleware"
m "github.com/grafana/grafana/pkg/models"
)
@@ -33,6 +33,39 @@ type cwRequest struct {
DataSource *m.DataSource
}
type datasourceInfo struct {
Profile string
Region string
AssumeRoleArn string
Namespace string
AccessKey string
SecretKey string
}
func (req *cwRequest) GetDatasourceInfo() *datasourceInfo {
assumeRoleArn := req.DataSource.JsonData.Get("assumeRoleArn").MustString()
accessKey := ""
secretKey := ""
for key, value := range req.DataSource.SecureJsonData.Decrypt() {
if key == "accessKey" {
accessKey = value
}
if key == "secretKey" {
secretKey = value
}
}
return &datasourceInfo{
AssumeRoleArn: assumeRoleArn,
Region: req.Region,
Profile: req.DataSource.Database,
AccessKey: accessKey,
SecretKey: secretKey,
}
}
func init() {
actionHandlers = map[string]actionHandler{
"GetMetricStatistics": handleGetMetricStatistics,
@@ -56,15 +89,15 @@ type cache struct {
var awsCredentialCache map[string]cache = make(map[string]cache)
var credentialCacheLock sync.RWMutex
func getCredentials(profile string, region string, assumeRoleArn string) *credentials.Credentials {
cacheKey := profile + ":" + assumeRoleArn
func getCredentials(dsInfo *datasourceInfo) (*credentials.Credentials, error) {
cacheKey := dsInfo.Profile + ":" + dsInfo.AssumeRoleArn
credentialCacheLock.RLock()
if _, ok := awsCredentialCache[cacheKey]; ok {
if awsCredentialCache[cacheKey].expiration != nil &&
(*awsCredentialCache[cacheKey].expiration).After(time.Now().UTC()) {
result := awsCredentialCache[cacheKey].credential
credentialCacheLock.RUnlock()
return result
return result, nil
}
}
credentialCacheLock.RUnlock()
@@ -74,9 +107,9 @@ func getCredentials(profile string, region string, assumeRoleArn string) *creden
sessionToken := ""
var expiration *time.Time
expiration = nil
if strings.Index(assumeRoleArn, "arn:aws:iam:") == 0 {
if strings.Index(dsInfo.AssumeRoleArn, "arn:aws:iam:") == 0 {
params := &sts.AssumeRoleInput{
RoleArn: aws.String(assumeRoleArn),
RoleArn: aws.String(dsInfo.AssumeRoleArn),
RoleSessionName: aws.String("GrafanaSession"),
DurationSeconds: aws.Int64(900),
}
@@ -85,18 +118,18 @@ func getCredentials(profile string, region string, assumeRoleArn string) *creden
stsCreds := credentials.NewChainCredentials(
[]credentials.Provider{
&credentials.EnvProvider{},
&credentials.SharedCredentialsProvider{Filename: "", Profile: profile},
&credentials.SharedCredentialsProvider{Filename: "", Profile: dsInfo.Profile},
&ec2rolecreds.EC2RoleProvider{Client: ec2metadata.New(stsSess), ExpiryWindow: 5 * time.Minute},
})
stsConfig := &aws.Config{
Region: aws.String(region),
Region: aws.String(dsInfo.Region),
Credentials: stsCreds,
}
svc := sts.New(session.New(stsConfig), stsConfig)
resp, err := svc.AssumeRole(params)
if err != nil {
// ignore
log.Error(3, "CloudWatch: Failed to assume role", err)
return nil, err
}
if resp.Credentials != nil {
accessKeyId = *resp.Credentials.AccessKeyId
@@ -115,9 +148,14 @@ func getCredentials(profile string, region string, assumeRoleArn string) *creden
SessionToken: sessionToken,
}},
&credentials.EnvProvider{},
&credentials.SharedCredentialsProvider{Filename: "", Profile: profile},
&credentials.StaticProvider{Value: credentials.Value{
AccessKeyID: dsInfo.AccessKey,
SecretAccessKey: dsInfo.SecretKey,
}},
&credentials.SharedCredentialsProvider{Filename: "", Profile: dsInfo.Profile},
&ec2rolecreds.EC2RoleProvider{Client: ec2metadata.New(sess), ExpiryWindow: 5 * time.Minute},
})
credentialCacheLock.Lock()
awsCredentialCache[cacheKey] = cache{
credential: creds,
@@ -125,31 +163,40 @@ func getCredentials(profile string, region string, assumeRoleArn string) *creden
}
credentialCacheLock.Unlock()
return creds
return creds, nil
}
func getAwsConfig(req *cwRequest) *aws.Config {
assumeRoleArn := req.DataSource.JsonData.Get("assumeRoleArn").MustString()
func getAwsConfig(req *cwRequest) (*aws.Config, error) {
creds, err := getCredentials(req.GetDatasourceInfo())
if err != nil {
return nil, err
}
cfg := &aws.Config{
Region: aws.String(req.Region),
Credentials: getCredentials(req.DataSource.Database, req.Region, assumeRoleArn),
Credentials: creds,
}
return cfg
return cfg, nil
}
func handleGetMetricStatistics(req *cwRequest, c *middleware.Context) {
cfg := getAwsConfig(req)
cfg, err := getAwsConfig(req)
if err != nil {
c.JsonApiErr(500, "Unable to call AWS API", err)
return
}
svc := cloudwatch.New(session.New(cfg), cfg)
reqParam := &struct {
Parameters struct {
Namespace string `json:"namespace"`
MetricName string `json:"metricName"`
Dimensions []*cloudwatch.Dimension `json:"dimensions"`
Statistics []*string `json:"statistics"`
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime"`
Period int64 `json:"period"`
Namespace string `json:"namespace"`
MetricName string `json:"metricName"`
Dimensions []*cloudwatch.Dimension `json:"dimensions"`
Statistics []*string `json:"statistics"`
ExtendedStatistics []*string `json:"extendedStatistics"`
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime"`
Period int64 `json:"period"`
} `json:"parameters"`
}{}
json.Unmarshal(req.Body, reqParam)
@@ -158,23 +205,33 @@ func handleGetMetricStatistics(req *cwRequest, c *middleware.Context) {
Namespace: aws.String(reqParam.Parameters.Namespace),
MetricName: aws.String(reqParam.Parameters.MetricName),
Dimensions: reqParam.Parameters.Dimensions,
Statistics: reqParam.Parameters.Statistics,
StartTime: aws.Time(time.Unix(reqParam.Parameters.StartTime, 0)),
EndTime: aws.Time(time.Unix(reqParam.Parameters.EndTime, 0)),
Period: aws.Int64(reqParam.Parameters.Period),
}
if len(reqParam.Parameters.Statistics) != 0 {
params.Statistics = reqParam.Parameters.Statistics
}
if len(reqParam.Parameters.ExtendedStatistics) != 0 {
params.ExtendedStatistics = reqParam.Parameters.ExtendedStatistics
}
resp, err := svc.GetMetricStatistics(params)
if err != nil {
c.JsonApiErr(500, "Unable to call AWS API", err)
return
}
metrics.M_Aws_CloudWatch_GetMetricStatistics.Inc(1)
c.JSON(200, resp)
}
func handleListMetrics(req *cwRequest, c *middleware.Context) {
cfg := getAwsConfig(req)
cfg, err := getAwsConfig(req)
if err != nil {
c.JsonApiErr(500, "Unable to call AWS API", err)
return
}
svc := cloudwatch.New(session.New(cfg), cfg)
reqParam := &struct {
@@ -193,8 +250,9 @@ func handleListMetrics(req *cwRequest, c *middleware.Context) {
}
var resp cloudwatch.ListMetricsOutput
err := svc.ListMetricsPages(params,
err = svc.ListMetricsPages(params,
func(page *cloudwatch.ListMetricsOutput, lastPage bool) bool {
metrics.M_Aws_CloudWatch_ListMetrics.Inc(1)
metrics, _ := awsutil.ValuesAtPath(page, "Metrics")
for _, metric := range metrics {
resp.Metrics = append(resp.Metrics, metric.(*cloudwatch.Metric))
@@ -210,7 +268,11 @@ func handleListMetrics(req *cwRequest, c *middleware.Context) {
}
func handleDescribeAlarms(req *cwRequest, c *middleware.Context) {
cfg := getAwsConfig(req)
cfg, err := getAwsConfig(req)
if err != nil {
c.JsonApiErr(500, "Unable to call AWS API", err)
return
}
svc := cloudwatch.New(session.New(cfg), cfg)
reqParam := &struct {
@@ -249,16 +311,21 @@ func handleDescribeAlarms(req *cwRequest, c *middleware.Context) {
}
func handleDescribeAlarmsForMetric(req *cwRequest, c *middleware.Context) {
cfg := getAwsConfig(req)
cfg, err := getAwsConfig(req)
if err != nil {
c.JsonApiErr(500, "Unable to call AWS API", err)
return
}
svc := cloudwatch.New(session.New(cfg), cfg)
reqParam := &struct {
Parameters struct {
Namespace string `json:"namespace"`
MetricName string `json:"metricName"`
Dimensions []*cloudwatch.Dimension `json:"dimensions"`
Statistic string `json:"statistic"`
Period int64 `json:"period"`
Namespace string `json:"namespace"`
MetricName string `json:"metricName"`
Dimensions []*cloudwatch.Dimension `json:"dimensions"`
Statistic string `json:"statistic"`
ExtendedStatistic string `json:"extendedStatistic"`
Period int64 `json:"period"`
} `json:"parameters"`
}{}
json.Unmarshal(req.Body, reqParam)
@@ -274,6 +341,9 @@ func handleDescribeAlarmsForMetric(req *cwRequest, c *middleware.Context) {
if reqParam.Parameters.Statistic != "" {
params.Statistic = aws.String(reqParam.Parameters.Statistic)
}
if reqParam.Parameters.ExtendedStatistic != "" {
params.ExtendedStatistic = aws.String(reqParam.Parameters.ExtendedStatistic)
}
resp, err := svc.DescribeAlarmsForMetric(params)
if err != nil {
@@ -285,7 +355,11 @@ func handleDescribeAlarmsForMetric(req *cwRequest, c *middleware.Context) {
}
func handleDescribeAlarmHistory(req *cwRequest, c *middleware.Context) {
cfg := getAwsConfig(req)
cfg, err := getAwsConfig(req)
if err != nil {
c.JsonApiErr(500, "Unable to call AWS API", err)
return
}
svc := cloudwatch.New(session.New(cfg), cfg)
reqParam := &struct {
@@ -317,7 +391,11 @@ func handleDescribeAlarmHistory(req *cwRequest, c *middleware.Context) {
}
func handleDescribeInstances(req *cwRequest, c *middleware.Context) {
cfg := getAwsConfig(req)
cfg, err := getAwsConfig(req)
if err != nil {
c.JsonApiErr(500, "Unable to call AWS API", err)
return
}
svc := ec2.New(session.New(cfg), cfg)
reqParam := &struct {
@@ -337,7 +415,7 @@ func handleDescribeInstances(req *cwRequest, c *middleware.Context) {
}
var resp ec2.DescribeInstancesOutput
err := svc.DescribeInstancesPages(params,
err = svc.DescribeInstancesPages(params,
func(page *ec2.DescribeInstancesOutput, lastPage bool) bool {
reservations, _ := awsutil.ValuesAtPath(page, "Reservations")
for _, reservation := range reservations {
+56 -44
View File
@@ -11,6 +11,7 @@ import (
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/grafana/grafana/pkg/metrics"
"github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/util"
)
@@ -81,6 +82,7 @@ func init() {
"AWS/RDS": {"ActiveTransactions", "AuroraBinlogReplicaLag", "AuroraReplicaLag", "AuroraReplicaLagMaximum", "AuroraReplicaLagMinimum", "BinLogDiskUsage", "BlockedTransactions", "BufferCacheHitRatio", "CommitLatency", "CommitThroughput", "CPUCreditBalance", "CPUCreditUsage", "CPUUtilization", "DatabaseConnections", "DDLLatency", "DDLThroughput", "Deadlocks", "DiskQueueDepth", "DMLLatency", "DMLThroughput", "FailedSqlStatements", "FreeableMemory", "FreeStorageSpace", "LoginFailures", "NetworkReceiveThroughput", "NetworkTransmitThroughput", "ReadIOPS", "ReadLatency", "ReadThroughput", "ReplicaLag", "ResultSetCacheHitRatio", "SelectLatency", "SelectThroughput", "SwapUsage", "TotalConnections", "VolumeReadIOPS", "VolumeWriteIOPS", "WriteIOPS", "WriteLatency", "WriteThroughput"},
"AWS/Route53": {"HealthCheckStatus", "HealthCheckPercentageHealthy", "ConnectionTime", "SSLHandshakeTime", "TimeToFirstByte"},
"AWS/S3": {"BucketSizeBytes", "NumberOfObjects"},
"AWS/SES": {"Bounce", "Complaint", "Delivery", "Reject", "Send"},
"AWS/SNS": {"NumberOfMessagesPublished", "PublishSize", "NumberOfNotificationsDelivered", "NumberOfNotificationsFailed"},
"AWS/SQS": {"NumberOfMessagesSent", "SentMessageSize", "NumberOfMessagesReceived", "NumberOfEmptyReceives", "NumberOfMessagesDeleted", "ApproximateNumberOfMessagesDelayed", "ApproximateNumberOfMessagesVisible", "ApproximateNumberOfMessagesNotVisible"},
"AWS/StorageGateway": {"CacheHitPercent", "CachePercentUsed", "CachePercentDirty", "CloudBytesDownloaded", "CloudDownloadLatency", "CloudBytesUploaded", "UploadBufferFree", "UploadBufferPercentUsed", "UploadBufferUsed", "QueuedWrites", "ReadBytes", "ReadTime", "TotalCacheSize", "WriteBytes", "WriteTime", "TimeSinceLastRecoveryPoint", "WorkingStorageFree", "WorkingStoragePercentUsed", "WorkingStorageUsed",
@@ -110,7 +112,7 @@ func init() {
"AWS/ElasticMapReduce": {"ClusterId", "JobFlowId", "JobId"},
"AWS/ES": {"ClientId", "DomainName"},
"AWS/Events": {"RuleName"},
"AWS/Firehose": {},
"AWS/Firehose": {"DeliveryStreamName"},
"AWS/IoT": {"Protocol"},
"AWS/Kinesis": {"StreamName", "ShardID"},
"AWS/KinesisAnalytics": {"Flow", "Id", "Application"},
@@ -122,6 +124,7 @@ func init() {
"AWS/RDS": {"DBInstanceIdentifier", "DBClusterIdentifier", "DatabaseClass", "EngineName"},
"AWS/Route53": {"HealthCheckId"},
"AWS/S3": {"BucketName", "StorageType"},
"AWS/SES": {},
"AWS/SNS": {"Application", "Platform", "TopicName"},
"AWS/SQS": {"QueueName"},
"AWS/StorageGateway": {"GatewayId", "GatewayName", "VolumeId"},
@@ -139,8 +142,8 @@ func init() {
// Please update the region list in public/app/plugins/datasource/cloudwatch/partials/config.html
func handleGetRegions(req *cwRequest, c *middleware.Context) {
regions := []string{
"ap-northeast-1", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "cn-north-1",
"eu-central-1", "eu-west-1", "sa-east-1", "us-east-1", "us-west-1", "us-west-2", "us-gov-west-1",
"ap-northeast-1", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-south-1", "ca-central-1", "cn-north-1",
"eu-central-1", "eu-west-1", "eu-west-2", "sa-east-1", "us-east-1", "us-east-2", "us-gov-west-1", "us-west-1", "us-west-2",
}
result := []interface{}{}
@@ -192,8 +195,10 @@ func handleGetMetrics(req *cwRequest, c *middleware.Context) {
}
} else {
var err error
assumeRoleArn := req.DataSource.JsonData.Get("assumeRoleArn").MustString()
if namespaceMetrics, err = getMetricsForCustomMetrics(req.Region, reqParam.Parameters.Namespace, req.DataSource.Database, assumeRoleArn, getAllMetrics); err != nil {
cwData := req.GetDatasourceInfo()
cwData.Namespace = reqParam.Parameters.Namespace
if namespaceMetrics, err = getMetricsForCustomMetrics(cwData, getAllMetrics); err != nil {
c.JsonApiErr(500, "Unable to call AWS API", err)
return
}
@@ -226,8 +231,10 @@ func handleGetDimensions(req *cwRequest, c *middleware.Context) {
}
} else {
var err error
assumeRoleArn := req.DataSource.JsonData.Get("assumeRoleArn").MustString()
if dimensionValues, err = getDimensionsForCustomMetrics(req.Region, reqParam.Parameters.Namespace, req.DataSource.Database, assumeRoleArn, getAllMetrics); err != nil {
dsInfo := req.GetDatasourceInfo()
dsInfo.Namespace = reqParam.Parameters.Namespace
if dimensionValues, err = getDimensionsForCustomMetrics(dsInfo, getAllMetrics); err != nil {
c.JsonApiErr(500, "Unable to call AWS API", err)
return
}
@@ -242,21 +249,26 @@ func handleGetDimensions(req *cwRequest, c *middleware.Context) {
c.JSON(200, result)
}
func getAllMetrics(region string, namespace string, database string, assumeRoleArn string) (cloudwatch.ListMetricsOutput, error) {
func getAllMetrics(cwData *datasourceInfo) (cloudwatch.ListMetricsOutput, error) {
creds, err := getCredentials(cwData)
if err != nil {
return cloudwatch.ListMetricsOutput{}, err
}
cfg := &aws.Config{
Region: aws.String(region),
Credentials: getCredentials(database, region, assumeRoleArn),
Region: aws.String(cwData.Region),
Credentials: creds,
}
svc := cloudwatch.New(session.New(cfg), cfg)
params := &cloudwatch.ListMetricsInput{
Namespace: aws.String(namespace),
Namespace: aws.String(cwData.Namespace),
}
var resp cloudwatch.ListMetricsOutput
err := svc.ListMetricsPages(params,
err = svc.ListMetricsPages(params,
func(page *cloudwatch.ListMetricsOutput, lastPage bool) bool {
metrics.M_Aws_CloudWatch_ListMetrics.Inc(1)
metrics, _ := awsutil.ValuesAtPath(page, "Metrics")
for _, metric := range metrics {
resp.Metrics = append(resp.Metrics, metric.(*cloudwatch.Metric))
@@ -272,8 +284,8 @@ func getAllMetrics(region string, namespace string, database string, assumeRoleA
var metricsCacheLock sync.Mutex
func getMetricsForCustomMetrics(region string, namespace string, database string, assumeRoleArn string, getAllMetrics func(string, string, string, string) (cloudwatch.ListMetricsOutput, error)) ([]string, error) {
result, err := getAllMetrics(region, namespace, database, assumeRoleArn)
func getMetricsForCustomMetrics(dsInfo *datasourceInfo, getAllMetrics func(*datasourceInfo) (cloudwatch.ListMetricsOutput, error)) ([]string, error) {
result, err := getAllMetrics(dsInfo)
if err != nil {
return []string{}, err
}
@@ -281,37 +293,37 @@ func getMetricsForCustomMetrics(region string, namespace string, database string
metricsCacheLock.Lock()
defer metricsCacheLock.Unlock()
if _, ok := customMetricsMetricsMap[database]; !ok {
customMetricsMetricsMap[database] = make(map[string]map[string]*CustomMetricsCache)
if _, ok := customMetricsMetricsMap[dsInfo.Profile]; !ok {
customMetricsMetricsMap[dsInfo.Profile] = make(map[string]map[string]*CustomMetricsCache)
}
if _, ok := customMetricsMetricsMap[database][region]; !ok {
customMetricsMetricsMap[database][region] = make(map[string]*CustomMetricsCache)
if _, ok := customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region]; !ok {
customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region] = make(map[string]*CustomMetricsCache)
}
if _, ok := customMetricsMetricsMap[database][region][namespace]; !ok {
customMetricsMetricsMap[database][region][namespace] = &CustomMetricsCache{}
customMetricsMetricsMap[database][region][namespace].Cache = make([]string, 0)
if _, ok := customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace]; !ok {
customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace] = &CustomMetricsCache{}
customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache = make([]string, 0)
}
if customMetricsMetricsMap[database][region][namespace].Expire.After(time.Now()) {
return customMetricsMetricsMap[database][region][namespace].Cache, nil
if customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Expire.After(time.Now()) {
return customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache, nil
}
customMetricsMetricsMap[database][region][namespace].Cache = make([]string, 0)
customMetricsMetricsMap[database][region][namespace].Expire = time.Now().Add(5 * time.Minute)
customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache = make([]string, 0)
customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Expire = time.Now().Add(5 * time.Minute)
for _, metric := range result.Metrics {
if isDuplicate(customMetricsMetricsMap[database][region][namespace].Cache, *metric.MetricName) {
if isDuplicate(customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache, *metric.MetricName) {
continue
}
customMetricsMetricsMap[database][region][namespace].Cache = append(customMetricsMetricsMap[database][region][namespace].Cache, *metric.MetricName)
customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache = append(customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache, *metric.MetricName)
}
return customMetricsMetricsMap[database][region][namespace].Cache, nil
return customMetricsMetricsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache, nil
}
var dimensionsCacheLock sync.Mutex
func getDimensionsForCustomMetrics(region string, namespace string, database string, assumeRoleArn string, getAllMetrics func(string, string, string, string) (cloudwatch.ListMetricsOutput, error)) ([]string, error) {
result, err := getAllMetrics(region, namespace, database, assumeRoleArn)
func getDimensionsForCustomMetrics(dsInfo *datasourceInfo, getAllMetrics func(*datasourceInfo) (cloudwatch.ListMetricsOutput, error)) ([]string, error) {
result, err := getAllMetrics(dsInfo)
if err != nil {
return []string{}, err
}
@@ -319,33 +331,33 @@ func getDimensionsForCustomMetrics(region string, namespace string, database str
dimensionsCacheLock.Lock()
defer dimensionsCacheLock.Unlock()
if _, ok := customMetricsDimensionsMap[database]; !ok {
customMetricsDimensionsMap[database] = make(map[string]map[string]*CustomMetricsCache)
if _, ok := customMetricsDimensionsMap[dsInfo.Profile]; !ok {
customMetricsDimensionsMap[dsInfo.Profile] = make(map[string]map[string]*CustomMetricsCache)
}
if _, ok := customMetricsDimensionsMap[database][region]; !ok {
customMetricsDimensionsMap[database][region] = make(map[string]*CustomMetricsCache)
if _, ok := customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region]; !ok {
customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region] = make(map[string]*CustomMetricsCache)
}
if _, ok := customMetricsDimensionsMap[database][region][namespace]; !ok {
customMetricsDimensionsMap[database][region][namespace] = &CustomMetricsCache{}
customMetricsDimensionsMap[database][region][namespace].Cache = make([]string, 0)
if _, ok := customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace]; !ok {
customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace] = &CustomMetricsCache{}
customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache = make([]string, 0)
}
if customMetricsDimensionsMap[database][region][namespace].Expire.After(time.Now()) {
return customMetricsDimensionsMap[database][region][namespace].Cache, nil
if customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Expire.After(time.Now()) {
return customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache, nil
}
customMetricsDimensionsMap[database][region][namespace].Cache = make([]string, 0)
customMetricsDimensionsMap[database][region][namespace].Expire = time.Now().Add(5 * time.Minute)
customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache = make([]string, 0)
customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Expire = time.Now().Add(5 * time.Minute)
for _, metric := range result.Metrics {
for _, dimension := range metric.Dimensions {
if isDuplicate(customMetricsDimensionsMap[database][region][namespace].Cache, *dimension.Name) {
if isDuplicate(customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache, *dimension.Name) {
continue
}
customMetricsDimensionsMap[database][region][namespace].Cache = append(customMetricsDimensionsMap[database][region][namespace].Cache, *dimension.Name)
customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache = append(customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache, *dimension.Name)
}
}
return customMetricsDimensionsMap[database][region][namespace].Cache, nil
return customMetricsDimensionsMap[dsInfo.Profile][dsInfo.Region][dsInfo.Namespace].Cache, nil
}
func isDuplicate(nameList []string, target string) bool {
+16 -12
View File
@@ -11,11 +11,13 @@ import (
func TestCloudWatchMetrics(t *testing.T) {
Convey("When calling getMetricsForCustomMetrics", t, func() {
region := "us-east-1"
namespace := "Foo"
database := "default"
assumeRoleArn := ""
f := func(region string, namespace string, database string, assumeRoleArn string) (cloudwatch.ListMetricsOutput, error) {
dsInfo := &datasourceInfo{
Region: "us-east-1",
Namespace: "Foo",
Profile: "default",
AssumeRoleArn: "",
}
f := func(dsInfo *datasourceInfo) (cloudwatch.ListMetricsOutput, error) {
return cloudwatch.ListMetricsOutput{
Metrics: []*cloudwatch.Metric{
{
@@ -29,7 +31,7 @@ func TestCloudWatchMetrics(t *testing.T) {
},
}, nil
}
metrics, _ := getMetricsForCustomMetrics(region, namespace, database, assumeRoleArn, f)
metrics, _ := getMetricsForCustomMetrics(dsInfo, f)
Convey("Should contain Test_MetricName", func() {
So(metrics, ShouldContain, "Test_MetricName")
@@ -37,11 +39,13 @@ func TestCloudWatchMetrics(t *testing.T) {
})
Convey("When calling getDimensionsForCustomMetrics", t, func() {
region := "us-east-1"
namespace := "Foo"
database := "default"
assumeRoleArn := ""
f := func(region string, namespace string, database string, assumeRoleArn string) (cloudwatch.ListMetricsOutput, error) {
dsInfo := &datasourceInfo{
Region: "us-east-1",
Namespace: "Foo",
Profile: "default",
AssumeRoleArn: "",
}
f := func(dsInfo *datasourceInfo) (cloudwatch.ListMetricsOutput, error) {
return cloudwatch.ListMetricsOutput{
Metrics: []*cloudwatch.Metric{
{
@@ -55,7 +59,7 @@ func TestCloudWatchMetrics(t *testing.T) {
},
}, nil
}
dimensionKeys, _ := getDimensionsForCustomMetrics(region, namespace, database, assumeRoleArn, f)
dimensionKeys, _ := getDimensionsForCustomMetrics(dsInfo, f)
Convey("Should contain Test_DimensionName", func() {
So(dimensionKeys, ShouldContain, "Test_DimensionName")
+24
View File
@@ -8,6 +8,7 @@ import (
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/metrics"
"github.com/grafana/grafana/pkg/middleware"
@@ -121,6 +122,10 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) Response {
}
dash := cmd.GetDashboardModel()
// Check if Title is empty
if dash.Title == "" {
return ApiError(400, m.ErrDashboardTitleEmpty.Error(), nil)
}
if dash.Id == 0 {
limitReached, err := middleware.QuotaReached(c, "dashboard")
if err != nil {
@@ -212,9 +217,28 @@ func GetHomeDashboard(c *middleware.Context) Response {
return ApiError(500, "Failed to load home dashboard", err)
}
if c.HasUserRole(m.ROLE_ADMIN) && !c.HasHelpFlag(m.HelpFlagGettingStartedPanelDismissed) {
addGettingStartedPanelToHomeDashboard(dash.Dashboard)
}
return Json(200, &dash)
}
func addGettingStartedPanelToHomeDashboard(dash *simplejson.Json) {
rows := dash.Get("rows").MustArray()
row := simplejson.NewFromAny(rows[0])
newpanel := simplejson.NewFromAny(map[string]interface{}{
"type": "gettingstarted",
"id": 123123,
"span": 12,
})
panels := row.Get("panels").MustArray()
panels = append(panels, newpanel)
row.Set("panels", panels)
}
func GetDashboardFromJsonFile(c *middleware.Context) {
file := c.Params(":file")
+41 -73
View File
@@ -1,17 +1,17 @@
package api
import (
"crypto/tls"
"crypto/x509"
"net"
"bytes"
"io/ioutil"
"net/http"
"net/http/httputil"
"net/url"
"sync"
"strings"
"time"
"github.com/grafana/grafana/pkg/api/cloudwatch"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/metrics"
"github.com/grafana/grafana/pkg/middleware"
m "github.com/grafana/grafana/pkg/models"
@@ -19,74 +19,9 @@ import (
"github.com/grafana/grafana/pkg/util"
)
type proxyTransportCache struct {
cache map[int64]cachedTransport
sync.Mutex
}
type cachedTransport struct {
updated time.Time
*http.Transport
}
var ptc = proxyTransportCache{
cache: make(map[int64]cachedTransport),
}
func DataProxyTransport(ds *m.DataSource) (*http.Transport, error) {
ptc.Lock()
defer ptc.Unlock()
if t, present := ptc.cache[ds.Id]; present && ds.Updated.Equal(t.updated) {
return t.Transport, nil
}
transport := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
Proxy: http.ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
}
var tlsAuth, tlsAuthWithCACert bool
if ds.JsonData != nil {
tlsAuth = ds.JsonData.Get("tlsAuth").MustBool(false)
tlsAuthWithCACert = ds.JsonData.Get("tlsAuthWithCACert").MustBool(false)
}
if tlsAuth {
transport.TLSClientConfig.InsecureSkipVerify = false
decrypted := ds.SecureJsonData.Decrypt()
if tlsAuthWithCACert && len(decrypted["tlsCACert"]) > 0 {
caPool := x509.NewCertPool()
ok := caPool.AppendCertsFromPEM([]byte(decrypted["tlsCACert"]))
if ok {
transport.TLSClientConfig.RootCAs = caPool
}
}
cert, err := tls.X509KeyPair([]byte(decrypted["tlsClientCert"]), []byte(decrypted["tlsClientKey"]))
if err != nil {
return nil, err
}
transport.TLSClientConfig.Certificates = []tls.Certificate{cert}
}
ptc.cache[ds.Id] = cachedTransport{
Transport: transport,
updated: ds.Updated,
}
return transport, nil
}
var (
dataproxyLogger log.Logger = log.New("data-proxy-log")
)
func NewReverseProxy(ds *m.DataSource, proxyPath string, targetUrl *url.URL) *httputil.ReverseProxy {
director := func(req *http.Request) {
@@ -173,6 +108,13 @@ func ProxyDataSourceRequest(c *middleware.Context) {
proxyPath := c.Params("*")
if ds.Type == m.DS_PROMETHEUS {
if c.Req.Request.Method != http.MethodGet || !strings.HasPrefix(proxyPath, "api/") {
c.JsonApiErr(403, "GET is only allowed on proxied Prometheus datasource", nil)
return
}
}
if ds.Type == m.DS_ES {
if c.Req.Request.Method == "DELETE" {
c.JsonApiErr(403, "Deletes not allowed on proxied Elasticsearch datasource", nil)
@@ -189,11 +131,37 @@ func ProxyDataSourceRequest(c *middleware.Context) {
}
proxy := NewReverseProxy(ds, proxyPath, targetUrl)
proxy.Transport, err = DataProxyTransport(ds)
proxy.Transport, err = ds.GetHttpTransport()
if err != nil {
c.JsonApiErr(400, "Unable to load TLS certificate", err)
return
}
logProxyRequest(ds.Type, c)
proxy.ServeHTTP(c.Resp, c.Req.Request)
c.Resp.Header().Del("Set-Cookie")
}
func logProxyRequest(dataSourceType string, c *middleware.Context) {
if !setting.DataProxyLogging {
return
}
var body string
if c.Req.Request.Body != nil {
buffer, err := ioutil.ReadAll(c.Req.Request.Body)
if err == nil {
c.Req.Request.Body = ioutil.NopCloser(bytes.NewBuffer(buffer))
body = string(buffer)
}
}
dataproxyLogger.Info("Proxying incoming request",
"userid", c.UserId,
"orgid", c.OrgId,
"username", c.Login,
"datasource", dataSourceType,
"uri", c.Req.RequestURI,
"method", c.Req.Request.Method,
"body", body)
}
+1 -152
View File
@@ -4,24 +4,18 @@ import (
"net/http"
"net/url"
"testing"
"time"
. "github.com/smartystreets/goconvey/convey"
"github.com/grafana/grafana/pkg/components/simplejson"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util"
)
func TestDataSourceProxy(t *testing.T) {
Convey("When getting graphite datasource proxy", t, func() {
clearCache()
ds := m.DataSource{Url: "htttp://graphite:8080", Type: m.DS_GRAPHITE}
targetUrl, err := url.Parse(ds.Url)
proxy := NewReverseProxy(&ds, "/render", targetUrl)
proxy.Transport, err = DataProxyTransport(&ds)
proxy.Transport, err = ds.GetHttpTransport()
So(err, ShouldBeNil)
transport, ok := proxy.Transport.(*http.Transport)
@@ -40,7 +34,6 @@ func TestDataSourceProxy(t *testing.T) {
})
Convey("When getting influxdb datasource proxy", t, func() {
clearCache()
ds := m.DataSource{
Type: m.DS_INFLUXDB_08,
Url: "http://influxdb:8083",
@@ -67,148 +60,4 @@ func TestDataSourceProxy(t *testing.T) {
So(queryVals["p"][0], ShouldEqual, "password")
})
})
Convey("When caching a datasource proxy", t, func() {
clearCache()
ds := m.DataSource{
Id: 1,
Url: "http://k8s:8001",
Type: "Kubernetes",
}
t1, err := DataProxyTransport(&ds)
So(err, ShouldBeNil)
t2, err := DataProxyTransport(&ds)
So(err, ShouldBeNil)
Convey("Should be using the cached proxy", func() {
So(t2, ShouldEqual, t1)
})
})
Convey("When getting kubernetes datasource proxy", t, func() {
clearCache()
setting.SecretKey = "password"
json := simplejson.New()
json.Set("tlsAuth", true)
json.Set("tlsAuthWithCACert", true)
t := time.Now()
ds := m.DataSource{
Url: "http://k8s:8001",
Type: "Kubernetes",
Updated: t.Add(-2 * time.Minute),
}
transport, err := DataProxyTransport(&ds)
So(err, ShouldBeNil)
Convey("Should have no cert", func() {
So(transport.TLSClientConfig.InsecureSkipVerify, ShouldEqual, true)
})
ds.JsonData = json
ds.SecureJsonData = map[string][]byte{
"tlsCACert": util.Encrypt([]byte(caCert), "password"),
"tlsClientCert": util.Encrypt([]byte(clientCert), "password"),
"tlsClientKey": util.Encrypt([]byte(clientKey), "password"),
}
ds.Updated = t.Add(-1 * time.Minute)
transport, err = DataProxyTransport(&ds)
So(err, ShouldBeNil)
Convey("Should add cert", func() {
So(transport.TLSClientConfig.InsecureSkipVerify, ShouldEqual, false)
So(len(transport.TLSClientConfig.Certificates), ShouldEqual, 1)
})
ds.JsonData = nil
ds.SecureJsonData = map[string][]byte{}
ds.Updated = t
transport, err = DataProxyTransport(&ds)
So(err, ShouldBeNil)
Convey("Should remove cert", func() {
So(transport.TLSClientConfig.InsecureSkipVerify, ShouldEqual, true)
So(len(transport.TLSClientConfig.Certificates), ShouldEqual, 0)
})
})
}
func clearCache() {
ptc.Lock()
defer ptc.Unlock()
ptc.cache = make(map[int64]cachedTransport)
}
const caCert string = `-----BEGIN CERTIFICATE-----
MIIDATCCAemgAwIBAgIJAMQ5hC3CPDTeMA0GCSqGSIb3DQEBCwUAMBcxFTATBgNV
BAMMDGNhLWs4cy1zdGhsbTAeFw0xNjEwMjcwODQyMjdaFw00NDAzMTQwODQyMjda
MBcxFTATBgNVBAMMDGNhLWs4cy1zdGhsbTCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBAMLe2AmJ6IleeUt69vgNchOjjmxIIxz5sp1vFu94m1vUip7CqnOg
QkpUsHeBPrGYv8UGloARCL1xEWS+9FVZeXWQoDmbC0SxXhFwRIESNCET7Q8KMi/4
4YPvnMLGZi3Fjwxa8BdUBCN1cx4WEooMVTWXm7RFMtZgDfuOAn3TNXla732sfT/d
1HNFrh48b0wA+HhmA3nXoBnBEblA665hCeo7lIAdRr0zJxJpnFnWXkyTClsAUTMN
iL905LdBiiIRenojipfKXvMz88XSaWTI7JjZYU3BvhyXndkT6f12cef3I96NY3WJ
0uIK4k04WrbzdYXMU3rN6NqlvbHqnI+E7aMCAwEAAaNQME4wHQYDVR0OBBYEFHHx
2+vSPw9bECHj3O51KNo5VdWOMB8GA1UdIwQYMBaAFHHx2+vSPw9bECHj3O51KNo5
VdWOMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAH2eV5NcV3LBJHs9
I+adbiTPg2vyumrGWwy73T0X8Dtchgt8wU7Q9b9Ucg2fOTmSSyS0iMqEu1Yb2ORB
CknM9mixHC9PwEBbkGCom3VVkqdLwSP6gdILZgyLoH4i8sTUz+S1yGPepi+Vzhs7
adOXtryjcGnwft6HdfKPNklMOHFnjw6uqpho54oj/z55jUpicY/8glDHdrr1bh3k
MHuiWLGewHXPvxfG6UoUx1te65IhifVcJGFZDQwfEmhBflfCmtAJlZEsgTLlBBCh
FHoXIyGOdq1chmRVocdGBCF8fUoGIbuF14r53rpvcbEKtKnnP8+96luKAZLq0a4n
3lb92xM=
-----END CERTIFICATE-----`
const clientCert string = `-----BEGIN CERTIFICATE-----
MIICsjCCAZoCCQCcd8sOfstQLzANBgkqhkiG9w0BAQsFADAXMRUwEwYDVQQDDAxj
YS1rOHMtc3RobG0wHhcNMTYxMTAyMDkyNTE1WhcNMTcxMTAyMDkyNTE1WjAfMR0w
GwYDVQQDDBRhZG0tZGFuaWVsLWs4cy1zdGhsbTCCASIwDQYJKoZIhvcNAQEBBQAD
ggEPADCCAQoCggEBAOMliaWyNEUJKM37vWCl5bGub3lMicyRAqGQyY/qxD9yKKM2
FbucVcmWmg5vvTqQVl5rlQ+c7GI8OD6ptmFl8a26coEki7bFr8bkpSyBSEc5p27b
Z0ORFSqBHWHQbr9PkxPLYW6T3gZYUtRYv3OQgGxLXlvUh85n/mQfuR3N1FgmShHo
GtAFi/ht6leXa0Ms+jNSDLCmXpJm1GIEqgyKX7K3+g3vzo9coYqXq4XTa8Efs2v8
SCwqWfBC3rHfgs/5DLB8WT4Kul8QzxkytzcaBQfRfzhSV6bkgm7oTzt2/1eRRsf4
YnXzLE9YkCC9sAn+Owzqf+TYC1KRluWDfqqBTJUCAwEAATANBgkqhkiG9w0BAQsF
AAOCAQEAdMsZg6edWGC+xngizn0uamrUg1ViaDqUsz0vpzY5NWLA4MsBc4EtxWRP
ueQvjUimZ3U3+AX0YWNLIrH1FCVos2jdij/xkTUmHcwzr8rQy+B17cFi+a8jtpgw
AU6WWoaAIEhhbWQfth/Diz3mivl1ARB+YqiWca2mjRPLTPcKJEURDVddQ423el0Q
4JNxS5icu7T2zYTYHAo/cT9zVdLZl0xuLxYm3asK1IONJ/evxyVZima3il6MPvhe
58Hwz+m+HdqHxi24b/1J/VKYbISG4huOQCdLzeNXgvwFlGPUmHSnnKo1/KbQDAR5
llG/Sw5+FquFuChaA6l5KWy7F3bQyA==
-----END CERTIFICATE-----`
const clientKey string = `-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA4yWJpbI0RQkozfu9YKXlsa5veUyJzJECoZDJj+rEP3IoozYV
u5xVyZaaDm+9OpBWXmuVD5zsYjw4Pqm2YWXxrbpygSSLtsWvxuSlLIFIRzmnbttn
Q5EVKoEdYdBuv0+TE8thbpPeBlhS1Fi/c5CAbEteW9SHzmf+ZB+5Hc3UWCZKEega
0AWL+G3qV5drQyz6M1IMsKZekmbUYgSqDIpfsrf6De/Oj1yhiperhdNrwR+za/xI
LCpZ8ELesd+Cz/kMsHxZPgq6XxDPGTK3NxoFB9F/OFJXpuSCbuhPO3b/V5FGx/hi
dfMsT1iQIL2wCf47DOp/5NgLUpGW5YN+qoFMlQIDAQABAoIBAQCzy4u312XeW1Cs
Mx6EuOwmh59/ESFmBkZh4rxZKYgrfE5EWlQ7i5SwG4BX+wR6rbNfy6JSmHDXlTkk
CKvvToVNcW6fYHEivDnVojhIERFIJ4+rhQmpBtcNLOQ3/4cZ8X/GxE6b+3lb5l+x
64mnjPLKRaIr5/+TVuebEy0xNTJmjnJ7yiB2HRz7uXEQaVSk/P7KAkkyl/9J3/LM
8N9AX1w6qDaNQZ4/P0++1H4SQenosM/b/GqGTomarEk/GE0NcB9rzmR9VCXa7FRh
WV5jyt9vUrwIEiK/6nUnOkGO8Ei3kB7Y+e+2m6WdaNoU5RAfqXmXa0Q/a0lLRruf
vTMo2WrBAoGBAPRaK4cx76Q+3SJ/wfznaPsMM06OSR8A3ctKdV+ip/lyKtb1W8Pz
k8MYQDH7GwPtSu5QD8doL00pPjugZL/ba7X9nAsI+pinyEErfnB9y7ORNEjIYYzs
DiqDKup7ANgw1gZvznWvb9Ge0WUSXvWS0pFkgootQAf+RmnnbWGH6l6RAoGBAO35
aGUrLro5u9RD24uSXNU3NmojINIQFK5dHAT3yl0BBYstL43AEsye9lX95uMPTvOQ
Cqcn42Hjp/bSe3n0ObyOZeXVrWcDFAfE0wwB1BkvL1lpgnFO9+VQORlH4w3Ppnpo
jcPkR2TFeDaAYtvckhxe/Bk3OnuFmnsQ3VzM75fFAoGBAI6PvS2XeNU+yA3EtA01
hg5SQ+zlHswz2TMuMeSmJZJnhY78f5mHlwIQOAPxGQXlf/4iP9J7en1uPpzTK3S0
M9duK4hUqMA/w5oiIhbHjf0qDnMYVbG+V1V+SZ+cPBXmCDihKreGr5qBKnHpkfV8
v9WL6o1rcRw4wiQvnaV1gsvBAoGBALtzVTczr6gDKCAIn5wuWy+cQSGTsBunjRLX
xuVm5iEiV+KMYkPvAx/pKzMLP96lRVR3ptyKgAKwl7LFk3u50+zh4gQLr35QH2wL
Lw7rNc3srAhrItPsFzqrWX6/cGuFoKYVS239l/sZzRppQPXcpb7xVvTp2whHcir0
Wtnpl+TdAoGAGqKqo2KU3JoY3IuTDUk1dsNAm8jd9EWDh+s1x4aG4N79mwcss5GD
FF8MbFPneK7xQd8L6HisKUDAUi2NOyynM81LAftPkvN6ZuUVeFDfCL4vCA0HUXLD
+VrOhtUZkNNJlLMiVRJuQKUOGlg8PpObqYbstQAf/0/yFJMRHG82Tcg=
-----END RSA PRIVATE KEY-----`

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