Coder Social home page Coder Social logo

Comments (3)

luke-belton avatar luke-belton commented on June 11, 2024

Hi @alexibz - I'm not sure if it's just a typo above, but you should be accessing the event's metadata via event.metadata (rather than event.meta_data as per your code snippet). Additionally are you sure the sidekiq path in your hash resolves to something non-nil for your Bugsnag.notify calls? Any serialized metadata keys with null values won't be displayed in the Bugsnag dashboard once the event has been received.

from bugsnag-ruby.

alexibz avatar alexibz commented on June 11, 2024

Hi @luke-belton, thank you for the response - my issue was that one of the keys was null, but with a caveat. In the code I sometimes directly call Bugnsag.notify and directly add metadata:

      Bugsnag.notify(e) do |event|
        params = {id: @id}
        params[:code] = defined?(e.class.code) ? e.class.code : :exception
        event.add_metadata(:params, params)
      end

That code was being called in a class method, so @id didn't exist. I also have a add_on_error callback that adds the relevant information:

  config.add_on_error(proc do |event|
    id = event.meta_data.dig("id")
    event.add_metadata(:params, { id: id }) if id
end

What I observed is that if an entry is set to null, like id in the class method, it won't be overwritten by the callback.

As for the meta_data I believe this was an old syntax.

from bugsnag-ruby.

luke-belton avatar luke-belton commented on June 11, 2024

Hi @alexibz - the behaviour you have observed with nil values not being overwritten has changed in more recent versions of bugsnag-ruby, see https://github.com/bugsnag/bugsnag-ruby/blob/master/lib/bugsnag/utility/metadata_delegate.rb#L17-L35. I'd recommend upgrading to the latest version, https://github.com/bugsnag/bugsnag-ruby/releases/tag/v6.25.0.

If this doesn't resolve this problem let us know and we can investigate this further 👍

from bugsnag-ruby.

Related Issues (20)

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.