Add User Data
You can set a key/value pair of strings to record important events or information. Below is the method signature for setting user data:
static void AppDynamics.Agent.Instrumentation.SetUserData(string key, string value)
For example, you might want to log the user ID when the method for logging in the user is called:
using AppDynamics.Agent;
...
void LogInUser(UserCredentials) {
// Log in user
...
// Set user data with the user name.
Instrumentation.SetUserData("user_id", UserCredentials.ID);
}
This information is available in Network Request Analyze and is added to any crash snapshots that may be taken. Keys and values are limited to 2048 characters each.
You can also set user data with values of other types (long, boolean, double, DateTime) using the following methods:
To remove user data, use the following methods: