Commit Graph

1129 Commits

Author SHA1 Message Date
Torkel Ödegaard
04da97bffb dashboard_folders refactoring 2017-06-19 15:37:22 -04:00
Torkel Ödegaard
74840178cf refactoring dashboard folder security checks 2017-06-19 15:22:42 -04:00
Torkel Ödegaard
f7194878fe dashboard guardian refactoring starting to work 2017-06-19 13:47:44 -04:00
Torkel Ödegaard
d6341162cb refactoring dashboad folder acl checks 2017-06-19 11:54:37 -04:00
Torkel Ödegaard
b494fd7689 dashboard folders acl work 2017-06-19 11:03:54 -04:00
Torkel Ödegaard
cbbbccf12a refactoring dashoard folder guardian 2017-06-17 18:24:38 -04:00
Torkel Ödegaard
3fe031d25d refactoring: Dashboard guardian 2017-06-16 21:25:24 -04:00
Daniel Lee
5cf63e3726 WIP: remove unused test file 2017-06-17 03:21:08 +02:00
Daniel Lee
d89c1260c6 WIP: refactor dash search and remove extra query 2017-06-17 03:00:13 +02:00
Daniel Lee
5cf40cbd12 WIP: move guardian logic for search into the sql query 2017-06-17 02:34:05 +02:00
Daniel Lee
84ff62d773 WIP: remove dashboard children on delete 2017-06-17 02:34:05 +02:00
Daniel Lee
9e7aa65fb7 WIP: clean up after user and org user delete 2017-06-15 20:19:54 +02:00
Daniel Lee
699f9095e2 WIP: remove permissions when deleting global user 2017-06-14 23:45:30 +02:00
Daniel Lee
222a938cdf WIP: delete dependent permissions on user group delete 2017-06-14 18:40:08 +02:00
Daniel Lee
a861b1b9ba WIP: check permissions for delete/post dashboard 2017-06-12 23:05:32 +02:00
Daniel Lee
3913f16550 WIP: add permission check for GetDashboard 2017-06-12 16:48:51 +02:00
Daniel Lee
ef0facc987 WIP: fix test after merge conflict 2017-06-12 15:49:09 +02:00
Daniel Lee
9eccb4e79f WIP: API - add dash permission 2017-06-12 15:49:09 +02:00
Daniel Lee
2097ed0bb8 WIP: Permission Type as string in permission query 2017-06-12 15:49:09 +02:00
Daniel Lee
c602afb9c6 WIP: dashboard search by folder + toggle for list or tree mode 2017-06-12 15:49:09 +02:00
Daniel Lee
6c736e002a WIP: add dummy root folder to folder picker
Can move a dash from a folder back to root level as well
2017-06-12 15:49:09 +02:00
Daniel Lee
68b9342de3 WIP: dashboard search by type (folder or dash) 2017-06-12 15:49:09 +02:00
Daniel Lee
b4576edc90 WIP: fix after upstream sqlstore refactoring 2017-06-12 15:49:09 +02:00
Daniel Lee
fa18b0053d WIP: delete permission in API 2017-06-12 15:49:09 +02:00
Daniel Lee
fff7b706d6 WIP: user group additions 2017-06-12 15:49:09 +02:00
Daniel Lee
53d11d50fc WIP: remove browse mode for dashboard search
Dashboard folders included in all searches. If a dashboard matches
a search and has a parent folder then the parent folder is appended
to the search result. A hierarchy is then returned in the result
with child dashboards under their parent folders.
2017-06-12 15:49:09 +02:00
Daniel Lee
f1e1da39e3 WIP: get Dashboard Permissions
The guardian class checks if the user is allowed to get the
permissions for a dashboard.
2017-06-12 15:49:09 +02:00
Daniel Lee
13314f23ba WIP: Can remove dashboard permission - sql 2017-06-12 15:49:09 +02:00
Daniel Lee
890ebcbb7b WIP: limit GetAllowedDashboards sql query with a where in 2017-06-12 15:49:09 +02:00
Daniel Lee
97c13b77bf WIP: Add or update Dashboard ACL
SQL Integration Tests for the guardian class too.
2017-06-12 15:49:09 +02:00
Daniel Lee
3785894b40 WIP: guardian service for search
Removes restricted dashboards from search result.
2017-06-12 15:49:09 +02:00
Daniel Lee
2e010b920b dashboard: sort search with dash folder first 2017-06-12 15:49:09 +02:00
Daniel Lee
552935031b WIP: API methods for add/remove members to user group 2017-06-12 15:49:09 +02:00
Daniel Lee
0a1df0905e WIP: add update user group command 2017-06-12 15:49:09 +02:00
Daniel Lee
233cd7af4a WIP: add user group search 2017-06-12 15:49:09 +02:00
Daniel Lee
af67aea2a9 WIP: add usergroup commands and queries 2017-06-12 15:49:09 +02:00
Daniel Lee
1248728d7f WIP: rough prototype of dashboard folders
Breaks some stuff like selected dash in the search result.
In dashboard search, if the user is not searching then the result is
returned as a tree structure. No ACL's or user group ux yet.
2017-06-12 15:49:09 +02:00
Torkel Ödegaard
08b37186a5 fix: fixed failing sql unit test 2017-06-07 15:42:48 +02:00
Torkel Ödegaard
e7e675e471 Merge branch 'walmartlabs-master' (Dashboard History Feature, #8472) 2017-06-07 14:30:03 +02:00
Torkel Ödegaard
391dc1e225 dasboard_history: fixed sql integration test 2017-06-07 14:25:46 +02:00
Torkel Ödegaard
46412c8475 dasboard_history: security fix, added orgId filter to dashboard version lookup 2017-06-07 14:21:40 +02:00
Torkel Ödegaard
7b5f7ed553 dashboard_history: SQL did not work when using MySQL, fixes to dashboard version numbering, so inserts start at 1, added migration to fix old dashboards with version 0 2017-06-06 15:40:10 +02:00
Torkel Ödegaard
5409f4c0eb dashboard_history: fixed issue with save as & overwrite 2017-06-06 14:39:57 +02:00
Torkel Ödegaard
e2061312f5 refactoring: moved compare dashboard version command out of sqlstore, the code in this command did not use any sql operations and was more high level, could be moved out and use existing queries to get the versions 2017-06-06 00:15:40 +02:00
Torkel Ödegaard
746d6cdc88 refactoring: changed name on compare command to make properties more explainatory 2017-06-05 23:29:25 +02:00
Torkel Ödegaard
cabbfe9adc refactoring: moved dashboard history item formating (message) and fixed dashboard history migration issue, and removed from frontend tests that where no longer needed 2017-06-05 22:59:04 +02:00
Torkel Ödegaard
f18ebea03e fix: dashboard save modals had double submit on enter after my refactoring this morning 2017-06-05 18:01:16 +02:00
Torkel Ödegaard
82d4d54dc5 refactoring: fixed broken unit test in last commit 2017-06-05 17:51:51 +02:00
Torkel Ödegaard
c87418d060 refactoring: Dashboard history restore operation is now reusing existing
operations instead of duplicating a bunch of get & save logic.
2017-06-05 17:45:27 +02:00
Torkel Ödegaard
c296ae1178 refactoring: fixing unit tests broken in last commit 2017-06-05 16:52:36 +02:00
Torkel Ödegaard
e18007153d refactoring: Renamed dashboard version queries that wrongly had Command suffix, added missing OrgId to dashboard history commands and queries 2017-06-05 16:34:32 +02:00
Anton Yackushev
bab21c9069 misspell: Corrected some misspelled words 2017-06-05 15:20:34 +03:00
Torkel Ödegaard
f3980504e2 Merge branch 'master' into walmartlabs-master 2017-06-05 13:43:00 +02:00
Dan Cech
f224fd8310 reduce length of dashboard columns used in compound indexes (#8507) 2017-06-04 14:28:03 +02:00
sanchitraizada
77c046aac6 Implement review feedback 2017-06-01 17:57:09 -04:00
Dan Cech
c0d5b61403 tweak column lengths for utf8mb4 support on older mysql (#8483) 2017-05-29 08:31:36 +02:00
Ricky Moorhouse
665caa8e08
Include triggering metrics to pagerduty alerts
Assist the person receiving the alert in identifying the cause

Based on the slack notifier fields this will include upto 4 triggering
metrics in the custom details section in the pagerduty incident

Fixes #8479
2017-05-26 12:30:56 +01:00
Ben Tranter
a927b893ae Use DBSession for getMaxVersion 2017-05-25 23:04:00 -04:00
sanchitraizada
e6616cc551 Merge pull request #10 from walmartlabs/version-control
History and Version Control for Dashboard Updates
2017-05-25 14:50:47 -07:00
Ben Tranter
b6e46c9eb8 History and Version Control for Dashboard Updates
A simple version control system for dashboards. Closes #1504.

Goals

1. To create a new dashboard version every time a dashboard is saved.
2. To allow users to view all versions of a given dashboard.
3. To allow users to rollback to a previous version of a dashboard.
4. To allow users to compare two versions of a dashboard.

Usage

Navigate to a dashboard, and click the settings cog. From there, click
the "Changelog" button to be brought to the Changelog view. In this
view, a table containing each version of a dashboard can be seen. Each
entry in the table represents a dashboard version. A selectable
checkbox, the version number, date created, name of the user who created
that version, and commit message is shown in the table, along with a
button that allows a user to restore to a previous version of that
dashboard. If a user wants to restore to a previous version of their
dashboard, they can do so by clicking the previously mentioned button.
If a user wants to compare two different versions of a dashboard, they
can do so by clicking the checkbox of two different dashboard versions,
then clicking the "Compare versions" button located below the dashboard.
From there, the user is brought to a view showing a summary of the
dashboard differences. Each summarized change contains a link that can
be clicked to take the user a JSON diff highlighting the changes line by
line.

Overview of Changes

Backend Changes

- A `dashboard_version` table was created to store each dashboard
  version, along with a dashboard version model and structs to represent
  the queries and commands necessary for the dashboard version API
  methods.
- API endpoints were created to support working with dashboard
  versions.
- Methods were added to create, update, read, and destroy dashboard
  versions in the database.
  - Logic was added to compute the diff between two versions, and
  display it to the user.
  - The dashboard migration logic was updated to save a "Version
  1" of each existing dashboard in the database.

Frontend Changes

- New views
- Methods to pull JSON and HTML from endpoints

New API Endpoints

Each endpoint requires the authorization header to be sent in
the format,

```
Authorization: Bearer <jwt>
```

where `<jwt>` is a JSON web token obtained from the Grafana
admin panel.

`GET "/api/dashboards/db/:dashboardId/versions?orderBy=<string>&limit=<int>&start=<int>"`

Get all dashboard versions for the given dashboard ID. Accepts
three URL parameters:

- `orderBy` String to order the results by. Possible values
  are `version`, `created`, `created_by`, `message`. Default
  is `versions`. Ordering is always in descending order.
- `limit` Maximum number of results to return
- `start` Position in results to start from

`GET "/api/dashboards/db/:dashboardId/versions/:id"`

Get an individual dashboard version by ID, for the given
dashboard ID.

`POST "/api/dashboards/db/:dashboardId/restore"`

Restore to the given dashboard version. Post body is of
content-type `application/json`, and must contain.

```json
{
  "dashboardId": <int>,
  "version": <int>
}
```

`GET "/api/dashboards/db/:dashboardId/compare/:versionA...:versionB"`

Compare two dashboard versions by ID for the given
dashboard ID, returning a JSON delta formatted
representation of the diff. The URL format follows
what GitHub does. For example, visiting
[/api/dashboards/db/18/compare/22...33](http://ec2-54-80-139-44.compute-1.amazonaws.com:3000/api/dashboards/db/18/compare/22...33)
will return the diff between versions 22 and 33 for
the dashboard ID 18.

Dependencies Added

- The Go package [gojsondiff](https://github.com/yudai/gojsondiff)
  was added and vendored.
2017-05-24 19:14:39 -04:00
Torkel Ödegaard
dcf7385cc1 sensu: added input tooltip to source property 2017-05-24 13:44:38 +02:00
joe miller
090594a0bc support setting the source and handler attribute in sensu notifications (#8405)
* support setting the handler attribute in sensu alert notifications

* allow the user to set the source attribute of Sensu notifications
2017-05-24 13:42:24 +02:00
Torkel Ödegaard
b17a1ed557 playlist: fixed dashboard play ordering, fixes #7688 2017-05-24 13:21:43 +02:00
Torkel Ödegaard
359421b5e8 refactor: sqlstore inTransaction consolidated to one version, fixes #8376 2017-05-23 10:56:23 +02:00
Dave Scott
f7215608e9 Update VictorOps notifier w/ auto resolve and image URL (#8431)
* Fixed newline JSON buy in VictorOps integration

* Fixed payload sent to VictorOps so that link displays correctly

* Fixed formatted to resolve go error

* Add auto resolve incidents and image URL to VictorOps notifier
2017-05-21 10:02:48 +02:00
Torkel Ödegaard
43d5525aaa Merge branch 'master' into alert_state 2017-05-18 13:38:34 +02:00
Dan Cech
9dc220b8e2 include error message in email notification (#8392) 2017-05-17 09:51:51 +02:00
Torkel Ödegaard
f84dc24fcb alerting: improving and fixing alert history, #7257 2017-05-15 16:17:05 +02:00
Torkel Ödegaard
f697f81950 sqlite: fixed database table looked handling, now retries up to 5 times, fixes #7992 2017-05-15 12:19:19 +02:00
Torkel Ödegaard
4ce0bf4d16 mysql: improved mysql data source, added test feature when adding data source, fixed cache issue 2017-05-11 10:50:24 +02:00
Torkel Ödegaard
368e847d12 feat: added api health endpoint that does not require auth and never creates sessions, returns db status as well. #3302 2017-04-25 17:17:45 +02:00
Torkel Ödegaard
87c978ebc9 fix: better error handling / messsage when testing email notification when stmp is not configured, fixes #8093 2017-04-25 13:16:41 +02:00
Dan Cech
b489e93d94 Config Array Syntax (#8204)
* refactor util encryption library so it doesn't have to import log

* add util.SplitString to handle space and/or comma-separated config lines

* go fmt
2017-04-25 09:14:29 +02:00
Torkel Ödegaard
b22b3e5bb9 mysql: added default query template 2017-04-21 16:28:01 +02:00
Daniel Lee
ee3a553800 Merge pull request #8163 from bashgeek/telegram_metrics
Add metrics/matches to Telegram notifications (proposed fix for #8110)
2017-04-19 15:03:03 +02:00
Daniel Schmitz
d123b951e9 Fixed parsing error 2017-04-19 17:02:52 +08:00
Torkel Ödegaard
e164eba677 mysql: began work on backend macro engine 2017-04-19 10:10:08 +02:00
Daniel Schmitz
7078d5d524 Added metrics/matches to telegram notifications; Added some HTML to beautify 2017-04-19 15:53:23 +08:00
Torkel Ödegaard
0bae7212f6 annotations: removed category stuff, my mistake, we need tags 2017-04-18 17:15:22 +02:00
Alexander Zobnin
7aa992bde4 initial category types 2017-04-17 18:56:39 +03:00
Alexander Zobnin
f0816b37bd rename annotation_category to category 2017-04-17 18:53:10 +03:00
Torkel Ödegaard
60ef7d8768 Merge branch 'master' into create-annotations 2017-04-14 22:36:34 +02:00
Dan Cech
f490c5f12c use X-Grafana-Org-Id header to ensure backend uses correct org (#8122) 2017-04-14 15:47:39 +02:00
Alexander Zobnin
ab99a7c1c7 graph(create annotation): add initial annotation_category table 2017-04-13 16:57:22 +03:00
Torkel Ödegaard
593b2ef866 annotation: added region support to annoations 2017-04-12 16:26:34 +02:00
Torkel Ödegaard
0156a94a49 annotations: you can now read annoations via manually created annoation query 2017-04-12 15:46:41 +02:00
Alexander Zobnin
f42202e665 Merge branch 'master' into graph-annotations 2017-04-11 10:27:37 +03:00
Alexander Zobnin
d553498a33 graph(add annotation): initial backend implementation #1286 2017-04-10 20:22:58 +03:00
Torkel Ödegaard
0384eecf5c fix: minor fix for bug when saving alert with empty message, fixes #7927 2017-04-10 15:26:05 +02:00
Alfred Krohmer
41171f8a5c Add a link to a graph image in Pushover notifications (#8075) 2017-04-10 09:17:37 +02:00
Torkel Ödegaard
26804d630f Merge branch 'master' into sql-proxy 2017-04-07 10:34:51 +02:00
Torkel Ödegaard
f5f0d94ad4 fix: temp/testing fix for hanging issue, #8033 2017-04-06 13:18:50 +02:00
Torkel Ödegaard
95e0010a5b fix: sqlite3 and concurrent write requests caused database locked error some times, depending on how many concurrent requests and speed of disk drive. Fixed by reducign the number of concurrent db connections to 1 for sqlite3, fixes #7992 2017-04-03 09:42:11 +02:00
Torkel Ödegaard
5af81b974e mysql: graph showing 2017-03-31 13:57:10 +02:00
Torkel Ödegaard
e5a5bef200 mysql: minor update 2017-03-31 12:49:05 +02:00
Torkel Ödegaard
d6d2080f11 mysql: minor progress on response processing 2017-03-31 11:45:25 +02:00
Torkel Ödegaard
bd4f073425 mysql: minor update 2017-03-30 20:23:40 +02:00
Torkel Ödegaard
998f04e1e8 mysql: testdata 2017-03-30 20:01:04 +02:00
Torkel Ödegaard
34d92b0e79 mysql: starting work on test data 2017-03-30 18:03:50 +02:00
Torkel Ödegaard
080d2a2054 mysql: reading arbitrary SQL data in go is really strange, data is only in strings? 2017-03-30 13:46:46 +02:00
Dan Cech
24d4e50343 utf8mb4 encoding (#7959)
* use utf8mb4 character set for connections to mysql

* use utf8mb4 character set for tables, shorten varchar fields used in unique indexes

* migration type to update table character set

* update table character sets

* set charset for temp_user.status

* gofmt
2017-03-28 14:34:53 +02:00
Jaroslav Hanslík
e91a078105 Slack notification should contain fallback text (#7961) 2017-03-28 10:05:44 +02:00
Dan Cech
dde8583db8 xorm engine.SetMaxConns is a deprecated alias for engine.SetMaxOpenConns 2017-03-27 18:04:03 -04:00
Daniel Lee
69bec98962 chore: update all grafana.org urls to .com 2017-03-21 15:37:55 +01:00
Pandurang Waghulde
f3cce7efc9 typo fix for OpsGenie 2017-03-17 12:57:52 +05:30
Daniel Lee
9efb6e76e9 users: adds search and pagination (#7753)
ref #7469. Follow up change that adds proper paging with 50 results
per page as well as a search box to search by name, login or email.
2017-03-07 16:03:54 +01:00
Wouter Smit
125ee865b6 Spelling mistake (#7739) 2017-03-06 21:08:45 +01:00
Torkel Ödegaard
9f1c6a73f0 tech: added sql logger to log all sql statements sent to sql server 2017-03-06 11:51:35 +01:00
Carl Bergquist
f185c2c953 Merge pull request #7676 from dbrgn/threema-emoji
feat(alerting): Add emoji to Threema alert notifications
2017-03-03 11:04:49 +01:00
bergquist
412b8998a8 webhooks: get proxy settings from ini file
closes #7710
2017-03-02 13:57:28 +01:00
Danilo Bargen
1422655e97 feat(alerting): Add emoji to Threema alert notifications
This commit prepends emoji to Threema alert notifications to make it
easier to discern various notification types (e.g. alert, no data, ok).
2017-02-27 17:10:52 +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
Carl Bergquist
5d3da99806 Merge pull request #7482 from dbrgn/master
Alerting: Add Threema Gateway integration
2017-02-24 07:40:36 +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
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
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
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
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
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
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
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
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
huydx
28d93b574d (feat) support max connection setting for database configuration 2017-02-10 15:30:01 +01:00
bergquist
00549f393c style(hipchat): improves code style 2017-02-08 11:24:49 +01:00
James Regovich
53942f7987 Adding HipChat Notifier 2017-02-07 10:50:49 -06: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
3827c0a69c tech(alerting): adds tags to alerting data model 2017-02-06 14:59:29 +01:00
bergquist
c05bc0cb17 chore(vet): fixes invalid fmt.Sprintf format 2017-02-05 21:19:39 +01:00
lucapette
032ecad3b7 Fix typo 2017-02-03 12:10:22 +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
Stanislav Vetlovskiy
bd4eadf69c #7383 Fix factory typo in telegram notifier (#7406) 2017-01-31 06:23:19 +01:00
bergquist
46e4a54a6e style: go fmt with simplify 2017-01-27 15:21:02 +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
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
e78da57e4d feat(alerting): shows when no_data triggered alerts
closes #7035
ref #7257
2017-01-17 09:49:25 +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
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
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
Lee Briggs
2e796da441 Add support for sensu notifications (#7207) 2017-01-11 13:57:07 +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
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
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
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
Mikhail Leonov
e32a653cb6 Added Telegram Messenger notification destination 2016-12-30 15:57:12 +03:00
bergquist
80d438ca49 chore(alerting): removes double logging 2016-12-20 08:34:44 +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
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
ecdf1888c4 feat(alerting): removes pause per datasource 2016-12-19 13:24:45 +01:00
bergquist
6b9db0c0c5 style(alerting): simplify support for pausing multiple alerts 2016-12-19 08:18:42 +01:00
bergquist
4ef95cfd31 style(api): reduce code complexity 2016-12-16 16:07:23 +01:00
bergquist
fb6aa0e026 feat(api): adds endpoint for mass pausing alerts
ref #6589
2016-12-16 15:00:58 +01:00
bergquist
c467e48940 feat(notifications): removes html escaping subject
closes #6905
2016-12-15 14:27:33 +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
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
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
Torkel Ödegaard
5ec7dea81a Merge branch 'v4.0.x' 2016-12-12 14:39:53 +01:00
huydx
015fa82cf5 fix(alert): alert test should return error when it failed to dispatch 2016-12-12 18:22:58 +09:00
Torkel Ödegaard
dee6b7d150 Merge branch 'master' into getting-started-panel 2016-12-08 08:51:40 +01:00
bergquist
dd3060fdc3 feat(alerting): calculate avg of valid points 2016-12-07 15:55:37 +01:00
bergquist
2bdd2a59cb test(alerting): improve naming for test scenario 2016-12-07 15:19:58 +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
Kyle McCullough
4ef940482c
alerting: add support for OpsGenie 2016-12-06 14:48:13 -06:00
Torkel Ödegaard
d1feaaf4f3 Merge branch 'v4.0.x' 2016-12-05 10:54:01 +01:00
bergquist
b81e97c99c webhook: adds json content-type
closes #6822
2016-12-05 10:46:04 +01:00
bergquist
0403f53b6f feat(webhook): adds alert rule message to webhook
close #6807
2016-12-05 09:34:35 +01:00
bergquist
6c9cf87080 feat(alerting): calculate avg of valid points 2016-12-02 23:44:14 +01:00
bergquist
9dd6cf45ac feat(webhook): adds alert rule message to webhook
close #6807
2016-12-02 22:24:36 +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
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
253324fc32 style(sqlstore): remove comment 2016-11-29 21:24:45 +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
360516ed41 feat(metrics): change active alerts to guage 2016-11-29 16:46:25 +01:00
Pavlos Daoglou
0064331bbf [6679] Check if org exists before delete it 2016-11-28 00:09:01 +02:00
bergquist
bdfb773a98 fix(alerting): fixes broken no_value evaluator
closes #6701
2016-11-27 16:53:29 +01:00
Daniel Lee
c9b2c694f1 refactor(dataproxy): TLS Client Auth
Use a SecureJsonData field for TLS
Client Auth instead of 3 new db
fields. Same model as used for
PluginSettings.

Saves and encrypts the pem file
content rather than just saving
the paths to the cert and key.
This allows for uploading from
the Edit Datasource page in
Grafana.
2016-11-24 13:22:25 +01:00
Joe Lanford
56b7e2dfaf Added support for TLS client auth for datasource proxies (#5801) 2016-11-24 13:22:25 +01:00
Torkel Ödegaard
2233938ba7 Merge branch 'master' into getting-started-panel 2016-11-24 13:17:22 +01:00
Carl Bergquist
df2b2e3058 feat(alerting): validate alerts before saving dashboard (#6691)
ref #6576
2016-11-24 09:50:35 +01:00
Tom Kozlowski
c21ffcc6c9 generalized database connection cert support and added to postgres 2016-11-22 15:29:22 -08:00
bergquist
6882dcfb99 feat(alerting): add backend support for median reducer 2016-11-22 14:09:35 +01:00
bergquist
50811c80ea fix(alerting): fixes bug that prevents noData from triggering
closes #6631
2016-11-22 11:47:52 +01:00
bergquist
2b6013ce81 fix(notifications): failed image upload should not stop notification
closes #6638
2016-11-21 09:47:59 +01:00
Torkel Ödegaard
fd512457d8 Merge remote-tracking branch 'origin/master' into getting-started-panel-css2 2016-11-18 16:31:54 +01:00
bergquist
61bb9cbc13 test(alerting): fixes broken unit test 2016-11-18 10:53:27 +01:00
Torkel Ödegaard
7ce33c31ec Merge branch 'master' of github.com:grafana/grafana 2016-11-17 15:50:08 +01:00
Torkel Ödegaard
62e8a039a1 refactor(alerting): refactoring PR for OR conditions, #6579 2016-11-17 15:48:15 +01:00
bergquist
3ea66ebe3f fix(alerting): remove possible divide by zero panic
ref #6599
2016-11-17 15:20:14 +01:00
Torkel Ödegaard
457ae74343 Merge branch 'or_alerting' of https://github.com/utkarshcmu/grafana into utkarshcmu-or_alerting 2016-11-17 14:43:24 +01:00
utkarshcmu
aae33b36dd Added tests for firingEvaluation string 2016-11-17 01:41:23 -08:00
utkarshcmu
fc82dac868 Added braces to single condition firingEvaluation string 2016-11-17 01:30:50 -08:00
utkarshcmu
690868c837 Added firingEvalution to Rule test 2016-11-17 01:28:17 -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
b0620a9d4b Add VictorOps alert notification capability 2016-11-16 14:02:34 -08:00
utkarshcmu
8d0bcd23f8 Added tests for checking nested operators 2016-11-15 08:07:05 -08:00
utkarshcmu
dfb1b1918c Implemented operator based firiing in backend 2016-11-15 06:35:25 -08:00
bergquist
b9d709ab27 feat(alerting): improve error logging for extracting alerts
ref #6576
2016-11-15 11:47:46 +01:00
bergquist
a87fd11f26 feat(stats): add alerts to global admin stats 2016-11-11 14:04:38 +01:00
bergquist
ad97db937c feat(stats_usage): add stats about alerts 2016-11-11 13:57:11 +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
fb57bf77da ux(getting started): progress on getting started panel and persited help flag states, #6466 2016-11-09 10:41:39 +01:00
bergquist
eb34855adb feat(pagerduty): add support for auto resolve
closes #6513
2016-11-08 20:38:38 +01:00
utkarshcmu
610ea090dc Send test notification fixed 2016-11-08 11:22:03 -08:00
bergquist
5542b0ab9e tech(pagerduty): sync calls should be using context 2016-11-08 20:05:43 +01:00
Torkel Ödegaard
fd09f17cd3 docs(): alerting docs, #6490 2016-11-08 14:53:28 +01:00
utkarshcmu
841fb74b39 Reversed loop for last function 2016-11-07 23:16:57 -08:00
utkarshcmu
74632b5e98 Added last function for alerting conditions 2016-11-07 23:16:57 -08:00
bergquist
5bbdd99d35 tech(notifications): remove async webhook 2016-11-08 08:06:42 +01:00
bergquist
66f257e382 tech(pagerduty): make api call sync 2016-11-08 07:51:19 +01:00
bergquist
7bc80d0374 tech(pagerduty): declare url as constant 2016-11-08 07:50:58 +01:00
utkarshcmu
5549d8658a Fixed description message 2016-11-07 07:27:31 -08:00
utkarshcmu
f8d1eb11a9 Removed ExecError state 2016-11-07 07:12:43 -08:00
utkarshcmu
4b53ea0a56 Fixed pagerduty tests 2016-11-07 07:08:52 -08:00
utkarshcmu
638d3bcb42 Removed NoData option 2016-11-07 07:08:51 -08:00
utkarshcmu
de0fa3d479 Added pagerduty tests 2016-11-07 07:08:51 -08:00
utkarshcmu
df8cd764b2 Added trigger options with Pagerduty 2016-11-07 07:08:51 -08:00
utkarshcmu
139bbecc10 Added Pagerduty basic alerting 2016-11-07 07:08:51 -08:00
Carl Bergquist
3607316920 Merge pull request #6489 from bergquist/reduce_notification_states
Reduce alerting states
2016-11-07 15:18:07 +01:00
bergquist
d7f11c304c tech(alerting): set prev state when creating eval context 2016-11-07 13:01:54 +01:00
bergquist
489f087fbd feat(alerting): reduce states. Make exeuction result configurable.
ref #6444
2016-11-07 12:42:39 +01:00
bergquist
f0b591b89b feat(alerting): extract logic state updates and notifications
ref #6444
2016-11-07 07:57:34 +01:00
utkarshcmu
c737704eeb Removed playlist item when dashboard is deleted 2016-11-06 01:49:43 -08:00
utkarshcmu
dc3a62da83 Added slack tests , fixed webhook tests 2016-11-04 06:05:44 -07:00
utkarshcmu
2f60929d1e Added slack mention functionality 2016-11-04 06:05:44 -07:00
bergquist
f0d9d133c6 tech(slack): format code using gofmt 2016-11-04 07:55:15 +01:00
bergquist
b578d06e4a chore(notification): improve log message 2016-11-03 18:04:50 +01:00
bergquist
4af420f759 tech(alerting): refactor how evalhandler uses conditions 2016-11-03 17:31:36 +01:00
bergquist
c138b04c5e feat(alerting): avoid double logging 2016-11-03 07:25:00 +01:00
bergquist
ff5d4e8e0c fix(alerting): temp fix for broken AND condition
This should be refactored. lets return condition results instead
of setting new value on the evalContext. The condition execution
should only be able to update its own state.

closes #6449
2016-11-03 07:18:39 +01:00
utkarshcmu
d009c6b953 Log bad alert config 2016-11-02 18:22:24 -07:00