System Metric
Was this helpful?
Was this helpful?
System metrics menu is newly added to Pinpoint in v2.5.0. Pinpoint uses telegraf agent 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 documents.
Telegraf agent sends system metrics data to Pinpoint collector.
Pinpoint collector saves data to Pinot through Kafka.
Kafka is necessary to stream data to Pinot.
Pinpoint web accesses Pinot to display collected metrics data.
Kafka enables real-time streaming of system metrics data from Pinpoint collector to Pinot.
Please refer to this document to get Kafka and start the Kafka environment.
Create 3 topics with the names below:
system-metric-data-type
system-metric-tag
system-metric-double
This section describes how to install Pinot which is used in Pinpoint to save system metrics data.
Install Pinot according to Pinot Getting Started guide
Above guide gives you the way to run Pinot locally, in Docker, and in Kubernetes.
Pinot table schemas for Pinpoint system metrics is provided in our github repository.
Please refer to Pinot documents 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.
There are additional configurations for Pinpoint collector to collect the metrics data from Telegraf agents.
1) In order to communicate with Pinot, you need to modify the configuration files in the profiles 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 profiles directory according to your profile.
Modify kafka-producer-factory.properties configuration: Set the address of your Kafka instance:
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.
There are additional configurations for Pinpoint web to display the system metrics data stored in Pinot.
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.properties file:
After successfully building Pinpoint project, run pinpoint-web-starter-boot-XXXX.jar
file created under pinpoint/metric-module/web-starter/target/deploy
.
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
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 guide.
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.
Click Infrastructure
on the side bar menu in Pinpoint web.
Search for the hostGroupName you have configured for Telegraf agents as decribed in 3.4.
A list of hosts will be displayed on the left, and you can view the system metrics data by clicking each of them.
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 guide for instructions.
system metrics ๊ธฐ๋ฅ์ v2.5.0์ ํํฌ์ธํธ์ ์๋ก ์ถ๊ฐ๋์๋ค. telegraf agent ๋ฅผ ์ฌ์ฉํ์ฌ system metric ๋ฐ์ดํฐ๋ฅผ collector์ ์ ๋ฌํ๊ณ pinot์ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ค. pinpoint web์์ ์ ์ฅ๋ system metric ๋ฐ์ดํฐ๋ฅผ ํ์ธํ ์ ์๋ค.
pinot๋ ์ค์๊ฐ ๋ถ์ฐ OLAP ๋ฐ์ดํฐ ์ ์ฅ์์ด๋ค. ์์ธํ ์ฌํญ์ pinot ์ฌ์ดํธ๋ฅผ ์ฐธ๊ณ ํ๋๋ก ํ์.
โ telgegraf agent์์ system metric ๋ฐ์ดํฐ๋ฅผ collector์ ์ ๋ฌํ๋ค.
โก collector๋ kafka์ ๋ฐ์ดํฐ๋ฅผ ์ ์กํ์ฌ pinot์ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ค.
์ฐธ๊ณ ๋ก pinot๋ stream ๋ฐ์ดํฐ ์ ์ก์ ์ํด์ kafka๋ฅผ ๋ฐ๋์ ํ์๋ก ํ๋ค.
โข web์ pinot์์ ๋ฐ์ดํฐ๋ฅผ ์กฐํํ์ฌ ํ๋ฉด์ผ๋ก ๋ฐ์ดํฐ๋ฅผ ๋ณด์ฌ์ค๋ค.
์ค์๊ฐ์ผ๋ก collector์์ ๋ฐ์ดํฐ๋ฅผ ์ ๋ฌ๋ฐ์ pinot์ ์ ์ฅํ๊ธฐ ์ํด์ kafka๋ฅผ ์ค์นํด์ผ ํ๋ค.
์ค์น ๊ฐ์ด๋ ๋งํฌ๋ฅผ ๋ณด๊ณ kafka๋ฅผ ๋ค์ด ๋ฐ์ ์คํํ์.
์๋ 3๊ฐ topic์ ์์ฑํ์. -system-metric-data-type
, system-metric-tag
, system-metric-double
์์คํ ๋ฉํธ๋ฆญ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ pinot๋ฅผ ์ค์นํ๋ ๋ฒ์ ์๋ดํ๋ค.
pinot ์ฌ์ดํธ์์ ์ค์น ๋ฐฉ๋ฒ ๊ฐ์ด๋๋ฅผ ์ฐธ๊ณ ํ์ฌ pinot๋ฅผ ์ค์นํ๋ค.
๋ค์ํ ํ๊ฒฝ(local, docker, Kubernetes)์์ pinot ์คํ ํ๊ฒฝ์ ๊ตฌ์ฑํ ์ ์์ผ๋ ์ ๊ฐ์ด๋๋ฅผ ์ฐธ๊ณ ํ์.
ํ ์ด๋ธ ์์ฑ ์คํค๋ง ํ์ผ์ ํ ์ด๋ธ ์ ๋ณด๊ฐ ์๋ค.
ํ ์ด๋ธ ์์ฑ ๋ฐฉ๋ฒ์ pinot๊ฐ์ด๋๋ฅผ ์ฐธ๊ณ ํ์ฌ pinot ์คํ ํ๊ฒฝ ๋ง๊ฒ ํ ์ด๋ธ์ ์์ฑํ๋ฉด ๋๋ค.
์์ฑํ๋ ํ ์ด๋ธ์ ์ด 3๊ฐ์ด๋ค.
systemMetricDataType : ์์ง๋๋ ๋ฐ์ดํฐ์ type ์ ๋ณด๋ฅผ ์ ์ฅํ๋ ํ ์ด๋ธ์ด๋ค.
systemMetricTag : ์์ง๋๋ ๋ฐ์ดํฐ์ metadata(host ์ ๋ณด, ๋ฐ์ดํฐ์ tag ์ ๋ณด)๋ฅผ ์ ์ฅํ๋ ํ ์ด๋ธ์ด๋ค.
systemMetricDouble : double ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ ํ ์ด๋ธ์ด๋ค. hybrid table ๊ธฐ๋ฅ ์ฌ์ฉ์ ์ํด์ REALTIME, OFFLINE ํ ์ด๋ธ ๋๋ค ์์ฑํ์.
telegraf agent๋ก ๋ถํฐ ์ ์ก๋ ๋ฐ์ดํฐ๋ฅผ ์์งํ๊ธฐ ์ํด์ collector์ ์ค์ ์ ์ถ๊ฐํ๋ค.
1) pinot์ ํต์ ์ ์ํด์ ์ค์ ํ์ผ๋ค์ profile์ ๋ง๊ฒ ์์ ํด์ผ ํ๋ค.
pinot-jdbc.properties ์ค์ : 3.1์์ ์ค์นํ pinot์ ์ฃผ์๋ฅผ ์ค์ ํ๋ค.
2) kafka์ ํต์ ์ ์ํด์ ์ค์ ํ์ผ๋ค์ profile์ ๋ง๊ฒ ์์ ํด์ผ ํ๋ค.
kafka-producer-factory.properties ์ค์ : kafka ์ ์ฃผ์๋ฅผ ์ค์ ํ๋ค.
๋น๋ ํ 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 ์์ง๊ธฐ๋ฅ์ด ๋์์ ๋์๋๋ค.
pinot์ ์ ์ฅ๋ ์์คํ ๋ฉํธ๋ฆญ ๋ฐ์ดํฐ๋ฅผ ๋ณด์ฌ์ฃผ๊ธฐ ์ํด์ web ์ค์ ์ ์์ ํ๋ค.
1) pinot์ ํต์ ์ ์ํด์ ์ค์ ํ์ผ๋ค์ profile์ ๋ง๊ฒ ์์ ํด์ผ ํ๋ค.
jdbc-pinot.properties ์ค์ : 3.1์์ ์ค์นํ pinot์ ์ฃผ์๋ฅผ ์ค์ ํ๋ค.
2)
system metric ๊ธฐ๋ฅ์ web์์ ํ์ฑํํ๊ธฐ ์ํด์ pinpoint-web-metric.properties ํ์ผ์ ์์ ํ๋ค.
๋น๋ ํ pinpoint/metric-module/web-starter/target/deploy์ ์์ฑ๋ pinpoint-web-starter-boot-XXXX.jar
์ ์คํํ๋ฉด ๋๋ค.
pinpoint-web-starter-boot-XXXX.jar
์ pinpoint web ๊ธฐ๋ฅ๊ณผ metric ๋ฐ์ดํฐ ํ์ธ ๊ธฐ๋ฅ์ด ํฉํด์ง ํจํค์ง์ด๋ค.
์ฐธ๊ณ ๋ก 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
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์ ์ฌ์ฉํ๋ ๊ฒ์ ์ถ์ฒํ๋ค.
pinpoint-web์์ ์ผ์ชฝ Infrastructure
๋ฉ๋ด๋ฅผ ์ ํํ์ฌ system metric ํ๋ฉด์ผ๋ก ์ด๋ํ๋ค.
์๋จ์ select box์์ telegraf.conf ํ์ผ์ ์ค์ ํ hostGroupName ๊ฐ์ ์ฐพ์์ ์ ํํ๋ค.
์๋์ ๊ฐ์ด ์ผ์ชฝ์ ํธ์คํธ ๋ชฉ๋ก์ด ๋์ค๊ณ , ํธ์คํธ๋ฅผ ์ ํํด์ system metric ๋ฐ์ดํฐ๋ฅผ ํ์ธํ ์ ์๋ค.
pinot์๋ system metric ๋ฟ๋ง์๋๋ผ pinpoint์ ๋ค์ํ ๋ฉํธ๋ฆญ ๋ฐ์ดํฐ์ ํต๊ณ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ ์์ ์ด๋ค. ์ฆ pinot๋ ๋ค์ํ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ ๋ชฉ์ ์ผ๋ก ์ฌ์ฉ๋ ๊ฒ์ด๋ค.
system metric์ ๊ฒฝ์ฐ ๋น๋ถ๊ฐ์ beta ๊ธฐ๋ฅ์ผ๋ก ์ ๊ณตํ ๊ฒ์ด๊ณ ์์ ์ ์ผ๋ก ๊ธฐ๋ฅ์ด ์ด์๋๋ ๊ฒฝํ์ด ์์ด๋ฉด ๊ณต์์ ์ผ๋ก ๊ธฐ๋ฅ์ ์ ๊ณตํ ๊ฒ์ด๋ค.
2.5.0 ์ดํ ๋ฒ์ ์์ system metric ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ค๊ฐ ๋ฒ์ ์ ์ ๊ทธ๋ ์ด๋ ํ๋ ๊ฒฝ์ฐ guide ์ค๋ช ์ ์ฐธ๊ณ ํ์.