appsignal / appsignal-ruby

🟥 AppSignal for Ruby gem
https://www.appsignal.com/ruby
MIT License
183 stars 115 forks source link

Improving grape on rails docs #1273

Closed hunterm-wbc closed 2 months ago

hunterm-wbc commented 2 months ago

Hi all,

I'm currently working up updating my app (which runs grape on rails) and it seems like there are some missing configuration steps from the Mounted Grape apps section. I was able to piece together a working setup (still verifying) by finding some notes in the release logs. Here's what I did:

  1. Load the grape integration file inside of app/initializers/appsignal.rb:
    
    # app/initializers/appsignal.rb

Appsignal.load(:grape)

2. Update the API classes to use `Appsignal::Rack::GrapeMiddleware` instead of `Appsignal::Grape::Middleware`
```ruby
class FooAPI < Grape::API
  use Appsignal::Rack::GrapeMiddleware
end

Please let me know if there is something incorrect here. I'm still working on testing this setup.

tombruijn commented 2 months ago

Hi @hunterm-wbc, you're right the Grape middleware constant wasn't updated for Ruby gem 4. I've submitted a PR with the fix. Let us know if you find any other issues :)