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

Using grape integration throws uninitialized constant Datadog::Contrib::Rack::TraceMiddleware #525

Closed
dim opened this issue Aug 24, 2018 · 3 comments
Assignees
Labels
bug Involves a bug community Was opened by a community member integrations Involves tracing integrations
Milestone

Comments

@dim
Copy link

dim commented Aug 24, 2018

Manually adding the following line fixes the problem:

require 'ddtrace/contrib/rack/middlewares'
@delner
Copy link
Contributor

delner commented Aug 24, 2018

I see... probably because we switched from a literal constant to a constant referenced in the Rack tracing middleware. This line of code here:

# set the request span resource if it's a `rack.request` span
request_span = payload[:env][Datadog::Contrib::Rack::TraceMiddleware::RACK_REQUEST_SPAN]

https://github.com/DataDog/dd-trace-rb/blob/master/lib/ddtrace/contrib/grape/endpoint.rb#L74

This didn't show up in our test suite because we loaded all constants there in the test environment.

Thanks for the report, we'll add this require to the Grape integration.

@delner delner self-assigned this Aug 24, 2018
@delner delner added bug Involves a bug integrations Involves tracing integrations community Was opened by a community member labels Aug 24, 2018
@delner delner added this to the 0.15.0 milestone Sep 10, 2018
@delner
Copy link
Contributor

delner commented Sep 10, 2018

This is being addressed in #533 . Should roll with 0.15.0.

@delner
Copy link
Contributor

delner commented Sep 12, 2018

Merged to 0.15-dev, should roll today. Thank you @dim !

@delner delner closed this as completed Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug community Was opened by a community member integrations Involves tracing integrations
Projects
None yet
Development

No branches or pull requests

2 participants