You can include extra information in traces, errors and http failures by using the SetCustomData method.

Syntax

Option 1:

using Agent;

Agent.Atatus.CurrentTransaction?.SetCustomData($key, $value);

Option 2:

var transaction = Agent.Atatus.CurrentTransaction;
transaction?.SetCustomData($key, $value);

Parameter

Parameter Type Description
$key String (Required) Custom data name.
$value Scalar (Required) Custom data value.

Examples

copy
icon/buttons/copy
using Atatus;

Agent.Atatus.CurrentTransaction?.SetCustomData("plan", "Pro");
Agent.Atatus.CurrentTransaction?.SetCustomData("features", "APM, RUM");
Agent.Atatus.CurrentTransaction?.SetCustomData("account", 6767);
Agent.Atatus.CurrentTransaction?.SetCustomData("paid", true);
using Atatus;

var transaction = Agent.Atatus.CurrentTransaction;
transaction?.SetCustomData("plan", "Pro");
transaction?.SetCustomData("features", "APM, RUM");
transaction?.SetCustomData("account", 6767);
transaction?.SetCustomData("paid", true);

See also