通过 .NET Agent API 支持自定义参数
.NET Agent API 允许您跟踪事务中特定方法的参数值,从而深入了解您自己的应用程序方法。
步骤:
- 根据您的应用程序环境,安装 APM Insight .NET agent 或 APM Insight .NET Core agent。
- 从 NuGet 包管理器下载或引用 Site24x7.Agent.Api 包到您的应用程序项目中。
注意:该 API 有一个名为 Site24x7.Agent.Api 的类,用于跟踪应用程序代码的性能。 - 使用方法 AddCustomParameter(string parameterName, object parameterValue) 跟踪事务中的参数值。
|
参数名称 |
描述 |
|---|---|
|
parameterName |
|
|
parameterValue |
Note
|
示例:
以下方法演示了如何通过 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..
}
添加的参数值将显示在 Trace > Summary 标签页的请求参数部分,如下所示:

