You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/security/application_security/how-it-works/add-user-info.md
+72-18Lines changed: 72 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -543,46 +543,100 @@ func handler(w http.ResponseWriter, r *http.Request) {
543
543
{{< /programming-lang >}}
544
544
{{< programming-lang lang="ruby" >}}
545
545
546
-
Starting in dd-trace-rb v1.9.0, you can use the Ruby tracer's API to track user events.
546
+
Starting in dd-trace-rb v1.9.0, you can use the Ruby tracer's API to track user events. Version v2.19.0 of dd-trace-rb introduces new methods under the `Datadog::Kit::AppSec::Events::V2` namespace. Existing event tracking methods are retained for compatibility.
547
547
548
548
The following examples show how to track login events or custom events (using signup as an example).
549
549
550
-
Traces containing login success/failure events can be queried using the following query `@appsec.security_activity:business_logic.users.login.success` or `@appsec.security_activity:business_logic.users.login.failure`.
#### Migrating to the new login success and failure methods
592
+
593
+
The new methods in `Datadog::Kit::AppSec::Events::V2` introduce a more intuitive parameter order and clearer separation of concerns. Here are the key changes:
594
+
595
+
1. The login identifier (email, username) is the first parameter and is mandatory.
596
+
2. The user object/ID is optional in success events and has been removed from failure events.
597
+
3. Metadata has been simplified and no longer requires the `usr.login` field.
598
+
4. The trace and span parameters are no longer required and are automatically inferred.
599
+
600
+
**Note**: the legacy methods `track_login_success` and `track_login_failure` are deprecated in favor of the new methods `track_user_login_success` and `track_user_login_failure`, respectively.
601
+
602
+
In the following example, the commented code is no longer necessary.
0 commit comments