A Rails engine for inspecting your Redis instances through a web UI.
Built for teams that cannot easily use more direct access methods (e.g. console) to inspect their Redis instances.
- Add this line to your application's Gemfile:
gem 'redis_ui_rails'
- In
config/routes.rb
, mount the engine
Rails.application.routes.draw do
mount RedisUiRails::Engine => "/redis_ui"
end
- Precompile your assets
cd path/to/your/rails/app/root
bundle exec rake assets:precompile
- Configure your engine.
Example:
# config/initializers/redis_ui_rail.rb
# Each Redis "instance" is a hash, with the following symbolized key structure:
# :id (required) The ID used in the URL for this instance.
# :name (required) The name that differentiates this Redis instance from others.
# :url (required) The URL of the redis instance.
# :resource_links (optional) Quick links to resources related to this instance.
# :enabled (optional) Allows enabling per environment. Defaults to true.
#
RedisUiRails.configure do |config|
config.redis_instances = [
{
id: :local,
name: "Local Queue and Cache", # many apps share a queue and cache Redis locally
url: ENV["REDIS_URL"],
enabled: Rails.env.development? || Rails.env.test?
},
{
id: :cache,
name: "Cache",
url: ENV.fetch("REDIS_CACHE_URL"), # many apps have separate queue and cache Redis instances in production
resource_links: [
{
label: "Custom Datadog Dashboard",
url: "https://myorg.datadoghq.com/path/to/your/dashhboard"
}
],
enabled: Rails.env.production?
}
]
end
- Requirements:
- Ruby >= 3.0
- Direnv (don't forget your rc file hook)
- Initial setup
bundle install
cp .rspec.example .rspec
cp .env.example .env
direnv allow
- Run tests
bundle exec rspec spec
Want to contribute? Awesome! Check out our guidelines.