lib/ddtrace/contrib/sinatra/env.rb in ddtrace-0.39.0 vs lib/ddtrace/contrib/sinatra/env.rb in ddtrace-0.40.0
- old
+ new
@@ -6,15 +6,16 @@
module Sinatra
# Gets and sets trace information from a Rack Env
module Env
module_function
- def datadog_span(env)
- env[Ext::RACK_ENV_REQUEST_SPAN]
+ def datadog_span(env, app)
+ env[Ext::RACK_ENV_REQUEST_SPAN][app]
end
- def set_datadog_span(env, span)
- env[Ext::RACK_ENV_REQUEST_SPAN] = span
+ def set_datadog_span(env, app, span)
+ hash = (env[Ext::RACK_ENV_REQUEST_SPAN] ||= {})
+ hash[app] = span
end
def request_header_tags(env, headers)
headers ||= []