Commit Graph

665 Commits

Author SHA1 Message Date
Oleg Gaidarenko
caa1314f44
Build: use golangci-lint as a make command (#17739)
* Build: use golangci-lint as a make command

* Since gometalinter was deprecated in favor of golangci-lint so it was
  replaced by it. Responsibilities held by the gometalinter was moved to
  golangci-lint

* There was some changes in implementation (that was also mentioned in
  the code comment) between the tools, which uncovered couple errors
  in the code. Those issues were either solved or disabled by
  the inline comments

* Introduce the golangci-lint config, to make their
  configuration more manageable

* Build: replace backend-lint.sh script with make
2019-07-02 16:06:59 +03:00
Marcus Efraimsson
5713048f48
Alerting: Improve alert rule testing (#16286)
* tsdb: add support for setting debug flag of tsdb query

* alerting: adds debug flag in eval context

Debug flag is set when testing an alert rule and this debug
flag is used to return more debug information in test aler rule
response. This debug flag is also provided to tsdb queries so
datasources can optionally add support for returning additional
debug data

* alerting: improve test alert rule ui

Adds buttons for expand/collapse json and copy json to clipboard,
very similar to how the query inspector works.

* elasticsearch: implement support for tsdb query debug flag

* elasticsearch: embedding client response in struct

* alerting: return proper query model when testing rule
2019-06-25 08:52:17 +02:00
Carl Bergquist
1aadb4426a
metrics: expose stats about roles as metrics (#17469) 2019-06-06 16:39:35 +02:00
Thibault Chataigner
e06abb30aa Alerting: Add tags to alert rules (#10989)
Ref #6552
2019-06-06 13:29:30 +02:00
Mario Trangoni
87760d4fde Codestyle: Fix govet issues (#17178)
ref #10381

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2019-06-04 22:00:05 +02:00
Carl Bergquist
d8736a2547
Alerting: golint fixes for alerting (#17246) 2019-06-03 10:25:58 +02:00
Abhilash Gnan
ca6151e23f Alerting: Support for configuring content field for Discord alert notifier (#17017) 2019-05-23 08:31:02 +02:00
Mario Trangoni
66ba2aa524 Fix gosimple issues (#17179)
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2019-05-21 07:50:44 +02:00
Carl Bergquist
bfa7c3d963
alerting: golint fixes for alert notifiers. (#17167) 2019-05-20 15:23:06 +02:00
Carl Bergquist
bd5bcea5d0
alerting: fix a bunch of lint issues. (#17128) 2019-05-20 12:13:32 +02:00
Carl Bergquist
2904e2d9fe
Alertmanager: Replace illegal chars with underscore in label names (#17002)
closes #16624
2019-05-16 11:41:57 +02:00
Carl Bergquist
13f137a17d
tech: avoid alias for importing models in alerting (#17041)
ref #14679
2019-05-14 08:15:05 +02:00
zhulongcheng
2fff8f77dc move log package to /infra (#17023)
ref #14679

Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
2019-05-13 08:45:54 +02:00
Carl Bergquist
f001815d9d
alerting: no notification when going from nodata -> pending (#16905)
ref #16496
2019-05-07 10:34:00 +02:00
Andrej Ocenas
0433af6385
Config: Fixes bug where timeouts for alerting was not parsed correctly (#16784)
* Fix parsing of the config

* Remove unnecessary conversion

* Remove timeout modification

Co-Authored-By: aocenas <mr.ocenas@gmail.com>

* Remove unused import
2019-04-30 12:05:38 +02:00
Oleg Gaidarenko
54c1bf0cc9
Chore: a bit of spring cleaning (#16710)
* Chore: use early return technic everywhere

And enable "indent-error-flow" revive rule

* Chore: remove if-return rule from revive config

* Chore: improve error messages

And enable "error-strings" revive rule

* Chore: enable "error-naming" revive rule

* Chore: make linter happy

* Chore: do not duplicate gofmt execution

* Chore: make linter happy

* Chore: address the pull review comments
2019-04-23 11:24:47 +03:00
Hofls
c17226af95 Pushover alert, support for different sound for OK (#16525)
Closes #15889
2019-04-12 14:57:17 +02:00
Zzy
1b84a924a3 Alerting: Makes timeouts and retries configurable (#16259)
Adds new alert settings for configuring timeouts and retries named 
evaluation_timeout_seconds, notification_timeout_seconds 
and max_attempts.

Closes #16240
2019-03-29 12:58:37 +07:00
Navaneesh Kumar
5ea823a65a Fix: Alert email variable name typo fixed (#16232) 2019-03-27 09:42:20 +01:00
Torkel Ödegaard
7c81f4dfd8
fix(Alerting): Fixed alert rules with eval in day units, fixes #16174 (#16182) 2019-03-25 16:27:58 +01:00
Magnus Berglund
e6623de6b2 Rewrote creation of images tag 2019-03-20 18:59:13 +01:00
Magnus Berglund
0511095303 Added missing commas 2019-03-20 18:42:48 +01:00
Magnus Berglund
0de77598d7 Don't include non-existing image in MS Teams alert
If an image section is included in the JSON payload for MS Teams alerts
when no image URL exists, rendering of the alert in the client fails.
This change makes sure that an image section is only included in the
JSON payload if an image URL exists.

Closes #16082
2019-03-20 18:23:36 +01:00
zhulongcheng
755f60358b Add more info to victorOps alert notifications 2019-03-14 15:47:11 +08:00
genofire
6d578dd372
fix imageurl in notification test
skip unnecessary http -> https redirect, which could make problems on some notifiers
2019-03-11 00:23:07 +01:00
Torkel Ödegaard
570187384b
Merge pull request #13825 from athurg/optimize_dingding_alert_message
Optimize dingding alert message
2019-03-08 15:33:24 +01:00
Marcus Efraimsson
f21c976b27
fix discord notifier so it doesn't crash when there are no image generated 2019-03-06 17:03:14 +01:00
Marcus Efraimsson
36f3accf0d
log phantomjs output even if it timeout and include orgId when render alert 2019-03-06 13:53:23 +01:00
bergquist
8a3a3cccc3 moves metric package to /infra
ref #14679
2019-02-24 21:12:51 +01:00
Torkel Ödegaard
1adc1a6097
Merge pull request #15455 from grafana/fixed-handling-of-alert-urls
Fixed handling of alert urls with true flags
2019-02-15 16:27:23 +01:00
Torkel Ödegaard
4c28ec83b3
Merge pull request #15444 from max-neverov/percent_diff_null
Fix percent_diff calculation when points are nulls
2019-02-15 13:03:19 +01:00
Torkel Ödegaard
7699706e65 fixed handling of alert urls with true flags, fixes #15454 2019-02-15 11:23:31 +01:00
Maxim Neverov
28eaac3a9c Extracted common code for diff calculation 2019-02-14 21:52:59 +01:00
Maxim Neverov
3c2f6094b2 Fix percent_diff calculation when points are nulls 2019-02-14 16:31:15 +01:00
Brian Gann
c98b00c302 allow 90 percent of alertTimeout for rendering to complete vs 50 percent 2019-02-13 09:56:37 -06:00
Athurg Feng
70b23ab73b Add string quote func 2019-02-02 13:36:10 +08:00
Athurg Feng
bba92c0746 Remove option used to control within browser 2019-02-02 13:35:17 +08:00
Carl Bergquist
e2c2b70a61
Merge pull request #14852 from jpenalbae/pushover-attach
pushover: add support for attaching images (closes #10780)
2019-01-31 11:18:08 +01:00
bergquist
21fff415ed removes unnessecary db request 2019-01-28 15:37:52 +01:00
bergquist
935da14f7d tab/spaces formatting 2019-01-28 15:27:02 +01:00
bergquist
6a8643b3d1 Merge branch 'master' into configurable-alert-notification
* master: (250 commits)
  Firing off an action instead of listening to location changes
  Changes after PR Comments
  Made ExplorerToolbar connected and refactored away responsabilities from Explore
  Removed some split complexity
  Fixed some more styling
  Fixed close split look and feel
  Fixed position of Closesplit
  Fixed small issue with TimePicker dropdown position
  Simplified some styles and dom elements
  Fixed some more with the sidemenu open and smaller screens
  Fixed so heading looks good with closed sidemenu
  Restructure of component and styling
  Refactored out ExploreToolbar from Explore
  Fixed reinitialise of Explore
  changelog: add notes about closing #13929
  changelog: add notes about closing #14558
  changelog: add notes about closing #14484
  changelog: add notes about closing #13765
  changelog: add notes about closing #11503
  changelog: add notes about closing #4075
  ...
2019-01-28 14:16:43 +01:00
bergquist
0cbc89b063 Merge branch 'master' into 14701-fix-alert-context
* master: (262 commits)
  pkg/services/dashboards/dashboard_service.go: simplify return
  Updated url query param encoding to exctly match angular encoding
  Updated snapshot
  Added missing props not being passed to scrollbar component, fixes #15058
  Document /api/health
  changelog: adds note for #15062
  change default rotate_token_minutes to 10 minutes
  fix
  load test/ha fixes
  set low login cookie rotate time in ha mode
  fix multiple piechart instances bug
  scripts/build/*: Fix some golint issues
  scripts/build/*: Fix golint issues Url => URL
  build: fixes building grafana completely within docker.
  dont specify domain for auth cookies
  New snapshot reflecting changes
  Makes the clickable side menu header look great in light theme again
  org id fix for load test
  user auth token load tests using k6.io
  moves cookie https setting to [security]
  ...
2019-01-28 08:09:52 +01:00
bergquist
364154d81f moves timeout tests to an integration test 2019-01-28 07:56:31 +01:00
sharkpc0813
35013a28cd add timeout test for alert handling. 2019-01-18 11:23:00 +09:00
Pavel Bakulev
f461d52004 Converted notification id to uid via fmt for old alert notification settings 2019-01-16 16:52:00 +02:00
Pavel Bakulev
2de32756c2 Returned id for alert notifications which were created without uid 2019-01-16 16:52:00 +02:00
Pavel Bakulev
f132e929ce Added uid for alert notifications 2019-01-16 16:50:00 +02:00
Pavel Bakulev
6e3e9a337d Added alert_notification configuration 2019-01-16 16:45:42 +02:00
bergquist
1b6203e430 removes error2 logger 2019-01-15 11:49:18 +01:00
sharkpc0813
e172bade40 fix that alert context and result handle context do not use the same derived context. 2019-01-15 17:51:50 +09:00