How to use Application Inspector
Application Inspector
1. Introduction
Application inspector provides an aggregate view of all the agent's resource data (cpu, memory, tps, datasource connection count, etc) registered under the same application name. A separate view is provided for the application inspector with stat charts similar to the agent inspector.
To access application inspector, click on the application inspector menu on the left side of the screen.
1 : application inspector menu, 2 : application stat data

The Heap Usage chart above for example, shows the average(Avg), smallest(Min), greatest(Max) heap usage of the agents registered under the same application name along with the id of the agent that had the smallest/greatest heap usage at a certain point in time. The application inspector also provides other statistics found in the agent inspector in a similar fashion.

Application inspector requires flink and zookeeper. Please read on for more detail.
2. Architecture

A. Run a streaming job on flink. B. The taskmanager server is registered to zookeeper as a data node once the job starts. C. The Collector obtains the flink server info from zookeeper to create a tcp connection with it and starts sending agent data. D. The flink server aggregates data sent by the Collector and stores them into hbase.
3. Configuration
In order to enable application inspector, you will need to do the following and run Pinpoint.
A. Create ApplicationStatAggre table (refer to create table script), which stores application stat data.
B. Configure zookeeper address in Pinpoint-flink.properties which will be used to store flink's taskmanager server information.
C. Configure job execution type and the number of listeners to receive data from the Collector in Pinpoint-flink.properties.
If you are running a flink cluster, set flink.StreamExecutionEnvironment to server.
If you are running flink as a standalone, set flink.StreamExecutionEnvironment to local.
D. Configure hbase address in hbase.properties which will be used to store aggregated application data.
E. Build Pinpoint-flink and run the streaming job file created under target directory on the flink server.
The name of the streaming job is
pinpoint-flink-job-{pinpoint.version}.jar.For details on how to run the job, please refer to the flink website.
You must put
spring.profiles.active releaseorspring.profiles.active localas the job parameter so that the job can refer to the configuration file configured above when running. It must be entered because it uses the spring profile function inside the job to refer to the configuration file.
F. Configure zookeeper address in Pinpoint-Collector.properties so that the Collector can connect to the flink server.
G. Enable application inspector in the web-ui by enabling the following configuration in pinpoint-web.properties.
4. Monitoring Streaming Jobs
There is a batch job that monitors how Pinpoint streaming jobs are running. To enable this batch job, configure the following files for Pinpoint-web.
batch.properties
applicationContext-batch-schedule.xml
If you would like to send alarms in case of batch job failure, you must implement com.navercorp.pinpoint.web.batch.JobFailMessageSender class and register it as a Spring bean.
5. Others
For more details on how to install and operate flink, please refer to the flink website.
Application Inspector
1. ๊ธฐ๋ฅ ์ค๋ช
application inspector ๊ธฐ๋ฅ์ agent๋ค์ ๋ฆฌ์์ค ๋ฐ์ดํฐ(stat : cpu, memory, tps, datasource connection count)๋ฅผ ์ง๊ณํ์ฌ ๋ฐ์ดํฐ๋ฅผ ๋ณด์ฌ์ฃผ๋ ๊ธฐ๋ฅ์ด๋ค. ์ฐธ๊ณ ๋ก application์ agent์ ๊ทธ๋ฃน์ผ๋ก ์ด๋ค์ง๋ค. ๊ทธ๋ฆฌ๊ณ agent์ ๋ฆฌ์์ค ๋ฐ์ดํฐ๋ agent inspector ํ๋ฉด์์ ์์ ๋ณผ ์ ์๋ค. application inspector ๊ธฐ๋ฅ ๋ํ ๋ณ๋์ ํ๋ฉด์์ ํ์ธํ ์ ์๋ค.
inspector ํ๋ฉด ์ผ์ชฝ ๋ฉ๋ด์ ๋งํฌ๋ฅผ ํด๋ฆญํ๋ฉด application inspector ๋ฒํผ์ ํด๋ฆญํ๊ณ ๋ฐ์ดํฐ๋ฅผ ๋ณผ ์ ์๋ค.
1 : application inspector menu, 2: application stat data

์๋ฅผ๋ค๋ฉด A๋ผ๋ application์ ํฌํจ๋ agent๋ค์ heap ์ฌ์ฉ๋์ ๋ชจ์์ heap ์ฌ์ฉ๋ ํ๊ท ๊ฐ , heap ์ฌ์ฉ๋์ ํ๊ท ๊ฐ, heap ์ฌ์ฉ๋์ด ๊ฐ์ฅ ๋์ agentid์ ์ฌ์ฉ๋, heap ์ฌ์ฉ๋์ด ๊ฐ์ฅ ์ ์ agentid์ ์ฌ์ฉ๋์ ๋ณด์ฌ์ค๋ค. ์ด์ธ์๋ agent inspector ์์ ์ ๊ณตํ๋ ๋ค๋ฅธ ๋ฐ์ดํฐ๋ค๋ ์ง๊ณํ์ฌ application inspector์์ ์ ๊ณตํ๋ค.

application inspector ๊ธฐ๋ฅ์ ๋์์ํค๊ธฐ ์ํด์๋ flink์ zookeeper๊ฐ ํ์ํ๊ณ , ๊ธฐ๋ฅ์ ๋์ ๊ตฌ์กฐ์ ๊ตฌ์ฑ ๋ฐ ์ค์ ๋ฐฉ๋ฒ์ ์๋ ์ค๋ช ํ๋ค.
2. ๋์ ๊ตฌ์กฐ
application inspector ๊ธฐ๋ฅ์ ๋์ ๋ฐ ๊ตฌ์กฐ๋ฅผ ๊ทธ๋ฆผ๊ณผ ํจ๊ป ๋ณด์.

A. flink์ streaming job์ ์คํ์ํจ๋ค. B. job์ด ์คํ๋๋ฉด taskmanager ์๋ฒ์ ์ ๋ณด๊ฐ zookeeper์ ๋ฐ์ดํฐ ๋ ธ๋๋ก ๋ฑ๋ก์ด ๋๋ค. C. Collector๋ zookeeper์์ flink ์๋ฒ์ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์์ flink ์๋ฒ์ tcp ์ฐ๊ฒฐ์ ๋งบ๊ณ agent stat ๋ฐ์ดํฐ๋ฅผ ์ ์กํ๋ค. D. flink ์๋ฒ์์๋ agent ๋ฐ์ดํฐ๋ฅผ ์ง๊ณํ์ฌ ํต๊ณ ๋ฐ์ดํฐ๋ฅผ hbase์ ์ ์ฅํ๋ค.
3. ๊ธฐ๋ฅ ์คํ ๋ฐฉ๋ฒ
application inspector ๊ธฐ๋ฅ์ ์คํํ๊ธฐ ์ํด์ ์๋์ ๊ฐ์ด ์ค์ ์ ๋ณ๊ฒฝํ๊ณ Pinpoint๋ฅผ ์คํํด์ผ ํ๋ค.
A. ํ ์ด๋ธ ์์ฑ ์คํฌ๋ฆฝํธ๋ฅผ ์ฐธ์กฐํ์ฌ application ํต๊ณ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ ApplicationStatAggre ํ ์ด๋ธ์ ์์ฑํ๋ค.
B. flink ํ๋ก์ ํธ ์ค์ ํ์ผ(Pinpoint-flink.properties)์ taskmanager ์๋ฒ ์ ๋ณด๋ฅผ ์ ์ฅํ๋ zookeeper ์ฃผ์๋ฅผ ์ค์ ํ๋ค.
C. flink ํ๋ก์ ํธ ์ค์ ํ์ผ(Pinpoint-flink.properties)์ job์ ์คํ ๋ฐฉ๋ฒ๊ณผ Collector์์ ๋ฐ์ดํฐ๋ฅผ ๋ฐ๋ listener์ ๊ฐ์๋ฅผ ์ค์ ํ๋ค.
flink๋ฅผ cluster๋ก ๊ตฌ์ถํด์ ์ฌ์ฉํ๋ค๋ฉด _flink.StreamExecutionEnvironment_์๋ server๋ฅผ ์ค์ ํ๋ค.
flink๋ฅผ Standalone ํํ๋ก ์คํํ๋ค๋ฉด _flink.StreamExecutionEnvironment_์๋ local์ ์ค์ ํ๋ค.
D. flink ํ๋ก์ ํธ ์ค์ ํ์ผ(hbase.properties)์ ์ง๊ณ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ hbase ์ฃผ์๋ฅผ ์ค์ ํ๋ค.
E. flink ํ๋ก์ ํธ๋ฅผ ๋น๋ํ์ฌ target ํด๋ ํ์์ ์์ฑ๋ streaming job ํ์ผ์ flink ์๋ฒ์ job์ ์คํํ๋ค.
streaming job ํ์ผ ์ด๋ฆ์
pinpoint-flink-job-{pinpoint.version}.jar์ด๋ค.์คํ๋ฐฉ๋ฒ์ flink ์ฌ์ดํธ๋ฅผ ์ฐธ์กฐํ๋ค.
๋ฐ๋์ ์คํ์ job์ด ์์์ ์ค์ ํ ์ค์ ํ์ผ์ ์ฐธ๊ณ ํ ์ ์๋๋ก job parameter๋ก
spring.profiles.active releaseorspring.profiles.active local๋ฅผ ๋ฃ์ด์ฃผ์ผ ํ๋ค. job ๋ด๋ถ์์ spring profile ๊ธฐ๋ฅ์ ์ฌ์ฉํ์ฌ ์ค์ ํ์ผ์ ์ฐธ๊ณ ํ๊ณ ์๊ธฐ๋๋ฌธ์ ๋ฐ๋์ ์ ๋ ฅํด์ผํ๋ค.
F. Collector์์ flink์ ์ฐ๊ฒฐ์ ๋งบ์ ์ ์๋๋ก ์ค์ ํ์ผ(Pinpoint-Collector.properties)์ zookeeper ์ฃผ์๋ฅผ ์ค์ ํ๋ค.
G. web์์ application inspector ๋ฒํผ์ ํ์ฑํ ํ๊ธฐ ์ํด์ ์ค์ ํ์ผ(pinpoint-web.properties)์ ์์ ํ๋ค.
4. streaming job ๋์ ํ์ธ ๋ชจ๋ํฐ๋ง batch
Pinpoint streaming job์ด ์คํ๋๊ณ ์๋์ง ํ์ธํ๋ batch job์ด ์๋ค. batch job์ ๋์ ์ํค๊ณ ์ถ๋ค๋ฉด Pinpoint web ํ๋ก์ ํธ์ ์ค์ ํ์ผ์ ์์ ํ๋ฉด ๋๋ค.
batch.properties
applicationContext-batch-schedule.xml
batch job์ด ์คํจํ ๊ฒฝ์ฐ ์๋์ด ์ ์ก๋๋๋ก ๊ธฐ๋ฅ์ ์ถ๊ฐ ํ๊ณ ์ถ๋ค๋ฉด com.navercorp.pinpoint.web.batch.JobFailMessageSender class ๊ตฌํ์ฒด๋ฅผ ๋ง๋ค๊ณ bean์ผ๋ก ๋ฑ๋กํ๋ฉด ๋๋ค.
5. ๊ธฐํ
์์ธํ flink ์ด์ ์ค์น์ ๋ํ ๋ด์ฉ์ flink ์ฌ์ดํธ๋ฅผ ์ฐธ๊ณ ํ์.
Was this helpful?