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

[rack] Remove deprecation warning on :datadog_rack_request_span #672

Merged
merged 2 commits into from
Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
delner marked this conversation as resolved.
Show resolved Hide resolved
# # 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