Method: Datadog::Kit::AppSec::Events.track_signup
- Defined in:
- lib/datadog/kit/appsec/events.rb
.track_signup(trace = nil, span = nil, user:, **others) ⇒ Object
Attach signup event information to the trace
This method is experimental and may change in the future.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/datadog/kit/appsec/events.rb', line 85 def track_signup(trace = nil, span = nil, user:, **others) set_trace_and_span_context('track_signup', trace, span) do |active_trace, active_span| = user.dup user_id = .delete(:id) user_login = [:login] || others[:'usr.login'] || others['usr.login'] || user_id raise ArgumentError, 'missing required key: :user => { :id }' if user_id.nil? others = others.reject { |key, _| USER_LOGIN_KEYS.include?(key) } others[:'usr.login'] = user_login track(SIGNUP_EVENT, active_trace, active_span, **others) [:login] = user_login Kit::Identity.set_user(trace, id: user_id, **) end end |