rearview 1.1.2-jruby → 1.2.0-jruby
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -3
- data/app/controllers/rearview/application_controller.rb +11 -0
- data/app/controllers/rearview/dashboard_children_controller.rb +1 -1
- data/app/controllers/rearview/dashboards_controller.rb +1 -1
- data/app/controllers/rearview/home_controller.rb +1 -1
- data/app/controllers/rearview/jobs_controller.rb +33 -29
- data/app/controllers/rearview/monitor_controller.rb +16 -2
- data/app/controllers/rearview/user_controller.rb +2 -2
- data/app/helpers/rearview/application_helper.rb +3 -3
- data/app/mailers/rearview/alert_mailer.rb +0 -2
- data/app/mailers/rearview/metrics_validation_mailer.rb +12 -0
- data/app/models/rearview/job.rb +17 -13
- data/app/views/rearview/home/show.html.erb +2 -0
- data/app/views/rearview/jobs/_job.json.jbuilder +1 -0
- data/app/views/rearview/metrics_validation_mailer/validation_failed_email.text.erb +13 -0
- data/app/views/rearview/monitor/create.json.jbuilder +1 -0
- data/db/migrate/20131106162900_base_schema.rb +2 -2
- data/lib/generators/templates/rearview.rb +24 -7
- data/lib/graphite.rb +13 -0
- data/lib/graphite/cacerts.pem +2184 -0
- data/lib/graphite/client.rb +44 -0
- data/lib/graphite/graph.rb +35 -0
- data/lib/{rearview/graphite_parser.rb → graphite/raw_parser.rb} +2 -3
- data/lib/graphite/target.rb +9 -0
- data/lib/graphite/target_grammer.rb +114 -0
- data/lib/graphite/target_grammer.treetop +53 -0
- data/lib/graphite/target_parser.rb +50 -0
- data/lib/graphite/treetop_ext.rb +14 -0
- data/lib/rearview.rb +11 -3
- data/lib/rearview/alerts_handler.rb +2 -6
- data/lib/rearview/configuration.rb +44 -19
- data/lib/rearview/cron_expression_validator.rb +11 -0
- data/lib/rearview/metrics_validator.rb +52 -0
- data/lib/rearview/metrics_validator_service.rb +24 -0
- data/lib/rearview/metrics_validator_task.rb +56 -0
- data/lib/rearview/monitor_runner.rb +9 -7
- data/lib/rearview/monitor_service.rb +2 -0
- data/lib/rearview/stats_service.rb +4 -2
- data/lib/rearview/version.rb +1 -1
- data/lib/tasks/rearview_tasks.rake +7 -1
- data/public/{help → rearview-src/help}/alert.html +0 -0
- data/public/{help → rearview-src/help}/quick.html +0 -0
- data/public/rearview-src/js/app.js +9 -0
- data/public/rearview-src/js/model/user.js +6 -2
- data/public/rearview-src/js/view/addmonitor.js +13 -8
- data/public/rearview-src/js/view/alert.js +11 -4
- data/public/rearview-src/js/view/dashboard.js +4 -2
- data/public/rearview-src/js/view/expandedmonitor.js +22 -9
- data/public/rearview-src/js/view/settings.js +84 -0
- data/public/rearview-src/less/login.less +4 -4
- data/public/rearview-src/less/rearview.less +17 -10
- data/public/{monitors → rearview-src/monitors}/index.json +1 -1
- data/public/{monitors → rearview-src/monitors}/outage.rb +0 -0
- data/public/rearview-src/templates/alert.hbs +10 -2
- data/public/rearview-src/templates/primarynav.hbs +6 -6
- data/public/rearview-src/templates/schedulemonitor.hbs +2 -1
- data/public/rearview-src/templates/settings.hbs +23 -0
- data/public/rearview/build.txt +1 -0
- data/public/rearview/help/alert.html +20 -0
- data/public/rearview/help/quick.html +34 -0
- data/public/rearview/js/app.js +1 -1
- data/public/rearview/js/main.js +21 -21
- data/public/rearview/js/model/user.js +1 -1
- data/public/rearview/js/view/addmonitor.js +1 -1
- data/public/rearview/js/view/alert.js +1 -1
- data/public/rearview/js/view/dashboard.js +1 -1
- data/public/rearview/js/view/expandedmonitor.js +1 -1
- data/public/rearview/js/view/settings.js +1 -0
- data/public/rearview/less/login.less +4 -4
- data/public/rearview/less/rearview.less +17 -10
- data/public/rearview/monitors/index.json +3 -0
- data/public/rearview/monitors/outage.rb +2 -0
- data/public/rearview/templates/alert.hbs +10 -2
- data/public/rearview/templates/primarynav.hbs +6 -6
- data/public/rearview/templates/schedulemonitor.hbs +2 -1
- data/public/rearview/templates/settings.hbs +23 -0
- data/spec/controllers/jobs_controller_spec.rb +1 -0
- data/spec/controllers/monitor_controller_spec.rb +3 -0
- data/spec/controllers/user_controller_spec.rb +5 -2
- data/spec/data/metrics.yml +598 -0
- data/spec/dummy/log/development.log +1044 -0
- data/spec/dummy/log/test.log +171716 -0
- data/spec/helpers/application_helper_spec.rb +33 -0
- data/spec/lib/graphite/client_spec.rb +126 -0
- data/spec/lib/graphite/graph_spec.rb +17 -0
- data/spec/lib/graphite/graphite_spec.rb +4 -0
- data/spec/lib/{rearview/graphite_parser_spec.rb → graphite/raw_parser.rb} +6 -5
- data/spec/lib/graphite/target_grammer_spec.rb +106 -0
- data/spec/lib/graphite/target_parser_spec.rb +124 -0
- data/spec/lib/graphite/target_spec.rb +5 -0
- data/spec/lib/rearview/configuration_spec.rb +69 -48
- data/spec/lib/rearview/metrics_validator_service_spec.rb +43 -0
- data/spec/lib/rearview/metrics_validator_spec.rb +84 -0
- data/spec/lib/rearview/metrics_validator_task_spec.rb +62 -0
- data/spec/lib/rearview/monitor_runner_spec.rb +3 -3
- data/spec/lib/rearview/stats_task_spec.rb +21 -0
- data/spec/mailers/metrics_validation_mailer_spec.rb +46 -0
- data/spec/models/job_spec.rb +82 -9
- data/spec/spec_helper.rb +15 -4
- data/spec/support/json_factory.rb +1 -1
- data/spec/views/dashboards/show.json.jbuilder_spec.rb +3 -1
- data/spec/views/jobs/show.json.jbuilder_spec.rb +2 -1
- metadata +98 -11
- data/public/rearview-src/templates/test.txt +0 -1
- data/public/rearview/templates/test.txt +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9930818c3cb39841ee9774dbdee3ad09c4e72c4
|
4
|
+
data.tar.gz: 0190f0a54cdebf77f29d161adeea0a9ea195a7d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a285f335cf44cb0d9fbfc174e419d9051544ab03a045a60cfa8529edb90752cf493625b957d9f983b50081ea063fcda6646454c7bd13ed40ef579a6b0b4c3503
|
7
|
+
data.tar.gz: 17e8d45a1f71f0bac7028cb1204978f968f4bc63d30a178e409cba18d2471b8cf48ce19d50ebea818d3ac463ca4fa628692e29b9976db9a3e9c280b89dc57730
|
data/README.md
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
[](http://travis-ci.org/livingsocial/rearview-engine)
|
2
|
+
[](https://coveralls.io/r/livingsocial/rearview-engine?branch=master)
|
2
3
|
[](https://codeclimate.com/github/livingsocial/rearview-engine)
|
4
|
+
[](http://badge.fury.io/rb/rearview)
|
3
5
|
|
4
6
|
Rails engine for [rearview](http://github.com/livingsocial/rearview). This project is for rearview developers only. For users please go to the [rearview](http://github.com/livingsocial/rearview) project for installation, configuration, and other details.
|
5
7
|
|
6
8
|
# Development Guide
|
7
9
|
|
8
|
-
|
10
|
+
Be sure to read the contribution guidelines [contribute](https://github.com/livingsocial/rearview-engine/blob/master/CONTRIBUTING.md).
|
9
11
|
|
10
12
|
## Intro
|
11
13
|
|
12
|
-
Before contributing you should read [Getting Started with Engines](http://guides.rubyonrails.org/engines.html) guide to familiarize yourself with rails engines.
|
14
|
+
Before contributing you should read [Getting Started with Engines](http://guides.rubyonrails.org/engines.html) guide to familiarize yourself with rails engines. This [blog post](http://trentalbright.info/ruby/open-sourcing-with-engines/) also provides some more in-depth details of rails engines.
|
13
15
|
|
14
16
|
Rearview consists of two components:
|
15
17
|
|
@@ -42,6 +44,10 @@ Change the line simliar to this
|
|
42
44
|
To point to the path you cloned the engine too, for example
|
43
45
|
|
44
46
|
gem 'rearview', :path => '~/clone/path/rearview-engine'
|
47
|
+
|
48
|
+
Update your gems with bundler
|
49
|
+
|
50
|
+
bundle install
|
45
51
|
|
46
52
|
#### sync the engine host database
|
47
53
|
|
@@ -54,7 +60,9 @@ To point to the path you cloned the engine too, for example
|
|
54
60
|
|
55
61
|
## User Interface Guide
|
56
62
|
|
57
|
-
Rearview
|
63
|
+
The Rearview UI is built using bootstrap and require.
|
64
|
+
|
65
|
+
Rearview does not use the asset pipeline. Instead you'll need to take a look at [public/rearview-src](https://github.com/livingsocial/rearview-engine/tree/master/public/rearview-src). In development mode javascript, css, etc are loaded directly from here. When rearview-engine is bundled as a Gem the various elements are pre-compiled (manually before **gem build**) using require.js and are loaded from [public/rearview](https://github.com/livingsocial/rearview-engine/tree/master/public/rearview).
|
58
66
|
|
59
67
|
To compile the ui before distribution, run the following rake task from inside rearview-engine:
|
60
68
|
|
@@ -2,5 +2,16 @@ module Rearview
|
|
2
2
|
class ApplicationController < ActionController::Base
|
3
3
|
helper Rearview::Engine.helpers
|
4
4
|
before_filter :authenticate_user!
|
5
|
+
|
6
|
+
protected
|
7
|
+
|
8
|
+
def underscore_params
|
9
|
+
self.params = self.params.inject({}.with_indifferent_access) { |a,(k,v)| a[k.to_s.underscore] = v; a }
|
10
|
+
end
|
11
|
+
|
12
|
+
def clean_empty_array_vals(key)
|
13
|
+
params[key].reject! { |m| !m.present? } if params[key].present?
|
14
|
+
end
|
15
|
+
|
5
16
|
end
|
6
17
|
end
|
@@ -1,6 +1,11 @@
|
|
1
1
|
module Rearview
|
2
|
-
class JobsController < ApplicationController
|
2
|
+
class JobsController < Rearview::ApplicationController
|
3
3
|
respond_to :json
|
4
|
+
before_action :underscore_params, only: [:create,:update]
|
5
|
+
before_action only: [:create, :update] do
|
6
|
+
clean_empty_array_vals(:metrics)
|
7
|
+
clean_empty_array_vals(:alert_keys)
|
8
|
+
end
|
4
9
|
|
5
10
|
def index
|
6
11
|
@jobs = if params[:dashboard_id].present?
|
@@ -11,13 +16,32 @@ module Rearview
|
|
11
16
|
end
|
12
17
|
|
13
18
|
def create
|
14
|
-
|
15
|
-
|
19
|
+
dashboard_id = params.delete("dashboard_id")
|
20
|
+
@job = Rearview::Job.new(job_create_params)
|
21
|
+
@job.deep_validation = true
|
22
|
+
@job.user_id = current_user.id
|
23
|
+
@job.dashboard = Rearview::Dashboard.find(dashboard_id.to_i)
|
24
|
+
if @job.save
|
25
|
+
@job.sync_monitor_service
|
26
|
+
render :show
|
27
|
+
else
|
28
|
+
render :show, status: 422
|
29
|
+
end
|
16
30
|
end
|
17
31
|
|
18
32
|
def update
|
19
|
-
|
20
|
-
|
33
|
+
@job = Rearview::Job.find(params[:id])
|
34
|
+
@job.deep_validation = true
|
35
|
+
dashboard_id = params.delete("dashboard_id")
|
36
|
+
if dashboard_id.present? && dashboard_id.to_i!=@job.app_id
|
37
|
+
@job.dashboard = Rearview::Dashboard.find(dashboard_id.to_i)
|
38
|
+
end
|
39
|
+
if @job.update_attributes(job_update_params)
|
40
|
+
@job.sync_monitor_service
|
41
|
+
render :show
|
42
|
+
else
|
43
|
+
render :show, status: 422
|
44
|
+
end
|
21
45
|
end
|
22
46
|
|
23
47
|
def destroy
|
@@ -49,32 +73,12 @@ module Rearview
|
|
49
73
|
|
50
74
|
private
|
51
75
|
|
52
|
-
def
|
53
|
-
|
54
|
-
dashboard_id = filtered_params.delete("dashboard_id")
|
55
|
-
if dashboard_id.present? && dashboard_id.to_i!=@job.app_id
|
56
|
-
@job.dashboard = Rearview::Dashboard.find(dashboard_id.to_i)
|
57
|
-
end
|
58
|
-
@job.update_attributes!(filtered_params)
|
59
|
-
@job.sync_monitor_service
|
60
|
-
end
|
61
|
-
|
62
|
-
def allowed_create_params
|
63
|
-
filtered_params = underscore_params
|
64
|
-
filtered_params.delete_if { |k,v|
|
65
|
-
["controller","job_type","version","action","job","id","format","created_at","modified_at"].include?(k)
|
66
|
-
}
|
67
|
-
end
|
68
|
-
|
69
|
-
def allowed_update_params
|
70
|
-
filtered_params = underscore_params
|
71
|
-
filtered_params.delete_if { |k,v|
|
72
|
-
!["dashboard_id","name","active","alert_keys","cron_expr","error_timeout","minutes","metrics","monitor_expr","to_date","description"].include?(k)
|
73
|
-
}
|
76
|
+
def job_update_params
|
77
|
+
params.permit(:name,:active,{ :alert_keys => []},:cron_expr,:error_timeout,:minutes,{ :metrics => [] },:monitor_expr,:to_date,:description)
|
74
78
|
end
|
75
79
|
|
76
|
-
def
|
77
|
-
params.
|
80
|
+
def job_create_params
|
81
|
+
params.permit(:dashboard_id,:name,:active,{ :alert_keys => []},:cron_expr,:error_timeout,:minutes,{ :metrics => [] },:monitor_expr,:to_date,:description)
|
78
82
|
end
|
79
83
|
|
80
84
|
end
|
@@ -1,9 +1,23 @@
|
|
1
1
|
|
2
2
|
module Rearview
|
3
|
-
class MonitorController < ApplicationController
|
3
|
+
class MonitorController < Rearview::ApplicationController
|
4
4
|
|
5
|
+
before_action only: [:create] do
|
6
|
+
clean_empty_array_vals(:metrics)
|
7
|
+
end
|
8
|
+
|
9
|
+
#
|
10
|
+
# TODO this should be moved to the JobsController#test and the UI changed to push the
|
11
|
+
# monitor job model instead of custom params
|
12
|
+
#
|
5
13
|
def create
|
6
|
-
|
14
|
+
metrics_validator = Rearview::MetricsValidator.new({attributes: [:metrics]})
|
15
|
+
@errors = params[:metrics].inject([]) { |a,v| a << "Metrics contains an invalid metric: #{v}" unless(metrics_validator.metric_valid?(v)); a }
|
16
|
+
results = if @errors.empty?
|
17
|
+
Rearview::MonitorRunner.run(params[:metrics],params[:monitorExpr],params[:minutes],{},false,params[:toDate],true)
|
18
|
+
else
|
19
|
+
{ }
|
20
|
+
end
|
7
21
|
@monitor_output = Rearview::MonitorRunner.normalize_results(results)
|
8
22
|
end
|
9
23
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_dependency "rearview/application_controller"
|
2
2
|
|
3
3
|
module Rearview
|
4
|
-
class UserController < ApplicationController
|
4
|
+
class UserController < Rearview::ApplicationController
|
5
5
|
respond_to :json
|
6
6
|
def show
|
7
7
|
@user = current_user
|
@@ -13,8 +13,8 @@ module Rearview
|
|
13
13
|
@user = current_user
|
14
14
|
if preferences.present?
|
15
15
|
@user.preferences = preferences
|
16
|
-
@user.save!
|
17
16
|
end
|
17
|
+
@user.save!
|
18
18
|
render :show
|
19
19
|
end
|
20
20
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Rearview
|
2
2
|
module ApplicationHelper
|
3
|
-
def rearview_static_path(segment)
|
3
|
+
def rearview_static_path(segment=nil)
|
4
4
|
prefix = if Rails.env.development?
|
5
5
|
"/rearview-src"
|
6
6
|
else
|
@@ -8,12 +8,12 @@ module Rearview
|
|
8
8
|
end
|
9
9
|
( segment.present? ? prefix + segment : prefix )
|
10
10
|
end
|
11
|
-
def rearview_link_tag(href,options)
|
11
|
+
def rearview_link_tag(href,options={})
|
12
12
|
options = options.symbolize_keys
|
13
13
|
options[:href] = rearview_static_path(href)
|
14
14
|
tag("link",options)
|
15
15
|
end
|
16
|
-
def rearview_img_tag(source,options)
|
16
|
+
def rearview_img_tag(source,options={})
|
17
17
|
options = options.symbolize_keys
|
18
18
|
options[:src] = rearview_static_path("/img"+source)
|
19
19
|
tag("img", options)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
module Rearview
|
3
|
+
class MetricsValidationMailer < ActionMailer::Base
|
4
|
+
default from: Rearview.config.default_from
|
5
|
+
def validation_failed_email(recipient, job)
|
6
|
+
@job = job
|
7
|
+
mail(:to => recipient, :subject => "[Rearview ALERT] invalid metrics for #{@job.name}")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
|
data/app/models/rearview/job.rb
CHANGED
@@ -10,7 +10,12 @@ module Rearview
|
|
10
10
|
make_constants_module :status,
|
11
11
|
:constants => [:success,:failed,:error,:graphite_error,:graphite_metric_error,:security_error]
|
12
12
|
|
13
|
-
|
13
|
+
attr_writer :deep_validation
|
14
|
+
|
15
|
+
attr_accessible :created_at, :updated_at, :name, :active, :last_run,
|
16
|
+
:cron_expr, :status, :user_id, :alert_keys, :deleted_at, :error_timeout,
|
17
|
+
:next_run, :description, :app_id, :metrics, :monitor_expr, :minutes,
|
18
|
+
:to_date
|
14
19
|
|
15
20
|
belongs_to :dashboard, :foreign_key => :app_id
|
16
21
|
belongs_to :user
|
@@ -25,8 +30,9 @@ module Rearview
|
|
25
30
|
before_destroy :unschedule
|
26
31
|
|
27
32
|
validates :app_id, :cron_expr, :name, :metrics, :presence => true
|
28
|
-
|
29
|
-
|
33
|
+
validates :cron_expr, :'rearview/cron_expression' => true, :if => :deep_validation?
|
34
|
+
validates :metrics, :'rearview/metrics' => true, :if => :deep_validation?
|
35
|
+
validate :valid_alert_keys, :if => :deep_validation?
|
30
36
|
|
31
37
|
scope :schedulable, -> { where(:active=>true) }
|
32
38
|
|
@@ -110,12 +116,6 @@ module Rearview
|
|
110
116
|
end
|
111
117
|
end
|
112
118
|
|
113
|
-
def valid_cron_expression
|
114
|
-
if cron_expr.present? && !Rearview::CronHelper.valid_expression?(cron_expr)
|
115
|
-
errors.add(:cron_expr, "not a valid cron expression")
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
119
|
def valid_alert_keys
|
120
120
|
if alert_keys.present?
|
121
121
|
schemes = Rearview::Alerts.registry.keys
|
@@ -124,15 +124,15 @@ module Rearview
|
|
124
124
|
uri = URI(key)
|
125
125
|
scheme = uri.scheme
|
126
126
|
unless scheme.present? && schemes.include?(scheme)
|
127
|
-
errors.add(:alert_keys,"
|
127
|
+
errors.add(:alert_keys,"#{key} is not a supported alert type")
|
128
128
|
else
|
129
129
|
scheme_class = Rearview::Alerts.registry[scheme]
|
130
130
|
unless scheme_class.key?(key)
|
131
|
-
errors.add(:alert_keys,"#{
|
131
|
+
errors.add(:alert_keys,"#{key} is invalid for supported alert type")
|
132
132
|
end
|
133
133
|
end
|
134
|
-
rescue URI::InvalidURIError
|
135
|
-
errors.add(:alert_keys,"invalid URI")
|
134
|
+
rescue URI::InvalidURIError, URI::InvalidComponentError
|
135
|
+
errors.add(:alert_keys,"#{key} is an invalid URI")
|
136
136
|
end
|
137
137
|
end
|
138
138
|
end
|
@@ -154,6 +154,10 @@ module Rearview
|
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
157
|
+
def deep_validation?
|
158
|
+
@deep_validation
|
159
|
+
end
|
160
|
+
|
157
161
|
protected
|
158
162
|
|
159
163
|
def report_transition(transition)
|
@@ -41,10 +41,12 @@
|
|
41
41
|
<section class='delete-monitor-wrap'></section>
|
42
42
|
<section class='reset-monitor-wrap'></section>
|
43
43
|
<section class='add-monitor-wrap'></section>
|
44
|
+
<section class='settings-wrap'></section>
|
44
45
|
<section class='secondary-nav-wrap'></section>
|
45
46
|
<script type='text/javascript'>
|
46
47
|
var rearview = {};
|
47
48
|
rearview.version = '<%= Rearview::VERSION %>';
|
49
|
+
rearview.path = '<%= rearview_static_path %>';
|
48
50
|
<% if Rails.env.development? %>
|
49
51
|
rearview.cache = false;
|
50
52
|
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
ALERT: Job has (<%= @job.errors[:metrics].count %>) invalid <%= "metric".pluralize(@job.errors[:metrics].count) %>
|
2
|
+
|
3
|
+
Monitor: <%= @job.name %>
|
4
|
+
Description: <%= @job.description.nil? ? "None" : @job.description %>
|
5
|
+
|
6
|
+
Alerted On: <%= Time.now.utc %>
|
7
|
+
Direct Link: <%= Rearview::UrlHelper.job_url(@job) %>
|
8
|
+
|
9
|
+
The following metric(s) are no longer valid in graphite:
|
10
|
+
|
11
|
+
<% @job.errors[:metrics].each do |metric_error| %>
|
12
|
+
<%= metric_error.match(/metric: (.*)$/).try(:[],1) %>
|
13
|
+
<% end %>
|
@@ -17,13 +17,13 @@ class BaseSchema < ActiveRecord::Migration
|
|
17
17
|
t.integer "job_id", :default => 0, :null => false
|
18
18
|
t.datetime "created_at"
|
19
19
|
t.datetime "updated_at"
|
20
|
-
t.text "data", :limit =>
|
20
|
+
t.text "data", :limit => 1073741823, :null => false
|
21
21
|
end
|
22
22
|
|
23
23
|
create_table "job_errors", :force => true do |t|
|
24
24
|
t.integer "job_id"
|
25
25
|
t.datetime "created_at"
|
26
|
-
t.text "message", :limit =>
|
26
|
+
t.text "message", :limit => 1073741823
|
27
27
|
t.string "status"
|
28
28
|
t.datetime "last_alerted_at"
|
29
29
|
t.datetime "updated_at"
|
@@ -29,10 +29,20 @@ Rearview.configure do |config|
|
|
29
29
|
# period the monitor script will be terminated.
|
30
30
|
config.sandbox_timeout = 10
|
31
31
|
|
32
|
-
# The
|
32
|
+
# The connection information for your graphite web server
|
33
33
|
# ex:
|
34
|
-
# config.
|
35
|
-
config.
|
34
|
+
# config.graphite_connection = { url: 'http://graphite.mycom.com' }
|
35
|
+
# config.graphite_connection = {
|
36
|
+
# url: 'http://graphite.mycompany.com'
|
37
|
+
# ssl: {
|
38
|
+
# verify: true,
|
39
|
+
# }
|
40
|
+
# basic_auth: {
|
41
|
+
# user: 'admin',
|
42
|
+
# password: 'xyzzy'
|
43
|
+
# }
|
44
|
+
# }
|
45
|
+
config.graphite_connection = { url: nil }
|
36
46
|
|
37
47
|
# This is the email from: address used when sending alerts
|
38
48
|
# ex:
|
@@ -42,7 +52,7 @@ Rearview.configure do |config|
|
|
42
52
|
# The url options for rearview application host. Required to generate
|
43
53
|
# monitor alerts with correct URL references.
|
44
54
|
# ex:
|
45
|
-
# config.default_url_options = { host: 'rearview.
|
55
|
+
# config.default_url_options = { host: 'rearview.mycompany.com', protocol: 'https'}
|
46
56
|
config.default_url_options = { host: 'localhost', port: '3000'}
|
47
57
|
|
48
58
|
# Enable collection of stats for rearview itself. This will send JVM and monitor related
|
@@ -51,9 +61,15 @@ Rearview.configure do |config|
|
|
51
61
|
config.enable_stats=false
|
52
62
|
|
53
63
|
# The connection information for the stats service. Only necessary if enable_stats is true.
|
54
|
-
|
55
|
-
|
56
|
-
#
|
64
|
+
config.statsd_connection = { host: 'statsd.mycompany.com', port: 8125 , namespace: 'rearview' }
|
65
|
+
|
66
|
+
# Enable periodic checking for invalid metrics used in monitors.
|
67
|
+
config.enable_metrics_validator = false
|
68
|
+
|
69
|
+
# Set schedule for checking for invalid metrics (cron expression). Recommended only once per day.
|
70
|
+
# see http://quartz-scheduler.org/api/2.0.0/org/quartz/CronExpression.html. Only necessary if
|
71
|
+
# enable_metrics_validator is true.
|
72
|
+
config.metrics_validator_schedule = '* * 23 * *'
|
57
73
|
|
58
74
|
case Rails.env
|
59
75
|
when "test"
|
@@ -67,6 +83,7 @@ Rearview.configure do |config|
|
|
67
83
|
if File.basename($0) == "rake"
|
68
84
|
config.enable_monitor = false
|
69
85
|
config.enable_stats = false
|
86
|
+
config.enable_metrics_validator = false
|
70
87
|
end
|
71
88
|
|
72
89
|
# Options passed via environment will override anything else set to this point...
|