A Rails engine for recording, replaying, and debugging HTTP requests with their database interactions in real-time.
-
🔍 Request Monitoring
- Automatic HTTP request recording
- Database query tracking
- Headers and parameters logging
- Session data capture
-
🎯 Smart Filtering
- Configurable sampling rates
- Path exclusion patterns
- Parameter filtering
- Header sanitization
-
🔄 Request Replay
- Exact request reproduction
- Database state tracking
- Error handling
- Related request linking
-
📊 Performance Analytics
- Response time tracking
- Error rate monitoring
- Request volume analysis
- SQL query profiling
- Add to your Gemfile:
gem 'railsclocks'- Install and run migrations:
rails generate railsclocks:install
rails db:migrate- Configure in
config/initializers/railsclocks.rb:
RailsClocks.configure do |config|
config.enabled = true
config.sample_rate = 1.0
config.excluded_paths = [/assets/, /packs/]
end| Option | Default | Description |
|---|---|---|
enabled |
true |
Enable/disable request recording |
sample_rate |
1.0 |
Percentage of requests to record |
excluded_paths |
[/assets/, /packs/] |
Paths to ignore |
max_request_size_bytes |
1.megabyte |
Maximum request size |
retention_period |
30.days |
Data retention period |
# Get recorded requests
requests = RailsClocks::RecordedRequest.recent
# Find specific request
request = RailsClocks::RecordedRequest.find_by(uuid: 'uuid')
# Replay request
result = request.replay
# Analyze performance
stats = RailsClocks::API.analyze_performance(period: 24.hours)Access the dashboard at /railsclocks to:
- View recorded requests
- Analyze performance metrics
- Replay specific requests
- Monitor error rates
RailsClocks includes:
- Parameter filtering
- Header sanitization
- Authorization controls
- Data retention policies
- Configurable sampling rate
- Minimal overhead (~1-2ms per request)
- Automatic data cleanup
- Compressed storage
- Fork the repository
- Create your feature branch
- Run tests:
bundle exec rspec - Submit a pull request
Released under the MIT License. See LICENSE for details.
