Skip to content

Instrumentation feature not working #505

Closed

Description

@joshuaflanagan

The new instrumentation feature (#499) does not seem to work, using the simplest example case.

It expects an instrumenter object which responds to instrument, start, and stop:

instrumenter.instrument("start_#{name}", :request => request)
instrumenter.start(name, :request => request)

which means we have to pass ActiveSupport::Notifications.instrumenter (which differs from the documented example).

But when I try to make a request, it appears to fail when I chain a get request:

2.5.1 :002 > require 'http'
 => true
2.5.1 :003 > require 'active_support/notifications'
 => true
2.5.1 :004 > HTTP.use(instrumentation: {instrumenter: ActiveSupport::Notifications.instrumenter}).get("https://httpbin.org/get")
Traceback (most recent call last):
       16: from (irb):4
       15: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/chainable.rb:20:in `get'
       14: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/client.rb:29:in `request'
       13: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/options.rb:165:in `merge'
       12: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/options.rb:23:in `new'
       11: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/options.rb:23:in `new'
       10: from /Users/josh/.rvm/gems/ruby-2.5.1gems/http-4.0.0/lib/http/options.rb:72:in `initialize'
        9: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/options.rb:72:in `each'
        8: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/options.rb:72:in `block in initialize'
        7: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/options.rb:188:in `[]='
        6: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/options.rb:110:in `features='
        5: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/options.rb:110:in `each_with_object'
        4: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/options.rb:110:in `each'
        3: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/options.rb:117:in `block in features='
        2: from /Users/josh/.rvm/gems/ruby-2.5.1/gems/http-4.0.0/lib/http/options.rb:117:in `new'
        1: from /Users/josh/.rvm/gems/ruby-2.5.1@/gems/http-4.0.0/lib/http/features/instrumentation.rb:18:in `initialize'

Activity

  1. paul commented on Oct 29, 2018

    @paul
    Contributor

    Thanks for the bug report. I must have tweaked some things after my last test using real Notifications (probably adding the start_request event). It should be fixed in #506, if you have a chance can you help me test it out?

    Thanks

  2. ixti commented on Jan 15, 2019

    @ixti
    Member

    Fixed in 4-x-stable; and will be released (today) as 4.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions