Simple website synthetic monitoring gem.
Example app which uses this gem: example-synthetic-monitor
The example application is deployable on Heroku which makes it very quick to get production monitoring up and running, and the monitoring is specified in plain old RSpec tests, which means that your monitoring is much more easily customised to your needs than most solutions.
Run all the specs in the 'spec' directory, every 5 minutes, and notify any failures on a Slack channel or group (with SMS notifications coming soon):
SyntheticMonitor.new.monitor ENV['SLACK_WEBHOOK_URL']
Alternatively you can have individual spec files notify an individual Slack channel or group:
spec_slack_pairs = {
'spec/a_spec.rb' => ENV['A_SlACK_WEBHOOK_URL'],
'spec/another_spec.rb' => ENV['A_DIFFERENT_SLACK_WEBHOOK_URL'],
'spec/a_third_spec.rb' => ENV['A_THIRD_SLACK_WEBHOOK_URL'],
}
SyntheticMonitor.new.monitor_on_varying_slack_channels spec_slack_pairs
The monitoring frequency is customisable:
SyntheticMonitor.new(frequency_in_minutes: 10).monitor
An example spec:
scenario "monitor example.com" do
@session.visit 'https://www.example.com'
expect(@session).to have_content("This domain is established to be used for illustrative examples in documents.")
expect(@session.status_code).to eq(200)
end
Running the functional tests
bundle exec rake test