How to use Application Inspector

English | ํ•œ๊ธ€

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

    inspector_view.jpg

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.

graph.jpg

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

2. Architecture

execute_flow.jpg

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 release orspring.profiles.active local as 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

    inspector_view.jpg

์˜ˆ๋ฅผ๋“ค๋ฉด A๋ผ๋Š” application์— ํฌํ•จ๋œ agent๋“ค์˜ heap ์‚ฌ์šฉ๋Ÿ‰์„ ๋ชจ์•„์„œ heap ์‚ฌ์šฉ๋Ÿ‰ ํ‰๊ท ๊ฐ’ , heap ์‚ฌ์šฉ๋Ÿ‰์˜ ํ‰๊ท ๊ฐ’, heap ์‚ฌ์šฉ๋Ÿ‰์ด ๊ฐ€์žฅ ๋†’์€ agentid์™€ ์‚ฌ์šฉ๋Ÿ‰, heap ์‚ฌ์šฉ๋Ÿ‰์ด ๊ฐ€์žฅ ์ ์€ agentid์™€ ์‚ฌ์šฉ๋Ÿ‰์„ ๋ณด์—ฌ์ค€๋‹ค. ์ด์™ธ์—๋„ agent inspector ์—์„œ ์ œ๊ณตํ•˜๋Š” ๋‹ค๋ฅธ ๋ฐ์ดํ„ฐ๋“ค๋„ ์ง‘๊ณ„ํ•˜์—ฌ application inspector์—์„œ ์ œ๊ณตํ•œ๋‹ค.

graph.jpg

application inspector ๊ธฐ๋Šฅ์„ ๋™์ž‘์‹œํ‚ค๊ธฐ ์œ„ํ•ด์„œ๋Š” flink์™€ zookeeper๊ฐ€ ํ•„์š”ํ•˜๊ณ , ๊ธฐ๋Šฅ์˜ ๋™์ž‘ ๊ตฌ์กฐ์™€ ๊ตฌ์„ฑ ๋ฐ ์„ค์ • ๋ฐฉ๋ฒ•์„ ์•„๋ž˜ ์„ค๋ช…ํ•œ๋‹ค.

2. ๋™์ž‘ ๊ตฌ์กฐ

application inspector ๊ธฐ๋Šฅ์˜ ๋™์ž‘ ๋ฐ ๊ตฌ์กฐ๋ฅผ ๊ทธ๋ฆผ๊ณผ ํ•จ๊ป˜ ๋ณด์ž.

execute_flow.jpg

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 release or spring.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?