GithubHelp home page GithubHelp logo

opbeat-ruby's People

Contributors

auroranockert avatar calvincorreli avatar eckardt avatar mikker avatar olleolleolle avatar orhantoy avatar simitt avatar skogsmaskin avatar ulrikandersen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

opbeat-ruby's Issues

undefined method `split' for nil:NilClass in 3.0.8 (rails 5)

I see this in my production log after upgrading to opbeat 3.0.8 (Rails 5)

I'll take a closer look asap, but wanted to file the issue here fast as well so others can chip in ;-)

Aug 26 09:05:06 myphoner app/web.2:  F, [2016-08-26T07:05:06.483114 #134] FATAL -- : vendor/bundle/ruby/2.3.0/gems/opbeat-3.0.8/lib/opbeat/middleware.rb:10:in `call' 
Aug 26 09:26:19 myphoner app/web.2:  E, [2016-08-26T07:26:19.663950 #134] ERROR -- : ** [Opbeat] Error capturing or sending exception undefined method `split' for nil:NilClass 

Impossible to disable Sidekiq integration

The Sidekiq integration bits get loaded, no matter what. This interferes with custom Sidekiq middleware and error handlers that report errors to Opbeat, typically causing duplicates to appear in Opbeat.

It should be possible to disable the Sidekiq integration feature.

Upgrade question

Working on upgrading an app from v2.0 to v3. One thing outstanding:

I have a few calls to Opbeat.capture_exception (and capture_message, but that's less important) scattered throughout my app. Is there any corollary to this in version 3?

Example:

    begin
      abc
    rescue Exception => e
      Opbeat.capture_exception(e)
    end

Add ActionMailer traces

If you send emails inline they take up a big chunk of the request transaction but they aren't traced.

filter_parameters not working as it should

I’m using your Opbeat-Ruby gem for my application, but I realized that there are some parameters which I use in my application is sent over to Opbeat, even though I have set those parameters to be filtered in filter_parameters. Here’s a snippet of of my code:

Rails.application.configure do
 config.opbeat = {
   organization_id: ENV['OPBEAT_ORG_ID'] ,
   app_id: ENV['OPBEAT_APP_ID'] ,
   secret_token: ENV['OPBEAT_SECRET_TOKEN'],
   filter_parameters: [ :password, :password_confirmation, :current_password, :token, :secret, :_secret2 ]
}

:_secret2 is still being logged inside Opbeat.

Upgrading from v2

Is there an upgrade guide from v2 of the gem?

I’m using

Opbeat.set_context

which doesn’t exist anymore.

I tried adding the code from your docs:

Rails.application.configure do |config|
  # ...
  config.opbeat.organization_id = 'XXX'
  config.opbeat.app_id = 'XXX'
  config.opbeat.secret_token = 'XXX'
end

but it fails:

➜  Simplero git:(master) ✗ rc
/Users/calvin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/rails-e90c76b83397/railties/lib/rails/railtie/configuration.rb:95:in `method_missing': undefined method `opbeat' for #<Rails::Application::Configuration:0x007ff65f451548> (NoMethodError)
    from /Users/calvin/Simplero/config/environments/development.rb:105:in `block in <top (required)>'
    from /Users/calvin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/rails-e90c76b83397/railties/lib/rails/railtie.rb:210:in `instance_eval'
    from /Users/calvin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/rails-e90c76b83397/railties/lib/rails/railtie.rb:210:in `configure'
    from /Users/calvin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/rails-e90c76b83397/railties/lib/rails/railtie.rb:182:in `configure'

I tried without the Rails.application.configure first, and it still fails:

➜  Simplero git:(master) ✗ rc
/Users/calvin/Simplero/config/initializers/opbeat.rb:6:in `block in <top (required)>': undefined method `opbeat' for #<Simplero::Application:0x007fe2cb2262e8> (NoMethodError)
    from /Users/calvin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/rails-e90c76b83397/railties/lib/rails/railtie.rb:210:in `instance_eval'
    from /Users/calvin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/rails-e90c76b83397/railties/lib/rails/railtie.rb:210:in `configure'
    from /Users/calvin/Simplero/config/initializers/opbeat.rb:5:in `<top (required)>'
    from /Users/calvin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/rails-e90c76b83397/activesupport/lib/active_support/dependencies.rb:268:in `load'

I tried in a config/initializers/opbeat.rb, and it still fails:

➜  Simplero git:(master) ✗ rc
/Users/calvin/Simplero/config/initializers/opbeat.rb:6:in `block in <top (required)>': undefined method `opbeat' for #<Opbeat::Configuration:0x007f89cf5b45b8> (NoMethodError)
    from /Users/calvin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/opbeat-3.0.3/lib/opbeat/configuration.rb:62:in `initialize'
    from /Users/calvin/Simplero/config/initializers/opbeat.rb:5:in `new'
    from /Users/calvin/Simplero/config/initializers/opbeat.rb:5:in `<top (required)>'
    from /Users/calvin/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/bundler/gems/rails-e90c76b83397/activesupport/lib/active_support/dependencies.rb:268:in `load'

So far, it’s not easy at all, and I can’t find anything that says what I need to change.

Can you point me in the right direction?

A before hook to filter exceptions

As of now, the only way to filter exceptions is the excluded_exceptions array.

I have the error with class ActionController::RoutingError which happens a lot, especially when some bots are scanning my app, and while I don't want to be spamed all the day long, I don't want to ignore ALL of the ActionController::RoutingError exceptions.

Having a before hook, juste before the excluded_exceptions array, passing the exception as a parameter would allow us to check some details about the exception, like in my case the message content using a Regex, a filter the exception with a finer granularity.

Something like:

config.opbeat.before_sending do |exception|
  if exception.message ~= /my message/
    return false # Prevent sending the exception
  end
end

Sinatra apps mounted inside Rails broken with v3

Hi there, me again.

As part of the upgrade process, I noticed that my "mounted apps" using Sinatra are now broken.

A common example would be Sidekiq::Web (a web interface for your sidekiq queue).

It is mounted in the routes file like:

require 'sidekiq/web'
mount Sidekiq::Web => '/sidekiq'

And the error that you get when visiting that page is:

NoMethodError at /sidekiq/
undefined method `endpoint=' for nil:NilClass
file: sinatra.rb location: block in dispatch! line: 13

Here's the backtrace if it helps:
Backtrace

I assume the problem is that I'm only using the Rails initialization steps, but I'll also need to somehow include the Rack steps for these mounted Rack apps.

Any idea on how that can be done?

undefined method 'each' for ActionDispatch::Request

After upgrading to rails 5 I see this in my logs:

** [Opbeat] Error capturing or sending exception undefined method `each' for #<ActionDispatch::Request:0x007fc96be63840>
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/opbeat-ruby-6b1705474436/lib/opbeat/error_message/http.rb:29:in `from_rack_env'
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/opbeat-ruby-6b1705474436/lib/opbeat/error_message.rb:64:in `from_exception'
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/opbeat-ruby-6b1705474436/lib/opbeat/client.rb:196:in `report'
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/opbeat-ruby-6b1705474436/lib/opbeat.rb:114:in `report'
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/opbeat-ruby-6b1705474436/lib/opbeat/integration/rails/inject_exceptions_catcher.rb:12:in `render_exception_with_opbeat'
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/debug_exceptions.rb:59:in `rescue in call'
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/debug_exceptions.rb:48:in `call'

Is the gem compatible with rails 5 or is it some other issue? I noticed that the builds haven't passed since 3.0.3 - I've reproduced this error with both 3.0.3, 3.0.7 and the fork with Rails 5 compatibility (#27)

Any ideas?

[Opbeat] Invalid config - Skipping posting to Opbeat

Opbeat throws an error Configuration missing 'app_id' and it skip posting to Opbeat. This error is only replicated in production whereas in development everything is fine. This means I've correct app_id.

My opbeat.rb looks like:
screen shot 2016-03-31 at 5 01 01 pm

Error log Screenshot while routing error.

screen shot 2016-03-31 at 4 57 51 pm

Sidekiq errors

Hi,
I get this:

2016-02-01T14:23:03.607Z 7211 TID-ovlsyrz9g ERROR: !!! ERROR HANDLER THREW AN ERROR !!! 2016-02-01T14:23:03.609Z 7211 TID-ovlsyrz9g ERROR: wrong number of arguments (2 for 1) 2016-02-01T14:23:03.610Z 7211 TID-ovlsyrz9g ERROR: /home/jnylen/.gem/ruby/2.2.4/bundler/gems/opbeat-ruby-7df5c6c1130e/lib/opbeat/integration/sidekiq.rb:33:in 'block (2 levels) in <top (required)>' /home/jnylen/.gem/ruby/2.2.4/gems/sidekiq-4.0.2/lib/sidekiq/exception_handler.rb:20:in 'call' /home/jnylen/.gem/ruby/2.2.4/gems/sidekiq-4.0.2/lib/sidekiq/exception_handler.rb:20:in 'block in handle_exception' /home/jnylen/.gem/ruby/2.2.4/gems/sidekiq-4.0.2/lib/sidekiq/exception_handler.rb:18:in 'each' /home/jnylen/.gem/ruby/2.2.4/gems/sidekiq-4.0.2/lib/sidekiq/exception_handler.rb:18:in 'handle_exception' /home/jnylen/.gem/ruby/2.2.4/gems/sidekiq-4.0.2/lib/sidekiq/processor.rb:142:in 'rescue in process' /home/jnylen/.gem/ruby/2.2.4/gems/sidekiq-4.0.2/lib/sidekiq/processor.rb:146:in 'process' /home/jnylen/.gem/ruby/2.2.4/gems/sidekiq-4.0.2/lib/sidekiq/processor.rb:79:in 'process_one' /home/jnylen/.gem/ruby/2.2.4/gems/sidekiq-4.0.2/lib/sidekiq/processor.rb:67:in 'run' /home/jnylen/.gem/ruby/2.2.4/gems/sidekiq-4.0.2/lib/sidekiq/util.rb:16:in 'watchdog' /home/jnylen/.gem/ruby/2.2.4/gems/sidekiq-4.0.2/lib/sidekiq/util.rb:24:in 'block in safe_thread'

When a ActiveRecord NotFound error occur.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.