```ruby
module HerokuRequestId
  class Railtie < Rails::Railtie
    initializer 'heroku_request_id.add_middleware' do |app|
      app.config.middleware.insert 0, "HerokuRequestId::Middleware"
    end
  end
end
```

Load the middleware before Rack::Runtime.
user
```ruby
module HerokuRequestId
  class Railtie < Rails::Railtie
    initializer 'heroku_request_id.add_middleware' do |app|
      app.config.middleware.insert_before "Rack::Runtime", "HerokuRequestId::Middleware"
    end
  end
end
```
assistant