You can set user info in APM Agent by using the atatus_set_user() function.

Compatibility

Requires PHP agent version 1.14.0 or higher.

Syntax

atatus_set_user($id, $user_properties);

Parameter

Parameter Type Description
$id String (Required) User ID
$user_properties String JSON contains email and name.

Example

Using String

copy
icon/buttons/copy
<?php

if (extension_loaded('atatus')) {
    atatus_set_user('user_00126', '{"user_email": "daniel.mac@acme.com", "user_name": "Daniel Mac"}');
}

Using Associative Array

copy
icon/buttons/copy
<?php

if (extension_loaded('atatus')) {
    $user_id = "user_00126";
    $user_properties = array(
        "user_email" => "daniel.mac@acme.com",
        "user_name" => "Daniel Mac"
    );

    atatus_set_user($user_id, json_encode($user_properties));
}