Configuration
Configuration Interface
Use NBUI.exe to configure parameters and control IIS or WCF services.
NBUI.exe is only a configuration management interface. After starting monitoring, you can exit the program.
Monitored WCF Services: Typical WCF hosts include the following four types:
- "Self-Hosting" in a Managed Application
- Managed Windows Services
- Internet Information Services (IIS)
- Windows Process Activation Service (WAS)
By default, the Agent only monitors application performance for IIS and WAS hosts. If you want to monitor WCF applications hosted by Windows Services, click the "..." button on the right to add the service names you want to monitor.
Monitoring Self-Hosted Applications
If you are using UniAgent version earlier than 2.5.0, add call "C:\Program Files\tingyun\monitor\agent\dotnet-enable.bat" to the application startup script.
If you are using UniAgent version 2.5.0 or later, modify C:\Program Files\tingyun\monitor\conf\interceptor.conf, and set netcore.namelist=w3wp,net-demo.exe. After restarting the TingyunMonitor service via "Task Manager" or "Services", restart the application to enable monitoring.
If you are using the standard Agent, please refer to the following instructions.
Local Startup
If the application is started locally, write a temporary environment variable at the first line of the batch file:
SET Cor_Enable_Profiling=1
For example, if your self-hosted application is d:\app\ConsoleWcf.exe, the batch file should look like:
SET Cor_Enable_Profiling=1
start /D "d:\app\" ConsoleWcf.exe
Stop the original running self-hosted application, then use the batch script to restart the self-hosted application.
If the application has an elevated privilege icon , the temporary environment variable set as above will not take effect. You need to use setx to set a permanent environment variable, and to prevent other processes from loading the Agent, you need to reset the variable at the end.
The startup script should be modified as follows:
SETX Cor_Enable_Profiling 1
start /D "C:\path1\" ConsoleWcf1.exe
start /D "C:\path2\" ConsoleWcf2.exe
start /D "C:\path3\" ConsoleWcf3.exe
SETX Cor_Enable_Profiling 0
The application name defaults to the exe name. If you need to customize the application name, add the environment variable TINGYUN_APP_NAME, for example:
SET TINGYUN_APP_NAME=custom_name
Remote Startup
If the application is started remotely, such as using Jenkins for remote deployment and startup, write the temporary environment variable at the first line of the batch file:
SET Cor_Enable_Profiling=1
SET COR_PROFILER={8BEB2128-D285-4E1D-91B6-11ACD43EC0EE}
SET TINGYUN_NET_HOME=C:\Program Files (x86)\Networkbench.COM\DotNet Profiler
For example, if your self-hosted application is d:\app\ConsoleWcf.exe, the batch file should look like:
SET Cor_Enable_Profiling=1
SET COR_PROFILER={8BEB2128-D285-4E1D-91B6-11ACD43EC0EE}
SET TINGYUN_NET_HOME=C:\Program Files (x86)\Networkbench.COM\DotNet Profiler
SET TINGYUN_APP_NAME=custom_name
start /D "d:\app\" ConsoleWcf.exe
Application Naming
The priority for application naming from high to low is as follows:
- Name by the process environment variable TINGYUN_APP_NAME
- Name by the website name siteName
- Name by the virtual directory website name
- Rename by the TingYun.ini configuration file
By default, the application name is the same as the site name.
If the same website is deployed on multiple servers, one application in the report will correspond to multiple instances. If multiple applications are deployed in one site, by default, these applications will all have the site name as their application name.
If you want to change to the virtual directory application name, modify the local configuration file TingYun.ini and set local.named_by_virtualpath to true.
If you want to set an application name prefix, modify the local configuration file TingYun.ini and set local.name_prefix to a specific string. Note that the prefix cannot contain special characters or commas.
If you want to change the application name, modify the local configuration file TingYun.ini and add rename.<original_app_name>=<new_app_name>, for example: rename.test_app=my_app.
Transaction Naming
In the report, you can customize the naming method for transactions.
For WCF applications, only URL matching is valid for matching rules, and naming rules only support naming by parameters and headers. When naming WCF applications by parameters, the parameter name is the index of the parameter, for example, the first parameter is 0, the second parameter is 1, and you can access the parameter's properties or methods using a dot ..
For example, the following code:
[ServiceContract]
public interface IService
{
[OperationContract]
public int GetData(Request request);
[OperationContract]
public int GetList(string name, string index);
}
[DataContract]
public class Request
{
[DataMember]
public int Id;
[DataMember]
public string Name;
public string GetColor(){
return "OK";
}
}
Example 1: If you want to split the transaction generated by /WCF/IService/GetData according to the Name and GetColor() of the first parameter Request of the GetData method, set the URL matching rule to Equals /WCF/IService/GetData, and set the parameter naming to 0.Name,0.GetColor().
Example 2: If you want to split the transaction generated by /WCF/IService/GetList according to the first parameter name and the second parameter index of the GetList method, set the URL matching rule to Equals /WCF/IService/GetList, and set the parameter naming to 0,1.
Disabling the Agent for Specific Applications
UniAgent Deployment
Currently, disabling/enabling the Agent via the UniAgent deployment interface is not supported. To disable the Agent, configure the process blacklist at C:\Program Files\tingyun\monitor\conf\blacklist.txt or C:\Program Files\tingyun\monitor\conf\dotnet.conf.
For example, to disable the application named discuz in IIS, modify C:\Program Files\tingyun\monitor\conf\blacklist.txt to:
discuz
Or modify the Agent configuration file C:\Program Files\tingyun\monitor\conf\dotnet.conf and set local.disabled_apps to disable the Agent:
local.disabled_apps=discuz
Standard Deployment
- Temporary disable: Use the switch in the Tingyun Console to temporarily disable or enable the Agent.
- Permanent disable: Modify the local configuration file TingYun.ini to permanently disable the Agent.
If you need to disable only a few applications and enable most, configure the blacklist local.disabled_apps. Applications in the blacklist will not have data collected.
If you need to disable most applications and enable only a few, configure the whitelist local.allowed_apps. Only applications in the whitelist will have data collected.
local.disabled_apps=AppName1,AppName2
local.allowed_apps=AppName1,AppName2
Log Management
Log Level: Controls the level of log data written to the log file. "DEBUG" is the lowest level, allowing all log information to be written. "OFF" is the highest level, prohibiting all log information from being written.
Audit Mode: This option determines whether all data uploaded to and downloaded from the Tingyun Platform is written to the log file.
Local Configuration
First exit the NBUI configuration interface, then open the configuration file TingYun.ini in the Agent installation path to specify local configuration items.
nbs.collector= // Collector address, multiple Collectors separated by commas
nbs.license = // License key
nbs.agent_log_file_name = // Log file location
nbs.agent_log_level = // Log level
nbs.audit_mode = // Audit mode (true/false)
nbs.max_log_size = // Log file size (MB)
nbs.max_log_count= // Number of log files
local.computername= // Custom instance name
local.process= // List of self-hosted WCF services, separated by commas
local.delay= // Startup delay (seconds)
local.named_by_virtualpath= // Name application by virtual directory (true/false)
local.name_prefix= // Application name prefix; when set, all application names on this machine will have this prefix
local.disabled_apps= // Application blacklist, multiple applications separated by commas
local.allowed_apps= // Application whitelist, multiple applications separated by commas; empty means all applications are allowed
local.async= // Monitor asynchronous methods switch, not monitored by default