Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrumentation feature not working #505

Closed
joshuaflanagan opened this issue Oct 28, 2018 · 2 comments
Closed

Instrumentation feature not working #505

joshuaflanagan opened this issue Oct 28, 2018 · 2 comments

Comments

@joshuaflanagan
Copy link
Contributor

joshuaflanagan commented Oct 28, 2018

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'
@paul
Copy link
Contributor

paul commented Oct 29, 2018

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

@ixti
Copy link
Member

ixti commented Jan 15, 2019

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

@ixti ixti closed this as completed Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants