Module: Datadog::AppSec::Contrib::Devise::Patches::SignupTrackingPatch
- Defined in:
- lib/datadog/appsec/contrib/devise/patches/signup_tracking_patch.rb
Overview
A patch for Devise::RegistrationsController with tracking functionality
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/datadog/appsec/contrib/devise/patches/signup_tracking_patch.rb', line 14 def create return super unless AppSec.enabled? return super unless Configuration.auto_user_instrumentation_enabled? return super unless AppSec.active_context super do |resource| context = AppSec.active_context if context.trace.nil? || context.span.nil? Datadog.logger.debug { 'AppSec: unable to track signup events, due to missing trace or span' } next yield(resource) if block_given? end next yield(resource) if resource.new_record? && block_given? context.trace.keep! record_successful_signup(context, resource) Instrumentation.gateway.push('appsec.events.user_lifecycle', Ext::EVENT_SIGNUP) yield(resource) if block_given? end end |