Permalink
Browse files

cmd/bosun: reloading, new config format, saving via web UI

 * reload makes it so the configuration can change without restarting bosun
 * system conf is now in toml format and is a separate file from rules (i.e. alerts, macros, etc)
 * order of the rule configuration is less important. Things are now loaded in the following order: templates, notifications, macros, lookups, and then alerts.
 * configuration can now be saved from the rule UI if "EnableSave = true" is in the system conf
 * experimental API for endpoints for editing parts of the config via REST
 * support savehooks, a command to run whenever saving the file (i.e. check into git, make a backup file)
  • Loading branch information...
1 parent 73446d0 commit 554d588fe652e7b754f7a633e5a93bbf4c164d96 @kylebrandt kylebrandt committed on GitHub Jul 26, 2016
Showing with 8,312 additions and 2,888 deletions.
  1. +2 −1 build/validate.sh
  2. +269 −1,344 cmd/bosun/conf/conf.go
  3. +7 −93 cmd/bosun/conf/conf_test.go
  4. +4 −4 cmd/bosun/conf/notify.go
  5. 0 cmd/bosun/conf/{ → rule}/invalid/crit-notification-no-template
  6. +0 −2 cmd/bosun/conf/{ → rule}/invalid/crit-warn-unmatching-tags
  7. +0 −2 cmd/bosun/conf/{ → rule}/invalid/depends-no-overlap
  8. 0 cmd/bosun/conf/{ → rule}/invalid/log-no-notification
  9. 0 cmd/bosun/conf/{ → rule}/invalid/lookup-key-pairs
  10. 0 cmd/bosun/conf/{ → rule}/invalid/lookup-key-pairs-dup
  11. 0 cmd/bosun/conf/{ → rule}/invalid/notification-lookup-bad-notification
  12. 0 cmd/bosun/conf/{ → rule}/invalid/notification-lookup-table
  13. +0 −2 cmd/bosun/conf/{ → rule}/invalid/number-func-args
  14. +173 −0 cmd/bosun/conf/rule/modify.go
  15. 0 cmd/bosun/conf/{ → rule}/parse/lex.go
  16. 0 cmd/bosun/conf/{ → rule}/parse/node.go
  17. +1 −1 cmd/bosun/conf/{ → rule}/parse/parse.go
  18. 0 cmd/bosun/conf/{ → rule}/parse/parse_test.go
  19. 0 cmd/bosun/conf/{ → rule}/parse/test_invalid/1
  20. 0 cmd/bosun/conf/{ → rule}/parse/test_invalid/2
  21. 0 cmd/bosun/conf/{ → rule}/parse/test_invalid/3
  22. 0 cmd/bosun/conf/{ → rule}/parse/test_invalid/4
  23. 0 cmd/bosun/conf/{ → rule}/parse/test_valid/1
  24. 0 cmd/bosun/conf/{ → rule}/parse/test_valid/2
  25. 0 cmd/bosun/conf/{ → rule}/parse/test_valid/3
  26. 0 cmd/bosun/conf/{ → rule}/parse/test_valid/4
  27. +1,140 −0 cmd/bosun/conf/rule/rule.go
  28. +91 −0 cmd/bosun/conf/rule/rule_test.go
  29. +0 −4 cmd/bosun/conf/{ → rule}/test.conf
  30. +467 −0 cmd/bosun/conf/system.go
  31. +82 −0 cmd/bosun/conf/system_test.go
  32. +80 −21 cmd/bosun/main.go
  33. +30 −8 cmd/bosun/sched/alertRunner.go
  34. +0 −453 cmd/bosun/sched/bolt.go
  35. +68 −22 cmd/bosun/sched/check.go
  36. +15 −16 cmd/bosun/sched/check_test.go
  37. +5 −5 cmd/bosun/sched/notification_test.go
  38. +15 −15 cmd/bosun/sched/notify.go
  39. +65 −30 cmd/bosun/sched/sched.go
  40. +11 −9 cmd/bosun/sched/sched_test.go
  41. +12 −12 cmd/bosun/sched/template.go
  42. +9 −5 cmd/bosun/sched/views.go
  43. +1 −1 cmd/bosun/search/search_test.go
  44. BIN cmd/bosun/web/bosun.state
  45. +9 −9 cmd/bosun/web/chart.go
  46. +18 −21 cmd/bosun/web/expr.go
  47. +5 −2 cmd/bosun/web/incident.go
  48. +2 −1 cmd/bosun/web/relay_test.go
  49. +79 −0 cmd/bosun/web/save.go
  50. +2 −2 cmd/bosun/web/search.go
  51. +642 −604 cmd/bosun/web/static.go
  52. +10 −22 cmd/bosun/web/static/js/0-bosun.ts
  53. +80 −22 cmd/bosun/web/static/js/bosun.js
  54. +182 −84 cmd/bosun/web/static/js/config.ts
  55. +125 −49 cmd/bosun/web/static/partials/config.html
  56. +7 −4 cmd/bosun/web/static/templates/index.html
  57. +79 −17 cmd/bosun/web/web.go
  58. +2 −1 cmd/bosun/web/web_test.go
  59. +17 −0 opentsdb/tsdb.go
  60. +151 −0 vendor/github.com/davecgh/go-spew/spew/bypass.go
  61. +37 −0 vendor/github.com/davecgh/go-spew/spew/bypasssafe.go
  62. +341 −0 vendor/github.com/davecgh/go-spew/spew/common.go
  63. +297 −0 vendor/github.com/davecgh/go-spew/spew/config.go
  64. +202 −0 vendor/github.com/davecgh/go-spew/spew/doc.go
  65. +509 −0 vendor/github.com/davecgh/go-spew/spew/dump.go
  66. +419 −0 vendor/github.com/davecgh/go-spew/spew/format.go
  67. +148 −0 vendor/github.com/davecgh/go-spew/spew/spew.go
  68. +27 −0 vendor/github.com/pmezard/go-difflib/LICENSE
  69. +772 −0 vendor/github.com/pmezard/go-difflib/difflib/difflib.go
  70. +22 −0 vendor/github.com/stretchr/testify/LICENSE
  71. +387 −0 vendor/github.com/stretchr/testify/assert/assertion_forward.go
  72. +4 −0 vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl
  73. +1,007 −0 vendor/github.com/stretchr/testify/assert/assertions.go
  74. +45 −0 vendor/github.com/stretchr/testify/assert/doc.go
  75. +10 −0 vendor/github.com/stretchr/testify/assert/errors.go
  76. +16 −0 vendor/github.com/stretchr/testify/assert/forward_assertions.go
  77. +106 −0 vendor/github.com/stretchr/testify/assert/http_assertions.go
  78. +6 −0 vendor/vendor.json
View
@@ -74,7 +74,8 @@ echo -e "\nTesting that bosun starts and stops cleanly"
#TODO: save linux build from above? cant seem to find where it is though.
cd $GOPATH/src/bosun.org/cmd/bosun
go build .
-echo -e "tsdbHost = localhost:4242\nledisDir = ../ledis_data\ncheckFrequency = 5m\nhttpListen = :8070\n" > dev.conf
+echo -e 'RuleFilePath = "rule.conf"' > bosun.toml
+echo "" > rule.conf
timeout 30 ./bosun & bosunpid=$! #Run bosun in background with a 30s timeout and capture the pid
BOSUN_START_RESULT=$?
sleep 5
Oops, something went wrong.

0 comments on commit 554d588

Please sign in to comment.