You can include current user information in traces, errors and HTTP failures by using the set_user() function. This helps you to debug and troubleshoot the issues for a specific user.

Compatibility

Compatible with all Ruby agent versions.

Syntax

set_user(user_object)

Parameter

Parameter Type Description
user_object User Object (Required) An object representing the user. It contains id (mandatory), name, email

Example

copy
icon/buttons/copy
# Only if you have user id
User = Struct.new(:id)
current_user = User.new('1021')
Atatus.set_user(current_user)
copy
icon/buttons/copy
# When you have user id and name
User = Struct.new(:id, :name)
current_user = User.new('1021', 'Jordan')
Atatus.set_user(current_user)
copy
icon/buttons/copy
# When you have user id, name and email.
User = Struct.new(:id, :name, :email)
current_user = User.new('1021', 'Jordan', 'jordan@example.com')
Atatus.set_user(current_user)