Skip to content

Commit

Permalink
[rack] Remove deprecation warning on :datadog_rack_request_span (#672)
Browse files Browse the repository at this point in the history
* [rack] Remove deprecation warning on :datadog_rack_request_span

* Remove call to env.without_datadog_warnings
  • Loading branch information
brettlangdon authored Jan 17, 2019
1 parent b002e79 commit b6d7502
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions lib/ddtrace/contrib/rack/middlewares.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@ def call(env)
request_span = tracer.trace(Ext::SPAN_REQUEST, trace_options)
env[RACK_REQUEST_SPAN] = request_span

# Add deprecation warnings
add_deprecation_warnings(env)
env.without_datadog_warnings do
# TODO: For backwards compatibility; this attribute is deprecated.
env[:datadog_rack_request_span] = env[RACK_REQUEST_SPAN]
end
# TODO: Add deprecation warnings back in
# DEV: Some third party Gems will loop over the rack env causing our deprecation
# warnings to be shown even when the user is not accessing them directly
#
# add_deprecation_warnings(env)
# env.without_datadog_warnings do
# # TODO: For backwards compatibility; this attribute is deprecated.
# env[:datadog_rack_request_span] = env[RACK_REQUEST_SPAN]
# end
env[:datadog_rack_request_span] = env[RACK_REQUEST_SPAN]

# Copy the original env, before the rest of the stack executes.
# Values may change; we want values before that happens.
Expand Down
2 changes: 1 addition & 1 deletion spec/ddtrace/contrib/rack/middleware_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
end

it do
expect(Datadog::Tracer.log).to have_received(:warn)
expect(Datadog::Tracer.log).to_not have_received(:warn)
.with(/:datadog_rack_request_span/)
end
end
Expand Down

0 comments on commit b6d7502

Please sign in to comment.