Creating an Application Monitoring Task
Tingyun Application & MicroServices offers comprehensive performace monitoring and management services, including automated topology discovery, distributed tracing, performance diagnostics, as well as fault alerting and locating. If you want to monitor your applications with Tingyun Application & MicroServices, you need to create an application monitoring task first.
Tingyun Application & Microservices supports monitoring for applications developed in various programming languages running in different container environments. This document demonstrates how to create an application monitoring task using a Java application running in a Tomcat environment on a Linux system as an example. The product provides two methods for Java Agent installation: automatic installation and manual installation. Currently, only Tomcat, Jetty, JBoss, WildFly, and Glassfish containers support automatic installation. This example uses the manual installation method.
Prerequisites
Before installing the Agent, you need to ensure that the local browser time is consistent with the server timezone and time. If there are multiple servers, you need to ensure that the local browser and all servers have consistent timezone and time. Otherwise, it may affect the accuracy of the data, such as incorrect topology.
Step 1: Installing the Agent Collector
Before installing the Agent, you need to install the Agent Collector (hereinafter referred to as Collector). Take the following steps to install the Collector:
-
In the left navigation bar, click Application and MicroServices > Deployment Management, then select the Download Center tab, and select Agent Collector for download.
-
Place tingyun-collector-3.5.1-with-jre.tar.gz in any directory and extract it.
tar -zxvf tingyun-collector-3.5.1-with-jre.tar.gzNote: Tingyun provides two types of installation packages: one with JRE and one without JRE, which can be identified from the name. If JDK is already installed in the installation environment (JDK version must be 1.8 or above), you can install the version without JRE. If JDK is not installed in the installation environment, please install the version with JRE. It is recommended to install the version with JRE.
-
Modify the collector.properties file in the /tingyun-collector directory.
-
Configure the Redirect server service address
redirect.host=10.128.2.28 -
Configure the Redirect server service port
redirect.port=7071 -
Configure the data center name where the Collector is located (can be left unchanged)
collector.idc=default -
Specify the IP address that the Collector service exposes to the Agent. It is recommended to configure this item.
collector.ip=10.128.1.120 -
Specify the port number that the Collector service exposes to the Agent. When using -p to map ports inside a Docker container, you need to configure this item. The default value is the same as collector.listen.
collector.port= -
Configure the listening port of the Collector service, default value: 7665
collector.listen=7665
-
-
Execute start.sh in the /tingyun-collector directory to start the Collector.
After successful deployment, click Deployment Management in the left navigation bar, then click the Collectors tab at the top of the page to see the information of the newly deployed Collector.
Step 2: Installing the Agent
-
In the left navigation bar, click Application and MicroServices > Deployment Management, then select the Download Center tab, and select Java Agent for download.
-
Extract the installation file package to the root directory of your application server.
unzip tingyun-agent-java-3.4.6.zip -d /path/to/appserver/Note: "/path/to/appserver" is an example path, please modify it to the correct directory based on your environment.
-
Modify the tingyun.properties file in the tingyun directory extracted on the server.
Method 1: Modify the configuration file
Modify the tingyun.properties file in the tingyun directory extracted on the server.
Modify the license_key, app_name, and collector.addresses configuration items in the file, otherwise the Agent will not be able to collect data or start. For other configuration items, please configure according to your actual needs.
- license_key: Associated with your Tingyun Application & Microservices account. The data collected by the Agent will be uploaded to the account bound to this License Key. Hover your mouse over the account name in the lower left corner, select Account Management in the hover menu, and view the License Key in the Account Information tab.
- app_name: Default application name. It is recommended to configure it as the business name of the application.
- collector.addresses: The address and port number of the Agent Collector server, for example: tingyun.server.com:8080. In high availability deployment mode, it is essential to configure the address and port number of all Agent Collector servers in the same data center, separated by English commas.
Method 2: Add JVM parameters
Configure JAVA_OPTS in Catalina.sh, add the following three parameters after
-javaagent, separated by spaces:
-Dtingyun.app_name=${APP_NAME} -Dtingyun.license_key=${LICENSE_KEY} -Dtingyun.collector.addresses=${COLLECTOR_ADDRESSES}
- -Dtingyun.app_name: Application name. It is recommended to configure it as the business name of the application.
- -Dtingyun.license_key: Associated with your Tingyun account. The data collected by the Agent will be uploaded to the account bound to this License Key. Hover your mouse over the account name in the lower left corner, select **Account Management** in the hover menu, and view the License Key in the **Account Information** tab.
- -Dtingyun.collector.addresses: The address and port number of the Agent Collector server, for example: tingyun.server.com:8080. In high availability deployment mode, it is essential to configure the address and port number of all Agent Collector servers in the same data center, separated by English commas.
-
Configure JAVA_OPTS in the startup script of the application server, add the following JVM parameter.
export JAVA_OPTS="$JAVA_OPTS -javaagent: /${path}/tingyun-agent-java.jar"Note:
${path}is the absolute path of the application server, please create and modify the directory according to your environment.- For deployment in other containers, see Manual Installation.
Step 3: Starting or Restarting the Application Server
Log in to the Tingyun Application & Microservices system to view performance data. When your Java application service receives HTTP requests, performance data will be sent to the Tingyun Application & Microservices system. After restarting for 5 minutes, if your application appears in the business system list or application list of the Tingyun Application & Microservices console and data is reported, it indicates that the agent deployment is successful.
Note: If you do not see any application performance data within a few minutes, you can get help in the following ways:
- Please review the above steps to check if the installation is correct, if the directory is correct, and if the startup script is correct.
- Please check if the license_key in tingyung.properties is consistent with the License Key you see in the application you created.
- If the above methods are ineffective, check the
/${path}/tingyun/logs/tingyun_agent.loglog file. You can send the Agent's log file to Tingyun's technical support staff for help.