lib/appsignal/transaction.rb in appsignal-1.0.4 vs lib/appsignal/transaction.rb in appsignal-1.0.5.beta.1
- old
+ new
@@ -122,10 +122,11 @@
def sample_data
{
:params => sanitized_params,
:environment => sanitized_environment,
:session_data => sanitized_session_data,
+ :metadata => metadata,
:tags => sanitized_tags
}.each do |key, data|
set_sample_data(key, data)
end
end
@@ -208,9 +209,14 @@
def sanitized_session_data
return if Appsignal.config[:skip_session_data] || !request.respond_to?(:session)
return unless session = request.session
Appsignal::ParamsSanitizer.sanitize(session.to_hash)
+ end
+
+ def metadata
+ return unless request.env
+ request.env[:metadata]
end
# Only keep tags if they meet the following criteria:
# * Key is a symbol or string with less then 100 chars
# * Value is a symbol or string with less then 100 chars