diff --git a/ruby/grape/app/Gemfile.lock b/ruby/grape/app/Gemfile.lock index 7f00a0e1..15b789db 100644 --- a/ruby/grape/app/Gemfile.lock +++ b/ruby/grape/app/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: /integration specs: - appsignal (3.9.1) + appsignal (4.0.0) rack GEM diff --git a/ruby/grape/app/api.rb b/ruby/grape/app/api.rb index dc3fcbda..7ffdc568 100644 --- a/ruby/grape/app/api.rb +++ b/ruby/grape/app/api.rb @@ -1,5 +1,4 @@ require "grape" -require "appsignal/integrations/grape" # In memory database for posts class Posts @@ -24,7 +23,7 @@ def find_by_id(id) module MyApp class BaseAPI < Grape::API - insert_before Grape::Middleware::Error, Appsignal::Grape::Middleware + insert_before Grape::Middleware::Error, Appsignal::Rack::GrapeMiddleware end module PostsAPI diff --git a/ruby/grape/app/config.ru b/ruby/grape/app/config.ru index 232f174d..3a81b5de 100644 --- a/ruby/grape/app/config.ru +++ b/ruby/grape/app/config.ru @@ -1,15 +1,12 @@ require "appsignal" +require "grape" -Appsignal.config = Appsignal::Config.new( - Dir.pwd, - ENV.fetch("RACK_ENV", "development") -) +use ::Rack::Events, [Appsignal::Rack::EventHandler.new] + +Appsignal.load(:grape) Appsignal.start -Appsignal.start_logger require_relative "api" -use ::Rack::Events, [Appsignal::Rack::EventHandler.new] - MyApp::API.compile! run MyApp::API