Commit Graph

3258 Commits

Author SHA1 Message Date
Marcus Efraimsson
d14946a135 mssql: cleanup and minor refactor 2018-03-19 13:32:04 +01:00
Marcus Efraimsson
24c0f28f41 mssql: allow host without port and fallback to default port 1433 2018-03-19 13:24:31 +01:00
Marcus Efraimsson
d26d8c713e Merge branch 'master' into mssql_datasource 2018-03-16 15:19:19 +01:00
Marcus Efraimsson
e97b03e930 mssql: additional integration tests
Metric query of table having multiple value columns
Annotation query
2018-03-16 14:42:54 +01:00
Marcus Efraimsson
f0f8006d8d mssql: support money, smallmoney and decimal data types 2018-03-16 14:37:16 +01:00
Daniel Lee
3ca1e06509 session: fork Macaron mysql session middleware
This changes forks the mysql part of the Macaron session middleware.

In the forked mysql file:

- takes in a config setting for SetConnMaxLifetime (this solves wait_timeout
problem if it is set to a shorter interval than wait_timeout)
- removes the panic when an error is returned in the Exist function.
- retries the exist query once
- retries the GC query once
2018-03-16 01:19:28 +01:00
Daniel Lee
9cdd7cb04c database: expose SetConnMaxLifetime as config setting
For MySQL, setting this to be shorter than the wait_timeout MySQL setting
solves the issue with connection errors after the session has timed out for
the connection to the database via xorm.
2018-03-16 01:09:00 +01:00
Daniel Lee
5a3ba68a9c database: fixes after xorm update 2018-03-16 00:09:29 +01:00
Daniel Lee
1c20126f87 database: update xorm to v0.6.4 and xorm core to v0.5.7 2018-03-16 00:02:50 +01:00
Marcus Efraimsson
9144701fcc mssql: disable mssql integration tests per default 2018-03-15 15:27:31 +01:00
Leonard Gram
3b03dce3c2 mssql: timeGroup fill support added. 2018-03-15 15:06:54 +01:00
Marcus Efraimsson
faf9e3f722 mssql: add timeGroup integration test 2018-03-15 14:26:53 +01:00
Corentin Chary
3d8f1a7439 alertmanager: /Creating/Sending/ 2018-03-15 13:48:58 +01:00
Leonard Gram
571556e1d8 mssql: adds fill to timeGroup macro. 2018-03-15 13:11:26 +01:00
Corentin Chary
c8da1a46c5 alertmanager: handle resolved alerts, nodata, and execution errors
- Resolved alerts will be sent to the AM the first time they move
  from Alerting to OK
- Errors are forwarded
- NoData is not ignored anymore
- The summary annotation is set (with the alertname)
- The image annotation is set (when available)
2018-03-15 12:02:29 +01:00
Mitja Zivkovic
5669596518 add regex search of username and password in urls, which are replaced by strings.Replace 2018-03-15 10:50:57 +01:00
Corentin Chary
d4d2b6d7da notitfiers: avoid ShouldNotify duplication 2018-03-15 10:48:29 +01:00
Corentin Chary
777c1024c9 alertmanager: if there are no alerts to send, do nothing 2018-03-15 10:08:03 +01:00
Marcus Efraimsson
d2267643ed Merge branch 'master' into mssql_datasource 2018-03-15 09:53:19 +01:00
Marcus Efraimsson
3d0f97aab9 mssql datasource: wip 2018-03-15 09:51:29 +01:00
Marcus Efraimsson
ef3588c1f8 docker: mssql and mssql tests blocks with common build context 2018-03-15 09:49:53 +01:00
Carl Bergquist
105f6ff88c
Merge pull request #11249 from bergquist/legacy_render_urls
Avoid redirecting internal rendering requests
2018-03-14 15:42:07 +01:00
bergquist
6cac7c2de9 renderer: avoid redirect render requests
closes #11180
2018-03-14 15:27:18 +01:00
Carl Bergquist
6d1e3613f7
Merge pull request #11246 from grafana/11227_import
dashboard: fix import dashboard with alert rule(s)
2018-03-14 14:38:29 +01:00
Carl Bergquist
a8918047a2
Merge pull request #11238 from grafana/11155-mysql-issue
middleware: recover and retry on session start
2018-03-14 14:29:47 +01:00
Marcus Efraimsson
87284d284e dashboard: fix import dashboard with alert rule
Importing a dashboard with alert rule(s) should be possible without receiving invalid
alert data error. This fix reverts the import logic to how it worked before Grafana v5.0,
that is import will allow dashboard with alert rule(s) but no alerts will be created.
After an import the user will need to update the dashboard for the alerts to be created.
Fixes #11227
2018-03-14 14:24:56 +01:00
Carl Bergquist
0ef94ea403
Merge pull request #11232 from grafana/11231_dash_url
Should be possible to browse dashboard using only uid
2018-03-14 14:18:58 +01:00
Daniel Lee
5f511deefc middleware: recover and retry on session start
Partial fix for #11155 - the Macaron session middleware
panics if mysql returns an error. This fix recovers from
the panic and retries once
2018-03-14 12:26:59 +01:00
bergquist
be7ec310b1 alerting: supports extracting alerts from collapsed panels
collapsed rows wrap the hidden rows within itself. This caused
the extractor to miss the panel and therefore delete the alert
accosiated with the graph.

closes #11222
2018-03-14 11:23:16 +01:00
Marcus Efraimsson
c87752102a mssql datasource: support for timeGroup macro function 2018-03-13 22:49:49 +01:00
Marcus Efraimsson
5fbfd67b94 dashboards: should be possible to browse dashboard using only uid
That is, the slug part of url should be optional.
Closes #11231
2018-03-13 21:06:25 +01:00
Marcus Efraimsson
57d46a706c mssql datasource: additional data type tests 2018-03-13 19:54:29 +01:00
Marcus Efraimsson
d4beee2bb0 Merge branch 'master' into mssql_datasource 2018-03-13 16:03:02 +01:00
Leonard Gram
87bc60b9d7 alerting: adds back the link to grafana. 2018-03-13 13:29:57 +01:00
John Baublitz
aba6f627c5 Fix CI 2018-03-13 13:29:57 +01:00
John Baublitz
89557dd67b Modify Grafana Pagerduty notifier to use Pagerduty API V2 2018-03-13 13:29:57 +01:00
bergquist
061a418f0f style: dont expose func outside package 2018-03-13 11:24:10 +01:00
Daniel Lee
3f2c086e6f teams: removes quota on route
Got added by mistake a year ago.
2018-03-13 10:56:35 +01:00
Dobrosław Żybort
5a368f99ec
Fix urls in plugin update_checker logs 2018-03-12 14:38:37 +01:00
Mitsuhiro Tanda
a83ede0193 support POST for query and query_range 2018-03-12 13:25:05 +09:00
Carl Bergquist
a589f701ad
Merge pull request #10925 from mtanda/cw_high_resolution
(cloudwatch) support high resolution query
2018-03-08 18:06:08 +01:00
Carl Bergquist
5153d8e535
Merge pull request #11161 from DanCech/quota-refactor
move quota to dedicated service
2018-03-08 15:21:16 +01:00
Carl Bergquist
87db2d1183
Merge pull request #11130 from DanCech/context-refactor
move Context and session out of middleware
2018-03-08 10:21:34 +01:00
Dan Cech
bbd6adabbf
move quota to dedicated service 2018-03-07 17:19:35 -05:00
Carl Bergquist
e3b86637f9
Merge pull request #11146 from grafana/go1.10
Upgrade golang to 1.10
2018-03-07 18:00:37 +01:00
Dan Cech
c0ecdee375
rename Context to ReqContext 2018-03-07 11:54:50 -05:00
Mitsuhiro Tanda
eecbdc89eb fix, set default highResolution setting 2018-03-08 01:18:11 +09:00
Carl Bergquist
d220516664
Merge pull request #11145 from grafana/alerting-invalid-data
alerting: fixes validation error when saving alerts in dash
2018-03-07 17:06:19 +01:00
Carl Bergquist
d07aff8991
Merge pull request #11127 from DanCech/oauth-jwt-email
only use jwt token if it contains an email address
2018-03-07 17:01:12 +01:00
bergquist
cb223ee563 removes commented code 2018-03-07 16:40:24 +01:00
bergquist
ff6108051d removes unused variables 2018-03-07 16:40:24 +01:00
Daniel Lee
d96fbb486f alerting: fixes validation error when saving alerts in dash
If a panelId in the dashboard json is set to zero then the validation
silently fails. Instead of returning an error, it just ignores alerts and
saves the dashboard.
2018-03-07 16:20:05 +01:00
Carl Bergquist
c39e68de24
Merge pull request #11046 from llamashoes/master
Add metrics that triggered alert to description in OpsGenie.
2018-03-07 15:48:30 +01:00
Carl Bergquist
3f6e525755
Merge pull request #10942 from grafana/pausing_alerts_updates_timestamp
Pausing/un alerts now updates new_state_date
2018-03-07 15:40:12 +01:00
Dan Cech
338655dd37
move Context and session out of middleware 2018-03-06 18:16:49 -05:00
Dan Cech
9d005c50a2
only use jwt token if it contains an email address 2018-03-06 14:21:36 -05:00
Carl Bergquist
01582a2f12
Merge pull request #11121 from grafana/telegram-inline-image-notifications
alerting: Limits telegram captions to 200 chars.
2018-03-06 14:19:59 +01:00
Leonard Gram
891462b5d9 alerting: Limits telegram captions to 200 chars.
The caption for inline images in Telegram is
limited to 200 characters.

Fixes #10975
2018-03-06 12:38:03 +01:00
bergquist
5934521137 fixes invalid link to profile pic when gravatar is disabled
closes #11097
2018-03-06 11:46:50 +01:00
Sven Klemm
4904a051cf use net/url to generate postgres connection url 2018-03-05 16:06:04 +01:00
Sven Klemm
4e826ff8f7 remove spaces around arguments of macros 2018-03-02 19:24:15 +01:00
Sven Klemm
f1ba9137c0 remove spaces around arguments before calling macro expansion 2018-03-02 19:20:30 +01:00
Sven Klemm
0f931f9e5e Merge remote-tracking branch 'upstream/master' into macroengine-interpolate 2018-03-01 18:01:54 +01:00
Daniel Lee
cc2f478792 Merge branch 'docs_v5.0' 2018-03-01 09:36:48 +01:00
Ryan Gifford
49266d5150 Add metrics that triggered alert to description 2018-02-28 15:26:11 -07:00
Marcus Efraimsson
3d4e99d8be
Merge pull request #11040 from grafana/permission-checks
Add permission check for dashboard diff api route
2018-02-28 18:23:39 +01:00
Laurent Godet
59704ee939 Fix Github OAuth not working with private Organizations (#11028)
* Fix Github OAuth not working with private organizations

* Update documentation
2018-02-28 13:08:15 +01:00
Marcus Efraimsson
f44e476580 permissions: fix validation of permissions before update
Did a bad pointer comparison so extended the tests for duplicate permissions.
2018-02-28 08:48:28 +01:00
Daniel Lee
ecf438f8d0 dashboard: add permission check for diff api route
ref #10770
2018-02-27 17:53:30 +01:00
Marcus Efraimsson
f76b98d252 dashboards: change dashboard/folder permission error messages 2018-02-27 16:04:45 +01:00
Marcus Efraimsson
03f8eff880 dashboards: handle new guardian error responses and update tests
Using a mocked guardian instead and relies on the actual guardian tests for verifying
permission handling correctness
2018-02-27 16:04:45 +01:00
Marcus Efraimsson
3c14cecd50 folders: handle new guardian error responses and add tests 2018-02-27 16:04:45 +01:00
Marcus Efraimsson
955dfcc8fe dashboards: don't allow override of permissions with a lower precedence
If a dashboard inherits permissions from a folder, don't allow same permission to be added
to the dashboard with a lower permission.
Add backend validation so that you cannot add same permission to folder/dashboard, for example
same user/team with different permissions
2018-02-27 16:04:45 +01:00
Marcel Anacker
69006a7764 Alerting: Fix OK state doesn't show up in Microsoft Teams (#11032)
* Alerting: Fix OK state doesn't show up in Microsoft Teams

* Fix formatting
2018-02-27 15:48:36 +01:00
Daniel Lee
3b836c9c5f
Merge pull request #10996 from grafana/snapshot_permissions
Snapshot fixes and changes to snapshot list
2018-02-23 09:17:59 +01:00
Daniel Lee
fe49182b9d snapshots: fixes cleanup of old snapshots
Snapshot cleanup did not work due to time.Now syntax error. Added test
for it as well to catch any future errors.

Added error and debug logging so that it is possible to see any errors in the future.

Removed an unused configuration value and deprecated the remove expired snapshots
setting.
2018-02-22 16:12:16 +01:00
Marcus Efraimsson
6751bbc17f Merge branch 'master' into docs_v5.0 2018-02-22 15:55:44 +01:00
Marcus Efraimsson
3f588b4c48 dashboards: created/updated and createdby/updatedby should be set before save
If creating a new folder/dashboard created/updated and createdby/updatedby should always be set.
If updating an existing folder/dashboard updated and updatedby should always be set.
2018-02-22 11:54:28 +01:00
Marcus Efraimsson
3f3175972e dashboards: fix batch dashboard/folder delete response
Use message returned from backend and use that as alert success response to user
2018-02-21 16:38:09 +01:00
Daniel Lee
7d9a9fa29c snapshots: change to snapshot list query
Admins can see all snapshots. Other roles can only see their own
snapshots.

Added permission check for deleting snapshots - admins can delete
any snapshot, other roles can delete their own snapshots or
snapshots that they have access to via dashboard permissions.
2018-02-21 13:39:08 +01:00
Marcus Efraimsson
9889c92083 fix typos in api, acl to permissions 2018-02-21 11:50:32 +01:00
Marcus Efraimsson
3df8ae2306 folders: rename folder_acl in api to folder_permission 2018-02-21 11:45:19 +01:00
Marcus Efraimsson
d68099bc4a dashboards: change api route for dashboard permissions
From /api/dashboards/id/:id/acl to /api/dashboards/id/:id/permissions
2018-02-21 11:42:54 +01:00
Marcus Efraimsson
8a8f3bd5bb folders: fix typo 2018-02-21 11:28:11 +01:00
Marcus Efraimsson
3c6bc263dc Merge branch 'master' into 10630_folder_api 2018-02-21 11:25:56 +01:00
Marcus Efraimsson
78283b9c77 folders: extend folder service tests 2018-02-21 11:25:21 +01:00
Marcus Efraimsson
a167e19b37 folders: folder api tests 2018-02-21 11:24:54 +01:00
Torkel Ödegaard
2f6e77af1e Merge branch 'master' into docs_v5.0 2018-02-21 10:47:14 +01:00
Marcus Efraimsson
417541c77f folders: folder permissions api tests 2018-02-20 18:11:50 +01:00
Marcus Efraimsson
02278f90a7 dashboards: make fake dashboard guardian available to other packages 2018-02-20 18:08:19 +01:00
Torkel Ödegaard
3964d6b797 fix: added new known data source plugins, and minor migration fix for v1 dashboards 2018-02-20 16:08:43 +01:00
Marcus Efraimsson
892bdecb19 folders: folder permission api routes 2018-02-20 15:25:16 +01:00
Marcus Efraimsson
717d8d0c45 folders: fix api error mapping 2018-02-20 15:01:20 +01:00
Marcus Efraimsson
ea7998ca8e folders: use new folder service in folder api routes 2018-02-20 13:57:32 +01:00
Marcus Efraimsson
268fb4dc6c folders: new folder service for managing folders 2018-02-20 13:56:22 +01:00
Marcus Efraimsson
39aba03483 dashboards: created date should be set when creating a folder/dashboard 2018-02-20 13:54:31 +01:00
Torkel Ödegaard
69ccbffaed fix: fixed github oauth login with allowed orgs filter, fixes #10964, reverts #10851 2018-02-20 11:30:18 +01:00
Torkel Ödegaard
21d48df095 fix: plugin dashboard did not get plugin id after import 2018-02-20 11:30:18 +01:00
bergquist
4dc6074e79 provisioning: dont ignore sample yaml files
closes #10963
2018-02-20 08:40:37 +01:00
Carl Bergquist
af7ede6ec5
Merge pull request #10959 from grafana/10957_influx_escaping
influxdb: escape backslashes in tag values (for alerting)
2018-02-19 15:28:55 +01:00