Custom parameter support via .NET Agent API
The .NET Agent API allows you to keep track of the parameter values of specific methods in a transaction. This gives deeper visibility into your own application methods.
Steps:
- Install APM Insight .NET agent or APM Insight .NET Core agent based on your application environment.
- Download or reference the package Site24x7.Agent.Api from the NuGet package manager to your application project.
Note: The API has a class named Site24x7.Agent.Api to track the performance of application code. - Use the method AddCustomParameter(string parameterName, object parameterValue) to track parameter values in a transaction.
Parameter Name |
Description |
---|---|
parameterName |
The name of the custom parameter you want to track for a particular transaction/request. |
parameterValue |
The value of the custom parameter you want to track. It can be any of the below types, |
Example:
The following method illustrates how the parameters are tracked via API,
public int UserLogin(string email, string sessionKey, bool isExternal)
{
Site24x7.Agent.Api.AddCustomParameter("ReportName", "Employee Report");
Site24x7.Agent.Api.AddCustomParameter("reportId", 2452);
//Your application code goes here..
}
The added parameter values will be displayed under the Request parameters section of the Trace summary tab as follows: