Help Docs

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:

  1. Install APM Insight .NET agent or APM Insight .NET Core agent based on your application environment.
  2. 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.
  3. 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.
  • The maximum length of a custom parameter key is 255 characters.

parameterValue

  • The value  of the custom parameter you want to track. It can be any of the below types,
    int, float, long, double, bool, decimal or string.
  • The maximum length of a custom parameter value is 255 characters.
Note
  • The first 1500 characters will be accepted.
  • In total, 50 parameters can be passed per transaction.

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:


 

Was this document helpful?

Would you like to help us improve our documents? Tell us what you think we could do better.


We're sorry to hear that you're not satisfied with the document. We'd love to learn what we could do to improve the experience.


Thanks for taking the time to share your feedback. We'll use your feedback to improve our online help resources.

Shortlink has been copied!