Documentation
Set the configuration.
status
json
or xml
or text
)
json
true
Put this line to your config/initializers/alive_state.rb
:
AliveState.configure do |config|
config.path = 'info/status'
config.format = 'xml'
end
Put this line to your config/application.rb
:
module Railsnew
class Application < Rails::Application
AliveState.config.insert_middleware = false
end
end
Set the code of application to observe on block.
Put this line to your config/initializers/alive_state.rb
:
AliveState.application do
active_ldap { ActiveLdap::Base.all(limit: 1) }
sidekiq do
Sidekiq.redis { |conn| conn.ping }
end
end
Response in the format of json:
{
"state": "green",
"observed_at": "2014-03-21T12:34:56.789Z",
"application": {
"active_record": true,
"active_ldap": true,
"sidekiq": true
}
}