System Metric

English | ํ•œ๊ธ€

1 System Metrics

System metrics menu is newly added to Pinpoint in v2.5.0. Pinpoint uses telegraf agentarrow-up-right to collect system metrics data to Pinpoint Collector in which the data are saved in Pinot. Saved system metrics data are accessible via Pinpoint web.

Pinot is a real-time distributed OLAP datastore. For further information please refer to their official documentsarrow-up-right.

2 Architecture

  1. Telegraf agent sends system metrics data to Pinpoint collector.

  2. Pinpoint collector saves data to Pinot through Kafka.

  • Kafka is necessary to stream data to Pinot.

  1. Pinpoint web accesses Pinot to display collected metrics data.

3 Installation and Configuration

3.1 Install Kafka

Kafka enables real-time streaming of system metrics data from Pinpoint collector to Pinot.

3.1.A Kafka Installation Guide

Please refer to this documentarrow-up-right to get Kafka and start the Kafka environment.

3.1.B Create Kafka Topics for Pinpoint System Metrics

Create 3 topics with the names below:

  • system-metric-data-type

  • system-metric-tag

  • system-metric-double

3.2 Install Pinot

This section describes how to install Pinot which is used in Pinpoint to save system metrics data.

3.2.A Install and Run Pinot

3.2.B Create Pinot Tables

  • Pinot table schemas for Pinpoint system metrics is provided in our github repositoryarrow-up-right.

  • Please refer to Pinot documentsarrow-up-right to create necessary tables in your Pinot cluster.

  • Total 3 tables should be created.

    • systemMetricDataType: this table saves type informations on collected data.

    • systemMetricTag: this table saves metadata (i.e., host, tags) for collected data.

    • systemMetricDouble: this table saves metric data in double. In order to use the hybrid table feature, create both REALTIME and OFFLINE tables.

3.3 Configure and Run Pinpoint Collector with System Metrics

There are additional configurations for Pinpoint collector to collect the metrics data from Telegraf agents.

3.3.A Pinpoint Collector Settings for System Metrics

1) In order to communicate with Pinot, you need to modify the configuration files in the profilesarrow-up-right directory according to your profile.

  • Modify pinot-jdbc.properties configuration: Set the address of the Pinot installed in 3.1 as follows:

2) In order to communicate with Kafka, you need to modify the configuration files in the profilesarrow-up-right directory according to your profile.

  • Modify kafka-producer-factory.properties configuration: Set the address of your Kafka instance:

3.3.B Run Pinpoint Collector with System Metrics

After successfully building Pinpoint project, run pinpoint-collector-starter-boot-XXXX.jar file created under pinpoint/metric-module/collector-starter/target/deploy.

  • pinpoint-collector-starter-boot-XXXX.jar includes system metrics on top of original pinpoint-collector.

  • In order to enable metric functions, you need to add --pinpoint.collector.type=METRIC or --pinpoint.collector.type=ALL arguments when starting the application.

    • METRIC: only enables collecting the system metrics.

    • ALL: enables both pinpoint collector and system metrics collection.

3.4 Configure and Run Pinpoint Web with System Metrics

There are additional configurations for Pinpoint web to display the system metrics data stored in Pinot.

3.4.A Pinpoint Web Settings for System Metrics

  1. In order to communicate with Pinot, you need to modify the configuration files in the [profiles]((https://github.com/pinpoint-apm/pinpoint/tree/master/pinot/pinot-config/src/main/resources/pinot/profiles) directory according to your profile.

  • Update the address of the Pinot installed in 3.1 in the jdbc-pinot.properties configuration file:

2) To enable the system metric feature in the web interface, modify the pinpoint-web-metric.propertiesarrow-up-right file:

3.4.B Run Pinpoint Web with System Metrics

After successfully building Pinpoint project, run pinpoint-web-starter-boot-XXXX.jar file created under pinpoint/metric-module/web-starter/target/deploy.

3.5 Additional Information

Pinpoint web and collector binaries with system metrics is located under different directories from those of the original Pinpoint web and collector.

  • original collector: pinpoint/collector/deploy -> collector with system metrics: pinpoint/metric-module/collector-starter/target/deploy

  • original web: pinpoint/web/deploy -> web with system metrics: pinpoint/metric-module/web-starter/target/deploy

3.6 Install and Configure Talegraf Agent

Telegraf collects below metrics information on the host machine:

  • cpu

  • disk usage

  • disk usage (percent)

  • inode usage

  • memory usage

  • memory usage(percent)

  • swap

  • system load

  • nginx

  • apache


  • Install Telegraf according to this installation guidearrow-up-right.

  • Add below configuration to telegraf.conf file to send collected metrics to Pinpoint collector via http.

    • url: substitute {PINPOINT_COLLECTOR_IP} to your Pinpoint collector address so that telegraf can send collected metrics to Pinpoint collector

    • hostGroupName: this value will be used as the key in Pinpoint web when querying the metrics details. It is recommended to use your applicationName already used in Pinpoint.

4 View Collected System Metrics Data

  1. Click Infrastructure on the side bar menu in Pinpoint web.

  2. Search for the hostGroupName you have configured for Telegraf agents as decribed in 3.4.

  3. A list of hosts will be displayed on the left, and you can view the system metrics data by clicking each of them.

5 Notes

  • Other metrics and statistics data will be stored in Pinot to enhance Pinpoint experience in near future.

  • Currently this system metrics versions are in beta. It will be officially released when when we can make sure that everything works as we intended.

  • If you have been using the system metric feature in version 2.5.0 or lower and are upgrading, please refer to guidearrow-up-right for instructions.


1 system metrics ๊ธฐ๋Šฅ์ด๋ž€?

system metrics ๊ธฐ๋Šฅ์€ v2.5.0์— ํ•€ํฌ์ธํŠธ์— ์ƒˆ๋กœ ์ถ”๊ฐ€๋˜์—ˆ๋‹ค. telegraf agentarrow-up-right ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ system metric ๋ฐ์ดํ„ฐ๋ฅผ collector์— ์ „๋‹ฌํ•˜๊ณ  pinot์— ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•œ๋‹ค. pinpoint web์—์„œ ์ €์žฅ๋œ system metric ๋ฐ์ดํ„ฐ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

pinot๋Š” ์‹ค์‹œ๊ฐ„ ๋ถ„์‚ฐ OLAP ๋ฐ์ดํ„ฐ ์ €์žฅ์†Œ์ด๋‹ค. ์ž์„ธํ•œ ์‚ฌํ•ญ์€ pinot ์‚ฌ์ดํŠธarrow-up-right๋ฅผ ์ฐธ๊ณ ํ•˜๋„๋ก ํ•˜์ž.

2 ๊ตฌ์กฐ

  • โ‘  telgegraf agent์—์„œ system metric ๋ฐ์ดํ„ฐ๋ฅผ collector์— ์ „๋‹ฌํ•œ๋‹ค.

  • โ‘ก collector๋Š” kafka์— ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•˜์—ฌ pinot์— ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•œ๋‹ค.

    • ์ฐธ๊ณ ๋กœ pinot๋Š” stream ๋ฐ์ดํ„ฐ ์ „์†ก์„ ์œ„ํ•ด์„œ kafka๋ฅผ ๋ฐ˜๋“œ์‹œ ํ•„์š”๋กœ ํ•œ๋‹ค.

  • โ‘ข web์€ pinot์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜์—ฌ ํ™”๋ฉด์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด์—ฌ์ค€๋‹ค.

3 ์„ค์น˜/์„ค์ • ๋ฐฉ๋ฒ•

3.1 kafka ์„ค์น˜ ๋ฐ ์‹คํ–‰

์‹ค์‹œ๊ฐ„์œผ๋กœ collector์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ „๋‹ฌ๋ฐ›์•„ pinot์— ์ €์žฅํ•˜๊ธฐ ์œ„ํ•ด์„œ kafka๋ฅผ ์„ค์น˜ํ•ด์•ผ ํ•œ๋‹ค.

3.1.A. kafka ์„ค์น˜

3.1.B. topic ์ƒ์„ฑ

  • ์•„๋ž˜ 3๊ฐœ topic์„ ์ƒ์„ฑํ•˜์ž. -system-metric-data-type, system-metric-tag, system-metric-double

3.2 pinot ์„ค์น˜ ๋ฐ ์‹คํ–‰

์‹œ์Šคํ…œ ๋ฉ”ํŠธ๋ฆญ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๋Š” pinot๋ฅผ ์„ค์น˜ํ•˜๋Š” ๋ฒ•์„ ์•ˆ๋‚ดํ•œ๋‹ค.

3.2.A. pinot ์„ค์น˜ ๋ฐ ์‹คํ–‰

  • pinot ์‚ฌ์ดํŠธ์—์„œ ์„ค์น˜ ๋ฐฉ๋ฒ• ๊ฐ€์ด๋“œarrow-up-right๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ pinot๋ฅผ ์„ค์น˜ํ•œ๋‹ค.

  • ๋‹ค์–‘ํ•œ ํ™˜๊ฒฝ(local, docker, Kubernetes)์—์„œ pinot ์‹คํ–‰ ํ™˜๊ฒฝ์„ ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ์œผ๋‹ˆ ์œ„ ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์ž.

3.2.B. ํ…Œ์ด๋ธ” ์Šคํ‚ค๋งˆ ๋ฐ ์ƒ์„ฑ

  • ํ…Œ์ด๋ธ” ์ƒ์„ฑ ์Šคํ‚ค๋งˆ ํŒŒ์ผarrow-up-right์— ํ…Œ์ด๋ธ” ์ •๋ณด๊ฐ€ ์žˆ๋‹ค.

  • ํ…Œ์ด๋ธ” ์ƒ์„ฑ ๋ฐฉ๋ฒ•์€ pinot๊ฐ€์ด๋“œarrow-up-right๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ pinot ์‹คํ–‰ ํ™˜๊ฒฝ ๋งž๊ฒŒ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•˜๋ฉด ๋œ๋‹ค.

  • ์ƒ์„ฑํ•˜๋Š” ํ…Œ์ด๋ธ”์€ ์ด 3๊ฐœ์ด๋‹ค.

    • systemMetricDataType : ์ˆ˜์ง‘๋˜๋Š” ๋ฐ์ดํ„ฐ์˜ type ์ •๋ณด๋ฅผ ์ €์žฅํ•˜๋Š” ํ…Œ์ด๋ธ”์ด๋‹ค.

    • systemMetricTag : ์ˆ˜์ง‘๋˜๋Š” ๋ฐ์ดํ„ฐ์˜ metadata(host ์ •๋ณด, ๋ฐ์ดํ„ฐ์˜ tag ์ •๋ณด)๋ฅผ ์ €์žฅํ•˜๋Š” ํ…Œ์ด๋ธ”์ด๋‹ค.

    • systemMetricDouble : double ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๋Š” ํ…Œ์ด๋ธ”์ด๋‹ค. hybrid table ๊ธฐ๋Šฅ ์‚ฌ์šฉ์„ ์œ„ํ•ด์„œ REALTIME, OFFLINE ํ…Œ์ด๋ธ” ๋‘˜๋‹ค ์ƒ์„ฑํ•˜์ž.

3.3 collector ์„ค์ • ๋ฐ ์‹คํ–‰

telegraf agent๋กœ ๋ถ€ํ„ฐ ์ „์†ก๋œ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๊ธฐ ์œ„ํ•ด์„œ collector์— ์„ค์ •์„ ์ถ”๊ฐ€ํ•œ๋‹ค.

3.3.A. collector ์„ค์ •

1) pinot์™€ ํ†ต์‹ ์„ ์œ„ํ•ด์„œ ์„ค์ •ํŒŒ์ผarrow-up-right๋“ค์„ profile์— ๋งž๊ฒŒ ์ˆ˜์ •ํ•ด์•ผ ํ•œ๋‹ค.

  • pinot-jdbc.properties ์„ค์ • : 3.1์—์„œ ์„ค์น˜ํ•œ pinot์˜ ์ฃผ์†Œ๋ฅผ ์„ค์ •ํ•œ๋‹ค.

2) kafka์™€ ํ†ต์‹ ์„ ์œ„ํ•ด์„œ ์„ค์ •ํŒŒ์ผarrow-up-right๋“ค์„ profile์— ๋งž๊ฒŒ ์ˆ˜์ •ํ•ด์•ผ ํ•œ๋‹ค.

  • kafka-producer-factory.properties ์„ค์ • : kafka ์˜ ์ฃผ์†Œ๋ฅผ ์„ค์ •ํ•œ๋‹ค.

3.3.B. collector ์‹คํ–‰ ๋ฐฉ๋ฒ•

๋นŒ๋“œ ํ›„ pinpoint/metric-module/collector-starter/target/deploy์— ์ƒ์„ฑ๋œ pinpoint-collector-starter-boot-XXXX.jar์„ ์‹คํ–‰ํ•˜๋ฉด ๋œ๋‹ค.

  • pinpoint-collector-starter-boot-XXXX.jar ์€ pinpoint-collector ๊ธฐ๋Šฅ๊ณผ system metric ์ˆ˜์ง‘๊ธฐ๋Šฅ์ด ํ•ฉํ•ด์ง„ ํŒจํ‚ค์ง€์ด๋‹ค.

  • metric ๊ธฐ๋Šฅ์„ ํ™œ์„ฑํ™” ํ•˜๊ธฐ ์œ„ํ•ด์„œ ์‹คํ–‰์‹œ --pinpoint.collector.type=METRIC ๋‚˜ --pinpoint.collector.type=ALL ์˜ต์…˜์„ ์ถ”๊ฐ€ํ•ด์•ผํ•œ๋‹ค.

    • METRIC : system metric ์ˆ˜์ง‘๊ธฐ๋Šฅ๋งŒ ๋™์ž‘๋œ๋‹ค.

    • ALL : pinpoint collector ๊ธฐ๋Šฅ๊ณผ system metric ์ˆ˜์ง‘๊ธฐ๋Šฅ์ด ๋™์‹œ์— ๋™์ž‘๋œ๋‹ค.

3.4 web ์„ค์ • ๋ฐ ์‹คํ–‰

pinot์— ์ €์žฅ๋œ ์‹œ์Šคํ…œ ๋ฉ”ํŠธ๋ฆญ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด์—ฌ์ฃผ๊ธฐ ์œ„ํ•ด์„œ web ์„ค์ •์„ ์ˆ˜์ •ํ•œ๋‹ค.

3.4.A. web ์„ค์ •

1) pinot์™€ ํ†ต์‹ ์„ ์œ„ํ•ด์„œ ์„ค์ •ํŒŒ์ผarrow-up-right๋“ค์„ profile์— ๋งž๊ฒŒ ์ˆ˜์ •ํ•ด์•ผ ํ•œ๋‹ค.

  • jdbc-pinot.properties ์„ค์ • : 3.1์—์„œ ์„ค์น˜ํ•œ pinot์˜ ์ฃผ์†Œ๋ฅผ ์„ค์ •ํ•œ๋‹ค.

2)

3.4.B. web ์‹คํ–‰ ๋ฐฉ๋ฒ•

๋นŒ๋“œ ํ›„ pinpoint/metric-module/web-starter/target/deploy์— ์ƒ์„ฑ๋œ pinpoint-web-starter-boot-XXXX.jar์„ ์‹คํ–‰ํ•˜๋ฉด ๋œ๋‹ค.

  • pinpoint-web-starter-boot-XXXX.jar ์€ pinpoint web ๊ธฐ๋Šฅ๊ณผ metric ๋ฐ์ดํ„ฐ ํ™•์ธ ๊ธฐ๋Šฅ์ด ํ•ฉํ•ด์ง„ ํŒจํ‚ค์ง€์ด๋‹ค.

3.5 ์ฐธ๊ณ 

  • ์ฐธ๊ณ ๋กœ web, collector์˜ ์‹คํ–‰ํŒŒ์ผ์ด ๊ณผ๊ฑฐ ๋ฒ„์ „๊ณผ ๋‹ค๋ฅด๊ฒŒ ๋‹ค๋ฅธ๊ณณ์— ์กด์žฌํ•œ๋‹ค.

  • ๊ธฐ์กด์˜ web, collector ์‹คํ–‰ํŒŒ์ผ ๊ฒฝ๋กœ์™€ ๋‹ค๋ฅด๊ฒŒ system metric๊ธฐ๋Šฅ์ด ํฌํ•จ๋œ collector, web์€ ์‹คํ–‰ ํŒŒ์ผ ๊ฒฝ๋กœ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

    • collector : pinpoint/collector/deploy -> pinpoint/metric-module/collector-starter/target/deploy

    • web : pinpoint/web/deploy -> pinpoint/metric-module/web-starter/target/deploy

3.6 telegraf agent ์„ค์น˜ ๋ฐ ์„ค์ •

telegraf agent๋ฅผ ํ†ตํ•ด ์ˆ˜์ง‘๋œ ์‹œ์Šคํ…œ ๋ฉ”ํŠธ๋ฆญ์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

  • cpu

  • disk usage

  • disk usage(percent)

  • inode usage

  • memory usage

  • memory usage(percent)

  • swap

  • system load

  • nginx

  • apache


  • ์‹œ์Šคํ…œ ๋ฉ”ํŠธ๋ฆญ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๋Š” telegraf agent๋ฅผ ์„ค์น˜ํ•˜์ž.

  • telegraf agent๊ฐ€ http ํ”„๋กœํ† ์ฝœ๋กœ collector์— ๋ฐ์ดํ„ฐ๋ฅผ ์ „๋‹ฌํ•  ์ˆ˜ ์žˆ๋„๋ก ์„ค์ •ํŒŒ์ผ์„ ์ˆ˜์ • ํ•ด์•ผํ•œ๋‹ค.

    • telegraf.conf ์„ค์ • ๋ฐฉ๋ฒ•

      • http ํ”„๋กœํ† ์ฝœ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ „๋‹ฌ์ˆ˜ ์žˆ๋„๋ก output http plugin ์•„๋ž˜ ์„ค์ •์„ ์ถ”๊ฐ€ํ•œ๋‹ค.

      • url: {PINPOINT_COLLECTOR_IP} ์ž๋ฆฌ์— ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๋Š” collector์˜ ์ฃผ์†Œ๋ฅผ ์„ค์ •ํ•œ๋‹ค.

      • outputs.http.headers์€ ์„œ๋ฒ„ ๊ทธ๋ฃน์˜ key์™€ Content-Type์„ ์„ค์ •ํ•œ๋‹ค.

        • hostGroupName: {applicationName}์— ์„ค์ •ํ•œ ๊ฐ’์„ key๋กœ pinpoint-web์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•  ์ˆ˜ ์žˆ๋‹ค. ํ•€ํฌ์ธํŠธ๋ฅผ ์ด๋ฏธ ์‚ฌ์šฉ ์ค‘์ด๋ผ๋ฉด application์„ ์ถ”์ ํ•  ๋•Œ agent ์„ค์ • ๊ฐ’์œผ๋กœ ์‚ฌ์šฉํ–ˆ๋˜ applicationName์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•œ๋‹ค.

4 ๋ฐ์ดํ„ฐ ์กฐํšŒ

  • pinpoint-web์—์„œ ์™ผ์ชฝ Infrastructure ๋ฉ”๋‰ด๋ฅผ ์„ ํƒํ•˜์—ฌ system metric ํ™”๋ฉด์œผ๋กœ ์ด๋™ํ•œ๋‹ค.

  • ์ƒ๋‹จ์˜ select box์—์„œ telegraf.conf ํŒŒ์ผ์— ์„ค์ •ํ•œ hostGroupName ๊ฐ’์„ ์ฐพ์•„์„œ ์„ ํƒํ•œ๋‹ค.

  • ์•„๋ž˜์™€ ๊ฐ™์ด ์™ผ์ชฝ์— ํ˜ธ์ŠคํŠธ ๋ชฉ๋ก์ด ๋‚˜์˜ค๊ณ , ํ˜ธ์ŠคํŠธ๋ฅผ ์„ ํƒํ•ด์„œ system metric ๋ฐ์ดํ„ฐ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

5 ๊ธฐํƒ€

  • pinot์—๋Š” system metric ๋ฟ๋งŒ์•„๋‹ˆ๋ผ pinpoint์˜ ๋‹ค์–‘ํ•œ ๋ฉ”ํŠธ๋ฆญ ๋ฐ์ดํ„ฐ์™€ ํ†ต๊ณ„ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•  ์˜ˆ์ •์ด๋‹ค. ์ฆ‰ pinot๋Š” ๋‹ค์–‘ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๋Š” ๋ชฉ์ ์œผ๋กœ ์‚ฌ์šฉ๋  ๊ฒƒ์ด๋‹ค.

  • system metric์˜ ๊ฒฝ์šฐ ๋‹น๋ถ„๊ฐ„์€ beta ๊ธฐ๋Šฅ์œผ๋กœ ์ œ๊ณตํ• ๊ฒƒ์ด๊ณ  ์•ˆ์ •์ ์œผ๋กœ ๊ธฐ๋Šฅ์ด ์šด์˜๋˜๋Š” ๊ฒฝํ—˜์ด ์Œ“์ด๋ฉด ๊ณต์‹์ ์œผ๋กœ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•  ๊ฒƒ์ด๋‹ค.

  • 2.5.0 ์ดํ•˜ ๋ฒ„์ „์—์„œ system metric ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋‹ค๊ฐ€ ๋ฒ„์ „์„ ์—…๊ทธ๋ ˆ์ด๋“œ ํ•˜๋Š” ๊ฒฝ์šฐ guidearrow-up-right ์„ค๋ช…์„ ์ฐธ๊ณ ํ•˜์ž.

Was this helpful?