reactor Documentation

Official TypeScript developer resources and documentation for pinpoint-apm/reactor. Verified technical context for AI.

0 stars TypeScript TypeScript 1 file ยท ~61,726 tokens
RAW Doc

1. Project Overview & Quickstart (pinpoint-apm/reactor)

Technical Documentation: pinpoint-apm/reactor

โ„น๏ธ Provenance: Multi-Tier Ingestion ยท CodeWiki Reference

reactor

Agent Skills & Rules

  • Discovered 21 agent rule(s) and prompt configurations.

--- METRICS ---

2. Official Technical Reference & Guides (pinpoint-apm/pinpoint-apm.github.io)

File: README.md

Introduction


Pinpoint is an APM (Application Performance Management) tool for large-scale distributed systems written in Java / PHP. Inspired by Dapper, Pinpoint provides a solution to help analyze the overall structure of the system and how components within them are interconnected by tracing transactions across distributed applications.

You should definitely check Pinpoint out If you want to

  • understand your application topology at a glance
  • monitor your application in Real-Time
  • gain code-level visibility to every transaction
  • install APM Agents without changing a single line of code
  • have minimal impact on the performance (approximately 3% increase in resource usage)

Live Demo

  • demo - Here is a Demo, So that you can take a look at Pinpoint right away.

Want a quick tour?

{% embed url="https://youtu.be/U4EwnB34Dus" %}

Getting Started

Google Analytics

The web module has google analytics attached that tracks the number and the order of button clicks in the server map, transaction list, and the inspector view.

This data is used to better understand how users interact with the Web UI which gives us valuable information in improving Pinpoint Web's user experience. To disable this for any reason, set the following option to false in pinpoint-web.properties for your web instance.

text
config.sendUsage=false

Is your application created with PHP?

Pinpoint has started to support application written in PHP. Check-out our php-agent repository.

Looking for place to ask questions?

Questions and FAQ

License

Pinpoint is licensed under the Apache License, Version 2.0. See LICENSE for full license text.

text
Copyright 2019 NAVER Corp.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

File: AGENTS.md

AGENTS.md โ€” pinpoint-apm.github.io

Personal, uncommitted instructions go in ~/.claude/CLAUDE.md or ~/.claude/skills. A CLAUDE.local.md anywhere in the tree stops Claude Code from reading this file.

Testing

  • The docs are published by GitBook from this repo. Check documentation changes in the GitBook preview of the branch.
  • Changes to .github/actions/publish-gitbook-docs need tests in its __test__/ directory. Run npm ci and then npm test in that directory.

Workflow

  1. Issue: create a GitHub issue in pinpoint-apm/pinpoint-apm.github.io (gh issue create) if none exists, with the milestone of the next release. The body opens with one or two sentences on what to do, then a task checklist. Under each task, its verification as input โ†’ expected result bullets that run locally. Reference links go last.
  2. Branch: create a feature branch from upstream/main.
  3. Code changes: implement the feature or fix.
  4. Testing: add or update tests, then run them. While they run, show the developer the PR draft (title, body, milestone).
  5. Review: stop and wait for the developer to review the diff. Do not proceed until they explicitly approve.
  6. Commit and push: squash into a single commit (git commit, not amend) and push the branch. Message: [#ISSUE_NUMBER] Short description, the title line only.
  7. PR: create it with gh pr create. Same milestone as the issue; Closes #ISSUE_NUMBER in the body.
  8. After merge: git fetch upstream โ†’ git checkout main โ†’ git rebase upstream/main โ†’ git push origin main โ†’ delete the feature branch locally and remotely. Tick the issue checklist and reflect any scope change.

Writing

Issues, PRs, commits and comments are in English, concise, bullet points, no emojis. Post once the draft is approved.

  • PR: the title names the main change. The body opens with why the change was made, in one or two sentences, then ## Test plan with the checked results and Closes #N. No other headers.

File: faq.md


FAQ

Github issues
Google group
Gitter

Chinese groups

QQ Group: 897594820 DING Group

How do I get the call stack view?

Click on a server node, which will populate the scatter chart on the right. This chart shows all succeeded/failed requests that went through the server. If there are any requests that spike your interest, simply drag on the scatter chart to select them. This will bring up the call stack view containing the requests you've selected.

How do I change agent's log level?

You can change the log level by modifying the agent's log4j.xml located in PINPOINT_AGENT/lib directory.

Why is only the first/some of the requests traced?

There is a sampling rate option in the agent's pinpoint.config file (profiler.sampling.rate). Pinpoint agent samples 1 trace every N transactions if this value was set as N. Changing this value to 1 will allow you to trace every transaction.

Request count in the Scatter Chart is different from the ones in Response Summary chart. Why is this?

The Scatter Chart data have a second granularity, so the requests counted here can be differentiated by a second interval. On the other hand, the Server Map, Response Summary, and Load Chart data are stored in a minute granularity (the collector aggregates these in memory and flushes them every minute due to performance reasons). For example, if the data is queried from 10:00:30 to 10:05:30, the Scatter Chart will show the requests counted between 10:00:30 and 10:05:30, whereas the server map, response summary, and load chart will show the requests counted between 10:00:00 and 10:05:59.

How do I delete application name and/or agent id from HBase?

Application names and agent ids, once registered, stay in HBase until their TTL expires (default 1year). You may however delete them proactively using admin APIs once they are no longer used.

  • Remove application name - /admin/removeApplicationName.pinpoint?applicationName=$APPLICATION_NAME&password=$PASSWORD

  • Remove agent id - /admin/removeAgentId.pinpoint?applicationName=$APPLICATION_NAME&agentId=$AGENT_ID&password=$PASSWORD

    Note that the value for the password parameter is what you defined admin.password property in pinpoint-web.properties. Since 4.0.1, the admin APIs are disabled until you set admin.password. Before 4.0.1, leaving this blank allowed you to call admin APIs without the password parameter.

    If another module authorizes the admin APIs, set admin.password.enabled=false to skip the password check. See pinpoint-web.

What are the criteria for the application name?

Pinpoint's applicationName doesn't support special characters. such as @,#,$,%,*. Pinpoint's applicationName only supports [a-zA-Z0-9], '.', '-', '_' characters.

HBase is taking up too much space, which data should I delete first?

Hbase is very scalable so you can always add more region servers if you're running out of space. Shortening the TTL values, especially for AgentStatV2 and TraceV2, can also help (though you might have to wait for a major compaction before space is reclaimed). For details on how to major compact, please refer to this script.

However, if you must make space asap, data in AgentStatV2 and TraceV2 tables are probably the safest to delete. You will lose agent statistic data (inspector view) and call stack data (transaction view), but deleting these will not break anything.

Note that deleting *MetaData tables will result in *-METADATA-NOT-FOUND being displayed in the call stack and the only way to "fix" this is to restart all the agents, so it is generally a good idea to leave these tables alone.

My custom jar application is not being traced. Help!

Pinpoint Agent need an entry point to start off a new trace for a transaction. This is usually done by various WAS plugins (such as Tomcat, Jetty, etc) in which a new trace is started when they receive an RPC request. For custom jar applications, you need to set this manually as the Agent does not have knowledge of when and where to start a trace. You can set this by configuring profiler.entrypoint in pinpoint.config file.

Building is failing after new release. Help!

Please remember to run the command ./mvnw clean verify -DskipTests=true if you've used a previous version before, and replace './mvnw' with './mvnw.cmd' if you are using Windows.

How to set java runtime option when using atlassian OSGi

-Datlassian.org.osgi.framework.bootdelegation=sun.,com.sun.,com.navercorp.*,org.apache.xerces.*

Why do I see UI send requests to [https://www.google-analytics.com/collect?](https://www.google-analytics.com/collect?)

Pinpoint Web module has google analytics attached which tracks the number and the order of button clicks in the Server Map, Transaction List, and the Inspector View.
This data is used to better understand how users interact with the Web UI which gives us valuable information on improving Pinpoint Web's user experience. To disable this for any reason, set following option to false in pinpoint-web.properties for your web instance.

text
config.sendUsage=false

I'd like to use Hbase 2.x for Pinpoint.

If you'd like to use Hbase 2.x for Pinpoint database, check out Hbase2-module.


File: main.md

What's New in v4.0.1

Improvements

[Agent] Enhanced Reactor tracing โ€” propagate unsampled traces across publishOn, subscribeOn, delay, and interval (#14604)
[Agent] Propagate unsampled traces across Reactor subscribe and retry (#14594)
[Agent] Propagate unsampled traces across coroutine dispatch (#14592)
[Agent] Added user-supplied URI template support for URI stat in the Jetty plugins (#14546)
[Agent] Added serviceName to the span event ContextData
[Collector] Apply the durability setting to SpanChunk (#14544)
[Web] Added a search box to the sidebar service selector
[Web] Added a search box to the server map service selector
[Web] Switched the alarm modules from thymeleaf to thymeleaf-spring6 (#14534)

Bug Fixes

[Agent] Fixed a class retransform issue by keeping the original constant pool indices when rewriting a class from its class file (#9246)
[Agent] Fixed a Base64 decoding compatibility issue by downgrading commons-codec to 1.22.1 (#14605)
[Agent] Fixed an unnecessary retransform by skipping Spring beans that declare no method to intercept
[Agent] Fixed the trace block depth in DisableTrace and DisableChildTrace traceBlockEnd()
[Web] Fixed the DEFAULT servicemap not applying the search option (#14600)
[Web] Fixed the server map right-click handlers to read the latest disableMenu state
[Web] Fixed the Apdex hover popup to attach to the side of the node that has room
[Web] Fixed the Apdex and service group popups disappearing when the server map menu is disabled
[Web] Fixed an extra drawer scroll when viewing servers
[Web] Fixed the group-by remove button showing when the error table cannot remove a group
[Web] Fixed focus to return to the service search box with ArrowUp from the first result

Security

[none] Bumped fastjson from 1.2.83 to 1.2.84 to fix CVE-2026-16723 (RCE under the default configuration) (#14584)
[Web] Bumped handlebars, storybook, and shell-quote to fix critical vulnerabilities
[Web] Bumped vite, zod, and transitive dependencies to fix high vulnerabilities
[Web] Bumped postcss-selector-parser to 7.1.7 to fix a moderate vulnerability
[Web] Reported by @Hamaecco: Reject admin API calls when admin.password is not set (#14533)

Dependency Updates

[Build]

  • Spring Boot 3.5.14 โ†’ 3.5.16
  • Spring Framework 6.2.18 โ†’ 6.2.19
  • Spring Security 6.5.10 โ†’ 6.5.11
  • Spring Batch 5.2.5 โ†’ 5.2.6
  • Spring Data 3.5.11 โ†’ 3.5.13
  • Spring Cloud 4.3.0 โ†’ 4.3.3
  • Spring Kafka 3.3.15 โ†’ 3.3.16
  • Spring Retry 2.0.12 โ†’ 2.0.13
  • Spring Shell 3.4.2 โ†’ 3.4.3
  • log4j2 2.25.4 โ†’ 2.25.5
  • jackson 2.21.4 โ†’ 2.21.8
  • snakeyaml 2.4 โ†’ 2.7
  • bouncycastle 1.81 โ†’ 1.86
  • httpclient5 5.4.4 โ†’ 5.6.5
  • tomcat-embed 10.1.55 โ†’ 10.1.61
  • snappy-java 1.1.10.4 โ†’ 1.1.10.12
  • oshi-core 6.9.1 โ†’ 7.7.3
  • jna 5.18.1 โ†’ 5.19.1
  • zstd-jni 1.5.7-16 โ†’ 1.5.7-25
  • HikariCP 7.0.1 โ†’ 7.1.0
  • commons-lang3 3.18.0 โ†’ 3.21.0
  • commons-io 2.20.0 โ†’ 2.22.0
  • commons-codec 1.17.1 โ†’ 1.23.0
  • commons-pool2 2.12.0 โ†’ 2.13.1
  • commons-collections4 4.4 โ†’ 4.6.0
  • hamcrest 2.2 โ†’ 3.0

Downloads

Binaries are attached to this release:

  • pinpoint-agent-4.0.1.tar.gz
  • pinpoint-batch-4.0.1-exec.jar
  • pinpoint-alarm-batch-starter-4.0.1-exec.jar
  • pinpoint-collector-4.0.1-exec.jar
  • pinpoint-collector-starter-4.0.1-exec.jar
  • pinpoint-web-4.0.1-exec.jar
  • pinpoint-web-starter-4.0.1-exec.jar

What's Changed

Full Changelog: https://github.com/pinpoint-apm/pinpoint/compare/v4.0.0...v4.0.1

Upgrade consideration

HBase compatibility table:

Pinpoint Version HBase 1.x HBase 2.x
2.0.x - 2.2.x yes optional
2.3.x - 2.5.x yes hbase2-module
3.0.x no yes
3.1.x no yes
4.0.x no yes

Agent compatibility to Collector table:

Agent Version Collector 2.x.x Collector 3.0.x Collector 3.1.x Collector 4.0.x
2.x.x yes yes yes yes
3.0.x no yes yes yes
3.1.x no no yes yes
4.0.x no no no yes

Additionally, the required Java version to run each Pinpoint component is given below:

Pinpoint Version Agent Collector Web Batch
2.0.x 6-13 8 8 8
2.1.x 6-14 8 8 8
2.2.x 7-14 8 8 8
2.3.x 7-17 8 8 8
2.4.x 7-18 11 11 11
2.5.x 8-19 11 11 11
3.0.x 8-21 17 17 17
3.1.x 8-25 17 17 17
4.0.x 8-25 17 17 17

Supported Modules

  • JDK 6+
  • Supported versions of the * indicated library may differ from the actual version.
Title Instrumented Library Min Max Comment
Tomcat 6.x 9.x
Jetty 8.x 9.x
JBoss 6.x 7.x
Websphere 6.x 8.x
Vertx 3.3 3.5
Weblogic 10.x 12.x
Undertow
Undertow Servlet
Jasper
Java Async Thread
OpenWhisk whisk.core
SpringMVC Framework spring-webmvc 3.0.7 5.3.6
Spring Web spring-web 4.1.2 4.3.30
Spring RabbitMQ spring-rabbit 1.3.3 2.2.16
Spring IBatis spring-ibatis 2.0.7 2.0.8
Spring MyBatis mybatis-spring 1.1.0 1.3.3
*Spring Boot spring-boot-autoconfigure
*Spring Webflux spring-webflux
MyBatis mybatis 3.0.3 3.3.1
Hystrix hystrix-core 1.4.0 1.5.18
JDKHTTP
Httpclient3 commons-httpclient 3.0 3.1
Httpclient4 httpclient 4.0 4.5.4
Thrift libthrift 0.9.1 0.14.1
Google HTTP Client google-http-client 1.19.0 1.39.2
AsyncHttpClient org.asynchttpclient:async-http-client 2.0.0 3.0.14
OkHttp okhttp 2.0.0 3.3.1
Apache HttpAsyncClient httpasyncclient 4.0 4.1.3
*Akka HTTP akka-http_2.12 10.1.0 10.1.x
*Kafka kafka-clients 0.11.0.1
GRPC grpc-stub 1.8.0 1.37.0
*Reactor reactor-core 3.3.0 3.3.1
*Reactor Netty reactor-netty 0.8.0 0.9.2
Log4j log4j 1.2.16 1.2.17
Logback logback-classic 1.0.13 1.2.3
Log4j2 log4j-core 2.0 2.12.1
*Arcus arcus-java-client 1.7.0 1.11.4
*MsSQL (jTDS) jtds 1.2.8
*MsSQL mssql-jdbc
HikariCP HikariCP-java6 2.3.0 2.3.13
Jackson-mapper-asl jackson-mapper-asl 1.0.1 1.8.11
Jackson Databind jackson-databind 2.0.6 2.12.3
MariaDB Connector/J mariadb-java-client 1.3.0 2.7.2
MongoDB Java Driver mongodb-driver 3.0.0 3.12.8
Elasticsearch elasticsearch-rest-high-level-client 6.0.0 6.8.15
Datastax Java Driver cassandra-driver-core 2.0.10 3.11.0
Druid druid 1.0.0 1.2.6
*Cubrid cubrid-jdbc-driver 8.4.1 10.0.0
*Commons DBCP commons-dbcp 1.0 1.4
*Commons DBCP2 commons-dbcp2 2.0 2.5.0
*HBase hbase-client 1.2.6.1 1.2.6.1
*MySQL mysql-connector-java 5.0 8.x
*Oracle JDBC Driver ojdbc
*PostgreSQL JDBC Driver postgresql
*Redis jedis 2.4.2
*Redis lettuce-core 5.0.0 5.1.2
*Redis redisson 3.10.0 3.10.4
Apache CXF cxf-rt-rs-client 3.0.0 3.4.3
Netty netty-all 4.1.0 4.1.63
ActiveMQ activemq-all 5.1.0 5.16.1
RxJAVA rxjava 1.0.0 1.3.8
RabbitMQ amqp-client 2.7.0 5.12.0
Paho MQTT org.eclipse.paho.client.mqttv3 1.0.2 1.2.5
Paho MQTT org.eclipse.paho.mqttv5.client 1.2.5 1.2.5
Gson gson 1.1 2.8.3
Json json-lib 1.0 2.2.2
FastJson fastjson 1.2.10 1.2.76
Dubbo dubbo 2.5.1 2.6.9
kafka-clients kafka-clients 0.11.0.0 2.6.1
postgresql postgresql 9.4.1208 42.2.19
ojdbc8 ojdbc8 12.2.0.1 21.1.0.0
ojdbc10 ojdbc10 19.3.0.0 19.10.0.0

File: performance.md


Performance Analysis

Introduction

Team members of Pinpoint are always aware of performance and stability issues. We've adapted technologies to reduced elements that hinder performance and always carefully examine the codes when there is a plugin pull requests.(plugin codes affects most in performance)

While we have been testing internally everyday for last few years, We've finally had the chance to make the data presentable.

This article doesn't include results compared with other APMs. It's pointless to compare with others due to the difference in collected data. Pinpoint collects massive data to enhance observability as much as possible. But still with minimum impact on the performance

Test Environment

JVM : 1.8.0_77 (G1, -Xms4g, -Xmx4g)
Server : Tomcat
Database : Cubrid
Stress test generator : NGrinder

Test Result

off : non traced
on-20 : trace 5% transaction using thrift
grpc-on-20 : trace 5% transaction using grpc
on-1 : trace 100% transaction using thrift
*grpc-on-1 : trace 100% transaction using grpc

Test result shows that Pinpoint affects less than 3% in performance and memory
TPS is effected by various reasons, which may not always be exact
gRPC is little slow than thrift in this test, the performance gap between the two is expected to be reduced, or even more, reversed in v1.9.0 release

Conclusion

Pinpoint is already being used in dozens of global companies in the world. With right environment and configuration it's been proved to be worthy. We believe most of the services can spare their 3% of resource to gain high observability with Pinpoint.

Check List

If you still have low performance issue due to Pinpoint. Here are several items to check in advance.

  1. Check the default log option for Pinpoint-Agent (Default was DEBUG prior to v1.8.1)

  2. JVM option

    • use G1 for the GC Type
    • fix initial/maximum memory allocation pool with same size. ex) -Xms4g -Xmx4g
  3. Change sampling rate. Even 1~2% would be enough if you are dealing big data.

    When certain transaction doesn't bypass database, it may appear that Pinpoint is consuming much more resources than 3%, since instrumentation time is not relative, but absolute. But this phenomenon appears in all APM, not only Pinpoint.

Reference Data

We run test with various technology stacks. Planning to expand more as we go.
Full Result


File: powered-by.md


Powered by Pinpoint

This page, documents alphabetical list of organizations using Pinpoint.

Sites using Pinpoint

  1. Coupang (www.coupang.com)
  2. Echemi (www.echemi.com)
  3. HANATOUR (www.hanatour.com)
  4. NAVER (www.naver.com)
  5. NHN Entertainment
  6. Pikicast (www.pikicast.com)
  7. SKPlanet (www.skplanet.com)
  8. THE PIRATES(www.tpirates.com)
  9. Toss (toss.im)
  10. XLGAMES (www.xlgames.com)

Naver Co., Ltd. uses Pinpoint as primary APM. Monitoring 2k+ applications with 10k+ instances. Supports 870k+ tps with only 17 Pinpoint-Collectors. Around 70 billion span chunks are collected per day. Which is equivalent to 10 billion transaction.


File: resources.md


Resources

If you have created informative posts on pinpoint and want the link to be added. Feel free to contact us anytime. We are glad to add more links.

Resources \(KOREAN\)

Resources \(ENGLISH\)

Resources \(ไธญๆ–‡\)


File: SUMMARY.md

Table of contents

Want a quick tour?

Getting Started

Documents

Contribution



File: contribution-1/contribution.md


Contribution

Thank you very much for choosing to share your contribution with us. Please read this page to help yourself to the contribution.

Before making first pull-request, please make sure you've signed the Contributor License Agreement. This isn't a copyright - it gives us (Naver) permission to use and redistribute your code as part of the project.

Making Pull Requests

Apart from trivial fixes such as typo or formatting, all pull requests should have a corresponding issue associated with them. It is always helpful to know what people are working on, and different (often better) ideas may pop up while discussing them. Please keep these in mind before you create a pull request:

  • Every new java file must have a copy of the license comment. You may copy this from an existing file.
  • Make sure you've tested your code thoroughly. For plugins, please try your best to include integration tests if possible.
  • Before submitting your code, make sure any changes introduced by your code does not break the build, or any tests.
  • Clean up your commit log into logical chunks of work to make it easier for us to figure out what and why you've changed something. (git rebase -i helps)
  • Please try best to keep your code updated against the master branch before creating a pull request.
  • Make sure you create the pull request against our master branch.
  • If you've created your own plugin, please take a look at plugin contribution guideline

Plugin Contribution Guideline

We welcome your plugin contribution. Currently, we would love to see additional tracing support for libraries such as Storm, HBase, as well as profiler support for additional languages (.NET, C++).

Technical Guide

For technical guides for developing plug-in, take a look at our plugin development guide, along with plugin samples project to get an idea of how we do instrumentation. The samples will provide you with example codes to help you get started.

Contributing Plugin

If you want to contribute your plugin, it has to satisfy the following requirements:

  1. Configuration key names must start with profiler.[pluginName].
  2. At least 1 plugin integration test.

Once your plugin is complete, please open an issue to contribute the plugin as below:

text
Title: [Target Library Name] Plugin Contribution

Link: Plugin Repository URL
Target: Target Library Name
Supported Version: 
Description: Simple description about the target library and/or target library homepage URL

ServiceTypes: List of service type names and codes the plugin adds
Annotations: List of annotation key names and codes the plugin adds
Configurations: List of configuration keys and description the plugin adds.

Our team will review the plugin, and your plugin repository will be linked at the third-party plugin list page if everything checks out. If the plugin is for a widely used library, and if we feel confident that we can continuously provide support for it, you may be asked to send us a PR. Should you choose to accept it, your plugin will be merged to the Pinpoint repository.

As much as we'd love to merge all the plugins to the source repository, we do not have the man power to manage all of them, yet. We are a very small team, and we certainly are not experts in all of the target libraries. We feel that it would be better to not merge a plugin if we are not confident in our ability to provide continuous support for it.

To send a PR, you have to modify your plugin like this:

  • Fork Pinpoint repository

  • Copy your plugin under /plugins directory

  • Set parent pom

    text
    <parent>
          <groupId>com.navercorp.pinpoint</groupId>
          <artifactId>pinpoint-plugins</artifactId>
          <version>Current Version</version>
      </parent>
  • Add your plugin to plugins/pom.xml as a sub-module.

  • Add your plugin to plugins/assembly/pom.xml as a dependency.

  • Copy your plugin integration tests under /agent-it/src/test directory.

  • Add your configurations to /agent/src/main/resources/*.config files.

  • Insert following license header to all java source files.

    text
    /*
    * Copyright 2018 Pinpoint contributors and NAVER Corp.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    *     http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */

If you do not want to be bothered with a PR, you may choose to tell us to do it ourselves. However, please note that your contribution will not visible through git history or the Github profile.


File: documents/alarm.md

English | ํ•œ๊ตญ์–ด

Service Alarm

Pinpoint now has the Service feature, and a new Service Alarm screen lets you set alarms for each service. Service Alarm runs alarm rules on the applications of a service. When a rule condition is met, it sends a notification through a channel.

The legacy alarm works only in the DEFAULT service. For a service that you create, manage the alarms of its applications on the Service Alarm screen.

Service Alarm requires the Service Map feature. If pinpoint.modules.web.servicemap.enabled is false, all applications belong to the DEFAULT service, and only the legacy alarm screen appears.

Main Changes

Item Legacy Alarm Service Alarm
Service DEFAULT A service that you create
Channel Set for each rule Registered once per service and shared by many rules and templates
Rule registration Register the same rule again for each application Make a template and apply it to many applications
Condition One simple comparison on one metric Many metrics combined with AND/OR
Operator Fixed for each checker Select >, >=, <, or <=
Evaluation window Fixed at 5 minutes Set for each rule
Repeat notification Sent at the 1st, 3rd, 7th, 15th... consecutive detection Set the interval with Action Interval

For the full comparison, refer to 9. Legacy Alarm and Service Alarm Comparison.

Notes

  • Legacy rules do not move to Service Alarm automatically.
    • If you move an application to a service, register its Service Alarm rules again.
  • The legacy alarm of the DEFAULT service continues to run in alarmJob of the batch module.
  • During the migration, if you enable the same condition in both the legacy alarm and Service Alarm, you get duplicate notifications.

Service Alarm needs a separate Alarm Batch process. The operation guide starts at 10. Components.

User Guide

1. Open the Alarm Screen

  1. Select the service to set alarms for.
  2. At the bottom left, click Service โ†’ Alarm.
  3. At the top, select an application.

The alarm screen has three tabs.

Tab Description
Rules Register and manage the rules of the selected application.
Channels Register the channels that receive notifications.
Templates Group many rules into one template and apply it to many applications.

2. Register a Rule

On the Rules tab, click Add Rule, enter the items below, and click Add. To change a registered rule, click Save.

Item Description
Name, Description Rule name and description. They appear in the notification message.
Severity Notification level. WARNING or CRITICAL
Data Source Data that the condition uses. Refer to 3. Data Sources and Metrics.
Check Interval How often the condition is checked
Action Interval Minimum interval before the same rule sends a notification again
Condition Condition that sends a notification. Refer to Condition below.
Filters Conditions that narrow the target. Some data sources do not support filters.
Notification Channels Channels that receive the notification

Condition

A condition has a metric, an aggregation, a comparison operator, a threshold, and an evaluation window (Window).

  • Select a comparison operator from >, >=, <, and <=.
  • To add a condition, click Add Condition.
  • To combine conditions with AND or OR, click Add Group.

Set the Window to the Check Interval or longer. If the Window is shorter, the data between two checks is not evaluated.

3. Data Sources and Metrics

Data Source Metric Aggregation Filter Remarks
Application Response Slow Count, Error Count, Total Count SUM Not supported
Slow Rate (%), Error Rate (%) Ratio over the whole window
Apdex Score Score over the whole window 0 to 100
Calls To Another Application Slow Count, Error Count, Total Count SUM callee, callee_host
Slow Rate (%), Error Rate (%) Ratio over the whole window
Agent Stat Heap Usage Rate (%), JVM CPU Usage Rate (%), System CPU Usage Rate (%), Open File Descriptor Count, Connection Pool Usage Rate (%) MAX, MIN, AVG Not supported Aggregates the value of each agent. The notification shows the agents that crossed the threshold.
Agent Event Deadlock Detected None Not supported Sends a notification when a new deadlock occurs. No threshold.

Application Response and Calls To Another Application

  • Application Response counts the requests that the application receives.
  • Calls To Another Application counts the calls that the application sends to other targets, such as a DB or an external API.

For example, one incoming request calls the DB three times and an external API once. Then the Total Count of Application Response is 1, and the Total Count of Calls To Another Application is 4.

Filters

  • Only Calls To Another Application supports filters. For a data source without filter support, the add filter button is disabled.
  • callee specifies the target application. callee_host specifies the target host.
  • If you add many filters, only the calls that match all filters are counted.
  • Without a filter, the calls to all targets are added together. Then the failures of one target can be hidden by the successful calls to other targets. Specify the target.
    • Example: 9,900 successful DB calls and 100 failed external API calls give a total Error Rate of 1%.

4. Register a Channel

  1. On the Channels tab, click Add Channel.
  2. Enter the name, the channel type, and the recipient, and click Add.
Type Recipient Remarks
EMAIL User Group Sends to the email addresses of the user group members.
SMS User Group The operator must register an SMS implementation. Refer to 12. Run Alarm Batch.
WEBHOOK URL Format is DEFAULT or SLACK. A private address works only for hosts that the operator allows. A channel with a blocked address can be saved, but it sends no notification.

Channels work as follows.

  • If you select a user group without recipients, a warning appears in the channel list and in the channel selection of rules and templates.
  • Many rules and templates in the same service can share one channel.
  • When you change a channel, all later notifications through that channel use the change.

5. Templates and Presets

A template is a group of rules. Apply one template to many applications to use the same alarm criteria.

Make a Template

  1. On the Templates tab, click Add Template.
  2. Select the rules for the template and click Start with N rules. You can select many items from the three groups below.
  3. Adjust the template name, channels, and rules, and click Save.
Group Description
Start from a preset Built-in rule groups. Refer to Built-in Presets.
Copy one of my templates Templates registered in this service
Import standalone rules Rules registered directly on an application
  • The selected rules are copied into the new template. Later changes to the source preset, template, or rule do not change the new template.
  • To start with an empty template, select nothing and click Start empty.

Apply a Template to an Application

  1. On the Rules tab, select an application.
  2. Click Add from template and select a template.

You cannot select a template that is already applied to the application.

Effect of Template Changes

Action Effect
Change a template The change applies to the rules of all applications that use the template. Added and removed rules also apply.
Change template channels The change applies to all rules made from the template.
Remove a template from an application Deletes only the rules made from that template in the selected application.
Delete a template Deletes the rules made from that template in all applications.

If you change a value of a template rule directly on an application, later template changes do not change that value.

Built-in Presets

Agent Health Basics: Monitors agent health with heap, CPU, and connection pool usage, and deadlocks.

Rule Severity Condition Check / Action
High heap usage WARNING Heap Usage Rate MAX >= 90% in 10 minutes 5 min / 30 min
High JVM CPU usage WARNING JVM CPU Usage Rate MAX >= 90% in 10 minutes 5 min / 30 min
High connection pool usage CRITICAL Connection Pool Usage Rate MAX >= 90% in 10 minutes 5 min / 30 min
Deadlock detected CRITICAL A new deadlock occurs 5 min / 60 min

Response Quality Basics: Monitors response quality with error rate, slow rate, and Apdex.

Rule Severity Condition Check / Action
High error rate CRITICAL Error Rate >= 10% in 5 minutes 3 min / 30 min
High slow rate WARNING Slow Rate >= 20% in 5 minutes 3 min / 30 min
Apdex drop WARNING Apdex Score < 70 in 5 minutes 3 min / 30 min

6. Status and History

Rule Status

Status Description
NORMAL The condition is not met.
FIRING The condition is met and the alarm fired.
CHECK_FAILED The data query, the evaluation, or the notification preparation failed.

History

Event When it is recorded Notification
FIRED When the alarm fires and sends a notification. A repeat inside the Action Interval is not recorded. Sent
RESOLVED When the rule returns to normal from FIRING or CHECK_FAILED Not sent
CHECK_FAILED When a check fails for the first time. Continued failures are not recorded again. Not sent
  • In the rule list, click Actions โ†’ History to see the current status and the history of a rule.
  • The history keeps the rule settings and the measured values at the time of the alarm. Later rule changes do not change the history.

Notification Content

A notification includes the service, the application, the rule, and the measured values.

Button Destination
View Details The Service Map for the time range of the alarm. Inspector for Agent Stat and Agent Event rules
Alarm History The history of the rule

7. Input Limits

Item Limit
Rule name / description 255 / 1000 characters
Rules in a template 30 per template
Conditions 10 conditions and groups in total, group depth 2
One group 3 conditions, 2 subgroups
Filters 5 per rule, 512 characters per value
Window 1 minute to 24 hours (except metrics without a threshold)
Check Interval 1, 3, 5, 10, 30, 60 minutes
Action Interval 5, 10, 30 minutes, 1, 6, 12, 24 hours

8. Migrate Legacy Alarm Rules

Legacy rules do not move automatically. Legacy rules have no severity, Action Interval, or shared channel, and their window and check interval are fixed. Register new Service Alarm rules with the mapping below.

Legacy checker Data Source Metric and settings
SLOW_COUNT, SLOW_RATE Application Response Slow Count, Slow Rate (%)
ERROR_COUNT, ERROR_RATE Application Response Error Count, Error Rate (%)
TOTAL_COUNT Application Response Total Count
APDEX_SCORE Application Response Apdex Score. To keep the legacy behavior, select <=.
*_TO_CALLEE Calls To Another Application Same metric. Move the target in the notes of the legacy rule to the callee or callee_host filter.
HEAP_USAGE_RATE, JVM_CPU_USAGE_RATE, SYSTEM_CPU_USAGE_RATE, FILE_DESCRIPTOR_COUNT Agent Stat Same metric. To keep the legacy behavior, select the MAX aggregation and >=.
DATASOURCE_CONNECTION_USAGE_RATE Agent Stat Connection Pool Usage Rate (%). To keep the legacy behavior, select the MAX aggregation and >.
DEADLOCK_OCCURRENCE Agent Event Deadlock Detected

The SMS, email, and webhook settings of legacy rules do not move. Register channels in the service and connect them to the rules.

Migration Steps

  1. Make the Service Alarm rule in the disabled state.
  2. Compare the service, condition, threshold, target, and recipients with the legacy rule.
  3. Disable the legacy rule and enable the Service Alarm rule immediately.
  4. Make sure that notifications arrive and the history is recorded.

9. Legacy Alarm and Service Alarm Comparison

Item Legacy Alarm Service Alarm
Management unit Application Application of a service
Condition One metric per rule Combined conditions with AND/OR
Comparison Fixed for each checker (Apdex: less than or equal, connection pool: greater than, others: greater than or equal) Select >, >=, <, or <=
Evaluation window Fixed at 5 minutes Window for each rule
Check interval Fixed at 3 minutes 1, 3, 5, 10, 30, 60 minutes
Repeat notification Sent at the 1st, 3rd, 7th, 15th... consecutive detection Action Interval
Agent condition Fires when any agent crosses the threshold MAX, MIN, AVG (MAX matches the legacy behavior)
Target selection One target in the notes of the rule callee, callee_host filters
Severity None WARNING, CRITICAL
Channel User group and SMS, email, webhook on/off Shared service channels connected to rules and templates
Reuse Register rules for each application Templates and presets
History Not shown on screen Status and history for each rule, history link in the notification

Operation Guide

10. Components

Component Role
Pinpoint Web Provides the API and the screen for rules, channels, and templates. Included without extra settings.
Alarm Batch (alarm-batch-starter) Checks the rules and sends notifications. Runs as a separate process.
Pinpoint Batch (batch) Deletes old alarm history. Optional. Refer to Clean Up the History.
MySQL Stores the alarm tables and the Spring Batch metadata.
HBase, Pinot Alarm Batch reads metrics from them.
  • The legacy alarm is evaluated by alarmJob of the batch module and checks only the applications of the DEFAULT service.
  • Service Alarm is evaluated and sent by Alarm Batch.
mermaid
flowchart LR
    user(["User"])
    api["Pinpoint Web<br/>Alarm API"]
    mysql[("MySQL<br/>Alarm tables")]

    subgraph batch["Alarm Batch"]
        direction TB
        eval["Rule evaluation<br/>every 10 seconds"]
        send["Notification delivery<br/>every 5 seconds"]
    end

    subgraph metrics["Metric storage"]
        direction TB
        hbase[("HBase<br/>Map statistics ยท Agent Event")]
        pinot[("Pinot<br/>Agent statistics")]
    end

    ch["Email ยท SMS ยท Webhook"]

    user -- "Manage rules, channels, templates" --> api
    api -- "Save" --> mysql
    mysql <-- "Read rules / save status and history" --> eval
    eval -- "Query metrics" --> metrics
    eval -. "Queue delivery<br/>(MySQL)" .-> send
    send -- "Send" --> ch
Data Source Source
Application Response, Calls To Another Application HBase map statistics
Agent Stat Pinot agent statistics table
Agent Event HBase Agent Event

Pinpoint Web does not check permissions on the alarm API. A user who can access Web can read and change the rules, channels, and templates of all services.

11. Prepare the Database

MySQL 8.4 or later is recommended. The configuration columns of the alarm tables use the JSON type.

Make the alarm tables with this script.

text
alarm/alarm-common/src/main/resources/sql/alarm/CreateTableStatement-mysql.sql
Group Tables
Template alarm_template, alarm_template_item
Rule alarm_rule_v2, alarm_rule_local_config
Channel alarm_notification_channel, alarm_channel_binding
Status and history alarm_state, alarm_history_v2
Delivery queue alarm_notification_outbox

Alarm Batch does not make the Spring Batch metadata schema. Make it with this script.

text
web/src/main/resources/sql/SpringBatchJobRepositorySchema-mysql.sql

12. Run Alarm Batch

  • Executable: pinpoint-alarm-batch-starter-<version>-exec.jar
  • Container image: pinpoint-alarm-batch
  • External configuration file: -Dpinpoint.alarm.batch.config.location=

Required Settings

Item Setting Remarks
MySQL jdbc.properties Use the same alarm tables as Web.
Spring Batch metadata spring.meta-datasource.* If not set, uses the same DB as the MySQL setting.
HBase hbase.properties
Pinot spring.pinot-datasource.*
Agent statistics table alarm.agent-stat.table.prefix, alarm.agent-stat.table.padding-length, alarm.agent-stat.table.count Startup fails without these values. The release profile has them only as comments, so set them yourself.

Notification Settings

Item Setting Remarks
Notification link alarm.pinpoint.web.url If empty, notifications have no View Details or Alarm History link.
Email alarm.email.sender, spring.mail.* If alarm.email.sender is empty, no email is sent.
Webhook private addresses pinpoint.webhook.allowed-private-hosts, pinpoint.webhook.allowed-private-host-suffixes By default, all private addresses are blocked.
SMS SmsAlarmSender bean No default implementation. Refer to the description below.

To use SMS channels, implement the interfaces below and register them as a SmsAlarmSender bean.

  • SmsDispatcher: Receives a list of phone numbers and a message, and sends the SMS.
  • UserGroupPhoneResolver: Finds the phone numbers of the user group members.

Without this bean, SMS channels send no notification, and the failure is recorded in the alarm history. The other channels of the same rule still send notifications.

Tunable Settings

Setting Default Description
pinpoint.modules.batch.alarm.fixedDelayMs 10000 Rule check interval (ms)
pinpoint.modules.batch.alarm.batchSize 300 Number of rules read at a time
pinpoint.modules.batch.alarm.worker.coreSize, .maxSize 4, 4 Number of rule evaluation threads
pinpoint.modules.batch.alarm.jobName alarmEvaluationJob Name that separates this job from the legacy alarm (alarmJob) when both use the same metadata schema
pinpoint.modules.batch.alarm.outbox.fixedDelayMs 5000 Notification delivery interval (ms)
pinpoint.modules.batch.alarm.outbox.batchSize 100 Number of notifications sent at a time
pinpoint.modules.batch.alarm.outbox.maxAttempts 5 Maximum delivery attempts, including the first attempt (1 to 255)
pinpoint.modules.batch.alarm.outbox.leaseSec 60 Time (seconds) during which no other process takes a notification that is being sent
alarm.pinpoint.web.alarm-path /config/alarm Path of the Alarm History link

Clean Up the History

alarmHistoryCleanupJob of the batch module deletes old alarm history. It runs in Pinpoint Batch, not in Alarm Batch, and uses the MySQL of its jdbc.properties. It is off by default.

Setting Default Description
job.cleanup.alarm.history.enable false Turns on the job
job.cleanup.alarm.history.cron 0 30 3 * * * Run schedule
job.cleanup.alarm.history.expiration-days 14 Retention (days). The job deletes the history older than this.
job.cleanup.alarm.history.chunk-size 5000 Number of rows deleted at a time

The job deletes the sent and dead items of the delivery queue (alarm_notification_outbox) first, then the history (alarm_history_v2). A history with an item that waits for delivery stays until that item is sent or dead.

Service ์•Œ๋žŒ ๊ฐ€์ด๋“œ

Pinpoint์— Service ๊ธฐ๋Šฅ์ด ์ถ”๊ฐ€๋˜๋ฉด์„œ, Service ๋‹จ์œ„๋กœ ์•Œ๋žŒ์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋Š” Service ์•Œ๋žŒ ํ™”๋ฉด์ด ์ถ”๊ฐ€๋˜์—ˆ์Šต๋‹ˆ๋‹ค. Service ์•Œ๋žŒ์€ Service์˜ Application์— ์•Œ๋žŒ ๋ฃฐ์„ ๋“ฑ๋กํ•˜๊ณ , ์กฐ๊ฑด์„ ๋งŒ์กฑํ•˜๋ฉด ์ฑ„๋„๋กœ ์•Œ๋ฆผ์„ ๋ณด๋ƒ…๋‹ˆ๋‹ค.

๊ธฐ์กด ์•Œ๋žŒ์€ DEFAULT Service์—์„œ๋งŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ง์ ‘ ์ƒ์„ฑํ•œ Service์—์„œ๋Š” Service ์•Œ๋žŒ ํ™”๋ฉด์—์„œ ๊ทธ Service์˜ Application ์•Œ๋žŒ์„ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

Service ์•Œ๋žŒ์€ Service Map ๊ธฐ๋Šฅ์ด ์ผœ์ ธ ์žˆ์„ ๋•Œ๋งŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. pinpoint.modules.web.servicemap.enabled๊ฐ€ false์ด๋ฉด ๋ชจ๋“  Application์ด DEFAULT Service๋กœ ์ฒ˜๋ฆฌ๋˜์–ด ๊ธฐ์กด ์•Œ๋žŒ ํ™”๋ฉด๋งŒ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

์ฃผ์š” ๋ณ€๊ฒฝ ์‚ฌํ•ญ

ํ•ญ๋ชฉ ๊ธฐ์กด ์•Œ๋žŒ Service ์•Œ๋žŒ
์‚ฌ์šฉํ•˜๋Š” Service DEFAULT ์ง์ ‘ ์ƒ์„ฑํ•œ Service
์ฑ„๋„ ๋ฃฐ๋งˆ๋‹ค ์ง€์ • Service ๋‹จ์œ„๋กœ ๋“ฑ๋กํ•˜๊ณ  ์—ฌ๋Ÿฌ ๋ฃฐยทํ…œํ”Œ๋ฆฟ์—์„œ ์žฌ์‚ฌ์šฉ
๋ฃฐ ๋“ฑ๋ก Application๋งˆ๋‹ค ๊ฐ™์€ ๋ฃฐ์„ ์ƒˆ๋กœ ๋“ฑ๋ก ํ…œํ”Œ๋ฆฟ์„ ๋งŒ๋“ค์–ด ์—ฌ๋Ÿฌ Application์— ์ ์šฉ
์กฐ๊ฑด ๋‹จ์ผ ์ง€ํ‘œ ๋‹จ์ˆœ ๋น„๊ต ์—ฌ๋Ÿฌ ์ง€ํ‘œ๋ฅผ AND/OR๋กœ ๊ฒฐํ•ฉ
์—ฐ์‚ฐ์ž checker๋งˆ๋‹ค ๊ณ ์ • >, >=, <, <= ์ค‘ ์„ ํƒ
ํ‰๊ฐ€ ๊ตฌ๊ฐ„ 5๋ถ„ ๊ณ ์ • ๋ฃฐ๋ณ„๋กœ ์ง€์ •
์žฌ์•Œ๋ฆผ ์—ฐ์† ๊ฐ์ง€ 1ยท3ยท7ยท15...๋ฒˆ์งธ์— ๋ฐœ์†ก Action Interval๋กœ ์žฌ์•Œ๋ฆผ ๊ฐ„๊ฒฉ ์ง€์ •

์ž์„ธํ•œ ๋น„๊ต๋Š” 9. ๊ธฐ์กด ์•Œ๋žŒ๊ณผ Service ์•Œ๋žŒ ๋น„๊ต๋ฅผ ์ฐธ๊ณ ํ•ฉ๋‹ˆ๋‹ค.

์•ˆ๋‚ด ์‚ฌํ•ญ

  • ๊ธฐ์กด ๋ฃฐ์€ ์ž๋™ ์ด์ „๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
    • Application์„ Service๋กœ ์˜ฎ๊ฒผ๋‹ค๋ฉด Service ์•Œ๋žŒ ๋ฃฐ์„ ๋‹ค์‹œ ๋“ฑ๋กํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • DEFAULT Service์˜ ๊ธฐ์กด ์•Œ๋žŒ์€ batch ๋ชจ๋“ˆ์˜ alarmJob์—์„œ ๊ณ„์† ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.
  • ์ „ํ™˜ ๊ธฐ๊ฐ„์— ๊ฐ™์€ ์กฐ๊ฑด์„ ๊ธฐ์กด ์•Œ๋žŒ๊ณผ Service ์•Œ๋žŒ์—์„œ ๋ชจ๋‘ ์ผœ๋ฉด ์•Œ๋ฆผ์ด ์ค‘๋ณต๋ฉ๋‹ˆ๋‹ค.

Service ์•Œ๋žŒ์„ ์šด์˜ํ•˜๋ ค๋ฉด ๋ณ„๋„์˜ Alarm Batch ํ”„๋กœ์„ธ์Šค๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. 10. ๊ตฌ์„ฑ ์š”์†Œ๋ถ€ํ„ฐ ์šด์˜ ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

์‚ฌ์šฉ ๊ฐ€์ด๋“œ

1. ์•Œ๋žŒ ํ™”๋ฉด ์—ด๊ธฐ

  1. ์•Œ๋žŒ์„ ์„ค์ •ํ•  Service๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  2. ์™ผ์ชฝ ์•„๋ž˜ Service โ†’ Alarm์„ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
  3. ์ƒ๋‹จ์—์„œ Application์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

์•Œ๋žŒ ํ™”๋ฉด์€ ์„ธ ๊ฐœ์˜ ํƒญ์œผ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.

ํƒญ ๋‚ด์šฉ
Rules ์„ ํƒํ•œ Application์˜ ๋ฃฐ์„ ๋“ฑ๋กํ•˜๊ณ  ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
Channels ์•Œ๋ฆผ์„ ๋ฐ›์„ ์ฑ„๋„์„ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.
Templates ์—ฌ๋Ÿฌ ๋ฃฐ์„ ํ•˜๋‚˜์˜ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ๋ฌถ๊ณ  ์—ฌ๋Ÿฌ Application์— ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.

2. ๋ฃฐ ๋“ฑ๋ก

Rules ํƒญ์—์„œ Add Rule์„ ๋ˆ„๋ฅด๊ณ , ์•„๋ž˜ ํ•ญ๋ชฉ์„ ์ž…๋ ฅํ•œ ๋’ค Add๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค. ๋“ฑ๋กํ•œ ๋ฃฐ์„ ์ˆ˜์ •ํ•  ๋•Œ๋Š” Save๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.

ํ•ญ๋ชฉ ์„ค๋ช…
Name, Description ๋ฃฐ ์ด๋ฆ„๊ณผ ์„ค๋ช…. ์•Œ๋ฆผ ๋ฉ”์‹œ์ง€์— ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
Severity ์•Œ๋ฆผ ๋“ฑ๊ธ‰. WARNING ๋˜๋Š” CRITICAL
Data Source ์กฐ๊ฑด์— ์‚ฌ์šฉํ•  ๋ฐ์ดํ„ฐ. 3. ๋ฐ์ดํ„ฐ ์†Œ์Šค์™€ ์ง€ํ‘œ์—์„œ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.
Check Interval ์กฐ๊ฑด์„ ๊ฒ€์‚ฌํ•˜๋Š” ์ฃผ๊ธฐ
Action Interval ๊ฐ™์€ ๋ฃฐ์˜ ์•Œ๋ฆผ์„ ๋‹ค์‹œ ๋ณด๋‚ด๊ธฐ๊นŒ์ง€์˜ ์ตœ์†Œ ๊ฐ„๊ฒฉ
Condition ์•Œ๋ฆผ์„ ๋ณด๋‚ผ ์กฐ๊ฑด. ์•„๋ž˜ ์กฐ๊ฑด ๊ตฌ์„ฑ์—์„œ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.
Filters ๊ฒ€์‚ฌ ๋Œ€์ƒ์„ ์ขํžˆ๋Š” ์กฐ๊ฑด. ์ผ๋ถ€ Data Source๋Š” ํ•„ํ„ฐ๋ฅผ ์ง€์›ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
Notification Channels ์•Œ๋ฆผ์„ ๋ณด๋‚ผ ์ฑ„๋„

์กฐ๊ฑด ๊ตฌ์„ฑ

์กฐ๊ฑด ํ•˜๋‚˜๋Š” ์ง€ํ‘œ, ์ง‘๊ณ„ ๋ฐฉ์‹, ๋น„๊ต ์—ฐ์‚ฐ์ž, ์ž„๊ณ„๊ฐ’, ํ‰๊ฐ€ ๊ตฌ๊ฐ„(Window)์œผ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.

  • ๋น„๊ต ์—ฐ์‚ฐ์ž๋Š” >, >=, <, <= ์ค‘์—์„œ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  • ์กฐ๊ฑด์„ ๋” ์ถ”๊ฐ€ํ•˜๋ ค๋ฉด Add Condition์„ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
  • ์—ฌ๋Ÿฌ ์กฐ๊ฑด์„ AND ๋˜๋Š” OR๋กœ ๋ฌถ์œผ๋ ค๋ฉด Add Group์„ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.

Window๋Š” Check Interval ์ด์ƒ์œผ๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. Window๊ฐ€ ๋” ์งง์œผ๋ฉด ๋‘ ๊ฒ€์‚ฌ ์‚ฌ์ด์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ํ‰๊ฐ€์—์„œ ๋น ์ง‘๋‹ˆ๋‹ค.

3. ๋ฐ์ดํ„ฐ ์†Œ์Šค์™€ ์ง€ํ‘œ

Data Source ์ง€ํ‘œ ์ง‘๊ณ„ ํ•„ํ„ฐ ๋น„๊ณ 
Application Response Slow Count, Error Count, Total Count SUM ์ง€์› ์•ˆ ํ•จ
Slow Rate (%), Error Rate (%) ํ‰๊ฐ€ ๊ตฌ๊ฐ„ ์ „์ฒด์˜ ๋น„์œจ
Apdex Score ํ‰๊ฐ€ ๊ตฌ๊ฐ„ ์ „์ฒด์˜ ์ ์ˆ˜ 0~100
Calls To Another Application Slow Count, Error Count, Total Count SUM callee, callee_host
Slow Rate (%), Error Rate (%) ํ‰๊ฐ€ ๊ตฌ๊ฐ„ ์ „์ฒด์˜ ๋น„์œจ
Agent Stat Heap Usage Rate (%), JVM CPU Usage Rate (%), System CPU Usage Rate (%), Open File Descriptor Count, Connection Pool Usage Rate (%) MAX, MIN, AVG ์ง€์› ์•ˆ ํ•จ Agent๋ณ„๋กœ ์ง‘๊ณ„ํ•˜๊ณ , ๊ธฐ์ค€์„ ๋„˜์€ Agent๋ฅผ ์•Œ๋ฆผ์— ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
Agent Event Deadlock Detected ์—†์Œ ์ง€์› ์•ˆ ํ•จ ์ƒˆ ๋ฐ๋“œ๋ฝ์ด ๋ฐœ์ƒํ•˜๋ฉด ์ž„๊ณ„๊ฐ’ ์—†์ด ์•Œ๋ฆผ

Application Response์™€ Calls To Another Application

  • Application Response๋Š” Application์œผ๋กœ ๋“ค์–ด์˜จ ์š”์ฒญ์„ ์ง‘๊ณ„ํ•ฉ๋‹ˆ๋‹ค.
  • Calls To Another Application์€ Application์ด DB, ์™ธ๋ถ€ API ๊ฐ™์€ ๋‹ค๋ฅธ ๋Œ€์ƒ์œผ๋กœ ๋ณด๋‚ธ ํ˜ธ์ถœ์„ ์ง‘๊ณ„ํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด ๋“ค์–ด์˜จ ์š”์ฒญ ํ•˜๋‚˜๊ฐ€ DB๋ฅผ ์„ธ ๋ฒˆ, ์™ธ๋ถ€ API๋ฅผ ํ•œ ๋ฒˆ ํ˜ธ์ถœํ•˜๋ฉด Application Response์˜ Total Count๋Š” 1, Calls To Another Application์˜ Total Count๋Š” 4์ž…๋‹ˆ๋‹ค.

ํ•„ํ„ฐ

  • Calls To Another Application๋งŒ ํ•„ํ„ฐ๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. ํ•„ํ„ฐ๋ฅผ ์ง€์›ํ•˜์ง€ ์•Š๋Š” Data Source์—์„œ๋Š” ํ•„ํ„ฐ ์ถ”๊ฐ€ ๋ฒ„ํŠผ์ด ๋น„ํ™œ์„ฑํ™”๋ฉ๋‹ˆ๋‹ค.
  • callee๋Š” ํ˜ธ์ถœ ๋Œ€์ƒ Application์„, callee_host๋Š” ํ˜ธ์ถœ ๋Œ€์ƒ host๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
  • ์—ฌ๋Ÿฌ ํ•„ํ„ฐ๋ฅผ ๋“ฑ๋กํ•˜๋ฉด ๋ชจ๋“  ํ•„ํ„ฐ๋ฅผ ๋งŒ์กฑํ•˜๋Š” ํ˜ธ์ถœ๋งŒ ์ง‘๊ณ„ํ•ฉ๋‹ˆ๋‹ค.
  • ํ•„ํ„ฐ๊ฐ€ ์—†์œผ๋ฉด ๋ชจ๋“  ํ˜ธ์ถœ ๋Œ€์ƒ์„ ํ•ฉ์‚ฐํ•ฉ๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ ํŠน์ • ๋Œ€์ƒ์˜ ์‹คํŒจ๊ฐ€ ๋‹ค๋ฅธ ๋Œ€์ƒ์˜ ์ •์ƒ ํ˜ธ์ถœ์— ๋ฌปํž ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ๋Œ€์ƒ์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
    • ์˜ˆ: ์ •์ƒ DB ํ˜ธ์ถœ 9,900๊ฑด๊ณผ ๋ชจ๋‘ ์‹คํŒจํ•œ ์™ธ๋ถ€ API ํ˜ธ์ถœ 100๊ฑด์ด ์žˆ์œผ๋ฉด ์ „์ฒด Error Rate๋Š” 1%์ž…๋‹ˆ๋‹ค.

4. ์ฑ„๋„ ๋“ฑ๋ก

  1. Channels ํƒญ์—์„œ Add Channel์„ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
  2. ์ด๋ฆ„, ์ฑ„๋„ ์ข…๋ฅ˜, ์ˆ˜์‹  ๋Œ€์ƒ์„ ์ž…๋ ฅํ•˜๊ณ  Add๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
์ข…๋ฅ˜ ์ˆ˜์‹  ๋Œ€์ƒ ๋น„๊ณ 
EMAIL User Group User Group ๊ตฌ์„ฑ์›์˜ ์ด๋ฉ”์ผ๋กœ ๋ณด๋ƒ…๋‹ˆ๋‹ค.
SMS User Group ์šด์˜์ž๊ฐ€ SMS ๋ฐœ์†ก ๊ตฌํ˜„์„ ๋“ฑ๋กํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. 12. Alarm Batch ์‹คํ–‰์„ ์ฐธ๊ณ ํ•ฉ๋‹ˆ๋‹ค.
WEBHOOK URL ํ˜•์‹์€ DEFAULT ๋˜๋Š” SLACK. ์‚ฌ์„ค ์ฃผ์†Œ๋Š” ์šด์˜์ž๊ฐ€ ํ—ˆ์šฉํ•œ ํ˜ธ์ŠคํŠธ๋งŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ํ—ˆ์šฉ๋˜์ง€ ์•Š์€ ์ฃผ์†Œ๋Š” ์ €์žฅ๋˜์–ด๋„ ์•Œ๋ฆผ์ด ๋ฐœ์†ก๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์ฑ„๋„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.

  • ์ˆ˜์‹ ์ž๊ฐ€ ์—†๋Š” User Group์„ ์„ ํƒํ•˜๋ฉด ์ฑ„๋„ ๋ชฉ๋ก๊ณผ ๋ฃฐยทํ…œํ”Œ๋ฆฟ์˜ ์ฑ„๋„ ์„ ํƒ ํ™”๋ฉด์— ๊ฒฝ๊ณ ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.
  • ์ฑ„๋„์€ ๊ฐ™์€ Service์˜ ์—ฌ๋Ÿฌ ๋ฃฐ๊ณผ ํ…œํ”Œ๋ฆฟ์—์„œ ์žฌ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์ฑ„๋„ ์ •๋ณด๋ฅผ ์ˆ˜์ •ํ•˜๋ฉด ๊ทธ ์ฑ„๋„์„ ์‚ฌ์šฉํ•˜๋Š” ์ดํ›„ ์•Œ๋ฆผ์— ๋ชจ๋‘ ๋ฐ˜์˜๋ฉ๋‹ˆ๋‹ค.

5. ํ…œํ”Œ๋ฆฟ๊ณผ Preset

ํ…œํ”Œ๋ฆฟ์€ ์—ฌ๋Ÿฌ ๋ฃฐ์„ ํ•˜๋‚˜๋กœ ๋ฌถ์€ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ํ…œํ”Œ๋ฆฟ ํ•˜๋‚˜๋ฅผ ์—ฌ๋Ÿฌ Application์— ์ ์šฉํ•˜๋ฉด ๊ฐ™์€ ๊ธฐ์ค€์œผ๋กœ ์•Œ๋žŒ์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ํ…œํ”Œ๋ฆฟ ๋งŒ๋“ค๊ธฐ

  1. Templates ํƒญ์—์„œ Add Template์„ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
  2. ํ…œํ”Œ๋ฆฟ์— ๋„ฃ์„ ๋ฃฐ์„ ๊ณ ๋ฅด๊ณ  Start with N rules๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค. ์•„๋ž˜ ์„ธ ๊ทธ๋ฃน์—์„œ ์—ฌ๋Ÿฌ ๊ฐœ๋ฅผ ํ•จ๊ป˜ ๊ณ ๋ฅผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  3. ํ…œํ”Œ๋ฆฟ ์ด๋ฆ„, ์ฑ„๋„, ๋ฃฐ์„ ์กฐ์ •ํ•˜๊ณ  Save๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
๊ทธ๋ฃน ์„ค๋ช…
Start from a preset ๊ธฐ๋ณธ ์ œ๊ณต ๋ฃฐ ๋ฌถ์Œ. ๊ธฐ๋ณธ ์ œ๊ณต Preset์„ ์ฐธ๊ณ ํ•ฉ๋‹ˆ๋‹ค.
Copy one of my templates ์ด Service์— ๋“ฑ๋กํ•œ ํ…œํ”Œ๋ฆฟ
Import standalone rules Application์— ์ง์ ‘ ๋“ฑ๋กํ•œ ๋ฃฐ
  • ๊ณ ๋ฅธ ๋ฃฐ์€ ์ƒˆ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ๋ณต์‚ฌ๋ฉ๋‹ˆ๋‹ค. ์›๋ณธ Preset, ํ…œํ”Œ๋ฆฟ, ๋ฃฐ์„ ๋‚˜์ค‘์— ๋ฐ”๊ฟ”๋„ ์ƒˆ ํ…œํ”Œ๋ฆฟ์€ ๋ฐ”๋€Œ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  • ์•„๋ฌด๊ฒƒ๋„ ๊ณ ๋ฅด์ง€ ์•Š์œผ๋ฉด Start empty๋ฅผ ๋ˆŒ๋Ÿฌ ๋นˆ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

Application์— ์ ์šฉ

  1. Rules ํƒญ์—์„œ Application์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  2. Add from template์„ ๋ˆ„๋ฅด๊ณ  ํ…œํ”Œ๋ฆฟ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

์ด๋ฏธ ๊ทธ Application์— ์ ์šฉํ•œ ํ…œํ”Œ๋ฆฟ์€ ๋‹ค์‹œ ์„ ํƒํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

ํ…œํ”Œ๋ฆฟ ๋ณ€๊ฒฝ์˜ ์˜ํ–ฅ

์ž‘์—… ์˜ํ–ฅ
ํ…œํ”Œ๋ฆฟ ์ˆ˜์ • ํ…œํ”Œ๋ฆฟ์„ ์ ์šฉํ•œ ๋ชจ๋“  Application์˜ ๋ฃฐ์— ๋ฐ˜์˜๋ฉ๋‹ˆ๋‹ค. ๋ฃฐ์„ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ ์‚ญ์ œํ•ด๋„ ํ•จ๊ป˜ ๋ฐ˜์˜๋ฉ๋‹ˆ๋‹ค.
ํ…œํ”Œ๋ฆฟ ์ฑ„๋„ ๋ณ€๊ฒฝ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ๋งŒ๋“  ๋ชจ๋“  ๋ฃฐ์— ๋ฐ˜์˜๋ฉ๋‹ˆ๋‹ค.
ํ…œํ”Œ๋ฆฟ ์ ์šฉ ํ•ด์ œ ์„ ํƒํ•œ Application์—์„œ ๊ทธ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ๋งŒ๋“  ๋ฃฐ๋งŒ ์‚ญ์ œ๋ฉ๋‹ˆ๋‹ค.
ํ…œํ”Œ๋ฆฟ ์‚ญ์ œ ๋ชจ๋“  Application์—์„œ ๊ทธ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ๋งŒ๋“  ๋ฃฐ์ด ์‚ญ์ œ๋ฉ๋‹ˆ๋‹ค.

Application์—์„œ ํ…œํ”Œ๋ฆฟ ๋ฃฐ์˜ ๊ฐ’์„ ์ง์ ‘ ๋ฐ”๊พธ๋ฉด ๊ทธ ํ•ญ๋ชฉ์€ ํ…œํ”Œ๋ฆฟ์„ ์ˆ˜์ •ํ•ด๋„ ๋ฐ”๋€Œ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๊ธฐ๋ณธ ์ œ๊ณต Preset

Agent Health Basics: ํž™, CPU, ์ปค๋„ฅ์…˜ ํ’€ ์‚ฌ์šฉ๋ฅ ๊ณผ ๋ฐ๋“œ๋ฝ์œผ๋กœ Agent ์ƒํƒœ๋ฅผ ๊ฐ์‹œํ•ฉ๋‹ˆ๋‹ค.

๋ฃฐ Severity ์กฐ๊ฑด Check / Action
High heap usage WARNING 10๋ถ„ ๋™์•ˆ Heap Usage Rate MAX >= 90% 5๋ถ„ / 30๋ถ„
High JVM CPU usage WARNING 10๋ถ„ ๋™์•ˆ JVM CPU Usage Rate MAX >= 90% 5๋ถ„ / 30๋ถ„
High connection pool usage CRITICAL 10๋ถ„ ๋™์•ˆ Connection Pool Usage Rate MAX >= 90% 5๋ถ„ / 30๋ถ„
Deadlock detected CRITICAL ์ƒˆ ๋ฐ๋“œ๋ฝ ๋ฐœ์ƒ 5๋ถ„ / 60๋ถ„

Response Quality Basics: ์—๋Ÿฌ์œจ, ๋А๋ฆฐ ์‘๋‹ต ๋น„์œจ, Apdex๋กœ ์‘๋‹ต ํ’ˆ์งˆ์„ ๊ฐ์‹œํ•ฉ๋‹ˆ๋‹ค.

๋ฃฐ Severity ์กฐ๊ฑด Check / Action
High error rate CRITICAL 5๋ถ„ ๋™์•ˆ Error Rate >= 10% 3๋ถ„ / 30๋ถ„
High slow rate WARNING 5๋ถ„ ๋™์•ˆ Slow Rate >= 20% 3๋ถ„ / 30๋ถ„
Apdex drop WARNING 5๋ถ„ ๋™์•ˆ Apdex Score < 70 3๋ถ„ / 30๋ถ„

6. ์ƒํƒœ์™€ ์ด๋ ฅ

๋ฃฐ ์ƒํƒœ

์ƒํƒœ ์˜๋ฏธ
NORMAL ์กฐ๊ฑด์„ ๋งŒ์กฑํ•˜์ง€ ์•Š๋Š” ์ƒํƒœ
FIRING ์กฐ๊ฑด์„ ๋งŒ์กฑํ•ด ์•Œ๋žŒ์ด ๋ฐœ์ƒํ•œ ์ƒํƒœ
CHECK_FAILED ๋ฐ์ดํ„ฐ ์กฐํšŒ, ํ‰๊ฐ€, ์•Œ๋ฆผ ์ค€๋น„ ์ค‘ ํ•˜๋‚˜๊ฐ€ ์‹คํŒจํ•œ ์ƒํƒœ

์ด๋ ฅ

์ด๋ฒคํŠธ ๊ธฐ๋ก ์‹œ์  ์•Œ๋ฆผ
FIRED ์•Œ๋žŒ์ด ๋ฐœ์ƒํ•ด ์•Œ๋ฆผ์„ ๋ณด๋‚ผ ๋•Œ. Action Interval ์•ˆ์— ๋‹ค์‹œ ๋ฐœ์ƒํ•˜๋ฉด ๊ธฐ๋กํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋ณด๋ƒ„
RESOLVED FIRING ๋˜๋Š” CHECK_FAILED์—์„œ ์ •์ƒ์œผ๋กœ ๋Œ์•„์™”์„ ๋•Œ ๋ณด๋‚ด์ง€ ์•Š์Œ
CHECK_FAILED ๊ฒ€์‚ฌ์— ์ฒ˜์Œ ์‹คํŒจํ–ˆ์„ ๋•Œ. ์‹คํŒจ๊ฐ€ ์ด์–ด์ง€๋Š” ๋™์•ˆ์—๋Š” ๋‹ค์‹œ ๊ธฐ๋กํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋ณด๋‚ด์ง€ ์•Š์Œ
  • ๋ฃฐ ๋ชฉ๋ก์—์„œ ๋ฃฐ์˜ Actions โ†’ History๋ฅผ ๋ˆ„๋ฅด๋ฉด ํ˜„์žฌ ์ƒํƒœ์™€ ์ด๋ ฅ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์ด๋ ฅ์—๋Š” ์•Œ๋žŒ์ด ๋ฐœ์ƒํ•œ ์‹œ์ ์˜ ๋ฃฐ ์„ค์ •๊ณผ ์ธก์ •๊ฐ’์ด ๋‚จ์Šต๋‹ˆ๋‹ค. ์ดํ›„์— ๋ฃฐ์„ ์ˆ˜์ •ํ•ด๋„ ์ด๋ ฅ์€ ๋ฐ”๋€Œ์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์•Œ๋ฆผ ๋‚ด์šฉ

์•Œ๋ฆผ์—๋Š” Service, Application, ๋ฃฐ, ์ธก์ •๊ฐ’์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

๋ฒ„ํŠผ ์ด๋™ํ•˜๋Š” ํ™”๋ฉด
View Details ์•Œ๋žŒ์ด ๋ฐœ์ƒํ•œ ์‹œ๊ฐ„ ๋ฒ”์œ„์˜ Service Map. Agent Stat, Agent Event ๋ฃฐ์€ Inspector
Alarm History ๊ทธ ๋ฃฐ์˜ ์ด๋ ฅ

7. ์ž…๋ ฅ ์ œํ•œ

ํ•ญ๋ชฉ ์ œํ•œ
๋ฃฐ ์ด๋ฆ„ / ์„ค๋ช… 255์ž / 1000์ž
ํ…œํ”Œ๋ฆฟ์˜ ๋ฃฐ ํ…œํ”Œ๋ฆฟ๋‹น 30๊ฐœ
์กฐ๊ฑด ์กฐ๊ฑด๊ณผ ๊ทธ๋ฃน์„ ํ•ฉ์ณ 10๊ฐœ, ๊ทธ๋ฃน ๊นŠ์ด 2๋‹จ
๊ทธ๋ฃน ํ•˜๋‚˜ ์กฐ๊ฑด 3๊ฐœ, ํ•˜์œ„ ๊ทธ๋ฃน 2๊ฐœ
ํ•„ํ„ฐ ๋ฃฐ๋‹น 5๊ฐœ, ๊ฐ’ 512์ž
Window 1๋ถ„ ์ด์ƒ 24์‹œ๊ฐ„ ์ดํ•˜ (์ž„๊ณ„๊ฐ’์ด ์—†๋Š” ์ง€ํ‘œ๋Š” ์ œ์™ธ)
Check Interval 1, 3, 5, 10, 30, 60๋ถ„
Action Interval 5, 10, 30๋ถ„, 1, 6, 12, 24์‹œ๊ฐ„

8. ๊ธฐ์กด ์•Œ๋žŒ ๋ฃฐ ์ „ํ™˜

๊ธฐ์กด ๋ฃฐ์€ ์ž๋™์œผ๋กœ ์ด์ „๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ธฐ์กด ๋ฃฐ์—๋Š” Severity, Action Interval, ๊ณต์šฉ ์ฑ„๋„์ด ์—†๊ณ  ํ‰๊ฐ€ ๊ตฌ๊ฐ„๊ณผ ๊ฒ€์‚ฌ ์ฃผ๊ธฐ๊ฐ€ ๊ณ ์ •๋˜์–ด ์žˆ์–ด์„œ ๊ทธ๋Œ€๋กœ ์˜ฎ๊ธธ ์ˆ˜ ์—†๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ์•„๋ž˜ ๋Œ€์‘ํ‘œ๋ฅผ ๋ณด๊ณ  Service ์•Œ๋žŒ ๋ฃฐ์„ ์ƒˆ๋กœ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ์กด checker Data Source ์ง€ํ‘œ์™€ ์„ค์ •
SLOW_COUNT, SLOW_RATE Application Response Slow Count, Slow Rate (%)
ERROR_COUNT, ERROR_RATE Application Response Error Count, Error Rate (%)
TOTAL_COUNT Application Response Total Count
APDEX_SCORE Application Response Apdex Score. ๊ธฐ์กด ๋™์ž‘๊ณผ ๊ฐ™๊ฒŒ ํ•˜๋ ค๋ฉด <=๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
*_TO_CALLEE Calls To Another Application ๊ฐ™์€ ์ง€ํ‘œ. ๊ธฐ์กด ๋ฃฐ์˜ notes์— ์ ์€ ํ˜ธ์ถœ ๋Œ€์ƒ์€ callee ๋˜๋Š” callee_host ํ•„ํ„ฐ๋กœ ์˜ฎ๊น๋‹ˆ๋‹ค.
HEAP_USAGE_RATE, JVM_CPU_USAGE_RATE, SYSTEM_CPU_USAGE_RATE, FILE_DESCRIPTOR_COUNT Agent Stat ๊ฐ™์€ ์ง€ํ‘œ. ๊ธฐ์กด ๋™์ž‘๊ณผ ๊ฐ™๊ฒŒ ํ•˜๋ ค๋ฉด ์ง‘๊ณ„ MAX์™€ >=๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
DATASOURCE_CONNECTION_USAGE_RATE Agent Stat Connection Pool Usage Rate (%). ๊ธฐ์กด ๋™์ž‘๊ณผ ๊ฐ™๊ฒŒ ํ•˜๋ ค๋ฉด ์ง‘๊ณ„ MAX์™€ >๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
DEADLOCK_OCCURRENCE Agent Event Deadlock Detected

๊ธฐ์กด ๋ฃฐ์˜ SMS, ๋ฉ”์ผ, ์›นํ›… ์„ค์ •์€ ์˜ฎ๊ฒจ์ง€์ง€ ์•Š์Šต๋‹ˆ๋‹ค. Service์— ์ฑ„๋„์„ ๋“ฑ๋กํ•˜๊ณ  ๋ฃฐ์— ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.

์ „ํ™˜ ์ˆœ์„œ

  1. Service ์•Œ๋žŒ ๋ฃฐ์„ ๊บผ์ง„ ์ƒํƒœ๋กœ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
  2. ๊ธฐ์กด ๋ฃฐ๊ณผ Service, ์กฐ๊ฑด, ์ž„๊ณ„๊ฐ’, ํ˜ธ์ถœ ๋Œ€์ƒ, ์ˆ˜์‹ ์ž๋ฅผ ๋Œ€์กฐํ•ฉ๋‹ˆ๋‹ค.
  3. ๊ธฐ์กด ๋ฃฐ์„ ๋„๊ณ  ๋ฐ”๋กœ Service ์•Œ๋žŒ ๋ฃฐ์„ ์ผญ๋‹ˆ๋‹ค.
  4. ์‹ค์ œ๋กœ ์•Œ๋ฆผ์ด ์˜ค๋Š”์ง€, ์ด๋ ฅ์ด ๋‚จ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

9. ๊ธฐ์กด ์•Œ๋žŒ๊ณผ Service ์•Œ๋žŒ ๋น„๊ต

๊ตฌ๋ถ„ ๊ธฐ์กด ์•Œ๋žŒ Service ์•Œ๋žŒ
๊ด€๋ฆฌ ๋‹จ์œ„ Application Service์˜ Application
์กฐ๊ฑด ๋ฃฐ๋‹น ์ง€ํ‘œ 1๊ฐœ AND/OR ๋ณตํ•ฉ ์กฐ๊ฑด
๋น„๊ต ๋ฐฉ์‹ checker๋งˆ๋‹ค ๊ณ ์ • (Apdex๋Š” ์ดํ•˜, ์ปค๋„ฅ์…˜ ํ’€์€ ์ดˆ๊ณผ, ๋‚˜๋จธ์ง€๋Š” ์ด์ƒ) >, >=, <, <= ์ค‘ ์„ ํƒ
ํ‰๊ฐ€ ๊ตฌ๊ฐ„ 5๋ถ„ ๊ณ ์ • ๋ฃฐ๋ณ„ Window
๊ฒ€์‚ฌ ์ฃผ๊ธฐ 3๋ถ„ ๊ณ ์ • 1, 3, 5, 10, 30, 60๋ถ„
๋ฐ˜๋ณต ์•Œ๋ฆผ ์—ฐ์† ๊ฐ์ง€ 1ยท3ยท7ยท15...๋ฒˆ์งธ์— ๋ฐœ์†ก Action Interval
Agent ์กฐ๊ฑด Agent ํ•˜๋‚˜๋ผ๋„ ๋„˜์œผ๋ฉด ๋ฐœ์ƒ MAX, MIN, AVG (MAX๊ฐ€ ๊ธฐ์กด๊ณผ ๊ฐ™์Œ)
ํ˜ธ์ถœ ๋Œ€์ƒ ์ง€์ • ๋ฃฐ์˜ notes์— 1๊ฐœ callee, callee_host ํ•„ํ„ฐ
Severity ์—†์Œ WARNING, CRITICAL
์ฑ„๋„ User Group๊ณผ SMSยท๋ฉ”์ผยท์›นํ›… on/off Service ๊ณต์šฉ ์ฑ„๋„์„ ๋ฃฐ๊ณผ ํ…œํ”Œ๋ฆฟ์— ์—ฐ๊ฒฐ
์žฌ์‚ฌ์šฉ Application๋งˆ๋‹ค ๋ฃฐ ๋“ฑ๋ก ํ…œํ”Œ๋ฆฟ๊ณผ Preset
์ด๋ ฅ ํ™”๋ฉด์—์„œ ๋ณผ ์ˆ˜ ์—†์Œ ๋ฃฐ๋ณ„ ์ƒํƒœ์™€ ์ด๋ ฅ, ์•Œ๋ฆผ์˜ ์ด๋ ฅ ๋งํฌ

์šด์˜ ๊ฐ€์ด๋“œ

10. ๊ตฌ์„ฑ ์š”์†Œ

๊ตฌ์„ฑ ์š”์†Œ ์—ญํ• 
Pinpoint Web ๋ฃฐ, ์ฑ„๋„, ํ…œํ”Œ๋ฆฟ API์™€ ํ™”๋ฉด์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๋ณ„๋„ ์„ค์ • ์—†์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.
Alarm Batch (alarm-batch-starter) ๋ฃฐ์„ ๊ฒ€์‚ฌํ•˜๊ณ  ์•Œ๋ฆผ์„ ๋ณด๋ƒ…๋‹ˆ๋‹ค. ๋ณ„๋„ ํ”„๋กœ์„ธ์Šค๋กœ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.
Pinpoint Batch (batch) ์˜ค๋ž˜๋œ ์•Œ๋žŒ ์ด๋ ฅ์„ ์ง€์›๋‹ˆ๋‹ค. ์„ ํƒ ์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค. ์ด๋ ฅ ์ •๋ฆฌ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
MySQL ์•Œ๋žŒ ํ…Œ์ด๋ธ”๊ณผ Spring Batch ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
HBase, Pinot Alarm Batch๊ฐ€ ์ง€ํ‘œ๋ฅผ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.
  • ๊ธฐ์กด ์•Œ๋žŒ์€ batch ๋ชจ๋“ˆ์˜ alarmJob์—์„œ ํ‰๊ฐ€ํ•˜๋ฉฐ, DEFAULT Service์˜ Application๋งŒ ๊ฒ€์‚ฌํ•ฉ๋‹ˆ๋‹ค.
  • Service ์•Œ๋žŒ์€ Alarm Batch์—์„œ ํ‰๊ฐ€ํ•˜๊ณ  ๋ฐœ์†กํ•ฉ๋‹ˆ๋‹ค.
mermaid
flowchart LR
    user(["์‚ฌ์šฉ์ž"])
    api["Pinpoint Web<br/>์•Œ๋žŒ API"]
    mysql[("MySQL<br/>์•Œ๋žŒ ํ…Œ์ด๋ธ”")]

    subgraph batch["Alarm Batch"]
        direction TB
        eval["๋ฃฐ ํ‰๊ฐ€<br/>10์ดˆ๋งˆ๋‹ค"]
        send["์•Œ๋ฆผ ๋ฐœ์†ก<br/>5์ดˆ๋งˆ๋‹ค"]
    end

    subgraph metrics["์ง€ํ‘œ ์ €์žฅ์†Œ"]
        direction TB
        hbase[("HBase<br/>Map ํ†ต๊ณ„ ยท Agent Event")]
        pinot[("Pinot<br/>Agent ํ†ต๊ณ„")]
    end

    ch["๋ฉ”์ผ ยท SMS ยท ์›นํ›…"]

    user -- "๋ฃฐยท์ฑ„๋„ยทํ…œํ”Œ๋ฆฟ ๊ด€๋ฆฌ" --> api
    api -- "์ €์žฅ" --> mysql
    mysql <-- "๋ฃฐ ์กฐํšŒ / ์ƒํƒœยท์ด๋ ฅ ์ €์žฅ" --> eval
    eval -- "์ง€ํ‘œ ์กฐํšŒ" --> metrics
    eval -. "๋ฐœ์†ก ๋Œ€๊ธฐ ๋“ฑ๋ก<br/>(MySQL)" .-> send
    send -- "๋ฐœ์†ก" --> ch
Data Source ์กฐํšŒ ๋Œ€์ƒ
Application Response, Calls To Another Application HBase Map ํ†ต๊ณ„
Agent Stat Pinot Agent ํ†ต๊ณ„ ํ…Œ์ด๋ธ”
Agent Event HBase Agent Event

Pinpoint Web์€ ์•Œ๋žŒ API์— ๊ถŒํ•œ ๊ฒ€์‚ฌ๋ฅผ ์ ์šฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. Web์— ์ ‘๊ทผํ•  ์ˆ˜ ์žˆ๋Š” ์‚ฌ์šฉ์ž๋Š” ๋ชจ๋“  Service์˜ ๋ฃฐ, ์ฑ„๋„, ํ…œํ”Œ๋ฆฟ์„ ์กฐํšŒํ•˜๊ณ  ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

11. DB ์ค€๋น„

MySQL 8.4 ์ด์ƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. ์•Œ๋žŒ ํ…Œ์ด๋ธ”์˜ ์„ค์ • ์ปฌ๋Ÿผ์€ JSON ํƒ€์ž…์ž…๋‹ˆ๋‹ค.

๋‹ค์Œ ์Šคํฌ๋ฆฝํŠธ๋กœ ์•Œ๋žŒ ํ…Œ์ด๋ธ”์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

text
alarm/alarm-common/src/main/resources/sql/alarm/CreateTableStatement-mysql.sql
๊ตฌ๋ถ„ ํ…Œ์ด๋ธ”
ํ…œํ”Œ๋ฆฟ alarm_template, alarm_template_item
๋ฃฐ alarm_rule_v2, alarm_rule_local_config
์ฑ„๋„ alarm_notification_channel, alarm_channel_binding
ํ‰๊ฐ€ ์ƒํƒœ์™€ ์ด๋ ฅ alarm_state, alarm_history_v2
๋ฐœ์†ก ๋Œ€๊ธฐ์—ด alarm_notification_outbox

Alarm Batch๋Š” Spring Batch ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ์Šคํ‚ค๋งˆ๋ฅผ ์ž๋™์œผ๋กœ ๋งŒ๋“ค์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ ์Šคํฌ๋ฆฝํŠธ๋กœ ์ง์ ‘ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

text
web/src/main/resources/sql/SpringBatchJobRepositorySchema-mysql.sql

12. Alarm Batch ์‹คํ–‰

  • ์‹คํ–‰ ํŒŒ์ผ: pinpoint-alarm-batch-starter-<version>-exec.jar
  • ์ปจํ…Œ์ด๋„ˆ ์ด๋ฏธ์ง€: pinpoint-alarm-batch
  • ์™ธ๋ถ€ ์„ค์ • ํŒŒ์ผ: -Dpinpoint.alarm.batch.config.location=<๊ฒฝ๋กœ>

ํ•„์ˆ˜ ์„ค์ •

ํ•ญ๋ชฉ ์„ค์ • ๋น„๊ณ 
MySQL jdbc.properties Web๊ณผ ๊ฐ™์€ ์•Œ๋žŒ ํ…Œ์ด๋ธ”์„ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
Spring Batch ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ spring.meta-datasource.* ์ง€์ •ํ•˜์ง€ ์•Š์œผ๋ฉด MySQL ์„ค์ •๊ณผ ๊ฐ™์€ DB๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
HBase hbase.properties
Pinot spring.pinot-datasource.*
Agent ํ†ต๊ณ„ ํ…Œ์ด๋ธ” alarm.agent-stat.table.prefix, alarm.agent-stat.table.padding-length, alarm.agent-stat.table.count ๊ฐ’์ด ์—†์œผ๋ฉด ์‹œ์ž‘์— ์‹คํŒจํ•ฉ๋‹ˆ๋‹ค. release ํ”„๋กœํ•„์—๋Š” ์ฃผ์„์œผ๋กœ๋งŒ ๋“ค์–ด ์žˆ์œผ๋ฏ€๋กœ ์ง์ ‘ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

์•Œ๋ฆผ ์„ค์ •

ํ•ญ๋ชฉ ์„ค์ • ๋น„๊ณ 
์•Œ๋ฆผ ๋งํฌ alarm.pinpoint.web.url ๋น„์–ด ์žˆ์œผ๋ฉด ์•Œ๋ฆผ์— View Details์™€ Alarm History ๋งํฌ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.
๋ฉ”์ผ alarm.email.sender, spring.mail.* alarm.email.sender๊ฐ€ ๋น„์–ด ์žˆ์œผ๋ฉด ๋ฉ”์ผ์„ ๋ณด๋‚ด์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
์›นํ›… ์‚ฌ์„ค ์ฃผ์†Œ ํ—ˆ์šฉ pinpoint.webhook.allowed-private-hosts, pinpoint.webhook.allowed-private-host-suffixes ๊ธฐ๋ณธ๊ฐ’์€ ๋ชจ๋“  ์‚ฌ์„ค ์ฃผ์†Œ ์ฐจ๋‹จ
SMS SmsAlarmSender ๋นˆ ๊ธฐ๋ณธ ๊ตฌํ˜„์ด ์—†์Šต๋‹ˆ๋‹ค. ์•„๋ž˜ ์„ค๋ช…์„ ์ฐธ๊ณ ํ•ฉ๋‹ˆ๋‹ค.

SMS ์ฑ„๋„์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ๋‹ค์Œ์„ ๊ตฌํ˜„ํ•ด SmsAlarmSender ๋นˆ์œผ๋กœ ๋“ฑ๋กํ•ฉ๋‹ˆ๋‹ค.

  • SmsDispatcher: ์ „ํ™”๋ฒˆํ˜ธ ๋ชฉ๋ก๊ณผ ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ›์•„ ์‹ค์ œ๋กœ SMS๋ฅผ ๋ณด๋ƒ…๋‹ˆ๋‹ค.
  • UserGroupPhoneResolver: User Group ๊ตฌ์„ฑ์›์˜ ์ „ํ™”๋ฒˆํ˜ธ๋ฅผ ์ฐพ์Šต๋‹ˆ๋‹ค.

๋“ฑ๋กํ•˜์ง€ ์•Š์œผ๋ฉด SMS ์ฑ„๋„๋กœ๋Š” ์•Œ๋ฆผ์„ ๋ณด๋‚ด์ง€ ์•Š๊ณ , ์‹คํŒจ ๋‚ด์šฉ์„ ์•Œ๋žŒ ์ด๋ ฅ์— ๋‚จ๊น๋‹ˆ๋‹ค. ๊ฐ™์€ ๋ฃฐ์˜ ๋‹ค๋ฅธ ์ฑ„๋„์€ ์ •์ƒ์œผ๋กœ ๋ฐœ์†ก๋ฉ๋‹ˆ๋‹ค.

์กฐ์ •ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ’

์„ค์ • ๊ธฐ๋ณธ๊ฐ’ ์„ค๋ช…
pinpoint.modules.batch.alarm.fixedDelayMs 10000 ๋ฃฐ ๊ฒ€์‚ฌ ์ฃผ๊ธฐ(ms)
pinpoint.modules.batch.alarm.batchSize 300 ํ•œ ๋ฒˆ์— ์ฝ๋Š” ๋ฃฐ ์ˆ˜
pinpoint.modules.batch.alarm.worker.coreSize, .maxSize 4, 4 ๋ฃฐ ํ‰๊ฐ€ ์Šค๋ ˆ๋“œ ์ˆ˜
pinpoint.modules.batch.alarm.jobName alarmEvaluationJob ๊ธฐ์กด ์•Œ๋žŒ(alarmJob)๊ณผ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ์Šคํ‚ค๋งˆ๋ฅผ ํ•จ๊ป˜ ์“ธ ๋•Œ ๊ตฌ๋ถ„ํ•˜๋Š” ์ด๋ฆ„
pinpoint.modules.batch.alarm.outbox.fixedDelayMs 5000 ์•Œ๋ฆผ ๋ฐœ์†ก ์ฃผ๊ธฐ(ms)
pinpoint.modules.batch.alarm.outbox.batchSize 100 ํ•œ ๋ฒˆ์— ๋ณด๋‚ด๋Š” ์•Œ๋ฆผ ์ˆ˜
pinpoint.modules.batch.alarm.outbox.maxAttempts 5 ์ฒซ ์‹œ๋„๋ฅผ ํฌํ•จํ•œ ์ตœ๋Œ€ ๋ฐœ์†ก ์‹œ๋„ ํšŸ์ˆ˜ (1~255)
pinpoint.modules.batch.alarm.outbox.leaseSec 60 ๋ฐœ์†ก ์ค‘์ธ ์•Œ๋ฆผ์„ ๋‹ค๋ฅธ ํ”„๋กœ์„ธ์Šค๊ฐ€ ๊ฐ€์ ธ๊ฐ€์ง€ ์•Š๋Š” ์‹œ๊ฐ„(์ดˆ)
alarm.pinpoint.web.alarm-path /config/alarm Alarm History ๋งํฌ์˜ ๊ฒฝ๋กœ

์ด๋ ฅ ์ •๋ฆฌ

์˜ค๋ž˜๋œ ์•Œ๋žŒ ์ด๋ ฅ์€ batch ๋ชจ๋“ˆ์˜ alarmHistoryCleanupJob์ด ์ง€์›๋‹ˆ๋‹ค. ์ด ์žก์€ Alarm Batch๊ฐ€ ์•„๋‹ˆ๋ผ Pinpoint Batch์—์„œ ์‹คํ–‰๋˜๋ฉฐ, Pinpoint Batch์˜ jdbc.properties์— ์„ค์ •ํ•œ MySQL์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๊ธฐ๋ณธ๊ฐ’์€ ๊บผ์ง์ž…๋‹ˆ๋‹ค.

์„ค์ • ๊ธฐ๋ณธ๊ฐ’ ์„ค๋ช…
job.cleanup.alarm.history.enable false ์ •๋ฆฌ ์žก ์‚ฌ์šฉ ์—ฌ๋ถ€
job.cleanup.alarm.history.cron 0 30 3 * * * ์‹คํ–‰ ์ฃผ๊ธฐ
job.cleanup.alarm.history.expiration-days 14 ๋ณด๊ด€ ๊ธฐ๊ฐ„(์ผ). ์ด๋ณด๋‹ค ์˜ค๋ž˜๋œ ์ด๋ ฅ์„ ์ง€์›๋‹ˆ๋‹ค.
job.cleanup.alarm.history.chunk-size 5000 ํ•œ ๋ฒˆ์— ์ง€์šฐ๋Š” ํ–‰ ์ˆ˜

๋ฐœ์†ก์„ ๋งˆ์นœ ๋Œ€๊ธฐ์—ด(alarm_notification_outbox์˜ SENT, DEAD)์„ ๋จผ์ € ์ง€์šฐ๊ณ  ์ด๋ ฅ(alarm_history_v2)์„ ์ง€์›๋‹ˆ๋‹ค. ๋ฐœ์†ก์„ ๊ธฐ๋‹ค๋ฆฌ๋Š” ์•Œ๋ฆผ์ด ์žˆ๋Š” ์ด๋ ฅ์€ ๊ทธ ์•Œ๋ฆผ์˜ ๋ฐœ์†ก์ด ๋๋‚  ๋•Œ๊นŒ์ง€ ๋‚จ์Šต๋‹ˆ๋‹ค.


File: documents/application-inspector.md


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

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.

text
flink.cluster.enable=true
    flink.cluster.zookeeper.address=YOUR_ZOOKEEPER_ADDRESS
    flink.cluster.zookeeper.sessiontimeout=3000
    flink.cluster.zookeeper.retry.interval=5000
    flink.cluster.tcp.port=19994

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.

    text
    flink.StreamExecutionEnvironment=server

D. Configure hbase address in hbase.properties which will be used to store aggregated application data.

text
hbase.client.host=YOUR_HBASE_ADDRESS
    hbase.client.port=2181

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.

text
flink.cluster.enable=true
    flink.cluster.zookeeper.address=YOUR_ZOOKEEPER_ADDRESS
    flink.cluster.zookeeper.sessiontimeout=3000

G. Enable application inspector in the web-ui by enabling the following configuration in pinpoint-web.properties.

text
config.show.applicationStat=true

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

text
batch.flink.server=FLINK_MANGER_SERVER_IP_LIST
# Flink job manager server IPs, separated by ','.
# ex) batch.flink.server=123.124.125.126,123.124.125.127

applicationContext-batch-schedule.xml

markup
<task:scheduled-tasks scheduler="scheduler">
    ...
    <task:scheduled ref="batchJobLauncher" method="flinkCheckJob" cron="0 0/10 * * * *" />
</task:scheduled-tasks>

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 ์ฃผ์†Œ๋ฅผ ์„ค์ •ํ•œ๋‹ค.

text
flink.cluster.enable=true
    flink.cluster.zookeeper.address=YOUR_ZOOKEEPER_ADDRESS
    flink.cluster.zookeeper.sessiontimeout=3000
    flink.cluster.zookeeper.retry.interval=5000
    flink.cluster.tcp.port=19994

C. flink ํ”„๋กœ์ ํŠธ ์„ค์ •ํŒŒ์ผ(Pinpoint-flink.properties)์— job์˜ ์‹คํ–‰ ๋ฐฉ๋ฒ•๊ณผ Collector์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ›๋Š” listener์˜ ๊ฐœ์ˆ˜๋ฅผ ์„ค์ •ํ•œ๋‹ค.

  • flink๋ฅผ cluster๋กœ ๊ตฌ์ถ•ํ•ด์„œ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด _flink.StreamExecutionEnvironment_์—๋Š” server๋ฅผ ์„ค์ •ํ•œ๋‹ค.
  • flink๋ฅผ Standalone ํ˜•ํƒœ๋กœ ์‹คํ–‰ํ•œ๋‹ค๋ฉด _flink.StreamExecutionEnvironment_์—๋Š” local์„ ์„ค์ •ํ•œ๋‹ค.
text
flink.StreamExecutionEnvironment=server
    flink.sourceFunction.Parallel=1

D. flink ํ”„๋กœ์ ํŠธ ์„ค์ •ํŒŒ์ผ(hbase.properties)์— ์ง‘๊ณ„ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๋Š” hbase ์ฃผ์†Œ๋ฅผ ์„ค์ •ํ•œ๋‹ค.

text
hbase.client.host=YOUR_HBASE_ADDRESS
    hbase.client.port=2181

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 ์ฃผ์†Œ๋ฅผ ์„ค์ •ํ•œ๋‹ค.

text
flink.cluster.enable=true
    flink.cluster.zookeeper.address=YOUR_ZOOKEEPER_ADDRESS
    flink.cluster.zookeeper.sessiontimeout=3000

G. web์—์„œ application inspector ๋ฒ„ํŠผ์„ ํ™œ์„ฑํ™” ํ•˜๊ธฐ ์œ„ํ•ด์„œ ์„ค์ •ํŒŒ์ผ(pinpoint-web.properties)์„ ์ˆ˜์ •ํ•œ๋‹ค.

text
config.show.applicationStat=true

4. streaming job ๋™์ž‘ ํ™•์ธ ๋ชจ๋‹ˆํ„ฐ๋ง batch

Pinpoint streaming job์ด ์‹คํ–‰๋˜๊ณ  ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” batch job์ด ์žˆ๋‹ค. batch job์„ ๋™์ž‘ ์‹œํ‚ค๊ณ  ์‹ถ๋‹ค๋ฉด Pinpoint web ํ”„๋กœ์ ํŠธ์˜ ์„ค์ • ํŒŒ์ผ์„ ์ˆ˜์ •ํ•˜๋ฉด ๋œ๋‹ค.

batch.properties

text
batch.flink.server=FLINK_MANGER_SERVER_IP_LIST
#`batch.flink.server` ์†์„ฑ ๊ฐ’์— flink job manager ์„œ๋ฒ„ IP๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ๋œ๋‹ค. ์„œ๋ฒ„ ๋ฆฌ์ŠคํŠธ์˜ ๊ตฌ๋ถ„์ž๋Š” ','์ด๋‹ค.
# ex) batch.flink.server=123.124.125.126,123.124.125.127

applicationContext-batch-schedule.xml

markup
<task:scheduled-tasks scheduler="scheduler">
    ...
    <task:scheduled ref="batchJobLauncher" method="flinkCheckJob" cron="0 0/10 * * * *" />
</task:scheduled-tasks>

batch job์ด ์‹คํŒจํ•  ๊ฒฝ์šฐ ์•Œ๋žŒ์ด ์ „์†ก๋˜๋„๋ก ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ ํ•˜๊ณ ์‹ถ๋‹ค๋ฉด com.navercorp.pinpoint.web.batch.JobFailMessageSender class ๊ตฌํ˜„์ฒด๋ฅผ ๋งŒ๋“ค๊ณ  bean์œผ๋กœ ๋“ฑ๋กํ•˜๋ฉด ๋œ๋‹ค.

5. ๊ธฐํƒ€

์ž์„ธํ•œ flink ์šด์˜ ์„ค์น˜์— ๋Œ€ํ•œ ๋‚ด์šฉ์€ flink ์‚ฌ์ดํŠธ๋ฅผ ์ฐธ๊ณ ํ•˜์ž.


File: documents/error_analysis.md

English | ํ•œ๊ตญ์–ด

Error Analysis

Error Analysis is a new feature introduced in Pinpoint v3.0.0.

The Pinpoint agent collects more detailed exception information and transmits it to the Pinpoint collector via gRPC. The Pinpoint collector then stores this data in Apache Pinot through Apache Kafka. You can view the stored Error Analysis data in the Pinpoint web interface.

1. Installation and Configuration Guide

1.1. Pinot and Kafka Setup

If Pinot and Kafka are already installed, you can skip this setup step. Otherwise, set them up by following the Pinot installation guide before creating Error Analysis topics and tables.

1.2. Create Kafka Topics

You need to create a topic named exception-trace.
Use the following command to create the exception-trace topic:

shell
$ bin/kafka-topics.sh --create --topic exception-trace --bootstrap-server ${YOUR_KAFKA_SERVER_ADDRESS}

1.3. Create Pinot Tables

Pinpoint Error Analysis requires CLP (Compressed Log Processor), supported from Pinot version 1.0.0, to appropriately process and group error messages. Please ensure you are using the correct version.

Due to the binary issue with clp-ffi-java, we recommend using an amd64-based / x86-based machine when installing Pinot version 1.0.0. Related Issue

Create the following table in Pinot:

  • exceptionTrace

Refer to the table schema file for details on creating the table.

1.4. Pinpoint Agent Configuration

This section covers the settings related to Error Analysis data collection. The default settings for the release profile are as follows:

config
###########################################################
# Exception Trace
###########################################################
profiler.exceptiontrace.enable=true
# Permits per second
profiler.exceptiontrace.new.throughput=1000
profiler.exceptiontrace.errormessage.max=2048
# Permits depth of exception. if max depth is 0, it is unlimited.
profiler.exceptiontrace.max.depth=5
profiler.exceptiontrace.io.buffering.buffersize=20
  • profiler.exceptiontrace.enable
    • true: Collects exceptions that occur. Default
    • false: Does not collect exceptions that occur.
  • profiler.exceptiontrace.new.throughput
    • Default: 1000
    • Determines how many exceptions per second to collect from the agent.
  • profiler.exceptiontrace.errormessage.max
    • Default: 2048
    • Determines the maximum length of the error message for exceptions collected by the agent.
  • profiler.exceptiontrace.max.depth
    • Default: 5
    • Determines the depth to traverse the exception chain.
    • If the value is 0, it will traverse until Throwable.getCause() returns null.
  • profiler.exceptiontrace.io.buffering.buffersize
    • Default: 20
    • Determines the number of exceptions to buffer.
    • This buffer is approximately the size of the buffer generated per Span.

1.5. Pinpoint Collector and Web Configuration and Execution

1.5.1. Collector Configuration and Execution

Configure and run the collector starter with BASIC or ALL type before enabling exception storage.

Ensure that pinpoint.modules.collector.exceptiontrace.enabled=true is set to enable exception storage. Default: true

1.5.2. Web Configuration and Execution

Configure and run the web starter before reading exception data.

Additionally, ensure that pinpoint.modules.web.exceptiontrace.enabled=true is set to enable reading exception data. Default: true

For Error Analysis, the following setting is added to pinpoint-web-metric.properties to control whether the Error Analysis item is displayed in the side menu. Default: true

config
config.show.exceptionTrace=true

Error Analysis

Error Analysis ๋Š” ํ•€ํฌ์ธํŠธ v3.0.0 ์— ์‹ ๊ทœ๋กœ ์ถ”๊ฐ€๋˜์—ˆ๋‹ค.
ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ์—์„œ ๋ณด๋‹ค ์ƒ์„ธํ•œ Exception ์ •๋ณด๋ฅผ ์ˆ˜์ง‘ํ•˜์—ฌ gRPC ๋ฅผ ํ†ตํ•ด ํ•€ํฌ์ธํŠธ ์ฝœ๋ ‰ํ„ฐ๋กœ ์ „๋‹ฌํ•œ๋‹ค.
ํ•€ํฌ์ธํŠธ ์ฝœ๋ ‰ํ„ฐ๋Š” ์ด๋ฅผ ์•„ํŒŒ์น˜ ์นดํ”„์นด๋ฅผ ํ†ตํ•ด ์•„ํŒŒ์น˜ ํ”ผ๋…ธ์— ๊ฐ’์„ ์ €์žฅํ•œ๋‹ค.
ํ•€ํฌ์ธํŠธ ์›น์—์„œ ์ €์žฅ๋œ Error Analysis ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

1. ์„ค์น˜ ๋ฐ ์„ค์ • ๋ฐฉ๋ฒ•

1.1. Pinot์™€ Kafka ์ค€๋น„

Pinot์™€ Kafka๊ฐ€ ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด ์ด ์ค€๋น„ ๋‹จ๊ณ„๋Š” ๊ฑด๋„ˆ๋›ฐ์–ด๋„ ๋ฉ๋‹ˆ๋‹ค. ์•„์ง ์„ค์น˜ํ•˜์ง€ ์•Š์•˜๋‹ค๋ฉด Error Analysis์šฉ topic๊ณผ table์„ ์ƒ์„ฑํ•˜๊ธฐ ์ „์— Pinot ์„ค์น˜ ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ Pinot์™€ Kafka๋ฅผ ์ค€๋น„ํ•ฉ๋‹ˆ๋‹ค.

1.2. Kafka topic ์ƒ์„ฑ

exception-trace ๋ผ๋Š” ์ด๋ฆ„์˜ topic ์„ ์ƒ์„ฑํ•ด์•ผ ํ•œ๋‹ค.
์•„๋ž˜์™€ ๊ฐ™์ด exception-trace ํ† ํ”ฝ์„ ์ƒ์„ฑํ•œ๋‹ค.

shell
$ bin/kafka-topics.sh --create --topic exception-trace --bootstrap-server ${YOUR_KAFKA_SERVER_ADDRESS}

1.3. Pinot table ์ƒ์„ฑ

ํ•€ํฌ์ธํŠธ๋Š” Error Message ๋ฅผ ์ ์ ˆํžˆ ์ฒ˜๋ฆฌํ•˜๊ณ  ๊ทธ๋ฃนํ™”ํ•˜๊ธฐ ์œ„ํ•ด Pinot 1.0.0 ๋ถ€ํ„ฐ ์ง€์›ํ•˜๋Š” CLP (Compressed Log Processor) ๊ฐ€ ํ•„์š”ํ•˜๋‹ค. ๋ฒ„์ „์— ์ฃผ์˜ํ•  ๊ฒƒ.

ํ”ผ๋…ธ Pinot ์— ๋‹ค์Œ ํ…Œ์ด๋ธ”์„ ์ƒˆ๋กœ ์ƒ์„ฑํ•œ๋‹ค.

1.4 ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ ์„ค์ •

Error Analysis ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘๊ณผ ๊ด€๋ จ๋œ ์„ค์ •์ด๋‹ค.
release ํ”„๋กœํ•„์˜ ๊ธฐ๋ณธ ์„ค์ •์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

config
###########################################################
# Exception Trace
###########################################################
profiler.exceptiontrace.enable=true
# Permits per second
profiler.exceptiontrace.new.throughput=1000
profiler.exceptiontrace.errormessage.max=2048
# Permits depth of exception. if max depth is 0, it is unlimited.
profiler.exceptiontrace.max.depth=5
profiler.exceptiontrace.io.buffering.buffersize=20
  • profiler.exceptiontrace.enable
    • true: ๋ฐœ์ƒํ•˜๋Š” exception ์„ ์ˆ˜์ง‘ํ•œ๋‹ค. ๊ธฐ๋ณธ๊ฐ’
    • false : ๋ฐœ์ƒํ•˜๋Š” exception ์„ ์ˆ˜์ง‘ํ•˜์ง€ ์•Š๋Š”๋‹ค.
  • profiler.exceptiontrace.new.throughput
    • ๊ธฐ๋ณธ๊ฐ’ 1000
    • ํ•ด๋‹น ์—์ด์ „ํŠธ์—์„œ ์ดˆ๋‹น ๋ช‡๊ฐœ๊นŒ์ง€์˜ exception ์„ ์ˆ˜์ง‘ํ• ์ง€ ๊ฒฐ์ •ํ•œ๋‹ค.
  • profiler.exceptiontrace.errormessage.max
    • ๊ธฐ๋ณธ๊ฐ’ 2048
    • ํ•ด๋‹น ์—์ด์ „ํŠธ์—์„œ ๋ฐœ์ƒํ•˜๋Š” exception ์˜ error message ๋ฅผ ๋ช‡์ž๊นŒ์ง€ ์ˆ˜์ง‘ํ• ์ง€ ๊ฒฐ์ •ํ•œ๋‹ค.
  • profiler.exceptiontrace.max.depth
    • ๊ธฐ๋ณธ๊ฐ’ 5
    • exception chain ์ด ์ฃผ์–ด์กŒ์„ ๋•Œ, ๊นŠ์ด๋ฅผ ์–ด๋А์ •๋„ ์ˆœํšŒํ• ์ง€ ๊ฒฐ์ •ํ•œ๋‹ค.
    • ๊ฐ’์ด 0์ด๋ฉด Throwable.getCause() ๊ฐ€ null ์ผ ๋•Œ๊นŒ์ง€ ์ˆœํšŒํ•œ๋‹ค.
  • profiler.exceptiontrace.io.buffering.buffersize
    • ๊ธฐ๋ณธ๊ฐ’ 20
    • buffer ์— exception ์„ ๋ช‡๊ฐœ๊นŒ์ง€ ์Œ“์•„๋‘˜์ง€ ๊ฒฐ์ •ํ•œ๋‹ค.
    • ํ•ด๋‹น buffer ๋Š” ๋Œ€๋žต Span ๋‹จ์œ„๋กœ ์ƒ์„ฑ๋˜๋Š” buffer ์ด๋‹ค.

1.5 ํ•€ํฌ์ธํŠธ ์ฝœ๋ ‰ํ„ฐ์™€ ํ•€ํฌ์ธํŠธ ์›น ์„ค์ • ๋ฐ ์‹คํ–‰

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

exception ์ €์žฅ์„ ํ™œ์„ฑํ™”ํ•˜๋ ค๋ฉด collector starter๋ฅผ BASIC ๋˜๋Š” ALL ํƒ€์ž…์œผ๋กœ ์‹คํ–‰ํ•œ๋‹ค.

์ด์— ์ถ”๊ฐ€์ ์œผ๋กœ
pinpoint.modules.collector.exceptiontrace.enabled=true
๋กœ ๋˜์–ด์žˆ์–ด์•ผ exception ์„ ์ €์žฅํ•œ๋‹ค. ๊ธฐ๋ณธ๊ฐ’ true

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

exception ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ์œผ๋ ค๋ฉด web starter๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.

์ด์— ์ถ”๊ฐ€์ ์œผ๋กœ
pinpoint.modules.web.exceptiontrace.enabled=true
๋กœ ๋˜์–ด์žˆ์–ด์•ผ exception ๋ฐ์ดํ„ฐ๋ฅผ ์ฝ์–ด์˜จ๋‹ค. ๊ธฐ๋ณธ๊ฐ’ true

์œ„ ์„ค์ • ์™ธ์— Error Analysis ๋ฅผ ์œ„ํ•ด pinpoint-web-metric.properties์— ์•„๋ž˜ ์„ค์ •๊ฐ’์ด ์ถ”๊ฐ€๋˜์—ˆ๋‹ค:
์ด ์„ค์ •์€ ์ขŒ์ธก ์‚ฌ์ด๋“œ ๋ฉ”๋‰ด์—์„œ Error Analysis ํ•ญ๋ชฉ์„ ๋…ธ์ถœ์‹œํ‚ฌ์ง€ ๊ฒฐ์ •ํ•œ๋‹ค.
๊ธฐ๋ณธ๊ฐ’true

  • text
    config.show.exceptionTrace=true

File: documents/hbase-table-changes.md

HBase Table Changes

3.1.0

Table creation scripts for 3.1.0:

Before You Start

Create the new HBase tables before changing table-related properties or starting upgraded components.

The property values shown below are the 3.1.0 defaults and use the new tables.

Upgrade Order

  1. Create the new HBase tables.
  2. Enable dual write for each feature (see each feature's Transition).
  3. Switch reads to the legacy tables during migration (see each feature's Transition).
  4. Run the copy APIs to migrate historical data, if supported.
  5. Switch reads back to the new tables, if changed in step 3.
  6. Disable legacy writes once the new tables are confirmed healthy.

Application & Agent List

Tables

ApplicationIndex is split into two new tables:

Legacy New
ApplicationIndex Application, AgentId

Properties

Collector

properties
pinpoint.collector.application.index.v1.enabled=false
pinpoint.collector.application.index.v2.enabled=true

Web

properties
# v1/v2 enabled properties are used for delete operations.
pinpoint.web.application.index.v1.enabled=false
pinpoint.web.application.index.v2.enabled=true
pinpoint.web.application.index.read.v2=true

Batch

properties
pinpoint.batch.application.index.read.v2=true

# Legacy ApplicationIndex cleanup
job.cleanup.inactive.applications.enable=true
job.cleanup.inactive.applications.cron=0 0 3 * * THU
job.cleanup.inactive.applications.emptydurationthreshold=P35D
# - emptyItemWriter: Not actually removes application
# - cleanTargetWriter: Actually removes application
job.cleanup.inactive.applications.writer=emptyItemWriter

# New Application and AgentId table cleanup
# Disabled by default; enable after verifying with dry-run.
job.cleanup.inactive.agent-application.enable=false
job.cleanup.inactive.agent-application.cron=0 0 4 * * THU
# Test run only. Does not delete data.
job.cleanup.inactive.agent-application.dry-run=true
job.cleanup.inactive.agent-application.threshold-days=30

Transition

  • Collector: set pinpoint.collector.application.index.v1.enabled=true for dual write.
  • Web: set pinpoint.web.application.index.v1.enabled=true to delete from the legacy table during migration.
  • Web: set pinpoint.web.application.index.read.v2=false to read from the legacy table during migration.
  • Batch: set pinpoint.batch.application.index.read.v2=false to read from the legacy table during migration.

Data Migration

Application & Agent List supports historical data migration through Web copy APIs.

API Description
/api/admin/copy/applications Copy all application index data
/api/admin/copy/agents/all Copy all agent index data, using more time and resources
/api/admin/copy/agents?durationDays=30 Copy agent index data for recent durationDays
/api/admin/copy/agents?applicationName=app Copy agent index data for a specific applicationName
/api/admin/copy/agents?serviceTypeCode=1000 Copy agent index data for a specific serviceTypeCode

Notes:

  • Copy APIs are exposed on the Web component.
  • Agent copy APIs use the AgentInfo table; Java agents send AgentInfo periodically, so durationDays can include long-running active agents.
  • Some agents may not send AgentInfo periodically; use serviceTypeCode for them.
  • durationDays and /agents/all copy a wider range of data, so they may take longer to complete.
  • applicationName and serviceTypeCode copy the least required data.

Example:

bash
# copy all applications
curl -X POST /api/admin/copy/applications

# copy all agents
curl -X POST /api/admin/copy/agents/all

# copy agents for recent 30 days
curl -X POST "/api/admin/copy/agents?durationDays=30"

# copy agents for a specific application
curl -X POST "/api/admin/copy/agents?applicationName=my-app"

# copy agents for a specific service type
curl -X POST "/api/admin/copy/agents?serviceTypeCode=1000"

ServerMap

Tables

ApplicationMapStatisticsSelf_Ver2 is split into two new tables:

Legacy New
HostApplicationMap_Ver2 MapAppHost
ApplicationMapStatisticsCaller_Ver2 MapAppOut
ApplicationMapStatisticsCallee_Ver2 MapAppIn
ApplicationMapStatisticsSelf_Ver2 MapAppSelf, MapAgentSelf

Properties

Collector

properties
# v2: legacy table, v3: new table, dual: dual write for data migration
pinpoint.modules.uid.version=v3

Web

properties
# v2: legacy table, v3: new table
pinpoint.modules.uid.version=v3

Transition

  • Collector: set pinpoint.modules.uid.version=dual for dual write.
  • Web: set pinpoint.modules.uid.version=v2 to read from the legacy tables during migration.

TraceIndex

Tables

Legacy New
ApplicationTraceIndex TraceIndex

Properties

Collector

properties
pinpoint.collector.application.trace.index.v1.enabled=false
pinpoint.collector.application.trace.index.v2.enabled=true

Web

properties
pinpoint.web.trace.index.read.v2=true

Transition

  • Collector: set pinpoint.collector.application.trace.index.v1.enabled=true for dual write.
  • Web: set pinpoint.web.trace.index.read.v2=false to read from the legacy table during migration.

File: documents/hbase-upgrade.md


Upgrade Database Hbase2

Do you like to use Hbase 2.x for Pinpoint?

Default settings of current releases are for Hbase 1.x.

If you'd like to use Hbase 2.x for Pinpoint database.

check out Hbase2-module.


File: documents/heatmap.md

English | ํ•œ๊ตญ์–ด

1 Overview

Heatmap is a new visualization feature introduced in Pinpoint v3.1.0. It provides a statistics-based view of transaction response time distribution alongside the existing Scatter Chart.

While Scatter Chart plots every individual transaction, Heatmap aggregates transactions into time/elapsed-time buckets and displays density using color intensity. This approach significantly improves rendering performance for high-volume applications and makes it easier to quickly grasp overall transaction distribution patterns.

Both views coexist โ€” users can switch between Heatmap and Scatter Chart via a toggle button.

2 Architecture

Heatmap data flows through the following pipeline:

  1. Pinpoint Agent sends span data to Pinpoint Collector via gRPC.
  2. Collector aggregates response time data and publishes to Kafka (heatmap-stat-app-* topics).
  3. Apache Pinot ingests from Kafka into the heatmapStatApp table, aggregating counts per time bucket (10-second intervals).
  4. Pinpoint Web queries Pinot to render the heatmap visualization.

Pinot schema and table configuration details are described in section 3.3 below.

3 Installation and Configuration

3.1 Pinot and Kafka Setup

If Pinot and Kafka are already installed, you can skip this step. Otherwise, set them up by following the Pinot installation guide before creating Heatmap topics and tables.

3.2 Create Kafka Topics

Create a Kafka topic with the name below:

  • heatmap-stat-app-00
text
$ bin/kafka-topics.sh --create --topic heatmap-stat-app-00 --bootstrap-server ${YOUR_KAFKA_SERVER_ADDRESS}

The topic name follows the pattern {prefix}{index}, where prefix is heatmap-stat-app- and index is zero-padded to 2 digits.

3.3 Create Pinot Tables

Create the heatmapStatApp table in both REALTIME and OFFLINE modes (hybrid table) for optimal query performance.

Schema and table configuration files are located in collector/src/main/pinot/:

File Description
pinot-heatmap-stat-application-schema.json Table schema
pinot-heatmap-stat-application-realtime-table.json Realtime table config
pinot-heatmap-stat-application-offline-table.json Offline table config

Refer to the Pinot documentation for table creation instructions.

Default retention is defined in the table configuration files. You can adjust it in the Pinot table settings as needed.

3.4 Configure and Run Pinpoint Collector and Web

Collector

Configure and run the collector starter with BASIC or ALL type.

Heatmap is enabled by default in the application.yml of collector-starter:

yaml
pinpoint:
  modules:
    collector:
      heatmap:
        enabled: true

Collector Kafka settings are configured by default in heatmap-collector.properties:

properties
kafka.heatmap.topic.count=1
kafka.heatmap.topic.prefix=heatmap-stat-app-
kafka.heatmap.topic.padding.length=2
kafka.heatmap.key.partition.count=1

Web

Configure and run the web starter.

Heatmap is enabled by default in the application.yml of web-starter:

yaml
pinpoint:
  modules:
    web:
      heatmap:
        enabled: true

Web Pinot settings are configured by default in heatmap-web.properties:

properties
pinot.heatmap.topic.count=1
pinot.heatmap.topic.prefix=heatmap-stat-
pinot.heatmap.topic.padding.length=2

4 Usage

  1. Select an application in Pinpoint Web.
  2. Click the toggle button on the Scatter Chart area to switch to the Heatmap view.
  3. The heatmap displays transaction distribution with color intensity indicating density โ€” darker colors represent higher transaction counts.
  4. Click on a cell to drill down into the individual transactions for that time/response-time range.

5 Scatter Chart vs Heatmap

Scatter Chart Heatmap
Data Individual transactions Aggregated statistics
Performance Degrades with high volume Consistent regardless of volume
Use case Detailed analysis of individual transactions Quick overview of distribution patterns
Storage HBase (real-time) Pinot (pre-aggregated)

6 Notes

  • Heatmap feature is enabled by default starting from v3.1.0.
  • No additional agent configuration is required โ€” heatmap data is derived from the same span data collected by the existing agent.
  • Both Scatter Chart and Heatmap can be used simultaneously.

1 ๊ฐœ์š”

Heatmap์€ Pinpoint v3.1.0์— ์ƒˆ๋กœ ์ถ”๊ฐ€๋œ ์‹œ๊ฐํ™” ๊ธฐ๋Šฅ์ž…๋‹ˆ๋‹ค. ๊ธฐ์กด Scatter Chart์™€ ํ•จ๊ป˜ ํŠธ๋žœ์žญ์…˜ ์‘๋‹ต์‹œ๊ฐ„ ๋ถ„ํฌ๋ฅผ ํ†ต๊ณ„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

Scatter Chart๋Š” ๊ฐœ๋ณ„ ํŠธ๋žœ์žญ์…˜์„ ํ•˜๋‚˜์”ฉ ์ ์œผ๋กœ ํ‘œ์‹œํ•˜์ง€๋งŒ, Heatmap์€ ํŠธ๋žœ์žญ์…˜์„ ์‹œ๊ฐ„/์‘๋‹ต์‹œ๊ฐ„ ๊ตฌ๊ฐ„๋ณ„๋กœ ์ง‘๊ณ„ํ•˜์—ฌ ์ƒ‰์ƒ ๋†๋„๋กœ ๋ฐ€๋„๋ฅผ ํ‘œํ˜„ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ฐฉ์‹์€ ๋Œ€๋Ÿ‰ ํŠธ๋žœ์žญ์…˜ ํ™˜๊ฒฝ์—์„œ ๋ Œ๋”๋ง ์„ฑ๋Šฅ์„ ํฌ๊ฒŒ ํ–ฅ์ƒ์‹œํ‚ค๋ฉฐ, ์ „์ฒด ํŠธ๋žœ์žญ์…˜ ๋ถ„ํฌ ํŒจํ„ด์„ ๋น ๋ฅด๊ฒŒ ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค.

๋‘ ๋ทฐ๋Š” ๊ณต์กดํ•˜๋ฉฐ, ํ† ๊ธ€ ๋ฒ„ํŠผ์œผ๋กœ Heatmap๊ณผ Scatter Chart๋ฅผ ์ „ํ™˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

2 ๊ตฌ์กฐ

Heatmap ๋ฐ์ดํ„ฐ๋Š” ๋‹ค์Œ ํŒŒ์ดํ”„๋ผ์ธ์œผ๋กœ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค:

  1. Pinpoint Agent๊ฐ€ gRPC๋กœ span ๋ฐ์ดํ„ฐ๋ฅผ Collector์— ์ „์†กํ•ฉ๋‹ˆ๋‹ค.
  2. Collector๊ฐ€ ์‘๋‹ต์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ๋ฅผ ์ง‘๊ณ„ํ•˜์—ฌ Kafka (heatmap-stat-app-* topic)์— ๋ฐœํ–‰ํ•ฉ๋‹ˆ๋‹ค.
  3. Apache Pinot๊ฐ€ Kafka์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜์—ฌ heatmapStatApp ํ…Œ์ด๋ธ”์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค (10์ดˆ ๋‹จ์œ„๋กœ ์ง‘๊ณ„).
  4. Pinpoint Web์ด Pinot์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜์—ฌ heatmap์„ ๋ Œ๋”๋งํ•ฉ๋‹ˆ๋‹ค.

Pinot ์Šคํ‚ค๋งˆ ๋ฐ ํ…Œ์ด๋ธ” ์„ค์ •์€ ์•„๋ž˜ 3.3 Pinot table ์ƒ์„ฑ์—์„œ ์ž์„ธํžˆ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

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

3.1 Pinot์™€ Kafka ์ค€๋น„

Pinot์™€ Kafka๊ฐ€ ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด ์ด ์ค€๋น„ ๋‹จ๊ณ„๋Š” ๊ฑด๋„ˆ๋›ฐ์–ด๋„ ๋ฉ๋‹ˆ๋‹ค. ์•„์ง ์„ค์น˜ํ•˜์ง€ ์•Š์•˜๋‹ค๋ฉด Heatmap์šฉ topic๊ณผ table์„ ์ƒ์„ฑํ•˜๊ธฐ ์ „์— Pinot ์„ค์น˜ ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ Pinot์™€ Kafka๋ฅผ ์ค€๋น„ํ•ฉ๋‹ˆ๋‹ค.

3.2 Kafka topic ์ƒ์„ฑ

์•„๋ž˜ topic์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

  • heatmap-stat-app-00
text
$ bin/kafka-topics.sh --create --topic heatmap-stat-app-00 --bootstrap-server ${YOUR_KAFKA_SERVER_ADDRESS}

topic ์ด๋ฆ„์€ {prefix}{index} ํ˜•์‹์œผ๋กœ, prefix๋Š” heatmap-stat-app-์ด๊ณ  index๋Š” 2์ž๋ฆฌ๋กœ zero-padding๋ฉ๋‹ˆ๋‹ค.

3.3 Pinot table ์ƒ์„ฑ

heatmapStatApp ํ…Œ์ด๋ธ”์„ REALTIME๊ณผ OFFLINE ๋ชจ๋“œ ๋ชจ๋‘๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค (hybrid table).

์Šคํ‚ค๋งˆ ๋ฐ ํ…Œ์ด๋ธ” ์„ค์ • ํŒŒ์ผ์€ ์†Œ์Šค์ฝ”๋“œ์˜ collector/src/main/pinot/ ๋””๋ ‰ํ† ๋ฆฌ์— ์žˆ์Šต๋‹ˆ๋‹ค.

ํŒŒ์ผ ์„ค๋ช…
pinot-heatmap-stat-application-schema.json ํ…Œ์ด๋ธ” ์Šคํ‚ค๋งˆ
pinot-heatmap-stat-application-realtime-table.json Realtime ํ…Œ์ด๋ธ” ์„ค์ •
pinot-heatmap-stat-application-offline-table.json Offline ํ…Œ์ด๋ธ” ์„ค์ •

ํ…Œ์ด๋ธ” ์ƒ์„ฑ ๋ฐฉ๋ฒ•์€ Pinot ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

๊ธฐ๋ณธ retention์€ ํ…Œ์ด๋ธ” ์„ค์ • ํŒŒ์ผ์— ์ •์˜๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ํ•„์š”์— ๋”ฐ๋ผ Pinot ํ…Œ์ด๋ธ” ์„ค์ •์—์„œ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

3.4 Collector์™€ Web ์„ค์ • ๋ฐ ์‹คํ–‰

Collector

collector starter๋ฅผ BASIC ๋˜๋Š” ALL ํƒ€์ž…์œผ๋กœ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

Heatmap ๊ธฐ๋Šฅ์€ collector-starter์˜ application.yml์—์„œ ๊ธฐ๋ณธ์ ์œผ๋กœ ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค:

yaml
pinpoint:
  modules:
    collector:
      heatmap:
        enabled: true

Collector Kafka ์„ค์ •์€ heatmap-collector.properties์— ๊ธฐ๋ณธ์ ์œผ๋กœ ์„ค์ •๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค:

properties
kafka.heatmap.topic.count=1
kafka.heatmap.topic.prefix=heatmap-stat-app-
kafka.heatmap.topic.padding.length=2
kafka.heatmap.key.partition.count=1

Web

web starter๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

Heatmap ๊ธฐ๋Šฅ์€ web-starter์˜ application.yml์—์„œ ๊ธฐ๋ณธ์ ์œผ๋กœ ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค:

yaml
pinpoint:
  modules:
    web:
      heatmap:
        enabled: true

Web Pinot ์„ค์ •์€ heatmap-web.properties์— ๊ธฐ๋ณธ์ ์œผ๋กœ ์„ค์ •๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค:

properties
pinot.heatmap.topic.count=1
pinot.heatmap.topic.prefix=heatmap-stat-
pinot.heatmap.topic.padding.length=2

4 ์‚ฌ์šฉ ๋ฐฉ๋ฒ•

  1. Pinpoint Web์—์„œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  2. Scatter Chart ์˜์—ญ์˜ ํ† ๊ธ€ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ Heatmap ๋ทฐ๋กœ ์ „ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
  3. Heatmap์€ ์ƒ‰์ƒ ๋†๋„๋กœ ํŠธ๋žœ์žญ์…˜ ๋ถ„ํฌ๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค โ€” ์ƒ‰์ด ์ง„ํ• ์ˆ˜๋ก ํŠธ๋žœ์žญ์…˜ ์ˆ˜๊ฐ€ ๋งŽ์Šต๋‹ˆ๋‹ค.
  4. ์…€์„ ํด๋ฆญํ•˜๋ฉด ํ•ด๋‹น ์‹œ๊ฐ„/์‘๋‹ต์‹œ๊ฐ„ ๊ตฌ๊ฐ„์˜ ๊ฐœ๋ณ„ ํŠธ๋žœ์žญ์…˜์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

5 Scatter Chart vs Heatmap

Scatter Chart Heatmap
๋ฐ์ดํ„ฐ ๊ฐœ๋ณ„ ํŠธ๋žœ์žญ์…˜ ์ง‘๊ณ„๋œ ํ†ต๊ณ„
์„ฑ๋Šฅ ๋Œ€๋Ÿ‰ ๋ฐ์ดํ„ฐ ์‹œ ์„ฑ๋Šฅ ์ €ํ•˜ ๋ฐ์ดํ„ฐ ์–‘์— ๊ด€๊ณ„์—†์ด ์ผ์ •
์šฉ๋„ ๊ฐœ๋ณ„ ํŠธ๋žœ์žญ์…˜ ์ƒ์„ธ ๋ถ„์„ ๋ถ„ํฌ ํŒจํ„ด ๋น ๋ฅธ ํŒŒ์•…
์ €์žฅ์†Œ HBase (์‹ค์‹œ๊ฐ„) Pinot (์‚ฌ์ „ ์ง‘๊ณ„)

6 ์ฐธ๊ณ ์‚ฌํ•ญ

  • Heatmap ๊ธฐ๋Šฅ์€ v3.1.0๋ถ€ํ„ฐ ๊ธฐ๋ณธ์œผ๋กœ ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
  • ๋ณ„๋„์˜ Agent ์„ค์ •์€ ํ•„์š” ์—†์Šต๋‹ˆ๋‹ค โ€” heatmap ๋ฐ์ดํ„ฐ๋Š” ๊ธฐ์กด Agent๊ฐ€ ์ˆ˜์ง‘ํ•˜๋Š” span ๋ฐ์ดํ„ฐ์—์„œ ํŒŒ์ƒ๋ฉ๋‹ˆ๋‹ค.
  • Scatter Chart์™€ Heatmap์„ ๋™์‹œ์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

File: documents/http-status-code-failure.md


Marking Transaction as Fail

HTTP Status Code with Request Failure.

Pinpoint Configuration

pinpoint.config

text
profiler.http.status.code.errors=5xx, 401, 403, 406

Comma separated list of HTTP status codes.

  • 1xx: Informational(100 ~ 199).
    • 100: Continue
    • 101: Switching Protocols
  • 2xx: Successful(200 ~ 299).
    • 200: OK
    • 201: Created
    • 202: Accepted
    • 203: Non-Authoritative Information
    • 204: No Content
    • 205: Reset Content
    • 206: Partial Content
  • 3xx: Redirection(300 ~ 399).
    • 300: Multiple Choices
    • 301: Moved Permanently
    • 302: Found
    • 303: See Other
    • 304: Not Modified
    • 305: Use Proxy
    • 307: Temporary Redirect
  • 4xx: Client Error(400 ~ 499).
    • 400: Bad Request
    • 401: Unauthorized
    • 402: Payment Required
    • 403: Forbidden
    • 404: Not Found
    • 405: Method Not Allowed
    • 406: Not Acceptable
    • 407: Proxy Authentication Required
    • 408: Request Time-out
    • 409: Conflict
    • 410: Gone
    • 411: Length Required
    • 412: Precondition Failed
    • 413: Request Entity Too Large
    • 414: Request-URI Too Large
    • 415: Unsupported Media Type
    • 416: Requested range not satisfiable
    • 417: Expectation Failed
  • 5xx: Server Error(500 ~ 599).
    • 500: Internal Server Error
    • 501: Not Implemented
    • 502: Bad Gateway
    • 503: Service Unavailable
    • 504: Gateway Time-out
    • 505: HTTP Version not supported

Resources


File: documents/new-inspector.md

English | ํ•œ๊ตญ์–ด

1 Overview

There has been changes in inspector in v3.0.0. The newly renewed inspector will be referred to as 'New Inspector' below, while the previous version will be referred to as 'Legacy Inspector' (Legacy Application Inspector).

Although users won't see significant changes on front-end, but the whole architecture has been rebuilt from the scratch.
The data storage has been changed from HBase to Pinot.
And the APIs have been improved so that it is more easily extenable and their responses more clear to understand.

2 Installation and Configuration

2.1 Pinot and Kafka Setup

If Pinot and Kafka are already installed, you can skip this setup step. Otherwise, set them up by following the Pinot installation guide before creating New Inspector topics and tables.

2.2 Create Kafka Topics for New Inspector

Create the Kafka topics below with the partition counts shown. These counts match the numPartitions values in Pinpoint's default Pinot table configurations, which use segmentPartitionConfig.

Kafka topic Pinot table Partitions
inspector-stat-agent-00 inspectorStatAgent00 32
inspector-stat-app inspectorStatApp 64
text
$ bin/kafka-topics.sh --create --topic inspector-stat-agent-00 --partitions 32 --bootstrap-server ${YOUR_KAFKA_SERVER_ADDRESS}
$ bin/kafka-topics.sh --create --topic inspector-stat-app --partitions 64 --bootstrap-server ${YOUR_KAFKA_SERVER_ADDRESS}

2.3 Create Pinot Tables

  • Create 2 tables with the names below:
    • inspectorStatAgent00: This table stores agent inspector data. The script file to create the table is provided in our github repository.
    • inspectorStatApp: This table stores application inspector data.
  • Refer to the github repository for table schema and configuration settings.

2.4 Configure and Run Pinpoint Collector, Web, and Batch with New Inspector

Configure and run the following with matching Pinot connection settings:

  • Collector starter with BASIC or ALL type โ€” collects New Inspector data.
  • Web starter โ€” displays New Inspector data from Pinot.
  • Pinpoint Batch โ€” processes New Inspector alarms.
  • New Inspector feature options are enabled by default, so no additional feature option changes are required for the configuration files provided in our github repository.
  • When upgrading from Pinpoint version below 3.0 to version 3.0.0 or above, some of the options may be missing in the configuration properties files you have been using. Please refer to the related configurations in the following section to check if any changes are needed in your settings.
  • The following configurations are already set by default in Pinpoint version 3.0.
  • When upgrading from Pinpoint version below 3.0 to version 3.0.0 or above and when you wish to continue using customized configuration files you have been using, please check if below mentioned configurations are well set in your files.

Pinpoint Collector

  • application.yml file in collector-starter module:
text
pinpoint:
  modules:
    collector:
      inspector:
        enabled: true

Pinpoint Web

  • application.yml file in web-starter module:
text
pinpoint:
  modules:
    web:
      inspector:
        enabled: true

Pinpoint Batch

  • batch-root.properties file in batch module:
text
alarm.collector.version=2

4 Q&A

A Can we still use the Legacy Inspector to save the data to HBase?

Yes, but Legacy Inspector will be deprecated in v3.0.1 so we recommended you to use the New Inspector.

To use Legacy Inspector with v3.0.0, you need to add the following settings to the Pinpoint components:

Modify application.yml file in collector-starter module OR add java vm option when running Pinpoint Collector.

  • application.yml
text
pinpoint:
  modules:
    collector:
      inspector:
        hbase:
          enabled: true
  • java vm option
text
-Dpinpoint.modules.collector.inspector.hbase.enabled=true

Modify batch-root.properties file in batch module OR add java vm option when running Pinpoint Batch.

  • batch-root.properties
text
alarm.collector.version=1
  • java vm option
text
-Dalarm.collector.version=1

B Why change database to Pinot when there are no additional features provided to users?

New Inspector saves and retrieves the data faster than the Legacy Inspector thanks to Pinot. As Pinot project gets mature over time, there can be further improvements on performance or additional features can be introduced to Pinpoint Inpsector as well.

C Reading inspector-stat-agent table becomes slow as more data is being stored.

You can improve performance by distributing the data across multiple tables. Follow the steps below to create multiple Pinot tables and Kafka topics. Then, add settings to Pinpoint components to read and write data from multiple Pinot tables.

Create More Kafka Topics

  • Create N Kafka topics. (From 00 to N-1)
  • The format of the topics is as follows:
    • inspector-stat-agent-00
    • inspector-stat-agent-01
    • ...
    • inspector-stat-agent-99

Create More Pinot Tables

  • Create N Pinot tables. (From 00 to N-1)
    • The script file creating multiple Pinot tables is provided in our github repository.
  • The format of the table names and schema names is as follows:
    • inspectorStatAgent00
    • inspectorStatAgent01
    • ...
    • inspectorStatAgent99

Modify application.yml file in collector-starter module OR add java vm option when running Pinpoint Collector

  • application.yml
text
kafka:
  inspector:
    agent:
      table:
        count: N
  • java vm option
text
-Dkafka.inspector.agent.topic.count=N

Modify application.yml file in web-starter module OR add java vm option when running Pinpoint Web

  • application.yml
text
pinot:
  inspector:
    agent:
      table:
        count: N
  • java vm option
text
-Dpinot.inspector.agent.topic.count=N

Modify batch-root.properties file in batch module OR add java vm option when running Pinpoint Batch

  • batch-root.properties
text
job.alarm.agent.inspector.stat.table.count=N
  • java vm option
text
-Djob.alarm.agent.inspector.stat.table.count=N

1 ๊ฐœ์š”

inspector๊ฐ€ Pinpoint v3.0.0์—์„œ ์ƒˆ๋กœ์›Œ์กŒ์Šต๋‹ˆ๋‹ค.
์ดํ•˜ ์ƒˆ๋กœ์›Œ์ง„ inspector๋ฅผ 'New Inspector'์ด๋ผ๊ณ  ๋ถ€๋ฅด๊ณ  ๊ณผ๊ฑฐ์˜ inspector๋Š” 'Legacy Inspector'๋ผ๊ณ  ์นญํ•ฉ๋‹ˆ๋‹ค (Legacy Application Inspector).

New Inspector์—์„œ ์‚ฌ์šฉ์ž๊ฐ€ ๋ณด๋Š” ํ™”๋ฉด์€ ํฌ๊ฒŒ ๋‹ฌ๋ผ์ง„ ๊ฑด์€ ์—†์Šต๋‹ˆ๋‹ค.
๊ทธ๋Ÿฌ๋‚˜ ๋‚ด๋ถ€์ ์œผ๋กœ ๋งŽ์€ ๋ณ€ํ™”๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๋Š” ์ €์žฅ์†Œ๊ฐ€ HBase์—์„œ Pinot๋กœ ๋ณ€๊ฒฝ์ด ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. api๋ฅผ ์‰ฝ๊ฒŒ ํ™•์žฅํ•  ์ˆ˜ ์žˆ๊ณ , response๋ฅผ ๋ช…ํ™•ํ•œ ํ˜•์‹์œผ๋กœ ๊ฐœํŽธํ–ˆ์Šต๋‹ˆ๋‹ค.
์ฆ‰ inspector ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•˜๊ณ  ํ™•์žฅํ•˜๊ธฐ ์‰ฝ๊ฒŒ ๊ฐœ์„ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

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

2.1 Pinot์™€ Kafka ์ค€๋น„

Pinot์™€ Kafka๊ฐ€ ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด ์ด ์ค€๋น„ ๋‹จ๊ณ„๋Š” ๊ฑด๋„ˆ๋›ฐ์–ด๋„ ๋ฉ๋‹ˆ๋‹ค. ์•„์ง ์„ค์น˜ํ•˜์ง€ ์•Š์•˜๋‹ค๋ฉด New Inspector์šฉ topic๊ณผ table์„ ์ƒ์„ฑํ•˜๊ธฐ ์ „์— Pinot ์„ค์น˜ ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ Pinot์™€ Kafka๋ฅผ ์ค€๋น„ํ•ฉ๋‹ˆ๋‹ค.

2.2 Kafka topic ์ƒ์„ฑ

์•„๋ž˜ Kafka topic์„ ์ง€์ •๋œ partition ์ˆ˜๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ด partition ์ˆ˜๋Š” segmentPartitionConfig๋ฅผ ์‚ฌ์šฉํ•˜๋Š” Pinpoint ๊ธฐ๋ณธ Pinot table ์„ค์ •์˜ numPartitions ๊ฐ’๊ณผ ์ผ์น˜ํ•ฉ๋‹ˆ๋‹ค.

Kafka topic Pinot table partitions
inspector-stat-agent-00 inspectorStatAgent00 32
inspector-stat-app inspectorStatApp 64
text
$ bin/kafka-topics.sh --create --topic inspector-stat-agent-00 --partitions 32 --bootstrap-server ${YOUR_KAFKA_SERVER_ADDRESS}
$ bin/kafka-topics.sh --create --topic inspector-stat-app --partitions 64 --bootstrap-server ${YOUR_KAFKA_SERVER_ADDRESS}

2.3 Pinot table ์ƒ์„ฑ

  • ์•„๋ž˜ 2๊ฐœ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
    • inspectorStatAgent00: ์ด ํ…Œ์ด๋ธ”์€ agent inspector data๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ์Šคํฌ๋ฆฝํŠธ๋กœ ์ƒ์„ฑ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
    • inspectorStatApp: ์ด ํ…Œ์ด๋ธ”์€ application inspector data๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
  • table schema์™€ configuration์€ github repository๋ฅผ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”.

2.4 Pinpoint Collector, Web, Batch์˜ New Inspector ๊ธฐ๋Šฅ ํ™œ์„ฑํ™”

์•„๋ž˜ ์ปดํฌ๋„ŒํŠธ๋“ค์„ ๋™์ผํ•œ Pinot connection settings๋กœ ์„ค์ •ํ•˜๊ณ  ์‹คํ–‰ํ•œ๋‹ค:

  • Collector starter โ€” BASIC ๋˜๋Š” ALL ํƒ€์ž…์œผ๋กœ ์‹คํ–‰, New Inspector ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•œ๋‹ค.
  • Web starter โ€” Pinot์— ์ €์žฅ๋œ New Inspector ๋ฐ์ดํ„ฐ๋ฅผ ํ‘œ์‹œํ•œ๋‹ค.
  • Pinpoint Batch โ€” New Inspector ์•Œ๋žŒ์„ ์ฒ˜๋ฆฌํ•œ๋‹ค.
  • New Inspector ๊ธฐ๋Šฅ ์˜ต์…˜์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์œผ๋ฏ€๋กœ github repository์—์„œ ์ œ๊ณตํ•˜๋Š” ์„ค์ • ํŒŒ์ผ์—์„œ ๋ณ„๋„ ๊ธฐ๋Šฅ ์˜ต์…˜ ๋ณ€๊ฒฝ์€ ํ•„์š”ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
  • Pinpoint 3.0 ๋ฏธ๋งŒ๋ฒ„์ „์—์„œ 3.0.0 ์ด์ƒ๋ฒ„์ „์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ ์‹œ ์ผ๋ถ€ ์˜ต์…˜์ด ๋ˆ„๋ฝ๋˜๋Š”๊ฒฝ์šฐ ์•„๋ž˜ ๊ด€๋ จ ์˜ต์…˜ ์„ค๋ช…์„ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”.

3 Pinpoint ์ปดํฌ๋„ŒํŠธ์˜ ๊ด€๋ จ ์„ค์ •

  • ์•„๋ž˜ ์„ค์ •๋“ค์€ Pinpoint 3.0 ๋ฒ„์ „์—์„œ ๊ธฐ๋ณธ์ ์œผ๋กœ ์„ค์ •๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค.
  • Pinpoint ๋ฒ„์ „์„ 3.0์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•˜๋Š”๊ฒฝ์šฐ ์ผ๋ถ€ ์„ค์ •์ด ๋ˆ„๋ฝ๋˜๋Š” ๊ฒฝ์šฐ ์ฐธ๊ณ ํ•˜๊ธฐ ์œ„ํ•ด์„œ ์„ค์ •์„ ๋ช…์‹œํ•ด๋†“์Šต๋‹ˆ๋‹ค.

Pinpoint Collector

  • collector-starter ๋ชจ๋‘˜์˜ application.yml ํŒŒ์ผ:
text
pinpoint:
  modules:
    collector:
      inspector:
        enabled: true

Pinpoint Web

  • web-starter ๋ชจ๋“ˆ์˜ application.yml ํŒŒ์ผ:
text
pinpoint:
  modules:
    web:
      inspector:
        enabled: true

Pinpoint Batch

  • batch ๋ชจ๋“ˆ์˜ batch-root.properties ํŒŒ์ผ:
text
alarm.collector.version=2

4 Q&A

A HBase์— ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๋Š” Legacy Inspector๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋‚˜์š”?

๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ 3.0.1 ๋ฒ„์ „ ์ด์ƒ ๋ถ€ํ„ฐ๋Š” Legacy Inspector๋ฅผ ์‚ญ์ œํ•  ์˜ˆ์ •์ด๋ฏ€๋กœ Pinpoint ๋ฒ„์ „์ด ์˜ฌ๋ผ๊ฐˆ์ˆ˜๋ก ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ• ์ˆ˜ ์—†์œผ๋ฏ€๋กœ New Inspector๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.
๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด Pinpoint ์ปดํฌ๋„ŒํŠธ๋“ค์— ์•„๋ž˜ ์„ค์ •์„ ์ถ”๊ฐ€ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.

collector-starter ํ”„๋กœ์ ํŠธ์˜ application.yml ํŒŒ์ผ์ด๋‚˜ java vm option์— ์•„๋ž˜ ์„ค์ •์„ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.

  • application.yml
text
pinpoint:
  modules:
    collector:
      inspector:
        hbase:
          enabled: true
  • java vm option
text
-Dpinpoint.modules.collector.inspector.hbase.enabled=true

batch ํ”„๋กœ์ ํŠธ์—์„œ batch-root.properties ํŒŒ์ผ์ด๋‚˜ java vm option์— ์•„๋ž˜ ์„ค์ •์„ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.

  • batch-root.properties
text
alarm.collector.version=1
  • java vm option
text
-Dalarm.collector.version=1

B ์‚ฌ์šฉ์ž์—๊ฒŒ ์ œ๊ณต๋˜๋Š” ๊ธฐ๋Šฅ์€ ๋น„์Šทํ•œ๋ฐ Pinot๊ธฐ๋ฐ˜์œผ๋กœ inspector๋ฅผ ๊ฐœ์„ ํ•œ ์ด์œ ๋Š” ๋ญ˜๊นŒ์š”?

๋‹ค์–‘ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ๋น ๋ฅด๊ฒŒ ์ €์žฅํ•˜๊ณ  ํ™•์ธํ•˜๊ณ  ์œ„ํ•ด์„œ Pinot๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๋„๋ก ๊ฐœ์„ ๋˜์—ˆ๊ณ 
์•„์ง ๋ถ€์กฑํ•œ ๊ธฐ๋Šฅ์ด ๋งŽ์ง€๋งŒ Pinot์˜ ๋ฐœ์ „์— ๋งž์ถฐ์„œ ๊ธฐ๋Šฅ์„ ๋ณด์™„ํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

C inspector-stat-agent ํ…Œ์ด๋ธ”์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ๋งŽ์•„์„œ ์ฝ๊ธฐ ์†๋„๊ฐ€ ๋А๋ ค์ง‘๋‹ˆ๋‹ค.

์—ฌ๋Ÿฌ ๊ฐœ์˜ ์ฒด์ด๋ธ”์— ๋ฐ์ดํ„ฐ๋ฅผ ๋‚˜๋ˆ„์–ด ์ €์žฅํ•ด์„œ ์„ฑ๋Šฅ ํ–ฅ์ƒ์„ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
์•„๋ž˜๋ฅผ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ผ ์ „์ฒด N ๊ฐœ์˜ Pinot table๊ณผ Kafka topic์„ ์ƒ์„ฑํ•˜๊ณ , Pinpoint ์ปดํฌ๋„ŒํŠธ๋“ค์— ์„ค์ •์„ ์ถ”๊ฐ€ํ•ด์„œ data๋ฅผ ์ˆ˜์ง‘/์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.

Kafka topic ์ƒ์„ฑ

  • N๊ฐœ Kafka topic์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. (00์—์„œ N-1๊นŒ์ง€)
  • topic์˜ ํ˜•์‹์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.
    • inspector-stat-agent-00
    • inspector-stat-agent-01
    • ...
    • inspector-stat-agent-99

Pinot table ์ƒ์„ฑ

  • N๊ฐœ Pinot table์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. (00์—์„œ N-1๊นŒ์ง€)
  • table name๊ณผ schema name์˜ ํ˜•์‹์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.
    • insepctorStatAgent00
    • insepctorStatAgent01
    • ...
    • insepctorStatAgent99

collector-starter ๋ชจ๋“ˆ์˜ application.yml ํŒŒ์ผ์ด๋‚˜ java vm option์— ์•„๋ž˜ ์„ค์ •์„ ์ถ”๊ฐ€ํ•ด ์ฃผ์„ธ์š”.

  • application.yml
text
kafka:
  inspector:
    agent:
      table:
        count: N
  • java vm option
text
-Dkafka.inspector.agent.topic.count=N

web-starter ๋ชจ๋“ˆ์˜ application.yml ํŒŒ์ผ์ด๋‚˜ java vm option์— ์•„๋ž˜ ์„ค์ •์„ ์ถ”๊ฐ€ํ•ด ์ฃผ์„ธ์š”.

  • application.yml
text
pinot:
  inspector:
    agent:
      table:
        count: N
  • java vm option
text
-Dpinot.inspector.agent.topic.count=N

batch ๋ชจ๋“ˆ์˜ batch-root.properties ํŒŒ์ผ์ด๋‚˜ java vm option์— ์•„๋ž˜ ์„ค์ •์„ ์ถ”๊ฐ€ํ•ด ์ฃผ์„ธ์š”.

  • batch-root.properties
text
job.alarm.agent.inspector.stat.table.count=N
  • java vm option
text
-Djob.alarm.agent.inspector.stat.table.count=N

File: documents/otel_metric.md

โš  This document is currently being written.


English | ํ•œ๊ตญ์–ด

OpenTelemetry Metric

1. Overview

Pinpoint provides OpenTelemetry metric ingestion via HTTP. Send metric data in OpenTelemetry format to Pinpoint Collector, and view the data through Pinpoint Web.

OpenTelemetry is an open-source framework for tracking and monitoring application performance and health.


2. Prerequisites

  • Apache Pinot and Kafka must be installed. If they are already installed, you can skip this setup step. Otherwise, see Pinot installation.
  • Pinpoint Collector must be installed and deployed.
  • Pinpoint Web must be installed and deployed.
  • MySQL must be installed.

3. Storage Configuration (Apache Pinot)

You need to create tables in Apache Pinot to store OTel metric data.

3.1 Pinot and Kafka Setup

If Pinot and Kafka are already installed, you can skip this setup step. Otherwise, set them up by following the Pinot installation guide before creating OTel Metric topics and tables.

3.2 Create Kafka Topics

Create 3 topics with the names below:

  • otlp-metric-double-00
  • otlp-metric-long-00
  • otlp-metric-metadata

3.3 Create Pinot Tables

For realtime tables, create the Kafka topics referenced by the table configuration before creating the Pinot tables.

Three tables are required.

Table Purpose
otlpMetricDouble Stores double-type metric values
otlpMetricLong Stores long-type metric values
otlpMetricMetadata Stores metric metadata

Schema and table configuration files are located in the otlpmetric/pinot-tables/ directory.

File Description
pinot-otlpmetric-double-schema.json Double table schema
pinot-otlpmetric-long-schema.json Long table schema
pinot-otlpmetric-metadata-schema.json Metadata table schema
pinot-otlpmetric-double-realtime-table.json Double realtime table config
pinot-otlpmetric-long-realtime-table.json Long realtime table config
pinot-otlpmetric-metadata-realtime-table.json Metadata realtime table config
pinot-otlpmetric-double-offline-table.json Double offline table config
pinot-otlpmetric-long-offline-table.json Long offline table config

3.4 Data Retention

Default retention is defined in the table configuration files. You can adjust it in the Pinot table settings as needed.


4. MySQL Configuration

You need to create a table in MySQL to store dashboard definition data.

The SQL file is located at otlpmetric/otlpmetric-web/src/main/resources/sql/CreateTableStatement-mysql.sql.

sql
CREATE TABLE `application_metric_definition` (
     `application_name` VARCHAR(255) NOT NULL,
     `metric_definition` text NOT NULL,
     `schema_version` int(10) NOT NULL,
     PRIMARY KEY (`application_name`)
);

5. Collector Configuration

OTel metric ingestion is enabled by default.

Configure and run the collector starter with METRIC or ALL type.

Running with METRIC or ALL type starts an HTTP server on port 9995, receiving metric data at the POST /opentelemetry endpoint.


6. Web Configuration

Configure and run the web starter.
OTel metric viewing is enabled by default. When you run Web, the OpenTelemetry menu item appears in the left sidebar.


7. Client Setup

This example uses Micrometer, a library that sends metrics in OpenTelemetry format.

7.1 Add Dependency

xml
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-otlp</artifactId>
    <version>1.13.3</version>
</dependency>

7.2 application.yml Configuration

Add the following configuration to send Micrometer metric data in OpenTelemetry format.

yaml
management:
  otlp:
    metrics:
      export:
        enabled: true
        step: 30s
        batch-size: 10000
        url: http://<your-collector-host>:9995/opentelemetry
  opentelemetry:
    resource-attributes:
      service.name: ${pinpoint.applicationName}
      pinpoint.agentId: ${pinpoint.agentId}

resource-attributes

  • service.name: Set this to your Pinpoint applicationName.
  • pinpoint.agentId: Set this to your Pinpoint agentId.

7.3 Micrometer Guide


8. Metric Dashboard

Unlike other metric pages, you need to build the dashboard yourself.

8.1 Define Metrics

Step 1: Select Application

Select an application at the top and click the 'Create a new metric' button to add a metric.

Step 2: Define Metric

Data Configuration

Define a metric by matching the stored metric data's metricGroupName, metricName, field, and tag.

Tags and fields have an N:N relationship. Select one primary search condition from either tag or field first, then select the remaining as multiple values.

Graph Configuration

Define how the graph should be displayed.

The stack option allows you to view data values stacked on top of each other.

8.2 Adjust Metric Position and Size

Added metrics can be repositioned and resized.

Click a metric to move its position. Click the bottom-right corner to resize.

8.3 Save Timing

Dashboard definitions are saved each time a metric is added.

When the 'Save Dashboard' button in the upper right blinks, it means the dashboard definition has changed and needs to be saved.


9. Dashboard Example


10. Notes

  • The OpenTelemetry feature is in beta; page layout and features may change.
  • Libraries other than Micrometer may require additional testing and improvements.

1. OpenTelemetry Metric ๊ธฐ๋Šฅ์ด๋ž€?

1. ๊ฐœ์š”

OpenTelemetry metric ๋ฐ์ดํ„ฐ๋ฅผ HTTP ๋ฐฉ์‹์œผ๋กœ Pinpoint Collector์— ์ „์†กํ•˜๋ฉด, Pinpoint Web์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

OpenTelemetry๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์„ฑ๋Šฅ๊ณผ ์ƒํƒœ๋ฅผ ์ถ”์ ํ•˜๊ณ  ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๊ธฐ ์œ„ํ•œ ์˜คํ”ˆ์†Œ์Šค ํ”„๋ ˆ์ž„์›Œํฌ์ž…๋‹ˆ๋‹ค.


2. ์‚ฌ์ „ ์กฐ๊ฑด

  • Apache Pinot์™€ Kafka๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด ์ด ์ค€๋น„ ๋‹จ๊ณ„๋Š” ๊ฑด๋„ˆ๋›ฐ์–ด๋„ ๋ฉ๋‹ˆ๋‹ค. ์•„์ง ์„ค์น˜ํ•˜์ง€ ์•Š์•˜๋‹ค๋ฉด Pinot ์„ค์น˜๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.
  • Pinpoint Collector๊ฐ€ ์„ค์น˜ ๋ฐ ๋ฐฐํฌ๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • Pinpoint Web์ด ์„ค์น˜ ๋ฐ ๋ฐฐํฌ๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • MySQL์ด ์„ค์น˜๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

3. ์Šคํ† ๋ฆฌ์ง€ ์„ค์ • (Apache Pinot)

OTel metric ๋ฐ์ดํ„ฐ ์ €์žฅ์„ ์œ„ํ•ด Apache Pinot์— ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

3.1 Pinot์™€ Kafka ์ค€๋น„

Pinot์™€ Kafka๊ฐ€ ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด ์ด ์ค€๋น„ ๋‹จ๊ณ„๋Š” ๊ฑด๋„ˆ๋›ฐ์–ด๋„ ๋ฉ๋‹ˆ๋‹ค. ์•„์ง ์„ค์น˜ํ•˜์ง€ ์•Š์•˜๋‹ค๋ฉด OTel Metric์šฉ topic๊ณผ table์„ ์ƒ์„ฑํ•˜๊ธฐ ์ „์— Pinot ์„ค์น˜ ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ Pinot์™€ Kafka๋ฅผ ์ค€๋น„ํ•ฉ๋‹ˆ๋‹ค.

3.2 Kafka topic ์ƒ์„ฑ

์•„๋ž˜ 3๊ฐœ topic์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

  • otlp-metric-double-00
  • otlp-metric-long-00
  • otlp-metric-metadata

3.3 Pinot table ์ƒ์„ฑ

realtime table์€ Pinot table์„ ์ƒ์„ฑํ•˜๊ธฐ ์ „์— table ์„ค์ •์—์„œ ์ฐธ์กฐํ•˜๋Š” Kafka topic์„ ๋จผ์ € ์ƒ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ด 3๊ฐœ์˜ ํ…Œ์ด๋ธ”์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

ํ…Œ์ด๋ธ” ์šฉ๋„
otlpMetricDouble double ํƒ€์ž… metric ๊ฐ’ ์ €์žฅ
otlpMetricLong long ํƒ€์ž… metric ๊ฐ’ ์ €์žฅ
otlpMetricMetadata metric ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ์ €์žฅ

์Šคํ‚ค๋งˆ ๋ฐ ํ…Œ์ด๋ธ” ์„ค์ • ํŒŒ์ผ์€ ์†Œ์Šค์ฝ”๋“œ์˜ otlpmetric/pinot-tables/ ๋””๋ ‰ํ† ๋ฆฌ์— ์žˆ์Šต๋‹ˆ๋‹ค.

ํŒŒ์ผ ์„ค๋ช…
pinot-otlpmetric-double-schema.json double ํ…Œ์ด๋ธ” ์Šคํ‚ค๋งˆ
pinot-otlpmetric-long-schema.json long ํ…Œ์ด๋ธ” ์Šคํ‚ค๋งˆ
pinot-otlpmetric-metadata-schema.json metadata ํ…Œ์ด๋ธ” ์Šคํ‚ค๋งˆ
pinot-otlpmetric-double-realtime-table.json double realtime ํ…Œ์ด๋ธ” ์„ค์ •
pinot-otlpmetric-long-realtime-table.json long realtime ํ…Œ์ด๋ธ” ์„ค์ •
pinot-otlpmetric-metadata-realtime-table.json metadata realtime ํ…Œ์ด๋ธ” ์„ค์ •
pinot-otlpmetric-double-offline-table.json double offline ํ…Œ์ด๋ธ” ์„ค์ •
pinot-otlpmetric-long-offline-table.json long offline ํ…Œ์ด๋ธ” ์„ค์ •

3.4 Data Retention

๊ธฐ๋ณธ retention์€ ํ…Œ์ด๋ธ” ์„ค์ • ํŒŒ์ผ์— ์ •์˜๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ํ•„์š”์— ๋”ฐ๋ผ Pinot ํ…Œ์ด๋ธ” ์„ค์ •์—์„œ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.


4. MySQL ์„ค์ •

๋Œ€์‹œ๋ณด๋“œ ์ •์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๊ธฐ ์œ„ํ•ด MySQL์— ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

SQL ํŒŒ์ผ์€ ์†Œ์Šค์ฝ”๋“œ์˜ otlpmetric/otlpmetric-web/src/main/resources/sql/CreateTableStatement-mysql.sql์— ์žˆ์Šต๋‹ˆ๋‹ค.

sql
CREATE TABLE `application_metric_definition` (
     `application_name` VARCHAR(255) NOT NULL,
     `metric_definition` text NOT NULL,
     `schema_version` int(10) NOT NULL,
     PRIMARY KEY (`application_name`)
);

5. Collector ์„ค์ •

OTel metric ์ˆ˜์‹  ๊ธฐ๋Šฅ์€ ๊ธฐ๋ณธ์œผ๋กœ ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

collector starter๋ฅผ METRIC ๋˜๋Š” ALL ํƒ€์ž…์œผ๋กœ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

METRIC ๋˜๋Š” ALL ํƒ€์ž…์œผ๋กœ ์‹คํ–‰ํ•˜๋ฉด ํฌํŠธ 9995์—์„œ HTTP ์„œ๋ฒ„๊ฐ€ ์‹œ์ž‘๋˜๋ฉฐ, POST /opentelemetry ์—”๋“œํฌ์ธํŠธ๋กœ metric ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์‹ ํ•ฉ๋‹ˆ๋‹ค.


6. Web ์„ค์ •

web starter๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.
OTel metric ์กฐํšŒ ๊ธฐ๋Šฅ์€ ๊ธฐ๋ณธ์œผ๋กœ ํ™œ์„ฑํ™”๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. Web์„ ์‹คํ–‰ํ•˜๋ฉด ์ขŒ์ธก ๋ฉ”๋‰ด์— OpenTelemetry ํ•ญ๋ชฉ์ด ๋…ธ์ถœ๋ฉ๋‹ˆ๋‹ค.


7. ํด๋ผ์ด์–ธํŠธ ์„ค์ •

OpenTelemetry ์ŠคํŽ™์œผ๋กœ metric์„ ์ „์†กํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ค‘ Micrometer๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ metric์„ ์ „์†กํ•˜๋Š” ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค.

7.1 dependency ์ถ”๊ฐ€

xml
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-otlp</artifactId>
    <version>1.13.3</version>
</dependency>

7.2 application.yml ์„ค์ •

Micrometer metric ๋ฐ์ดํ„ฐ๋ฅผ OpenTelemetry ํ˜•ํƒœ๋กœ ์ „์†ก๋˜๋„๋ก ์„ค์ •์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

yaml
management:
  otlp:
    metrics:
      export:
        enabled: true
        step: 30s
        batch-size: 10000
        url: http://<your-collector-host>:9995/opentelemetry
  opentelemetry:
    resource-attributes:
      service.name: ${pinpoint.applicationName}
      pinpoint.agentId: ${pinpoint.agentId}

resource-attributes ์„ค์ •

  • service.name์—๋Š” Pinpoint์˜ applicationName์„ ๋„ฃ์œผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
  • pinpoint.agentId์—๋Š” Pinpoint์˜ agentId์„ ๋„ฃ์œผ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

7.3 Micrometer ๊ฐ€์ด๋“œ


8. Metric ๋Œ€์‹œ๋ณด๋“œ

๋‹ค๋ฅธ metric ํŽ˜์ด์ง€๋“ค๊ณผ ๋‹ค๋ฅด๊ฒŒ ๋Œ€์‹œ๋ณด๋“œ๋ฅผ ์ง์ ‘ ๊ตฌ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

8.1 metric ์ •์˜

step 1 : application ์„ ํƒ

์ƒ๋‹จ์˜ application์„ ์„ ํƒํ•˜๊ณ  'Create a new metric' ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ metric์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

step 2 : metric ์ •์˜

Data configuration ์˜์—ญ

์ €์žฅ๋œ metric ๋ฐ์ดํ„ฐ์˜ metricGroupName, metricName, field, tag๋ฅผ ๋งค์นญ์‹œ์ผœ์„œ metric์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.

tag, field๋Š” N:N ๊ด€๊ณ„๋ฅผ ๊ฐ–๊ณ  ์žˆ๊ณ , tag, field ์ค‘์— ์šฐ์„ ์‹œ ๋˜๋Š” ๊ฒ€์ƒ‰ ์กฐ๊ฑด์„ ๋จผ์ € ํ•˜๋‚˜ ์„ ํƒํ•˜๊ณ  ๋‚˜๋จธ์ง€๋ฅผ ๋‹ค์ค‘์œผ๋กœ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Graph configuration ์˜์—ญ

graph๋ฅผ ์–ด๋–ค ํ˜•ํƒœ๋กœ ์ถœ๋ ฅํ• ์ง€ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.

stack ์˜ต์…˜์€ ์ถœ๋ ฅ๋˜๋Š” ๋ฐ์ดํ„ฐ์˜ ์ˆ˜์น˜๊ฐ’์„ stack ํ˜•ํƒœ๋กœ ๊ฐ’์„ ์Œ“์•„์„œ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

8.2 ๋ฉ”ํŠธ๋ฆญ ์œ„์น˜, ํฌ๊ธฐ ์กฐ์ ˆ

์ถ”๊ฐ€๋œ metric์€ ์œ„์น˜ ํฌ๊ธฐ ์กฐ์ ˆ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

๋ฉ”ํŠธ๋ฆญ์„ ํด๋ฆญํ•˜์—ฌ ์œ„์น˜๋ฅผ ์˜ฎ๊ธธ ์ˆ˜ ์žˆ๊ณ , ์˜ค๋ฅธ์ชฝ ํ•˜๋‹จ์„ ํด๋ฆญํ•˜๋ฉด ํฌ๊ธฐ๋ฅผ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

8.3 ์ €์žฅ ํƒ€์ด๋ฐ

๋ฉ”ํŠธ๋ฆญ์„ ์ถ”๊ฐ€ํ•  ๋•Œ๋งˆ๋‹ค dashboard์˜ ์ •์˜ ๋‚ด์šฉ์€ ์ €์žฅ๋ฉ๋‹ˆ๋‹ค.

์˜ค๋ฅธ์ชฝ ์ƒ๋‹จ์˜ save dashboard ๋ฒ„ํŠผ์ด ๊นœ๋นก์ด๋ฉด dashboard ์ •์˜ ๊ฐ’์ด ๋ณ€๊ฒฝ๋˜์–ด ์ €์žฅ์ด ํ•„์š”ํ•˜๋‹ค๋Š” ๋œป์ž…๋‹ˆ๋‹ค.


9. ๋Œ€์‹œ๋ณด๋“œ ์˜ˆ์‹œ


10. ์ฐธ๊ณ ์‚ฌํ•ญ

  • OpenTelemetry ๊ธฐ๋Šฅ์€ beta๋ผ ํŽ˜์ด์ง€ ๊ตฌ์„ฑ๊ณผ ๊ธฐ๋Šฅ์ด ๋ณ€๊ฒฝ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • Micrometer ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์™ธ์— ๋‹ค๋ฅธ ์ˆ˜์ง‘ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” ํ…Œ์ŠคํŠธ ๋ฐ ๊ฐœ์„ ์ด ํ•„์š”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

File: documents/per-request_feature_guide.md


Separate Logging Per Request

ENGLISH GUIDE

Per-request logging

1. Description

Pinpoint saves additional information(transactionId, spanId) in log messages to classify them by request.

When tomcat processes multiple requests concurrently, we can see log files printed in chronological order. But we can not classify them by each request. For example when an exception message is logged, we can not easily identify all the logs related to the request that threw the exception.

Pinpoint is able to classify logs by requests by storing additional information(transactionId, spanId) in MDC of each request. The transactionId printed in the log message is the same as the transactionId in Pinpoint Webโ€™s Transaction List view.

Letโ€™s take a look at a more specific example. The log below is from an exception that occurred without using Pinpoint. As you can see, it is hard to identify the logs related to the request that threw the exception. ex) Without Pinpoint

text
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76 ) get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123 ) get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) get content name : SPORTS
2015-04-04 14:35:20 [INFO](ContentInfoCollector:25 ) get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:56 ) get content name : NATIONAL
2015-04-04 14:35:20 [INFO](ContentInfoCollector:34 ) get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoService:55 ) check authorization of user
2015-04-04 14:35:20 [INFO](ContentInfoService:14 ) get title of content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14 ) execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114 ) execute query ...    
2015-04-04 14:35:20 [INFO](ContentInfoService:74 ) get top linking for content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14 ) execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114 ) execute query ...
2015-04-04 14:35:22 [INFO](ContentDAOImpl:186 ) execute query ...
2015-04-04 14:35:22 [ERROR]ContentDAOImpl:158 )
     com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
          at example.ContentDAO.executequery(ContentDAOImpl.java:152)
          ...
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787)
          ...
     Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
     Communications link failure The last packet sent successfully to the server was 0 milliseconds ago.
     The driver has not received any packets from the server.    
          at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2181)
          ... 12 more
     Caused by: java.net.ConnectException: Connection refused
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)   
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)   
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)   
          at java.net.Socket.connect(Socket.java:529)    
          ...13 more
2015-04-04 14:35:22 [INFO](ContentDAO:145 ) execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:38 ) update hits for content
2015-04-04 14:35:20 [INFO](ContentInfoService:89 ) check of user
2015-04-04 14:35:24 [INFO](ContentDAO:146 ) execute query ...
2015-04-04 14:35:25 [INFO](ContentDAO:123 ) execute query ...

Pinpoint classifies logs by requests by storing additional information(transactionId, spanId) in MDC of each request. ex) With Pinpoint

text
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76) [txId : agent^14252^17 spanId : 1224] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123) [txId : agent^142533^18 spanId : 1231] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) [txId : agent^142533^19 spanId : 1246] get content name : SPORTS
2015-04-04 14:35:20 [INFO](ContentInfoCollector:25) [txId : agent^142533^20 spanId : 1263] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:56) [txId : agent^142533^21 spanId : 1265] get content name : NATIONAL
2015-04-04 14:35:20 [INFO](ContentInfoCollector:34) [txId : agent^142533^22 spanId : 1278] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoService:55) [txId : agent^14252^18 spanId : 1231] check authorization of user
2015-04-04 14:35:20 [INFO](ContentInfoService:14) [txId : agent^14252^17 spanId : 1224] get title of content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14) [txId : agent^14252^17 spanId : 1224] execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114) [txId : agent^142533^19 spanId : 1246] execute query ...    
2015-04-04 14:35:20 [INFO](ContentInfoService:74) [txId : agent^14252^17 spanId : 1224] get top linking for content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14) [txId : agent^142533^18 spanId : 1231] execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114) [txId : agent^142533^21 spanId : 1265] execute query ...
2015-04-04 14:35:22 [INFO](ContentDAOImpl:186) [txId : agent^142533^22 spanId : 1278] execute query ...
2015-04-04 14:35:22 [ERROR](ContentDAOImpl:158) [txId : agent^142533^18 spanId : 1231]
     com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
          at com.pinpoint.example.dao.ContentDAO.executequery(ContentDAOImpl.java:152)
          ...
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787)   
          ...
     Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
     Communications link failure The last packet sent successfully to the server was 0 milliseconds ago.
     The driver has not received any packets from the server.
          ...
          at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2181)
          ... 12 more
     Caused by: java.net.ConnectException: Connection refused
          at java.net.PlainSocketImpl.socketConnect(Native Method)   
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
          at java.net.Socket.connect(Socket.java:529)
          ... 13 more
2015-04-04 14:35:22 [INFO](ContentDAO:145) [txId : agent^14252^17 spanId : 1224] execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:38) [txId : agent^142533^19 spanId : 1246] update hits for content
2015-04-04 14:35:20 [INFO](ContentInfoService:89) [txId : agent^142533^21 spanId : 1265] check of user
2015-04-04 14:35:24 [INFO](ContentDAO:146) [txId : agent^142533^22 spanId : 1278] execute query ...
2015-04-04 14:35:25 [INFO](ContentDAO:123) [txId : agent^14252^17 spanId : 1224] execute query ...

The transactionId printed in the log message is the same as the transactionId in Pinpoint Webโ€™s Transaction List view.

2. How to configure

2-1 Pinpoint agent configuration

To enable this feature, set the logging property corresponding to the logging library in use to true in pinpoint.config. For example,

ex) pinpoint.config when using log4j

text
###########################################################
# log4j
###########################################################
profiler.log4j.logging.transactioninfo=true

ex) pinpoint.config when using log4j2

text
###########################################################
# log4j2 
###########################################################
profiler.log4j2.logging.transactioninfo=true

ex) pinpoint.config when using logback

text
###########################################################
# logback
###########################################################
profiler.logback.logging.transactioninfo=true

2-2 log4j, log4j2, logback configuration

Change the log message format to print the transactionId, and spanId saved in MDC.

ex) log4j : log4j.xml

markup
Before
<appender name = "console" class= "org.apache.log4j.ConsoleAppender" >
     <layout class = "org.apache.log4j.EnhancedPatternLayout">
          <param name = "ConversionPattern" value= "%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) %m%n" />
     </layout >
</appender >

After
<appender name = "console" class= "org.apache.log4j.ConsoleAppender" >
     <layout class = "org.apache.log4j.EnhancedPatternLayout">
          <param name = "ConversionPattern" value= "%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) [TxId : %X{PtxId} , SpanId : %X{PspanId}] %m%n" />
        </layout >
</appender >

ex) log4j2 - log4j2.xml

markup
Before
<appender>
     <console name="STDOUT" target="SYSTEM_OUT">
          <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) %m%n""/>
     </console>
<appender>

After
<appender>
     <console name="STDOUT" target="SYSTEM_OUT">
          <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) [TxId : %X{PtxId} , SpanId : %X{PspanId}] %m%n""/>
     </console>
<appender>

ex) logback : logback.xml

markup
Before
<appender name = "STDOUT" class= "ch.qos.logback.core.ConsoleAppender" >
     <layout class = "ch.qos.logback.classic.PatternLayout">
          <Pattern >%d{HH:mm} %-5level %logger{36} - %msg%n</Pattern >
     </layout >
</appender >

After
<appender name = "STDOUT" class= "ch.qos.logback.core.ConsoleAppender" >
     <layout class = "ch.qos.logback.classic.PatternLayout">
          <Pattern >%d{HH:mm} %-5level %logger{36} - [TxId : %X{PtxId} , SpanId : %X{PspanId}] %msg%n</Pattern >
     </layout >
</appender >

2-3 Checking log message

If the per-request logging is correctly configured, the transactionId, and spanId are printed in the log file.

text
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76 ) [txId : agent^14252^17 spanId : 1224] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123 ) [txId : agent^142533^18 spanId : 1231] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) [txId : agent^142533^19 spanId : 1246] get content name : SPORTS

3. expose log in Pinpoint web

If you want to add links to the logs in the transaction list view, you should configure and implement the logic as below. Pinpoint Web only adds link buttons - you should implement the logic to retrieve the log message.

If you want to expose your agentโ€™s log messages, please follow the steps below.

step 1 You should implement a controller that receives transactionId, spanId, transaction_start_time as parameters and retrieve the logs yourself. We do not yet provide a way to retrieve the logs.

example)

java
@RestController
public class Nelo2LogController {

    @RequestMapping(value = "/????")
    public String NeloLogForTransactionId(@RequestParam (value= "transactionId", required=true) String transactionId,
                                            @RequestParam(value= "spanId" , required=false) String spanId,
                                            @RequestParam(value="time" , required=true) long time ) {

          // you should implement the logic to retrieve your agentโ€™s logs.
    }

step 2 In pinpoint-web.properties file, set log.enable to true, and log.page.url to the url of the controller above. The value set in log.button.name will show up as the button text in the Web UI.

text
log.enable= true
log.page.url=XXXX.pinpoint
log.button.name= log

step 3 Pinpoint 1.5.0 or later, we improve button to decided enable/disable depending on whether or not being logged. You should implement interceptor for using logging appender to add logic whether or not being logged. you also should create plugin for logging appender internally. Please refer to Pinpoint Profiler Plugin Sample(Link). Location added logic of interceptor is method to log for data of LoggingEvent in appender class. you should review your appender class and find method. This is interceptor example.

text
public class AppenderInterceptor implements AroundInterceptor0 {

    private final TraceContext traceContext;

    public AppenderInterceptor(TraceContext traceContext) {
        this.traceContext = traceContext;
    }

    @Override
    public void before(Object target) {
        Trace trace = traceContext.currentTraceObject();

        if (trace != null) {
            SpanRecorder recorder = trace.getSpanRecorder();
            recorder.recordLogging(LoggingInfo.LOGGED);
        }
    }

    @IgnoreMethod
    @Override
    public void after(Object target, Object result, Throwable throwable) {

    }
}

If those are correctly configured, the buttons are added in the transaction list view.

For details in how the log buttons are generated, please refer to Pinpoint Webโ€™s BusinessTransactionController and ScatterChartController.

ํ•œ๊ตญ์–ด ๊ฐ€์ด๋“œ

Per-request logging

1. ๊ธฐ๋Šฅ ์„ค๋ช…

Pinpoint์—์„œ๋Š” log message๋ฅผ request ๋‹จ์œ„๋กœ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๋„๋ก log message ์— ์ถ”๊ฐ€์ •๋ณด๋ฅผ ์ €์žฅํ•ด์ค€๋‹ค.

๋‹ค์ˆ˜์˜ ์š”์ฒญ์„ ์ฒ˜๋ฆฌํ•˜๋Š” tomcat์„ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ ๋กœ๊ทธ ํŒŒ์ผ์„ ๋ณด๋ฉด ์‹œ๊ฐ„์ˆœ์œผ๋กœ ์ถœ๋ ฅ๋œ ๋กœ๊ทธ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ๋™์‹œ์— ์š”์ฒญ๋œ ๋‹ค์ˆ˜์˜ request ๊ฐ๊ฐ์— ๋Œ€ํ•œ ๋กœ๊ทธ๋ฅผ ๊ตฌ๋ถ„ ํ•ด์„œ ๋ณผ ์ˆ˜ ์—†๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ๋กœ๊ทธ์—์„œ exception message๊ฐ€ ์ถœ๋ ฅ๋์„ ๋•Œ ๊ทธ exception์ด ๋ฐœ์ƒํ•œ request์˜ ๋ชจ๋“  log๋ฅผ ํ™•์ธํ•˜๊ธฐ ํž˜๋“ค๋‹ค.

Pinpoint๋Š” log message ๋งˆ๋‹ค request์™€ ์—ฐ๊ด€๋œ ์ •๋ณด(transactionId, spanId)๋ฅผ MDC์— ๋„ฃ์–ด์ค˜์„œ request ๋‹จ์œ„๋กœ log message๋ฅผ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ค€๋‹ค. ๋กœ๊ทธ์— ์ถœ๋ ฅ๋œ transactionId๋Š” pinpoint web์˜ transaction List ํ™”๋ฉด์— ์ถœ๋ ฅ๋œ transactionId์™€ ์ผ์น˜ํ•œ๋‹ค.

๊ตฌ์ฒด์ ์œผ๋กœ ์˜ˆ๋ฅผ ๋“ค์–ด๋ณด์ž. Pinpoint๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•˜์„ ๋•Œ exception์ด ๋ฐœ์ƒํ–ˆ์„ ๊ฒฝ์šฐ ๋กœ๊ทธ ๋ฉ”์‹œ์ง€๋ฅผ ์‚ดํŽด ๋ณด์ž. ์š”์ฒญ๋œ ๋‹ค์ˆ˜์˜ request ๊ฐ๊ฐ์„ ๊ตฌ๋ถ„ํ•˜์—ฌ ๋กœ๊ทธ๋ฅผ ํ™•์ธํ•  ์ˆ˜๊ฐ€ ์—†๋‹ค.

ex) Without Pinpoint

text
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76 ) get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123 ) get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) get content name : SPORTS
2015-04-04 14:35:20 [INFO](ContentInfoCollector:25 ) get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:56 ) get content name : NATIONAL
2015-04-04 14:35:20 [INFO](ContentInfoCollector:34 ) get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoService:55 ) check authorization of user
2015-04-04 14:35:20 [INFO](ContentInfoService:14 ) get title of content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14 ) execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114 ) execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:74 ) get top linking for content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14 ) execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114 ) execute query ...
2015-04-04 14:35:22 [INFO](ContentDAOImpl:186 ) execute query ...
2015-04-04 14:35:22 [ERROR]ContentDAOImpl:158 )
     com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
          at example.ContentDAO.executequery(ContentDAOImpl.java:152)
          ...
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787)
          ...
     Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
     Communications link failure The last packet sent successfully to the server was 0 milliseconds ago.
     The driver has not received any packets from the server.
          at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2181)
          ... 12 more
     Caused by: java.net.ConnectException: Connection refused
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
          at java.net.Socket.connect(Socket.java:529)
          ...13 more
2015-04-04 14:35:22 [INFO](ContentDAO:145 ) execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:38 ) update hits for content
2015-04-04 14:35:20 [INFO](ContentInfoService:89 ) check of user
2015-04-04 14:35:24 [INFO](ContentDAO:146 ) execute query ...
2015-04-04 14:35:25 [INFO](ContentDAO:123 ) execute query ...

Pinpoint๋Š” ๋กœ๊ทธ ๋ฉ”์„ธ์ง€ ๋งˆ๋‹ค request์™€ ์—ฐ๊ด€๋œ ์ •๋ณด(transactionId, spanId)๋ฅผ MDC์— ๋„ฃ์–ด์ค˜์„œ request ๋‹จ์œ„๋กœ log message๋ฅผ ๊ตฌ๋ถ„์‹œ์ผœ ์ค€๋‹ค.

ex) With Pinpoint

text
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76) [txId : agent^14252^17 spanId : 1224] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123) [txId : agent^142533^18 spanId : 1231] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) [txId : agent^142533^19 spanId : 1246] get content name : SPORTS
2015-04-04 14:35:20 [INFO](ContentInfoCollector:25) [txId : agent^142533^20 spanId : 1263] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:56) [txId : agent^142533^21 spanId : 1265] get content name : NATIONAL
2015-04-04 14:35:20 [INFO](ContentInfoCollector:34) [txId : agent^142533^22 spanId : 1278] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoService:55) [txId : agent^14252^18 spanId : 1231] check authorization of user
2015-04-04 14:35:20 [INFO](ContentInfoService:14) [txId : agent^14252^17 spanId : 1224] get title of content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14) [txId : agent^14252^17 spanId : 1224] execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114) [txId : agent^142533^19 spanId : 1246] execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:74) [txId : agent^14252^17 spanId : 1224] get top linking for content
2015-04-04 14:35:21 [INFO](ContentDAOImpl:14) [txId : agent^142533^18 spanId : 1231] execute query ...
2015-04-04 14:35:21 [INFO](ContentDAOImpl:114) [txId : agent^142533^21 spanId : 1265] execute query ...
2015-04-04 14:35:22 [INFO](ContentDAOImpl:186) [txId : agent^142533^22 spanId : 1278] execute query ...
2015-04-04 14:35:22 [ERROR](ContentDAOImpl:158) [txId : agent^142533^18 spanId : 1231]
     com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
          at com.pinpoint.example.dao.ContentDAO.executequery(ContentDAOImpl.java:152)
          ...
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787)
          ...
     Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
     Communications link failure The last packet sent successfully to the server was 0 milliseconds ago.
     The driver has not received any packets from the server.
          ...
          at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2181)
          ... 12 more
     Caused by: java.net.ConnectException: Connection refused
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
          at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
          at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
          at java.net.Socket.connect(Socket.java:529)
          ... 13 more
2015-04-04 14:35:22 [INFO](ContentDAO:145) [txId : agent^14252^17 spanId : 1224] execute query ...
2015-04-04 14:35:20 [INFO](ContentInfoService:38) [txId : agent^142533^19 spanId : 1246] update hits for content
2015-04-04 14:35:20 [INFO](ContentInfoService:89) [txId : agent^142533^21 spanId : 1265] check of user
2015-04-04 14:35:24 [INFO](ContentDAO:146) [txId : agent^142533^22 spanId : 1278] execute query ...
2015-04-04 14:35:25 [INFO](ContentDAO:123) [txId : agent^14252^17 spanId : 1224] execute query ...

๋กœ๊ทธ๋ฉ”์‹œ์ง€์— ์ถœ๋ ฅ๋œ transactionId๋Š” Pinpoint web์˜ transactionlist์˜ transactionId์™€ ์ผ์น˜ํ•œ๋‹ค.

2. ์„ค์ • ๋ฐฉ๋ฒ•

2-1 Pinpoint agent ์„ค์ •

Pinpoint๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด Pinpoint agent ์„ค์ •ํŒŒ์ผ(Pinpoint.config)์˜ logging ์„ค์ • ๊ฐ’์„ true๋กœ ๋ณ€๊ฒฝํ•ด์•ผ ํ•œ๋‹ค. ์‚ฌ์šฉํ•˜๋Š” logging ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์— ํ•ด๋‹นํ•˜๋Š” ์„ค์ •๊ฐ’๋งŒ true๋กœ ๋ณ€๊ฒฝํ•˜๋ฉด ๋œ๋‹ค. ์•„๋ž˜ ์„ค์ •์— ๋Œ€ํ•œ ์˜ˆ์‹œ๊ฐ€ ์žˆ๋‹ค.

ex) Pinpoint.config - log4j ๋ฅผ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ

text
###########################################################
# log4j
###########################################################
profiler.log4j.logging.transactioninfo=true

ex) Pinpoint.config - log4j2 ๋ฅผ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ

text
###########################################################
# log4j2 
###########################################################
profiler.log4j2.logging.transactioninfo=true

ex) Pinpoint.config - logback ๋ฅผ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ

text
###########################################################
# logback
###########################################################
profiler.logback.logging.transactioninfo=true

2-2 log4j, log4j2, logback ์„ค์ • ํŒŒ์ผ ์„ค์ •

logging ์„ค์ • ํŒŒ์ผ์˜ log message pattern ์„ค์ •์— Pinpoint์—์„œ MDC์— ์ €์žฅํ•œ transactionId, spanId๊ฐ’์ด ์ถœ๋ ฅ๋ ์ˆ˜ ์žˆ๋„๋ก ์„ค์ •์„ ์ถ”๊ฐ€ํ•˜์ž.

ex) log4j - log4j.xml

markup
๋ณ€๊ฒฝ ์ „
<appender name = "console" class= "org.apache.log4j.ConsoleAppender" >
     <layout class = "org.apache.log4j.EnhancedPatternLayout">
          <param name = "ConversionPattern" value= "%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) %m%n" />
     </layout >
</appender >

๋ณ€๊ฒฝ ํ›„
<appender name = "console" class= "org.apache.log4j.ConsoleAppender" >
     <layout class = "org.apache.log4j.EnhancedPatternLayout">
          <param name = "ConversionPattern" value= "%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) [TxId : %X{PtxId} , SpanId : %X{PspanId}] %m%n" />
        </layout >
</appender >

ex) log4j2 - log4j2.xml

markup
๋ณ€๊ฒฝ ์ „
<appender>
     <console name="STDOUT" target="SYSTEM_OUT">
          <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) %m%n""/>
     </console>
<appender>

๋ณ€๊ฒฝ ํ›„
<appender>
     <console name="STDOUT" target="SYSTEM_OUT">
          <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} [%-5p](%-30c{1}) [TxId : %X{PtxId} , SpanId : %X{PspanId}] %m%n""/>
     </console>
<appender>

ex) logback - logback.xml

markup
๋ณ€๊ฒฝ ์ „
<appender name = "STDOUT" class= "ch.qos.logback.core.ConsoleAppender" >
     <layout class = "ch.qos.logback.classic.PatternLayout">
          <Pattern >%d{HH:mm} %-5level %logger{36} - %msg%n</Pattern >
     </layout >
</appender >

๋ณ€๊ฒฝ ํ›„
<appender name = "STDOUT" class= "ch.qos.logback.core.ConsoleAppender" >
     <layout class = "ch.qos.logback.classic.PatternLayout">
          <Pattern >%d{HH:mm} %-5level %logger{36} - [TxId : %X{PtxId} , SpanId : %X{PspanId}] %msg%n</Pattern >
     </layout >
</appender >

2-3 ๋กœ๊ทธ ์ถœ๋ ฅ ํ™•์ธ

Pinpoint agent๊ฐ€ ์ ์šฉ๋œ ์„œ๋น„์Šค๋ฅผ ๋™์ž‘ํ•˜์—ฌ log message์— ์•„๋ž˜์™€ ๊ฐ™์ด transactionId, spanId ์ •๋ณด๊ฐ€ ์ถœ๋ ฅ๋˜๋Š”๊ฒƒ์„ ํ™•์ธํ•˜๋ฉด ๋œ๋‹ค.

text
2015-04-04 14:35:20 [INFO](ContentInfoCollector:76 ) [txId : agent^14252^17 spanId : 1224] get content name : TECH
2015-04-04 14:35:20 [INFO](ContentInfoCollector:123 ) [txId : agent^142533^18 spanId : 1231] get content name : OPINION
2015-04-04 14:35:20 [INFO](ContentInfoCollector:12) [txId : agent^142533^19 spanId : 1246] get content name : SPORTS

3. Pinpoint web์—์„œ ๋กœ๊ทธ ํ™•์ธ

Pinpoint web์˜ transaction list ํ™”๋ฉด์—์„œ log๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ๋งํฌ๋ฅผ ์ œ๊ณตํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ์„ค์ • ๋ฐ ๊ตฌํ˜„์„ ์ถ”๊ฐ€ํ•˜๋ฉด ๋œ๋‹ค. Pinpoint web์—์„œ๋Š” ๋ฒ„ํŠผ ์„ ์ถ”๊ฐ€ํ•ด์ฃผ๊ธฐ๋งŒ ํ•˜๊ณ  ๋กœ๊ทธ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๋กœ์ง์€ ์ง์ ‘ ๊ตฌํ˜„์„ ํ•ด์•ผํ•œ๋‹ค.

๋กœ๊ทธ ๋ฉ”์‹œ์ง€๋ฅผ Pinpoint web์—์„œ ๋ณด์—ฌ์ฃผ๊ธฐ ์œ„ํ•ด์„œ๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด 2๊ฐ€์ง€ step์„ ๋”ฐ๋ผ์•ผ ํ•œ๋‹ค.

step 1 transactionId์™€ spanId, transaction ์‹œ์ž‘ ์‹œ๊ฐ„์„ ํŒŒ๋ผ๋ฏธํ„ฐ๋กœ ๋ฐ›์•„์„œ ๋กœ๊ทธ ๋ฉ”์‹œ์ง€๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” controller์„ ๊ตฌํ˜„ํ•ด์•ผํ•œ๋‹ค.

example)

java
@RestController
public class Nelo2LogController {

    @RequestMapping(value = "/XXXX")
    public String NeloLogForTransactionId(@RequestParam (value= "transactionId", required=true) String transactionId,
                                            @RequestParam(value= "spanId" , required=false) String spanId,
                                            @RequestParam(value="time" , required=true) long time ) {

          // you should implement the logic to retrieve your agentโ€™s logs.
    }

step 2 Pinpoint-web.properties ํŒŒ์ผ์—์„œ ๋ฒ„ํŠผ์„ ์ถ”๊ฐ€ํ•ด์ฃผ๋Š” ๊ธฐ๋Šฅ์„ ํ™œ์„ฑํ™” ํ•˜๊ธฐ ์œ„ํ•ด์„œ log.enable์˜ ๊ฐ’์„ true๋กœ ์„ค์ •ํ•˜๊ณ  ์œ„์—์„œ ๊ตฌํ˜„ํ•œ controller์˜ url๊ณผ button์˜ ์ด๋ฆ„์„ ์ถ”๊ฐ€ํ•ด์ฃผ์ž.

text
log.enable=true
log.page.url=XXXX.Pinpoint
log.button.name=log

step 3 pinpoint 1.5 ์ดํ›„ ๋ฒ„์ „๋ถ€ํ„ฐ log ๊ธฐ๋ก ์—ฌ๋ถ€์— ๋”ฐ๋ผ log ๋ฒ„ํŠผ์˜ ํ™œ์„ฑํ™”๊ฐ€ ๊ฒฐ์ •๋˜๋„๋ก ๊ฐœ์„  ๋๊ธฐ ๋•Œ๋ฌธ์— ๋‹น์‹ ์ด ์‚ฌ์šฉํ•˜๋Š” logging appender์˜ ๋กœ๊น… ๋ฉ”์†Œ๋“œ์— logging ์—ฌ๋ถ€๋ฅผ ์ €์žฅํ•˜๋Š” interceptor๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ๊ฐœ๋ฐœํ•ด์•ผ ํ•œ๋‹ค. ํ”Œ๋Ÿฌ๊ทธ์ธ ๊ฐœ๋ฐœ ๋ฐฉ๋ฒ•์€ ๋‹ค์Œ ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ•˜๋ฉด ๋œ๋‹ค(Link). interceptor ๋กœ์ง์ด ์ถ”๊ฐ€๋ผ์•ผ ํ•˜๋Š” ์œ„์น˜๋Š” appender class ๋‚ด์— LoggingEvent ๊ฐ์ฒด์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์ด์šฉํ•˜์—ฌ ๋กœ๊น…์„ ํ•˜๋Š” ๋ฉ”์†Œ๋“œ๋‹ค. ์•„๋ž˜๋Š” interceptor ์˜ˆ์ œ์ด๋‹ค.

text
public class AppenderInterceptor implements AroundInterceptor0 {

    private final TraceContext traceContext;

    public AppenderInterceptor(TraceContext traceContext) {
        this.traceContext = traceContext;
    }

    @Override
    public void before(Object target) {
        Trace trace = traceContext.currentTraceObject();

        if (trace != null) {
            SpanRecorder recorder = trace.getSpanRecorder();
            recorder.recordLogging(LoggingInfo.LOGGED);
        }
    }

    @IgnoreMethod
    @Override
    public void after(Object target, Object result, Throwable throwable) {

    }
}

์œ„์™€ ๊ฐ™์ด ์„ค์ • ๋ฐ ๊ตฌํ˜„์„ ์ถ”๊ฐ€ํ•˜๊ณ  pinpoint web์„ ๋™์ž‘์‹œํ‚ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ๋ฒ„ํŠผ์ด ์ถ”๊ฐ€ ๋œ๋‹ค. ๋กœ๊ทธ ๋ฒ„ํŠผ์„ ์ƒ์„ฑํ•ด์ฃผ๋Š” ๊ณผ์ •์„ ๋ณด์‹œ๋ ค๋ฉด, Pinpoint Web์˜ BusinessTransactionController ์™€ ScatterChartController class๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.


File: documents/plugin-dev-guide.md


Plugin Developer Guide

You can write Pinpoint profiler plugins to extend profiling target coverage. It is highly advisable to look into the trace data recorded by pinpoint plugins before jumping into plugin development.

I. Trace Data

In Pinpoint, a transaction consists of a group of Spans. Each Span represents a trace of a single logical node where the transaction has gone through.

To aid in visualization, let's suppose that there is a system like below. The FrontEnd server receives requests from users, then sends request to the BackEnd server, which queries a DB. Among these nodes, let's assume only the FrontEnd and BackEnd servers are profiled by the Pinpoint Agent.

When a request arrives at the FrontEnd server, Pinpoint Agent generates a new transaction id and creates a Span with it. To handle the request, the FrontEnd server then invokes the BackEnd server. At this point, Pinpoint Agent injects the transaction id (plus a few other values for propagation) into the invocation message. When the BackEnd server receives this message, it extracts the transaction id (and the other values) from the message and creates a new Span with them. Resulting, all Spans in a single transaction share the same transaction id.

A Span records important method invocations and their related data(arguments, return value, etc) before encapsulating them as SpanEvents in a call stack like representation. The Span itself and each of its SpanEvents represents a method invocation.

Span and SpanEvent have many fields, but most of them are handled internally by Pinpoint Agent and most plugin developers won't need to worry about them. But the fields and data that must be handled by plugin developers will be listed throughout this guide.

II. Pinpoint Plugin Structure

Pinpoint plugin consists of type-provider.yml and ProfilerPlugin implementations. type-provider.yml defines the ServiceTypes and AnnotationKeys that will be provided by the plugin, and provides them to Pinpoint Agent, Web and Collector. ProfilerPlugin implementations are used by Pinpoint Agent to transform target classes to record trace data.

Plugins are deployed as jar files. These jar files are packaged under the plugin directory for the agent, while the collector and web have them deployed under WEB-INF/lib. On start up, Pinpoint Agent, Collector, and Web iterates through each of these plugins; parses type-provider.yml, and loads ProfilerPlugin implementations using ServiceLoader from the following locations:

  • META-INF/pinpoint/type-provider.yml
  • META-INF/services/com.navercorp.pinpoint.bootstrap.plugin.ProfilerPlugin

Here is a template plugin project you can use to start creating your own plugin.

1. type-provider.yml

type-provider.yml defines the ServiceTypes and AnnotationKeys that will be used by the plugin and provided to the agent, collector and web; the format of which is outlined below.

yaml
serviceTypes:
    - code: <short>
      name: <String>
      desc: <String>   # May be omitted, defaulting to the same value as name.
      property:        # May be omitted, all properties defaulting to false.
          terminal: <boolean>               # May be omitted, defaulting to false.
          queue: <boolean>                  # May be omitted, defaulting to false.
          recordStatistics: <boolean>       # May be omitted, defaulting to false.
          includeDestinationId: <boolean>   # May be omitted, defaulting to false.
          alias: <boolean>                  # May be omitted, defaulting to false.          
      matcher:         # May be omitted
          type: <String>   # Any one of 'args', 'exact', 'none'
          code: <int>      # Annotation key code - required only if type is 'exact'

annotationKeys:
    - code: <int>
      name: <String>
      property:        # May be omitted, all properties defaulting to false.
          viewInRecordSet: <boolean>

ServiceType and AnnotationKey defined here are instantiated when the agent loads, and can be obtained using ServiceTypeProvider and AnnotationKeyProvider like below.

java
// ServiceType
ServiceType serviceType = ServiceTypeProvider.getByCode(1000);    // by ServiceType code
ServiceType serviceType = ServiceTypeProvider.getByName("NAME");  // by ServiceType name
// AnnotationKey
AnnotationKey annotationKey = AnnotationKeyProvider.getByCode("100");

1.1 ServiceType

Every Span and SpanEvent contains a ServiceType. The ServiceType represents which library the traced method belongs to, as well as how the Span and SpanEvent should be handled.

The table below shows the ServiceType's properties.

property description
name name of the ServiceType. Must be unique
code short type code value of the ServiceType. Must be unique
desc description
properties properties

ServiceType code must use a value from its appropriate category. The table below shows these categories and their range of codes.

category range
Internal Use 0 ~ 999
Server 1000 ~ 1999
DB Client 2000 ~ 2999
Cache Client 8000 ~ 8999
RPC Client 9000 ~ 9999
Others 5000 ~ 7999

ServiceType code must be unique. Therefore, if you are writing a plugin that will be shared publicly, you must contact Pinpoint dev. team to get a ServiceType code assigned. If your plugin is for private use, you may freely pick a value for ServiceType code from the table below.

category range
Server 1900 ~ 1999
DB client 2900 ~ 2999
Cache client 8900 ~ 8999
RPC client 9900 ~ 9999
Others 7500 ~ 7999

ServiceTypes can have the following properties.

property description
TERMINAL This Span or SpanEvent invokes a remote node but the target node is not traceable with Pinpoint
QUEUE This Span or SpanEvent consumes/produces a message from/to a message queue.
INCLUDE_DESTINATION_ID This Span or SpanEvent records a destination id and remote server is not a traceable type.
RECORD_STATISTICS Pinpoint Collector should collect execution time statistics of this Span or SpanEvent
ALIAS The service may or may not have Pinpoint-Agent attached at the following service but regardlessly have knowledge what will follow. (Ex. Elasticsearch client)

1.2 AnnotationKey

You can annotate spans and span events with more information. An Annotation is a key-value pair where the key is an AnnotationKey type and the value is a primitive type, String or a byte[]. There are pre-defined AnnotationKeys for commonly used annotation types, but you can define your own keys in type-provider.yml if these are not enough.

property description
name Name of the AnnotationKey
code int type code value of the AnnotationKey. Must be unique.
properties properties

If you are writing a plugin for public use, and are looking to add a new AnnotationKey, you must contact the Pinpoint dev. team to get an AnnotationKey code assigned. If your plugin is for private use, you may pick a value between 900 to 999 safely to use as AnnotationKey code.

The table below shows the AnnotationKey properties.

property description
VIEW_IN_RECORD_SET Show this annotation in transaction call tree.
ERROR_API_METADATA This property is not for plugins.

Example

You can find type-provider.yml sample here.

You may also define and attach an AnnotationKeyMatcher with a ServiceType (matcher element in the sample type-provider code above). If you attach an AnnotationKeyMatcher this way, matching annotations will be displayed as representative annotation when the ServiceType's Span or SpanEvent is displayed in the transaction call tree.

2. ProfilerPlugin

ProfilerPlugin modifies target library classes to collect trace data.

ProfilerPlugin works in the order of following steps:

  1. Pinpoint Agent is started when the JVM starts.
  2. Pinpoint Agent loads all plugins under plugin directory.
  3. Pinpoint Agent invokes ProfilerPlugin.setup(ProfilerPluginSetupContext) for each loaded plugin.
  4. In the setup method, the plugin registers a TransformerCallback to all classes that are going to be transformed.
  5. Target application starts.
  6. Every time a class is loaded, Pinpoint Agent looks for the TransformerCallback registered to the class.
  7. If a TransformerCallback is registered, the Agent invokes it's doInTransform method.
  8. TransformerCallback modifies the target class' byte code. (e.g. add interceptors, add fields, etc.)
  9. The modified byte code is returned to the JVM, and the class is loaded with the returned byte code.
  10. Application continues running.
  11. When a modified method is invoked, the injected interceptor's before and after methods are invoked.
  12. The interceptor records the trace data.

The most important points to consider when writing a plugin are 1) figuring out which methods are interesting enough to warrant tracing, and 2) injecting interceptors to actually trace these methods. These interceptors are used to extract, store, and pass trace data around before they are sent off to the Collector. Interceptors may even cooperate with each other, sharing context between them. Plugins may also aid in tracing by adding getters or even custom fields to the target class so that the interceptors may access them during execution. Pinpoint plugin sample shows you how the TransformerCallback modifies classes and what the injected interceptors do to trace a method.

We will now describe what interceptors must do to trace different kinds of methods.

2.1 Plain method

Plain method refers to anything that is not a top-level method of a node, or is not related to remote or asynchronous invocation. Sample 2 shows you how to trace these plain methods.

2.2 Top level method of a node

Top level method of a node is a method in which its interceptor begins a new trace in a node. These methods are typically acceptors for RPCs, and the trace is recorded as a Span with ServiceType categorized as a server.

How the Span is recorded depends on whether the transaction has already begun at any previous nodes.

2.2.1 New transaction

If the current node is the first one that is recording the transaction, you must issue a new transaction id and record it. TraceContext.newTraceObject() will handle this task automatically, so you will simply need to invoke it.

2.2.2 Continue Transaction

If the request came from another node traced by a Pinpoint Agent, then the transaction will already have a transaction id issued; and you will have to record the data below to the Span. (Most of these data are sent from the previous node, usually packed in the request message)

name description
transactionId Transaction ID
parentSpanId Span ID of the previous node
parentApplicationName Application name of the previous node
parentApplicationType Application type of the previous node
rpc Procedure name (Optional)
endPoint Server(current node) address
remoteAddr Client address
acceptorHost Server address that the client used

Pinpoint finds caller-callee relation between nodes using acceptorHost. In most cases, acceptorHost is identical to endPoint. However, the address which client sent the request to may sometimes be different from the address the server received the request (proxy). To handle such cases, you have to record the actual address the client used to send the request to as acceptorHost. Normally, the client plugin will have added this address into the request message along with the transaction data.

Moreover, you must also use the span id issued and sent by the previous node.

Sometimes, the previous node marks the transaction to not be traced. In this case, you must not trace the transaction.

As you can see, the client plugin must be able pass trace data to the server plugin, and how to do this is protocol dependent.

You can find an example of top-level method server interceptor here.

2.3 Methods invoking a remote node

An interceptor of a method that invokes a remote node has to record the following data:

name description
endPoint Target server address
destinationId Logical name of the target
rpc Invoking target procedure name (optional)
nextSpanId Span id that will be used by next node's span (If next node is traceable by Pinpoint)

Whether or not the next node is traceable by Pinpoint affects how the interceptor is implemented. The term "traceable" here is about possibility. For example, a HTTP client's next node is a HTTP server. Pinpoint does not trace all HTTP servers, but it is possible to trace them (and there already are HTTP server plugins). In this case, the HTTP client's next node is traceable. On the other hand, MySQL JDBC's next node, a MySQL database server, is not traceable.

2.3.1 If the next node is traceable

If the next node is traceable, the interceptor must propagate the following data to the next node. How to pass them is protocol dependent, and in worst cases may be impossible to pass them at all.

name description
transactionId Transaction ID
parentApplicationName Application name of current node
parentApplicationType Application type of current node
parentSpanId Span id of trace at current node
nextSpanId Span id that will be used by the next node's span (same value with nextSpanId of above table)

Pinpoint finds out caller-callee relation by matching destinationId of client trace and acceptorHost of server trace. Therefore the client plugin has to record destinationId and the server plugin has to record acceptorHost with the same value. If server cannot acquire the value by itself, client plugin has to pass it to server.

The interceptor's recorded ServiceType must be from the RPC client category.

You can find an example for these interceptors here.

2.3.2 If the next node is not traceable

If the next node is not traceable, your ServiceType must have the TERMINAL property.

If you want to record the destinationId, it must also have the INCLUDE_DESTINATION_ID property. If you record destinationId, server map will show a node per destinationId even if they have same endPoint.

Also, the ServiceType must be a DB client or Cache client category. Note that you do not need to concern yourself about the terms "DB" or "Cache", as any plugin tracing a client library with non-traceable target server may use them. The only difference between "DB" and "Cache" is the time range of the response time histogram ("Cache" having smaller intervals for the histogram).

2.4 Asynchronous task

Trace objects are bound to the thread that first created them via ThreadLocal and whenever the execution crosses a thread boundary, trace objects are lost to the new thread. Therefore, in order to trace tasks across thread boundaries, you must take care of passing the current trace context over to the new thread. This is done by injecting an AsyncContext into an object shared by both the invocation thread and the execution thread.
The invocation thread creates an AsyncContext from the current trace, and injects it into an object that will be passed over to the execution thread. The execution thread then retrieves the AsyncContext from the object, creates a new trace out of it and binds it to it's own ThreadLocal.
You must therefore create interceptors for two methods : i) one that initiates the task (invocation thread), and ii) the other that actually handles the task (execution thread).

The initiating method's interceptor has to issue an AsyncContext and pass it to the handling method. How to pass this value depends on the target library. In worst cases, you may not be able to pass it at all.

The handling method's interceptor must then continue the trace using the propagated AsyncContext and bind it to it's own thread. However, it is very strongly recommended that you simply extend the AsyncContextSpanEventSimpleAroundInterceptor so that you do not have to handle this manually.

Keep in mind that since the shared object must be able have AsyncContext injected into it, you have to add a field using AsyncContextAccessor during it's class transformation. You can find an example for tracing asynchronous tasks here.

2.5 Case Study: HTTP

HTTP client is an example of a method invoking a remote node (client), and HTTP server is an example of a top level method of a node (server). As mentioned before, client plugins must have a way to pass transaction data to server plugins to continue the trace. Note that the implementation is protocol dependent, and HttpMethodBaseExecuteMethodInterceptor of HttpClient3 plugin and StandardHostValveInvokeInterceptor of Tomcat plugin show a working example of this for HTTP:

  1. Pass transaction data as HTTP headers. You can find header names here
  2. Client plugin records IP:PORT of the server as destinationId.
  3. Client plugin passes destinationId value to server as Header.HTTP_HOST header.
  4. Server plugin records Header.HTTP_HOST header value as acceptorHost.

One more thing you have to remember is that all the clients and servers using the same protocol must pass the transaction data in the same way to ensure compatibility. So if you are writing a plugin of some other HTTP client or server, your plugin has to record and pass transaction data as described above.

3. Plugin Integration Test

You can run plugin integration tests (mvn integration-test) with PinointPluginTestSuite, which is a JUnit Runner. It downloads all the required dependencies from maven repositories and launches a new JVM with the Pinpoint Agent and the aforementioned dependencies. The JUnit tests are executed in this JVM.

To run the plugin integration test, it needs a complete agent distribution - which is why integration tests are in the plugin-sample-agent module and why they are run in integration-test phase.

For the actual integration test, you will want to first invoke the method you are tracing, and then use PluginTestVerifier to check if the trace data is correctly recorded.

3.1 Test Dependency

PinointPluginTestSuite doesn't use the project's dependencies (configured in pom.xml). It uses the dependencies that are listed by @Dependency annotation. This way, you may test multiple versions of the target library using the same test class.

Dependencies are declared as following. You may specify versions or version ranges for a dependency library.

text
@Dependency({"some.group:some-artifact:1.0", "another.group:another-artifact:2.1-RELEASE"})
@Dependency({"some.group:some-artifact:[1.0,)"})
@Dependency({"some.group:some-artifact:[1.0,1.9]"})
@Dependency({"some.group:some-artifact:[1.0],[2.1],[3.2])"})

PinointPluginTestSuite by default searches the local repository and maven central repository. You may also add your own repositories by using the @Repository annotation.

3.2 Jvm Version

You can specify the JVM version for a test using @JvmVersion. If @JvmVersion is not present, JVM at java.home property will be used.

3.3 Application Test

PinpointPluginTestSuite is not for applications that has to be launched by its own main class. You can extend AbstractPinpointPluginTestSuite and related types to test such applications.

4. Adding Images

If you're developing a plugin for applications, you need to add images so the server map can render the corresponding node. The plugin jar itself cannot provide these image files and for now, you will have to add the image files to the web module manually.

First, put the PNG files to following directories:

  • web/src/main/webapp/images/icons (25x25)
  • web/src/main/webapp/images/servermap (80x40)

Then, add ServiceType name and the image file name to htIcons in web/src/main/webapp/components/server-map2/jquery.ServerMap2.js.


File: documents/proxy-http-header.md


Monitoring Proxy Server

Proxy monitoring using HTTP headers

It is used to know the elapsed time between proxy and WAS.

Pinpoint Configuration

pinpoint.config

text
profiler.proxy.http.header.enable=true

Proxy Configuration

Apache HTTP Server

Add HTTP header.

text
Pinpoint-ProxyApache: t=991424704447256 D=3775428 i=51 b=49

e.g.

httpd.conf

text
<IfModule mod_jk.c>
...
RequestHeader set Pinpoint-ProxyApache "%t %D %i %b"
...
</IfModule>

%t is required value.

Nginx

Add HTTP header.

text
Pinpoint-ProxyNginx: t=1504248328.423 D=0.123

e.g.

nginx.conf

text
...
  server {
        listen       9080;
        server_name  localhost;

        location / {
            ...
            set $pinpoint_proxy_header "t=$msec D=$request_time";
            proxy_set_header Pinpoint-ProxyNginx $pinpoint_proxy_header;
        }
  }
...

or

text
http {
...

    proxy_set_header Pinpoint-ProxyNginx t=$msec;

...
}

t=$msec is required value.

App

Milliseconds since epoch (13 digits) and app information.

Add HTTP header.

text
Pinpoint-ProxyApp: t=1594316309407 app=foo-bar

t=epoch is required value.


File: documents/realtime.md

Real-time active request monitoring

The collection of request information can sometimes be so resource intensive that it can have a serious impact on the target system. Pinpoint provides a number of features that allow this expensive information to be monitored in real time only when the user really needs it.

Features

The realtime monitor consists of 2 features: recording the number of active requests, thread-dumping the thread handling the active request

Active request - realtime graph

In the datetime range picker there is a REAL TIME button which is focused on automatically augmenting the current data with the just generated realtime data.

REAL TIME also activates the Active Requests window. This shows the number of active requests at the moment.

Active request thread dump

Pressing the icon in the green square above navigates to the thread dump view

The above list view contains brief information about the threads that were handling requests at the time the page was loaded. When the item is selected, the thread dump is collected and displayed in the UI as shown below.

The thread dump only works if the request is still active, but can be replaced with There is no message( may be completed) if the request session is already closed by the time the user selects the item in the list.

Requirements and installation

These features are disabled by default and can be enabled with the property pinpoint.modules.realtime.enabled=true at the web, collector module.

Required properties

Once the feature is enabled, the Redis connection must be provided, which can be configured by adjusting the properties below in `redis/src/main/resources/redis/profiles'.

Most of the properties below follow, but are not exactly the same as, those defined in the spring-data-redis library.

yaml
spring.data.redis.lettuce.client.io-thread-pool-size=8
spring.data.redis.lettuce.client.computation-thread-pool-size=8
spring.data.redis.lettuce.client.request-queue-size=1024

spring.data.redis.username=default
spring.data.redis.password=

# Standalone mode
spring.data.redis.host=localhost
spring.data.redis.port=6379

# Cluster mode: Cluster mode is prior to standalone
spring.data.redis.cluster.nodes=localhost.1:6379,localhost.2:6379,localhost.3:6379

If spring.data.redis.cluster.nodes is not empty, spring.data.redis.host is ignored.

Architecture

Real-time information is not collected on a 24-hour basis, but is triggered by some kind of signal from a collector listening to a specific channel for broadcasting the event that a user has accessed that web page (demand). The collected information (supply) is immediately sent to the corresponding channel in Redis and can be read by the web server that sent the demand event.

Case: the number of active requests

Most of the specifications for this section are described in ATCServiceProtocolConfig.java.

java
@Bean
FluxChannelServiceProtocol<ATCDemand, ATCSupply> atcProtocol(ObjectMapper objectMapper) {
    return ChannelServiceProtocol.<ATCDemand, ATCSupply>builder()
      ...
            .setDemandPubChannelURIProvider(demand -> URI.create(RedisPubSubConstants.SCHEME + ":demand:atc-2"))
            .setDemandSubChannelURI(URI.create(RedisPubSubConstants.SCHEME + ":demand:atc-2"))
            .setSupplyChannelURIProvider(demand -> URI.create(RedisPubSubConstants.SCHEME + ":supply:atc-2:" + demand.getApplicationName() + ':' + demand.getAgentId() + ':' + demand.getStartTimestamp()))
            .buildFlux();
}

As described in the code above, the demand for the number of active requests is communicated over the redis pubsub channel using the key demand:atc-2. If real-time is enabled, all collectors should listen to this channel from the start.

A collector can ignore a demand event if it determines that it cannot respond to that event on its own, but you should design your demands carefully so that there is exactly one collector that can respond to the demand.

The appropriate collector with the appropriate connection triggers the agent to gather the required information, which is then passed in real time to the redis pubsub supply channel with the key 'supply:atc-2:{applicationName}:{agentId}:{startTimestamp}'.


File: documents/service.md

English | ํ•œ๊ตญ์–ด

Pinpoint Service Guide

Pinpoint has released the Service feature.
You can group multiple applications into a single service and check the call relationships between services on the Service Map.
On screens that support the Service feature, you can view only the data of the applications that belong to the selected service.

This lets you focus on the data of the service you are responsible for and analyze the cause of problems faster.
Even as applications increase, you can clearly separate monitoring targets by service.

This document provides content for both Pinpoint users who use services and Pinpoint operators who deploy and operate the Service feature. Check the guide below that matches your role.

Audience What to check in this document
Pinpoint users User Guide, chapters 1 to 5: the Service concept, creating and selecting a service, agent settings, using the Service Map, and FAQ
Pinpoint operators Operator Guide, chapters 6 to 7: components and settings, schema changes in 4.0.0

User Guide

This part explains how to create a service, connect agents, and then view monitoring data by service.

1. What Is a Service?

A Service is a higher-level monitoring unit that represents one service made up of multiple applications.

Pinpoint's monitoring targets consist of three levels: Service โ†’ Application โ†’ Agent.
Decide which applications to treat as one service according to your organization's service structure and operational boundaries.

Level Meaning Example
Service A higher-level monitoring unit that contains multiple applications demo-shop-commerce
Application A monitoring unit with a specific role within a service Shopping-Order
Agent An individual instance of an application running on a server or in a container shop-order-01

A simplified view of the demo-shop-commerce service in the demo shopping mall is as follows. To explain the relationship between service, application, and agent, this example assumes that each application runs as two agent instances.

text
Service: demo-shop-commerce                  product and order domain
โ”œโ”€ Application: Shopping-Order               order processing
โ”‚  โ”œโ”€ Agent: shop-order-01
โ”‚  โ””โ”€ Agent: shop-order-02
โ””โ”€ Application: Shopping-Product             product lookup
   โ”œโ”€ Agent: shop-product-01
   โ””โ”€ Agent: shop-product-02

1-1. What Changes with the Service Feature

With the Service feature, an application is identified by the Service + Application combination, not by its name alone.

Change Description
Separate query scope Only the data of the applications in the selected service is viewed.
Duplicate application names allowed The same application name can be used in different services.
Call relationships Calls with other services are checked on the Service Map.
Infrastructure System metric host groups are also separated by service. Telegraf sets the service with the serviceName header. See System Metrics.

1-2. Selecting a Service

Click the Service menu at the bottom left, and select the service to view from the Select Service list on the right.

Selecting a service takes you to that service's Service Map.
The currently selected service is marked with a check. The list shows the current service first, then DEFAULT, then the remaining services sorted by name.

The service selection is kept independently per browser tab. In a new tab, the last selected service is used as the default.

When you select demo-shop-commerce, you can view only the applications and monitoring data that belong to that service.
The application list and the queried data also change based on the selected service.

1-3. Service Map

The Service Map shows, on one screen, the application calls inside the selected service and the call relationships with directly connected services.

Target How it is shown
Selected service Its applications are expanded into individual nodes.
Other services with call relationships Multiple applications are shown as one group node.
Number on a group node The number of applications in that service.

When demo-shop-commerce is selected in the demo shopping mall, the call relationships are shown as follows.

text
[Service: demo-shop-front]
             โ”‚
             โ–ผ
[Service: demo-shop-commerce]
Shopping-Order โ”€โ”€โ”€โ”€โ”€โ†’ Shopping-Product
      โ”‚                       โ”‚
      โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ†’ MySQL โ†โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
      โ–ผ
[Service: demo-shop-payment]

Shopping-Order (application), Shopping-Product (application), and MySQL (database), which belong to the selected demo-shop-commerce service, are shown as individual nodes. The connected demo-shop-front and demo-shop-payment services are each shown as a single service group node.

See chapter 4 for the display range and the limitations of group nodes.

1-4. Role of the DEFAULT Service and Data Handling

DEFAULT is the default service name where data from agents without a specified service is collected.

Case Handling
Data collected without a specified service Viewed under the default service, DEFAULT.
Data collected after a service is set on the agent and the agent is restarted Viewed under the configured service.
Existing data collected before a service was specified Stays in DEFAULT and does not move to the new service.

Creating a new service by itself does not move existing applications and data.

See chapter 3 for how to configure agents.

2. Getting Started with Services

Turn on the Service feature, create a service, and apply the agent settings in order.

The following order is recommended for the first setup.

text
Turn on the Service feature
โ†’ Create a service
โ†’ Set the service on the agents
โ†’ Verify the data

2-1. Turning On the Service Feature

  1. Click Configuration at the bottom left.
  2. Select Experimental.
  3. Turn on Enable service-based application map grouping.
  4. Check that Service and Servicemap appear in the left menu.

This setting is saved per browser.

You need to set it again in other browsers or devices.

If the option or the menus are not visible, contact your Pinpoint operator.

2-2. Creating a Service

  1. Click Service at the bottom left.
  2. Click Service Setting.
  3. Click New Service.
  4. Enter the service name and click Save.
  5. Check that the created service is selected as the current service.

The service name is used as-is for the agent's pinpoint.serviceName.

Enter the name according to the following rules so that it can be linked with agents.

Item Rule
Length 3 to 254 characters
Allowed characters Uppercase and lowercase letters, digits, period (.), underscore (_), hyphen (-)
Not allowed Spaces, Korean characters, slashes
Duplicate names A name that differs from an existing service only in letter case cannot be used
Reserved names DEFAULT, ERROR, UNKNOWN, NULL, TEST

Examples of usable names are demo-shop-commerce, member-platform, and finance-platform.

Right after a service is created, it has no applications.

Applications are displayed once you finish the agent settings in chapter 3 and data is collected.

2-3. Selecting a Service

You can select a service in the following two places.

  • The Service menu at the bottom left
  • Switch To in the Service Setting list

Check the selected service in the Service menu at the bottom left.

2-4. Deleting a Service

When a service is deleted, existing data is not recovered.

Deleting a service has the following effects.

Item State after deletion
Service registration Deleted.
Existing monitoring data Remains, but does not move to another service.
A service re-created with the same name Registered as a new service and not linked to the existing data.

If the agents of a deleted service are restarted, registration may fail and new data may not be collected.

If you need to delete a service, follow this order.

  1. Stop the agents that use the service, or change them to another service.
  2. Check that new data is collected under the changed service.

It may take some time for a deleted service to disappear from the list.

DEFAULT cannot be deleted.

3. Setting the Service on Agents

The Service feature is available in Pinpoint Agent 4.0.0 or later.

When you set the service, application, and agent names in the agent startup options, Pinpoint builds the membership relationships.

3-1. Before You Start

Decide the service, application, and agent names according to the structure and operational standards of each environment.

This chapter assumes that the product and order domain is configured as one service with the following names.

Level Example name
Service demo-shop-commerce
Application Shopping-Order
Agent shop-order-01

Create the demo-shop-commerce service in Pinpoint Web before starting the agent. In a real environment, replace the names above with the names decided for each environment.

If the Pinpoint Agent is older than 4.0.0, upgrade it and then set the service. The service and application names must match the values shown in Pinpoint Web, including letter case.

3-2. JVM Options

Set the example names decided in 3-1 as JVM options as follows.

Setting Example value Meaning
pinpoint.serviceName demo-shop-commerce The service the agent belongs to. It must be registered in Pinpoint Web first.
pinpoint.applicationName Shopping-Order The application the agent belongs to.
pinpoint.agentName shop-order-01 A name that identifies the running instance. Optional.
bash
-Dpinpoint.serviceName=demo-shop-commerce
-Dpinpoint.applicationName=Shopping-Order
-Dpinpoint.agentName=shop-order-01

pinpoint.serviceName and pinpoint.applicationName must be set.

If pinpoint.agentName is omitted, the agent generates an instance name automatically.

To easily tell apart instances before and after a restart, specifying the name directly is recommended.

3-3. Applying and Verifying the Settings

  1. Apply the settings and restart the agent.
  2. Check in the agent log whether registration succeeded.
  3. Select the registered service in Pinpoint Web.
  4. Check that the configured application appears in the application list and on the Service Map.
  5. Check transactions and agent status in a recent time range.

4. Supported Scope and Current Limitations

On screens that support the Service feature, data is viewed based on the selected service.

4-1. Main Features with Service Support

Area Service support
Applications and agents View only the applications and agents that belong to the selected service
Service Map View the call relationships between the applications of the selected service and other servicesRefresh the Service Map, Heatmap, and Scatter in real time, and view the Active Requests of the selected application
Transaction analysis View Heatmap, Scatter, Histogram, Apdex, and the transaction list and details
Statistics and analysis View Inspector, URL Statistic, and Exception Trace

4-2. Current Limitations

Feature Current limitation Notes
Service Map Inbound and outbound calls are each viewed up to one hop from the selected service Services two or more hops away may not be displayed
Group nodes Not every application call inside a collapsed service may be represented Use group nodes to check the connections between services
Infrastructure Service scope is not applied Data from multiple services may be shown together
OpenTelemetry Metric Service scope is not applied Data may be shown together regardless of the selected service

5. FAQ

5-1. Where do I see the data if I turn the Service feature off?

When the Service feature is off, the DEFAULT data is viewed in the legacy Servermap.

Data stored under a specific service does not move to DEFAULT and is not shown in the legacy Servermap.

To see that data, turn the Service feature back on and select the correct service.

5-2. I created a service, but no application appears

Check the following in order.

  1. The Pinpoint Agent is 4.0.0 or later.
  2. The service was created before the agent.
  3. pinpoint.serviceName satisfies the allowed characters and the length limit (3 to 254 characters), and pinpoint.applicationName satisfies the allowed characters and the 254-character limit.
  4. pinpoint.serviceName matches the registered service, including letter case.
  5. If the service was created after the agent, wait up to 10 minutes and restart the agent.
  6. The agent registration log shows no errors.
  7. The correct service and a recent time range are selected in Pinpoint Web.

5-3. Can I use the same application name in several services?

Yes, you can.

commerce-service / order-api and partner-service / order-api are treated as different applications.

5-4. Can I rename a service?

Service names cannot be changed.

Create a new service, change the agent's pinpoint.serviceName, and restart the agent.

Only data collected after the change is stored in the new service.

Existing data is not copied to the new service.

5-5. If I re-create a deleted service with the same name, is the data restored?

Monitoring data is not restored.

Even if you re-create it with the same name, it is registered as a new service, and the monitoring data from before the deletion is not linked.

5-6. After applying 4.0.0, a called Application appears as `host:port (UNKNOWN)`

On the Service Map of a selected Service, the called Application appears as an UNKNOWN node (cloud icon) named host:port. In the transaction call tree, the two Applications may still appear together normally.

Cause

The Agent version of the called Application is lower than 3.1.0.

Calling Application Agent of the called Application Service Map link Transaction call tree
4.0.0, belongs to a Service 3.0.x or lower Broken Normal
4.0.0, belongs to a Service 4.0.0 or 3.1.x Normal Normal

An Application that belongs to a Service sends its Service information along with each request. The Agent on the receiving side must read this information and report it to Pinpoint so that the link between the two Applications is drawn by Service. Reading this information is supported from Agent 3.1.0, so if the receiving Agent is 3.0.x or lower, the link appears broken.

Resolution

If the Agent version of the called Application is lower than 3.1.0, upgrade it to 3.1.0 or later. Upgrading to the latest 4.0.0 version is most recommended.

Operator Guide

This part explains how to prepare Pinpoint Web and Collector and apply the Service feature.

6. Architecture and Default Settings

6-1. Components

The Service feature works with the following components together.

Component Role
Pinpoint Agent Sends the configured service, application, and agent information to the Collector.
Pinpoint Collector Looks up the service name sent by the agent in the Service Registry and links the collected data to that service.
Pinpoint Web Provides the APIs and screens for creating and deleting services and for querying by service.
MySQL Stores the Service Registry, which manages service names and service UIDs.
HBase Stores the data used for the Service Map, transactions, and application and agent lookups.
Pinot Stores Heatmap, Inspector, URL Stat, Exception Stat, Infrastructure, and OpenTelemetry Metric data.

Pinpoint Web and Collector must look up the same Service Registry. If the two components use the service table in different MySQL databases, the Collector cannot find a service created in Web.

The flow in which service information is stored and looked up is as follows.

The MySQL Service Registry stores service names and UIDs. Monitoring data is stored in HBase and Pinot without passing through MySQL.

The service name created in Web and the service name set on the agent must be the same for the collected data to be viewed under the correct service.

6-2. Checking the Default Settings

In Pinpoint 4.0.0, the Service feature is enabled by default. The related settings are as follows.

Layer Setting 4.0.0 default Source file
Collector pinpoint.collector.service.lookup.enabled true collector/src/main/resources/pinpoint-collector-root.properties
Service Map API pinpoint.modules.web.servicemap.enabled true web/src/main/resources/pinpoint-web-root.properties
Browser UI initial value experimental.enableServiceMap.value true web/src/main/resources/pinpoint-web-root.properties

7. Schema Changes in 4.0.0

Upgrading to Pinpoint 4.0.0 requires schema changes.

7-1. Pinot

7-2. MySQL

  • Create the service table
  • Create the alarm tables
    • Tables: alarm_template, alarm_template_item, alarm_rule_v2, alarm_rule_local_config, alarm_notification_channel, alarm_channel_binding, alarm_state, alarm_history_v2, alarm_notification_outbox
    • Requirements: MySQL 8.4 or later is recommended. The configuration columns use the JSON type.
    • Schema: CreateTableStatement-mysql.sql

7-3. HBase


Pinpoint Service ๊ฐ€์ด๋“œ

Pinpoint์—์„œ Service ๊ธฐ๋Šฅ์„ ์ถœ์‹œํ–ˆ์Šต๋‹ˆ๋‹ค.
์—ฌ๋Ÿฌ Application์„ ํ•˜๋‚˜์˜ Service๋กœ ๊ตฌ์„ฑํ•˜๊ณ , Service ๊ฐ„ ํ˜ธ์ถœ ๊ด€๊ณ„๋ฅผ Service Map์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
Service ๊ธฐ๋Šฅ์„ ์ง€์›ํ•˜๋Š” ํ™”๋ฉด์—์„œ๋Š” ์„ ํƒํ•œ Service์— ์†ํ•œ Application์˜ ๋ฐ์ดํ„ฐ๋งŒ ์กฐํšŒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด๋ฅผ ํ†ตํ•ด ๋‹ด๋‹น Service์˜ ๋ฐ์ดํ„ฐ์— ์ง‘์ค‘ํ•˜๊ณ , ๋ฌธ์ œ ์›์ธ์„ ๋” ๋น ๋ฅด๊ฒŒ ๋ถ„์„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
Application์ด ๋Š˜์–ด๋‚˜๋„ ๋ชจ๋‹ˆํ„ฐ๋ง ๋Œ€์ƒ์„ Service ๋‹จ์œ„๋กœ ๋ช…ํ™•ํ•˜๊ฒŒ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ๋ฌธ์„œ๋Š” Service๋ฅผ ์‚ฌ์šฉํ•˜๋Š” Pinpoint ์‚ฌ์šฉ์ž์™€ Service ๊ธฐ๋Šฅ์„ ๋ฐฐํฌยท์šด์˜ํ•˜๋Š” Pinpoint ์šด์˜์ž๋ฅผ ์œ„ํ•œ ๋‚ด์šฉ์„ ํ•จ๊ป˜ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์—ญํ• ์— ๋”ฐ๋ผ ์•„๋ž˜ ๊ฐ€์ด๋“œ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

๋Œ€์ƒ ์ด ๋ฌธ์„œ์—์„œ ํ™•์ธํ•  ๋‚ด์šฉ
Pinpoint ์‚ฌ์šฉ์ž ์‚ฌ์šฉ์ž ๊ฐ€์ด๋“œ 1์žฅ๋ถ€ํ„ฐ 5์žฅ: Service ๊ฐœ๋…, ์ƒ์„ฑ๊ณผ ์„ ํƒ, Agent ์„ค์ •, Service Map ์‚ฌ์šฉ๊ณผ FAQ
Pinpoint ์šด์˜์ž ์šด์˜์ž ๊ฐ€์ด๋“œ 6์žฅ๋ถ€ํ„ฐ 7์žฅ: ๊ตฌ์„ฑ ์š”์†Œ์™€ ์„ค์ •, 4.0.0 ์Šคํ‚ค๋งˆ ๋ณ€๊ฒฝ์‚ฌํ•ญ

์‚ฌ์šฉ์ž ๊ฐ€์ด๋“œ

Service๋ฅผ ์ƒ์„ฑํ•˜๊ณ  Agent๋ฅผ ์—ฐ๊ฒฐํ•œ ๋’ค, Service ๋‹จ์œ„๋กœ ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

1. Service๋ž€

Service๋Š” ์—ฌ๋Ÿฌ Application์œผ๋กœ ๊ตฌ์„ฑ๋œ ํ•˜๋‚˜์˜ ์„œ๋น„์Šค๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์ƒ์œ„ ๋ชจ๋‹ˆํ„ฐ๋ง ๋‹จ์œ„์ž…๋‹ˆ๋‹ค.

Pinpoint์˜ ๋ชจ๋‹ˆํ„ฐ๋ง ๋Œ€์ƒ์€ Service โ†’ Application โ†’ Agent์˜ ์„ธ ๋‹จ๊ณ„๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.
์–ด๋–ค Application์„ ํ•˜๋‚˜์˜ Service๋กœ ๋ณผ์ง€๋Š” ์กฐ์ง์˜ ์„œ๋น„์Šค ๊ตฌ์„ฑ๊ณผ ์šด์˜ ๊ฒฝ๊ณ„์— ๋งž๊ฒŒ ์ •ํ•ฉ๋‹ˆ๋‹ค.

๊ตฌ๋ถ„ ์˜๋ฏธ ์˜ˆ์‹œ
Service ์—ฌ๋Ÿฌ Application์„ ํฌํ•จํ•˜๋Š” ์ƒ์œ„ ๋ชจ๋‹ˆํ„ฐ๋ง ๋‹จ์œ„ demo-shop-commerce
Application Service ์•ˆ์—์„œ ํŠน์ • ์—ญํ• ์„ ๋‹ด๋‹นํ•˜๋Š” ๋ชจ๋‹ˆํ„ฐ๋ง ๋‹จ์œ„ Shopping-Order
Agent ์„œ๋ฒ„๋‚˜ ์ปจํ…Œ์ด๋„ˆ์—์„œ ์‹คํ–‰ ์ค‘์ธ Application์˜ ๊ฐœ๋ณ„ ์ธ์Šคํ„ด์Šค shop-order-01

๋ฐ๋ชจ ์‡ผํ•‘๋ชฐ์˜ demo-shop-commerce Service๋ฅผ ๋‹จ์ˆœํ™”ํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. Service, Application, Agent์˜ ๊ด€๊ณ„๋ฅผ ์„ค๋ช…ํ•˜๊ธฐ ์œ„ํ•ด ๊ฐ Application์ด ๋‘ Agent ์ธ์Šคํ„ด์Šค๋กœ ์‹คํ–‰๋œ๋‹ค๊ณ  ๊ฐ€์ •ํ•ฉ๋‹ˆ๋‹ค.

text
Service: demo-shop-commerce                  ์ƒํ’ˆยท์ฃผ๋ฌธ ์˜์—ญ
โ”œโ”€ Application: Shopping-Order               ์ฃผ๋ฌธ ์ฒ˜๋ฆฌ
โ”‚  โ”œโ”€ Agent: shop-order-01
โ”‚  โ””โ”€ Agent: shop-order-02
โ””โ”€ Application: Shopping-Product             ์ƒํ’ˆ ์กฐํšŒ
   โ”œโ”€ Agent: shop-product-01
   โ””โ”€ Agent: shop-product-02

1-1. Service ๊ธฐ๋Šฅ์œผ๋กœ ๋‹ฌ๋ผ์ง€๋Š” ์ 

Service ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋ฉด Application์€ ์ด๋ฆ„๋งŒ์ด ์•„๋‹ˆ๋ผ Service + Application ์กฐํ•ฉ์œผ๋กœ ๊ตฌ๋ถ„๋ฉ๋‹ˆ๋‹ค.

๋ณ€ํ™” ์„ค๋ช…
์กฐํšŒ ๋ฒ”์œ„ ๋ถ„๋ฆฌ ์„ ํƒํ•œ Service์— ์†ํ•œ Application์˜ ๋ฐ์ดํ„ฐ๋งŒ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.
Application ์ด๋ฆ„ ์ค‘๋ณต ํ—ˆ์šฉ Service๊ฐ€ ๋‹ค๋ฅด๋ฉด ๊ฐ™์€ Application ์ด๋ฆ„์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
ํ˜ธ์ถœ ๊ด€๊ณ„ ํ™•์ธ ๋‹ค๋ฅธ Service์™€์˜ ํ˜ธ์ถœ์„ Service Map์—์„œ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
Infrastructure System metric์˜ ์„œ๋ฒ„ ๊ทธ๋ฃน๋„ Service๋ณ„๋กœ ๋‚˜๋‰ฉ๋‹ˆ๋‹ค. Telegraf๋Š” serviceName ํ—ค๋”๋กœ Service๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. System Metrics๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.

1-2. Service ์„ ํƒ

์™ผ์ชฝ ์•„๋ž˜ Service ๋ฉ”๋‰ด๋ฅผ ๋ˆ„๋ฅด๊ณ , ์˜ค๋ฅธ์ชฝ Select Service ๋ชฉ๋ก์—์„œ ์กฐํšŒํ•  Service๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

Service๋ฅผ ์„ ํƒํ•˜๋ฉด ํ•ด๋‹น Service์˜ Service Map์œผ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.
ํ˜„์žฌ ์„ ํƒํ•œ Service์—๋Š” ์ฒดํฌ ํ‘œ์‹œ๊ฐ€ ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค. ๋ชฉ๋ก์€ ํ˜„์žฌ Service, DEFAULT, ๋‚˜๋จธ์ง€ Service ์ด๋ฆ„์ˆœ์œผ๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

Service ์„ ํƒ์€ ๋ธŒ๋ผ์šฐ์ € ํƒญ๋งˆ๋‹ค ๋…๋ฆฝ์ ์œผ๋กœ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค. ์ƒˆ ํƒญ์—์„œ๋Š” ๋งˆ์ง€๋ง‰์œผ๋กœ ์„ ํƒํ•œ Service๊ฐ€ ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

demo-shop-commerce๋ฅผ ์„ ํƒํ•˜๋ฉด ํ•ด๋‹น Service์— ์†ํ•œ Application๊ณผ ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ์ดํ„ฐ๋งŒ ์กฐํšŒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
Application ๋ชฉ๋ก๊ณผ ์กฐํšŒ ๋ฐ์ดํ„ฐ๋„ ์„ ํƒํ•œ Service๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋ฐ”๋€๋‹ˆ๋‹ค.

1-3. Service Map

Service Map์€ ์„ ํƒํ•œ Service ๋‚ด๋ถ€์˜ Application ํ˜ธ์ถœ๊ณผ ์ง์ ‘ ์—ฐ๊ฒฐ๋œ Service ๊ฐ„ ํ˜ธ์ถœ ๊ด€๊ณ„๋ฅผ ํ•œ ํ™”๋ฉด์— ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

ํ‘œ์‹œ ๋Œ€์ƒ ํ‘œ์‹œ ๋ฐฉ์‹
์„ ํƒํ•œ Service ์†Œ์† Application์„ ๊ฐœ๋ณ„ ๋…ธ๋“œ๋กœ ํŽผ์ณ์„œ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
ํ˜ธ์ถœ ๊ด€๊ณ„๊ฐ€ ์žˆ๋Š” ๋‹ค๋ฅธ Service ์—ฌ๋Ÿฌ Application์„ ํ•˜๋‚˜์˜ ๊ทธ๋ฃน ๋…ธ๋“œ๋กœ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
๊ทธ๋ฃน ๋…ธ๋“œ์˜ ์ˆซ์ž ํ•ด๋‹น Service์— ํฌํ•จ๋œ Application ์ˆ˜๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

๋ฐ๋ชจ ์‡ผํ•‘๋ชฐ์—์„œ demo-shop-commerce๋ฅผ ์„ ํƒํ•˜๋ฉด ํ˜ธ์ถœ ๊ด€๊ณ„๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

text
[Service: demo-shop-front]
             โ”‚
             โ–ผ
[Service: demo-shop-commerce]
Shopping-Order โ”€โ”€โ”€โ”€โ”€โ†’ Shopping-Product
      โ”‚                       โ”‚
      โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ†’ MySQL โ†โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
      โ–ผ
[Service: demo-shop-payment]

์„ ํƒํ•œ demo-shop-commerce(Service)์— ์†ํ•œ Shopping-Order(Application), Shopping-Product(Application), MySQL(Database)์€ ๊ฐœ๋ณ„ ๋…ธ๋“œ๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ์—ฐ๊ฒฐ๋œ demo-shop-front(Service)์™€ demo-shop-payment(Service)๋Š” ๊ฐ๊ฐ ํ•˜๋‚˜์˜ Service ๊ทธ๋ฃน ๋…ธ๋“œ๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

ํ‘œ์‹œ ๋ฒ”์œ„์™€ ๊ทธ๋ฃน ๋…ธ๋“œ์˜ ์ œํ•œ ์‚ฌํ•ญ์€ 4์žฅ์„ ์ฐธ๊ณ ํ•ฉ๋‹ˆ๋‹ค.

1-4. DEFAULT Service์˜ ์—ญํ• ๊ณผ ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ

DEFAULT๋Š” Service๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š์€ Agent์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ชจ์ด๋Š” ๊ธฐ๋ณธ Service ์ด๋ฆ„์ž…๋‹ˆ๋‹ค.

๊ตฌ๋ถ„ ์ฒ˜๋ฆฌ ๋ฐฉ์‹
Service๋ฅผ ์ง€์ •ํ•˜์ง€ ์•Š๊ณ  ์ˆ˜์ง‘ํ•œ ๋ฐ์ดํ„ฐ ๊ธฐ๋ณธ Service์ธ DEFAULT์—์„œ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.
Agent์— Service๋ฅผ ์„ค์ •ํ•˜๊ณ  ์žฌ๊ธฐ๋™ํ•œ ๋’ค ์ˆ˜์ง‘ํ•œ ๋ฐ์ดํ„ฐ ์„ค์ •ํ•œ Service์—์„œ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.
Service๋ฅผ ์ง€์ •ํ•˜๊ธฐ ์ „์— ์ˆ˜์ง‘ํ•œ ๊ธฐ์กด ๋ฐ์ดํ„ฐ DEFAULT์— ๋‚จ๊ณ  ์ƒˆ Service๋กœ ์ด๋™ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

์ƒˆ Service๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ๋งŒ์œผ๋กœ ๊ธฐ์กด Application๊ณผ ๋ฐ์ดํ„ฐ๊ฐ€ ์ด๋™ํ•˜์ง€๋Š” ์•Š์Šต๋‹ˆ๋‹ค.

Agent ์„ค์ • ๋ฐฉ๋ฒ•์€ 3์žฅ์„ ์ฐธ๊ณ ํ•ฉ๋‹ˆ๋‹ค.

2. Service ์‹œ์ž‘ํ•˜๊ธฐ

Service ๊ธฐ๋Šฅ์„ ์ผ  ๋’ค Service๋ฅผ ๋งŒ๋“ค๊ณ  Agent ์„ค์ •์„ ์ˆœ์„œ๋Œ€๋กœ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.

์ฒ˜์Œ ์„ค์ •ํ•  ๋•Œ๋Š” ๋‹ค์Œ ์ˆœ์„œ๋ฅผ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

text
Service ๊ธฐ๋Šฅ ์ผœ๊ธฐ
โ†’ Service ์ƒ์„ฑ
โ†’ Agent์— Service ์ง€์ •
โ†’ ๋ฐ์ดํ„ฐ ํ™•์ธ

2-1. Service ๊ธฐ๋Šฅ ์ผœ๊ธฐ

  1. ์™ผ์ชฝ ์•„๋ž˜ Configuration์„ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
  2. Experimental์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  3. **Enable service-based application map grouping.**์„ ์ผญ๋‹ˆ๋‹ค.
  4. ์™ผ์ชฝ ๋ฉ”๋‰ด์— Service์™€ Servicemap์ด ํ‘œ์‹œ๋˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

์ด ์„ค์ •์€ ๋ธŒ๋ผ์šฐ์ €๋ณ„๋กœ ์ €์žฅ๋ฉ๋‹ˆ๋‹ค.

๋‹ค๋ฅธ ๋ธŒ๋ผ์šฐ์ €๋‚˜ ๊ธฐ๊ธฐ์—์„œ๋Š” ๋‹ค์‹œ ์„ค์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์˜ต์…˜์ด๋‚˜ ๋ฉ”๋‰ด๊ฐ€ ๋ณด์ด์ง€ ์•Š์œผ๋ฉด Pinpoint ์šด์˜์ž์—๊ฒŒ ๋ฌธ์˜ํ•ฉ๋‹ˆ๋‹ค.

2-2. Service ์ƒ์„ฑ

  1. ์™ผ์ชฝ ์•„๋ž˜ Service๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
  2. Service Setting์„ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
  3. New Service๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
  4. Service ์ด๋ฆ„์„ ์ž…๋ ฅํ•˜๊ณ  Save๋ฅผ ๋ˆ„๋ฆ…๋‹ˆ๋‹ค.
  5. ์ƒ์„ฑํ•œ Service๊ฐ€ ํ˜„์žฌ Service๋กœ ์„ ํƒ๋๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

Service ์ด๋ฆ„์€ Agent์˜ pinpoint.serviceName์— ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

Agent์™€ ์—ฐ๊ฒฐํ•  ์ˆ˜ ์žˆ๋„๋ก ๋‹ค์Œ ๊ทœ์น™์— ๋งž์ถฐ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

ํ•ญ๋ชฉ ๊ทœ์น™
๊ธธ์ด 3~254์ž
ํ—ˆ์šฉ ๋ฌธ์ž ์˜๋ฌธ ๋Œ€์†Œ๋ฌธ์ž, ์ˆซ์ž, ๋งˆ์นจํ‘œ(.), ๋ฐ‘์ค„(_), ํ•˜์ดํ”ˆ(-)
์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋Š” ๋ฌธ์ž ๊ณต๋ฐฑ, ํ•œ๊ธ€, ์Šฌ๋ž˜์‹œ
์ค‘๋ณต ์ด๋ฆ„ ๊ธฐ์กด Service์™€ ๋Œ€์†Œ๋ฌธ์ž๋งŒ ๋‹ค๋ฅธ ์ด๋ฆ„๋„ ์‚ฌ์šฉ ๋ถˆ๊ฐ€
์˜ˆ์•ฝ ์ด๋ฆ„ DEFAULT, ERROR, UNKNOWN, NULL, TEST

์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ด๋ฆ„์˜ ์˜ˆ๋Š” demo-shop-commerce, member-platform, finance-platform์ž…๋‹ˆ๋‹ค.

Service๋ฅผ ๋งŒ๋“  ์งํ›„์—๋Š” ์†Œ์† Application์ด ์—†์Šต๋‹ˆ๋‹ค.

3์žฅ์˜ Agent ์„ค์ •์„ ๋งˆ์น˜๊ณ  ๋ฐ์ดํ„ฐ๊ฐ€ ์ˆ˜์ง‘๋˜๋ฉด Application์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

2-3. Service ์„ ํƒ

๋‹ค์Œ ๋‘ ์œ„์น˜์—์„œ Service๋ฅผ ์„ ํƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ์™ผ์ชฝ ์•„๋ž˜ Service ๋ฉ”๋‰ด
  • Service Setting ๋ชฉ๋ก์˜ Switch To

์„ ํƒํ•œ Service๋Š” ์™ผ์ชฝ ์•„๋ž˜ Service ๋ฉ”๋‰ด์—์„œ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

2-4. Service ์‚ญ์ œ

Service ์‚ญ์ œ ์‹œ ๊ธฐ์กด ๋ฐ์ดํ„ฐ๋Š” ๋ณต๊ตฌ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

Service ์‚ญ์ œ๊ฐ€ ๋ฏธ์น˜๋Š” ์˜ํ–ฅ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

ํ•ญ๋ชฉ ์‚ญ์ œ ํ›„ ์ƒํƒœ
Service ๋“ฑ๋ก ์ •๋ณด ์‚ญ์ œ๋ฉ๋‹ˆ๋‹ค.
๊ธฐ์กด ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ์ดํ„ฐ ๋‚จ์•„ ์žˆ์ง€๋งŒ ๋‹ค๋ฅธ Service๋กœ ์ด๋™ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
๊ฐ™์€ ์ด๋ฆ„์œผ๋กœ ๋‹ค์‹œ ๋งŒ๋“  Service ์ƒˆ๋กœ์šด Service๋กœ ๋“ฑ๋ก๋˜๋ฉฐ ๊ธฐ์กด ๋ฐ์ดํ„ฐ์™€ ์—ฐ๊ฒฐ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

Service๋ฅผ ์‚ญ์ œํ•œ ๋’ค ํ•ด๋‹น Service์˜ Agent๋ฅผ ์žฌ๊ธฐ๋™ํ•˜๋ฉด ๋“ฑ๋ก์ด ์‹คํŒจํ•˜๊ณ  ์‹ ๊ทœ ๋ฐ์ดํ„ฐ๊ฐ€ ์ˆ˜์ง‘๋˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์‚ญ์ œ๊ฐ€ ํ•„์š”ํ•œ ๊ฒฝ์šฐ ๋‹ค์Œ ์ˆœ์„œ๋ฅผ ๋”ฐ๋ฆ…๋‹ˆ๋‹ค.

  1. ํ•ด๋‹น Service๋ฅผ ์‚ฌ์šฉํ•˜๋Š” Agent๋ฅผ ์ค‘์ง€ํ•˜๊ฑฐ๋‚˜ ๋‹ค๋ฅธ Service๋กœ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.
  2. ๋ณ€๊ฒฝํ•œ Service์—์„œ ์‹ ๊ทœ ๋ฐ์ดํ„ฐ๊ฐ€ ์ˆ˜์ง‘๋˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

์‚ญ์ œํ•œ Service๊ฐ€ ๋ชฉ๋ก์—์„œ ์‚ฌ๋ผ์ง€๋Š” ๋ฐ ์‹œ๊ฐ„์ด ๊ฑธ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

DEFAULT๋Š” ์‚ญ์ œํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

3. Agent์— Service ์„ค์ •

Service ๊ธฐ๋Šฅ์€ Pinpoint Agent 4.0.0 ์ด์ƒ์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Agent ์‹œ์ž‘ ์˜ต์…˜์— Service, Application, Agent ์ด๋ฆ„์„ ์„ค์ •ํ•˜๋ฉด Pinpoint๊ฐ€ ์†Œ์† ๊ด€๊ณ„๋ฅผ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค.

3-1. ์„ค์ • ์ „ ํ™•์ธ

Service, Application, Agent ์ด๋ฆ„์€ ๊ฐ ํ™˜๊ฒฝ์˜ ๊ตฌ์„ฑ๊ณผ ์šด์˜ ๊ธฐ์ค€์— ๋งž๊ฒŒ ์ •ํ•ฉ๋‹ˆ๋‹ค.

์ด ์žฅ์—์„œ๋Š” ์ƒํ’ˆยท์ฃผ๋ฌธ ์˜์—ญ์„ ํ•˜๋‚˜์˜ Service๋กœ ๊ตฌ์„ฑํ•˜๊ณ , ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ด๋ฆ„์„ ์ •ํ–ˆ๋‹ค๊ณ  ๊ฐ€์ •ํ•ฉ๋‹ˆ๋‹ค.

๊ตฌ๋ถ„ ์˜ˆ์‹œ ์ด๋ฆ„
Service demo-shop-commerce
Application Shopping-Order
Agent shop-order-01

Agent๋ฅผ ๊ธฐ๋™ํ•˜๊ธฐ ์ „์— Pinpoint Web์—์„œ demo-shop-commerce Service๋ฅผ ๋จผ์ € ๋งŒ๋“ญ๋‹ˆ๋‹ค. ์‹ค์ œ ํ™˜๊ฒฝ์—์„œ๋Š” ์œ„ ์ด๋ฆ„์„ ๊ฐ ํ™˜๊ฒฝ์—์„œ ์ •ํ•œ ์ด๋ฆ„์œผ๋กœ ๋ฐ”๊ฟ”์„œ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

Pinpoint Agent๊ฐ€ 4.0.0๋ณด๋‹ค ๋‚ฎ๋‹ค๋ฉด ์—…๊ทธ๋ ˆ์ด๋“œํ•œ ๋’ค Service๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. Service์™€ Application ์ด๋ฆ„์€ Pinpoint Web์— ํ‘œ์‹œ๋œ ๊ฐ’๊ณผ ๋Œ€์†Œ๋ฌธ์ž๊นŒ์ง€ ๊ฐ™์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.

3-2. JVM ์˜ต์…˜ ์„ค์ •

3-1์—์„œ ์ •ํ•œ ์˜ˆ์‹œ ์ด๋ฆ„์„ JVM ์˜ต์…˜์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

์„ค์ • ์˜ˆ์‹œ ๊ฐ’ ์˜๋ฏธ
pinpoint.serviceName demo-shop-commerce Agent๊ฐ€ ์†ํ•  Service์ž…๋‹ˆ๋‹ค. Pinpoint Web์— ๋จผ์ € ๋“ฑ๋ก๋ผ ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
pinpoint.applicationName Shopping-Order Agent๊ฐ€ ์†ํ•  Application์ž…๋‹ˆ๋‹ค.
pinpoint.agentName shop-order-01 ์‹คํ–‰ ์ค‘์ธ ์ธ์Šคํ„ด์Šค๋ฅผ ๊ตฌ๋ถ„ํ•˜๋Š” ์ด๋ฆ„์ž…๋‹ˆ๋‹ค. ์„ ํƒ ํ•ญ๋ชฉ์ž…๋‹ˆ๋‹ค.
bash
-Dpinpoint.serviceName=demo-shop-commerce
-Dpinpoint.applicationName=Shopping-Order
-Dpinpoint.agentName=shop-order-01

pinpoint.serviceName๊ณผ pinpoint.applicationName์€ ๋ฐ˜๋“œ์‹œ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

pinpoint.agentName์„ ์ƒ๋žตํ•˜๋ฉด Agent๊ฐ€ ์ธ์Šคํ„ด์Šค ์ด๋ฆ„์„ ์ž๋™์œผ๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

์žฌ๊ธฐ๋™ ์ „ํ›„์˜ ์ธ์Šคํ„ด์Šค๋ฅผ ์‰ฝ๊ฒŒ ๊ตฌ๋ถ„ํ•˜๋ ค๋ฉด ์ด๋ฆ„์„ ์ง์ ‘ ์ง€์ •ํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

3-3. ์„ค์ • ์ ์šฉ๊ณผ ํ™•์ธ

  1. ์„ค์ •์„ ๋ฐ˜์˜ํ•œ ๋’ค Agent๋ฅผ ์žฌ๊ธฐ๋™ํ•ฉ๋‹ˆ๋‹ค.
  2. Agent ๋กœ๊ทธ์—์„œ ๋“ฑ๋ก ์„ฑ๊ณต ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  3. Pinpoint Web์—์„œ ๋“ฑ๋กํ•œ Service๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
  4. Application ๋ชฉ๋ก๊ณผ Service Map์—์„œ ์„ค์ •ํ•œ Application์ด ํ‘œ์‹œ๋˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  5. ์ตœ๊ทผ ์‹œ๊ฐ„ ๋ฒ”์œ„์—์„œ Transaction๊ณผ Agent ์ƒํƒœ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

4. ํ˜„์žฌ ์ง€์› ๋ฒ”์œ„์™€ ์ œํ•œ ์‚ฌํ•ญ

Service ๊ธฐ๋Šฅ์„ ์ง€์›ํ•˜๋Š” ํ™”๋ฉด์—์„œ๋Š” ์„ ํƒํ•œ Service๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.

4-1. Service๊ฐ€ ์ ์šฉ๋œ ์ฃผ์š” ๊ธฐ๋Šฅ

์˜์—ญ Service ์ ์šฉ ๋‚ด์šฉ
Application๊ณผ Agent ์„ ํƒํ•œ Service์— ์†ํ•œ Application๊ณผ Agent๋งŒ ์กฐํšŒ
Service Map ์„ ํƒํ•œ Service์˜ Application๊ณผ ๋‹ค๋ฅธ Service์˜ ํ˜ธ์ถœ ๊ด€๊ณ„ ์กฐํšŒService Map, Heatmap, Scatter๋ฅผ ์‹ค์‹œ๊ฐ„์œผ๋กœ ๊ฐฑ์‹ ํ•˜๊ณ  ์„ ํƒํ•œ Application์˜ Active Request ์กฐํšŒ
Transaction ๋ถ„์„ Heatmap, Scatter, Histogram, Apdex, Transaction ๋ชฉ๋ก๊ณผ ์ƒ์„ธ ์กฐํšŒ
ํ†ต๊ณ„์™€ ๋ถ„์„ Inspector, URL Statistic, Exception Trace ์กฐํšŒ

4-2. ํ˜„์žฌ ์ œํ•œ ์‚ฌํ•ญ

๊ธฐ๋Šฅ ํ˜„์žฌ ์ œํ•œ ์‚ฌ์šฉ ์‹œ ์ฃผ์˜์‚ฌํ•ญ
Service Map ์„ ํƒํ•œ Service๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋“ค์–ด์˜ค๋Š” ํ˜ธ์ถœ๊ณผ ๋‚˜๊ฐ€๋Š” ํ˜ธ์ถœ์„ ๊ฐ๊ฐ ํ•œ ๋‹จ๊ณ„๊นŒ์ง€ ์กฐํšŒ ๋‘ ๋‹จ๊ณ„ ์ด์ƒ ๋–จ์–ด์ง„ Service๋Š” ํ‘œ์‹œ๋˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Œ
๊ทธ๋ฃน ๋…ธ๋“œ ์ ‘ํžŒ Service ๋‚ด๋ถ€์˜ Application ํ˜ธ์ถœ์„ ๋ชจ๋‘ ํ‘œํ˜„ํ•˜์ง€ ๋ชปํ•  ์ˆ˜ ์žˆ์Œ ๊ทธ๋ฃน ๋…ธ๋“œ๋Š” Service ๊ฐ„ ์—ฐ๊ฒฐ์„ ํ™•์ธํ•˜๋Š” ์šฉ๋„๋กœ ์‚ฌ์šฉ
Infrastructure Service ๋ฒ”์œ„๊ฐ€ ์ ์šฉ๋˜์ง€ ์•Š์Œ ์—ฌ๋Ÿฌ Service์˜ ๋ฐ์ดํ„ฐ๊ฐ€ ํ•จ๊ป˜ ๋ณด์ผ ์ˆ˜ ์žˆ์Œ
OpenTelemetry Metric Service ๋ฒ”์œ„๊ฐ€ ์ ์šฉ๋˜์ง€ ์•Š์Œ ์„ ํƒํ•œ Service์™€ ๊ด€๊ณ„์—†์ด ๋ฐ์ดํ„ฐ๊ฐ€ ํ•จ๊ป˜ ๋ณด์ผ ์ˆ˜ ์žˆ์Œ

5. FAQ

5-1. Service ๊ธฐ๋Šฅ์„ ๋„๋ฉด ๋ฐ์ดํ„ฐ๋Š” ์–ด๋””์—์„œ ๋ณด๋‚˜์š”?

Service ๊ธฐ๋Šฅ์„ ๋„๋ฉด ๊ธฐ์กด Servermap์—์„œ DEFAULT ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.

ํŠน์ • Service์— ์ €์žฅ๋œ ๋ฐ์ดํ„ฐ๋Š” DEFAULT๋กœ ์ด๋™ํ•˜์ง€ ์•Š์œผ๋ฉฐ ๊ธฐ์กด Servermap์—๋„ ํ‘œ์‹œ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

ํ•ด๋‹น ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด๋ ค๋ฉด Service ๊ธฐ๋Šฅ์„ ๋‹ค์‹œ ์ผœ๊ณ  ์˜ฌ๋ฐ”๋ฅธ Service๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

5-2. Service๋ฅผ ๋งŒ๋“ค์—ˆ๋Š”๋ฐ Application์ด ๋ณด์ด์ง€ ์•Š์Šต๋‹ˆ๋‹ค

๋‹ค์Œ์„ ์ˆœ์„œ๋Œ€๋กœ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

  1. Pinpoint Agent๊ฐ€ 4.0.0 ์ด์ƒ์ธ์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  2. Agent๋ณด๋‹ค ๋จผ์ € Service๋ฅผ ๋งŒ๋“ค์—ˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  3. pinpoint.serviceName์ด ํ—ˆ์šฉ ๋ฌธ์ž์™€ ๊ธธ์ด(3~254์ž) ์ œํ•œ์„, pinpoint.applicationName์ด ํ—ˆ์šฉ ๋ฌธ์ž์™€ 254์ž ์ œํ•œ์„ ๋งŒ์กฑํ•˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  4. pinpoint.serviceName์ด ๋“ฑ๋กํ•œ Service์™€ ๋Œ€์†Œ๋ฌธ์ž๊นŒ์ง€ ๊ฐ™์€์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  5. Service๋ฅผ Agent๋ณด๋‹ค ๋Šฆ๊ฒŒ ๋งŒ๋“ค์—ˆ๋‹ค๋ฉด ์ตœ๋Œ€ 10๋ถ„ ๊ธฐ๋‹ค๋ฆฐ ๋’ค Agent๋ฅผ ์žฌ๊ธฐ๋™ํ•ฉ๋‹ˆ๋‹ค.
  6. Agent ๋“ฑ๋ก ๋กœ๊ทธ์—์„œ ์˜ค๋ฅ˜๊ฐ€ ์—†๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  7. Pinpoint Web์—์„œ ์˜ฌ๋ฐ”๋ฅธ Service์™€ ์ตœ๊ทผ ์‹œ๊ฐ„ ๋ฒ”์œ„๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

5-3. ๊ฐ™์€ Application ์ด๋ฆ„์„ ์—ฌ๋Ÿฌ Service์—์„œ ์จ๋„ ๋˜๋‚˜์š”?

์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

commerce-service / order-api์™€ partner-service / order-api๋Š” ์„œ๋กœ ๋‹ค๋ฅธ Application์œผ๋กœ ๊ตฌ๋ถ„๋ฉ๋‹ˆ๋‹ค.

5-4. Service ์ด๋ฆ„์„ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ๋‚˜์š”?

Service ์ด๋ฆ„์€ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

์ƒˆ Service๋ฅผ ๋งŒ๋“  ๋’ค Agent์˜ pinpoint.serviceName์„ ๋ณ€๊ฒฝํ•˜๊ณ  ์žฌ๊ธฐ๋™ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋ณ€๊ฒฝ ์ดํ›„์— ์ˆ˜์ง‘ํ•œ ๋ฐ์ดํ„ฐ๋งŒ ์ƒˆ Service์— ์ €์žฅ๋ฉ๋‹ˆ๋‹ค.

๊ธฐ์กด ๋ฐ์ดํ„ฐ๋Š” ์ƒˆ Service๋กœ ๋ณต์‚ฌ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

5-5. ์‚ญ์ œํ•œ Service๋ฅผ ๊ฐ™์€ ์ด๋ฆ„์œผ๋กœ ๋งŒ๋“ค๋ฉด ๋ณต๊ตฌ๋˜๋‚˜์š”?

๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ์ดํ„ฐ๋Š” ๋ณต๊ตฌ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๊ฐ™์€ ์ด๋ฆ„์œผ๋กœ ๋‹ค์‹œ ๋งŒ๋“ค์–ด๋„ ์ƒˆ๋กœ์šด Service๋กœ ๋“ฑ๋ก๋˜๋ฉฐ, ์‚ญ์ œ ์ „ ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ์ดํ„ฐ๋Š” ์—ฐ๊ฒฐ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

5-6. 4.0.0 ์ ์šฉ ํ›„ ํ˜ธ์ถœ ๋Œ€์ƒ Application์ด `ํ˜ธ์ŠคํŠธ:ํฌํŠธ (UNKNOWN)`์œผ๋กœ ๋ณด์ž…๋‹ˆ๋‹ค

Service๋ฅผ ์„ ํƒํ•œ Service Map์—์„œ ํ˜ธ์ถœ ๋Œ€์ƒ Application์ด ํ˜ธ์ŠคํŠธ:ํฌํŠธ ์ด๋ฆ„์˜ UNKNOWN ๋…ธ๋“œ(๊ตฌ๋ฆ„ ์•„์ด์ฝ˜)๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค. ํŠธ๋žœ์žญ์…˜ ์ฝœํŠธ๋ฆฌ์—์„œ๋Š” ๋‘ Application์ด ์ •์ƒ์ ์œผ๋กœ ํ•จ๊ป˜ ๋ณด์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์›์ธ

ํ˜ธ์ถœ๋ฐ›๋Š” Application์˜ Agent ๋ฒ„์ „์ด 3.1.0 ๋ฏธ๋งŒ์ด๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

ํ˜ธ์ถœํ•˜๋Š” Application ํ˜ธ์ถœ๋ฐ›๋Š” Application์˜ Agent Service Map ์—ฐ๊ฒฐ ํŠธ๋žœ์žญ์…˜ ์ฝœํŠธ๋ฆฌ
4.0.0, Service์— ์†ํ•จ 3.0.x ์ดํ•˜ ๋Š๊น€ ์ •์ƒ
4.0.0, Service์— ์†ํ•จ 4.0.0 ๋˜๋Š” 3.1.x ์ •์ƒ ์ •์ƒ

Service์— ์†ํ•œ Application์€ ์š”์ฒญ์„ ๋ณด๋‚ผ ๋•Œ ์ž์‹ ์ด ์†ํ•œ Service ์ •๋ณด๋ฅผ ํ•จ๊ป˜ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. ์š”์ฒญ์„ ๋ฐ›๋Š” ์ชฝ์˜ Agent๊ฐ€ ์ด ์ •๋ณด๋ฅผ ์ฝ์–ด Pinpoint์— ๋ณด๊ณ ํ•ด์•ผ ๋‘ Application ์‚ฌ์ด์˜ ์—ฐ๊ฒฐ์ด Service ๊ธฐ์ค€์œผ๋กœ ๊ทธ๋ ค์ง‘๋‹ˆ๋‹ค. ์ด ์ •๋ณด๋ฅผ ์ฝ๋Š” ๊ธฐ๋Šฅ์€ Agent 3.1.0๋ถ€ํ„ฐ ์ง€์›ํ•˜๋ฏ€๋กœ, ๋ฐ›๋Š” ์ชฝ Agent๊ฐ€ 3.0.x ์ดํ•˜์ด๋ฉด ์—ฐ๊ฒฐ์ด ๋Š๊ฒจ ๋ณด์ž…๋‹ˆ๋‹ค.

์กฐ์น˜ ๋ฐฉ๋ฒ•

๋Œ€์ƒ Application์˜ Agent ๋ฒ„์ „์ด 3.1.0 ๋ฏธ๋งŒ์ด๋ฉด 3.1.0 ์ด์ƒ์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•ฉ๋‹ˆ๋‹ค. 4.0.0 ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•˜๋Š” ๊ฒƒ์„ ๊ฐ€์žฅ ์ถ”์ฒœํ•ฉ๋‹ˆ๋‹ค.

์šด์˜์ž ๊ฐ€์ด๋“œ

Pinpoint Web๊ณผ Collector๋ฅผ ์ค€๋น„ํ•˜๊ณ  Service ๊ธฐ๋Šฅ์„ ์ ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

6. ๊ตฌ์กฐ์™€ ๊ธฐ๋ณธ ์„ค์ •

6-1. ๊ตฌ์„ฑ ์š”์†Œ

Service ๊ธฐ๋Šฅ์€ ๋‹ค์Œ ๊ตฌ์„ฑ ์š”์†Œ๊ฐ€ ํ•จ๊ป˜ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.

๊ตฌ์„ฑ ์š”์†Œ ์—ญํ• 
Pinpoint Agent ์„ค์ •ํ•œ Service, Application, Agent ์ •๋ณด๋ฅผ Collector๋กœ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.
Pinpoint Collector Agent๊ฐ€ ๋ณด๋‚ธ Service ์ด๋ฆ„์„ Service Registry์—์„œ ํ™•์ธํ•˜๊ณ  ์ˆ˜์ง‘ ๋ฐ์ดํ„ฐ๋ฅผ ํ•ด๋‹น Service์™€ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.
Pinpoint Web Service ์ƒ์„ฑยท์‚ญ์ œ์™€ Service ๋‹จ์œ„ ์กฐํšŒ API ๋ฐ ํ™”๋ฉด์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
MySQL Service ์ด๋ฆ„๊ณผ Service UID๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” Service Registry๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
HBase Service Map, Transaction, Application๊ณผ Agent ์กฐํšŒ์— ์‚ฌ์šฉํ•˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
Pinot Heatmap, Inspector, URL Stat, Exception Stat, Infrastructure, OpenTelemetry Metric ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.

Pinpoint Web๊ณผ Collector๋Š” ๋™์ผํ•œ Service Registry๋ฅผ ์กฐํšŒํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋‘ ๊ตฌ์„ฑ ์š”์†Œ๊ฐ€ ์„œ๋กœ ๋‹ค๋ฅธ MySQL์˜ service ํ…Œ์ด๋ธ”์„ ์‚ฌ์šฉํ•˜๋ฉด Web์—์„œ ์ƒ์„ฑํ•œ Service๋ฅผ Collector๊ฐ€ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

Service ์ •๋ณด๊ฐ€ ์ €์žฅ๋˜๊ณ  ์กฐํšŒ๋˜๋Š” ํ๋ฆ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

MySQL Service Registry์—๋Š” Service ์ด๋ฆ„๊ณผ UID๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค. ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ์ดํ„ฐ๋Š” MySQL์„ ๊ฑฐ์น˜์ง€ ์•Š๊ณ  HBase์™€ Pinot์— ์ €์žฅ๋ฉ๋‹ˆ๋‹ค.

Web์— ์ƒ์„ฑํ•œ Service ์ด๋ฆ„๊ณผ Agent์— ์„ค์ •ํ•œ Service ์ด๋ฆ„์ด ๊ฐ™์•„์•ผ ์ˆ˜์ง‘ ๋ฐ์ดํ„ฐ๋ฅผ ์˜ฌ๋ฐ”๋ฅธ Service์—์„œ ์กฐํšŒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

6-2. ๊ธฐ๋ณธ ์„ค์ • ํ™•์ธ

Pinpoint 4.0.0์—์„œ๋Š” Service ๊ธฐ๋Šฅ์ด ๊ธฐ๋ณธ์œผ๋กœ ํ™œ์„ฑํ™”๋ฉ๋‹ˆ๋‹ค. ๊ด€๋ จ ์„ค์ •์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

๊ณ„์ธต ์„ค์ • 4.0.0 ๊ธฐ๋ณธ๊ฐ’ ๊ธฐ์ค€ ํŒŒ์ผ
Collector pinpoint.collector.service.lookup.enabled true collector/src/main/resources/pinpoint-collector-root.properties
Service Map API pinpoint.modules.web.servicemap.enabled true web/src/main/resources/pinpoint-web-root.properties
๋ธŒ๋ผ์šฐ์ € UI ์ดˆ๊ธฐ๊ฐ’ experimental.enableServiceMap.value true web/src/main/resources/pinpoint-web-root.properties

7. 4.0.0 ์Šคํ‚ค๋งˆ ๋ณ€๊ฒฝ์‚ฌํ•ญ

Pinpoint 4.0.0 ๋ฒ„์ „ ์—…๊ทธ๋ ˆ์ด๋“œ ์‹œ ์Šคํ‚ค๋งˆ ๋ณ€๊ฒฝ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

7-1. Pinot

  • exceptionTrace ํ…Œ์ด๋ธ” ์ปฌ๋Ÿผ ์ถ”๊ฐ€
    • ๋ณ€๊ฒฝ ๋‚ด์šฉ: serviceName ์ปฌ๋Ÿผ ์ถ”๊ฐ€ (STRING, ๊ธฐ๋ณธ๊ฐ’ DEFAULT)
    • ์Šคํ‚ค๋งˆ: pinot-exceptionTrace-schema.json

7-2. MySQL

  • service ํ…Œ์ด๋ธ” ์ƒ์„ฑ
  • ์•Œ๋žŒ ๊ด€๋ จ ํ…Œ์ด๋ธ” ์ƒ์„ฑ
    • ํ…Œ์ด๋ธ”: alarm_template, alarm_template_item, alarm_rule_v2, alarm_rule_local_config, alarm_notification_channel, alarm_channel_binding, alarm_state, alarm_history_v2, alarm_notification_outbox
    • ์š”๊ตฌ ์‚ฌํ•ญ: MySQL 8.4 ์ด์ƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค. ์„ค์ • ์ปฌ๋Ÿผ์ด JSON ํƒ€์ž…์ž…๋‹ˆ๋‹ค.
    • ์Šคํ‚ค๋งˆ: CreateTableStatement-mysql.sql

7-3. HBase

  • 3.1.0 ๋ฒ„์ „์—์„œ service์— ๊ด€๋ จ๋œ ํ…Œ์ด๋ธ”์ด ์ด๋ฏธ ์ถ”๊ฐ€๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
  • ๋งŒ์•ฝ 3.1.0 ๋ฏธ๋งŒ ๋ฒ„์ „์—์„œ 4.0.0์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•˜๋Š” ๊ฒฝ์šฐ ์•„๋ž˜ ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ HBase ํ…Œ์ด๋ธ”์„ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.
  • https://pinpoint-apm.gitbook.io/pinpoint/documents/hbase-table-changes#id-3.1.0

File: documents/system_metric.md

English | ํ•œ๊ตญ์–ด

1 System Metrics

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.

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 Pinot and Kafka Setup

If Pinot and Kafka are already installed, you can skip this setup step. Otherwise, set them up by following the Pinot installation guide before creating System Metric topics and tables.

3.2 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.3 Create Pinot Tables

  • 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.

3.4 Configure and Run Pinpoint Collector and Web with System Metrics

Configure and run the collector starter with METRIC or ALL type.
Configure and run the web starter to display System Metric data stored in Pinot.

To show the System Metric menu, enable the following option in pinpoint-web-metric.properties:

text
config.show.systemMetric=true

3.5 Install and Configure Telegraf 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 guide.
  • Add below configuration to telegraf.conf file to send collected metrics to Pinpoint collector via http.
    • Note: Starting from Pinpoint v3.0.2, the metric port has been changed from 15200 to 9995.
    • text
      [[outputs.http]]
                  url = "http://{PINPOINT_COLLECTOR_IP}:9995/telegraf"
                   
                   [outputs.http.headers]
                   hostGroupName = {applicationName}
                   serviceName = {serviceName}
                   Content-Type = "application/json"
    • 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.
    • serviceName (optional, Pinpoint v4.1.0 or later): the service that the host group belongs to. Pinpoint web shows the host group only when this service is selected.
      • If you omit it, the collector stores the metrics in the DEFAULT service. default is also stored as DEFAULT.
      • Use 3 to 254 characters of letters, digits, ., _, and -. The collector rejects other values with 400 Bad Request.

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 described in 3.5.
    • The list shows only the host groups of the selected service. Select the service set in the serviceName header.
    • Metrics collected before v4.1.0 have no service. They are shown in the DEFAULT service until they expire.
  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 guide for instructions.

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

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

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

2 ๊ตฌ์กฐ

  • โ‘  telgegraf agent์—์„œ system metric ๋ฐ์ดํ„ฐ๋ฅผ collector์— ์ „๋‹ฌํ•œ๋‹ค.
  • โ‘ก collector๋Š” kafka์— ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•˜์—ฌ pinot์— ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•œ๋‹ค.
    • ์ฐธ๊ณ ๋กœ pinot๋Š” stream ๋ฐ์ดํ„ฐ ์ „์†ก์„ ์œ„ํ•ด์„œ kafka๋ฅผ ๋ฐ˜๋“œ์‹œ ํ•„์š”๋กœ ํ•œ๋‹ค.
  • โ‘ข web์€ pinot์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜์—ฌ ํ™”๋ฉด์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด์—ฌ์ค€๋‹ค.

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

3.1 Pinot์™€ Kafka ์ค€๋น„

Pinot์™€ Kafka๊ฐ€ ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด ์ด ์ค€๋น„ ๋‹จ๊ณ„๋Š” ๊ฑด๋„ˆ๋›ฐ์–ด๋„ ๋œ๋‹ค. ์•„์ง ์„ค์น˜ํ•˜์ง€ ์•Š์•˜๋‹ค๋ฉด System Metric์šฉ topic๊ณผ table์„ ์ƒ์„ฑํ•˜๊ธฐ ์ „์— Pinot ์„ค์น˜ ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ Pinot์™€ Kafka๋ฅผ ์ค€๋น„ํ•œ๋‹ค.

3.2 Kafka topic ์ƒ์„ฑ

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

3.3 Pinot table ์ƒ์„ฑ

  • ํ…Œ์ด๋ธ” ์ƒ์„ฑ ์Šคํ‚ค๋งˆ ํŒŒ์ผ์— ํ…Œ์ด๋ธ” ์ •๋ณด๊ฐ€ ์žˆ๋‹ค.
  • ํ…Œ์ด๋ธ” ์ƒ์„ฑ ๋ฐฉ๋ฒ•์€ pinot๊ฐ€์ด๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ pinot ์‹คํ–‰ ํ™˜๊ฒฝ ๋งž๊ฒŒ ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•˜๋ฉด ๋œ๋‹ค.
  • ์ƒ์„ฑํ•˜๋Š” ํ…Œ์ด๋ธ”์€ ์ด 3๊ฐœ์ด๋‹ค.
    • systemMetricDataType : ์ˆ˜์ง‘๋˜๋Š” ๋ฐ์ดํ„ฐ์˜ type ์ •๋ณด๋ฅผ ์ €์žฅํ•˜๋Š” ํ…Œ์ด๋ธ”์ด๋‹ค.
    • systemMetricTag : ์ˆ˜์ง‘๋˜๋Š” ๋ฐ์ดํ„ฐ์˜ metadata(host ์ •๋ณด, ๋ฐ์ดํ„ฐ์˜ tag ์ •๋ณด)๋ฅผ ์ €์žฅํ•˜๋Š” ํ…Œ์ด๋ธ”์ด๋‹ค.
    • systemMetricDouble : double ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๋Š” ํ…Œ์ด๋ธ”์ด๋‹ค. hybrid table ๊ธฐ๋Šฅ ์‚ฌ์šฉ์„ ์œ„ํ•ด์„œ REALTIME, OFFLINE ํ…Œ์ด๋ธ” ๋‘˜๋‹ค ์ƒ์„ฑํ•˜์ž.

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

System Metric ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๋ ค๋ฉด collector starter๋ฅผ METRIC ๋˜๋Š” ALL ํƒ€์ž…์œผ๋กœ ์‹คํ–‰ํ•œ๋‹ค.
Pinot์— ์ €์žฅ๋œ System Metric ๋ฐ์ดํ„ฐ๋ฅผ ํ™•์ธํ•˜๋ ค๋ฉด web starter๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.

System Metric ๋ฉ”๋‰ด๋ฅผ ํ‘œ์‹œํ•˜๋ ค๋ฉด pinpoint-web-metric.properties์— ์•„๋ž˜ ์„ค์ •๊ฐ’์„ ์ถ”๊ฐ€ํ•œ๋‹ค:

text
config.show.systemMetric=true

3.5 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 ์•„๋ž˜ ์„ค์ •์„ ์ถ”๊ฐ€ํ•œ๋‹ค.
        • ์ฐธ๊ณ : Pinpoint v3.0.2๋ถ€ํ„ฐ ๋ฉ”ํŠธ๋ฆญ ํฌํŠธ๊ฐ€ 15200์—์„œ 9995๋กœ ๋ณ€๊ฒฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
        • text
          [[outputs.http]]
                    url = "http://{PINPOINT_COLLECTOR_IP}:9995/telegraf"
                     
                     [outputs.http.headers]
                     hostGroupName = {applicationName}
                     serviceName = {serviceName}
                     Content-Type = "application/json"
      • url: {PINPOINT_COLLECTOR_IP} ์ž๋ฆฌ์— ๋ฐ์ดํ„ฐ๋ฅผ ์ˆ˜์ง‘ํ•˜๋Š” collector์˜ ์ฃผ์†Œ๋ฅผ ์„ค์ •ํ•œ๋‹ค.
      • outputs.http.headers์€ ์„œ๋ฒ„ ๊ทธ๋ฃน์˜ key์™€ Content-Type์„ ์„ค์ •ํ•œ๋‹ค.
        • hostGroupName: {applicationName}์— ์„ค์ •ํ•œ ๊ฐ’์„ key๋กœ pinpoint-web์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•  ์ˆ˜ ์žˆ๋‹ค. ํ•€ํฌ์ธํŠธ๋ฅผ ์ด๋ฏธ ์‚ฌ์šฉ ์ค‘์ด๋ผ๋ฉด application์„ ์ถ”์ ํ•  ๋•Œ agent ์„ค์ • ๊ฐ’์œผ๋กœ ์‚ฌ์šฉํ–ˆ๋˜ applicationName์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•œ๋‹ค.
        • serviceName (์„ ํƒ, Pinpoint v4.1.0 ์ด์ƒ): ์„œ๋ฒ„ ๊ทธ๋ฃน์ด ์†ํ•œ service๋ฅผ ์„ค์ •ํ•œ๋‹ค. pinpoint-web์—์„œ๋Š” ์ด service๋ฅผ ์„ ํƒํ–ˆ์„ ๋•Œ๋งŒ ์„œ๋ฒ„ ๊ทธ๋ฃน์ด ๋ณด์ธ๋‹ค.
          • ์ƒ๋žตํ•˜๋ฉด collector๋Š” DEFAULT service๋กœ ์ €์žฅํ•œ๋‹ค. default๋„ DEFAULT๋กœ ์ €์žฅํ•œ๋‹ค.
          • ์˜๋ฌธ์ž, ์ˆซ์ž, ., _, -๋กœ 3~254์ž๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. ๋‹ค๋ฅธ ๊ฐ’์€ collector๊ฐ€ 400 Bad Request๋กœ ๊ฑฐ๋ถ€ํ•œ๋‹ค.

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

  • pinpoint-web์—์„œ ์™ผ์ชฝ Infrastructure ๋ฉ”๋‰ด๋ฅผ ์„ ํƒํ•˜์—ฌ system metric ํ™”๋ฉด์œผ๋กœ ์ด๋™ํ•œ๋‹ค.
  • ์ƒ๋‹จ์˜ select box์—์„œ telegraf.conf ํŒŒ์ผ์— ์„ค์ •ํ•œ hostGroupName ๊ฐ’์„ ์ฐพ์•„์„œ ์„ ํƒํ•œ๋‹ค.
    • ๋ชฉ๋ก์—๋Š” ์„ ํƒํ•œ service์˜ ์„œ๋ฒ„ ๊ทธ๋ฃน๋งŒ ๋‚˜์˜จ๋‹ค. serviceName ํ—ค๋”์— ์„ค์ •ํ•œ service๋ฅผ ์„ ํƒํ•ด์•ผ ํ•œ๋‹ค.
    • v4.1.0 ์ด์ „์— ์ˆ˜์ง‘ํ•œ ๋ฉ”ํŠธ๋ฆญ์—๋Š” service๊ฐ€ ์—†๋‹ค. ์ด ๋ฐ์ดํ„ฐ๋Š” ๋ณด๊ด€ ๊ธฐ๊ฐ„์ด ๋๋‚  ๋•Œ๊นŒ์ง€ DEFAULT service์—์„œ ๋ณด์ธ๋‹ค.
  • ์•„๋ž˜์™€ ๊ฐ™์ด ์™ผ์ชฝ์— ํ˜ธ์ŠคํŠธ ๋ชฉ๋ก์ด ๋‚˜์˜ค๊ณ , ํ˜ธ์ŠคํŠธ๋ฅผ ์„ ํƒํ•ด์„œ system metric ๋ฐ์ดํ„ฐ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

5 ๊ธฐํƒ€

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

File: documents/uri_statistics.md

English | ํ•œ๊ตญ์–ด

URI Statistics

URI statistics menu is newly added to Pinpoint in v2.5.0.
Pinpoint Agent aggregates URI templates and send them to Pinpoint collector via GRPC.
Pinpoint Collector saves the data to Pinot via Apache Kafka.
Pinpoint Web accesses Pinot to display the data.

1. Installation and Configuration

1.1 Pinot and Kafka Setup

If Pinot and Kafka are already installed, you can skip this setup step. Otherwise, set them up by following the Pinot installation guide before creating URI Statistics topics and tables.

1.2 Create Kafka Topics for Pinpoint URI Statistics

Create the url-stat Kafka topic with 64 partitions. This matches the numPartitions value in Pinpoint's default Pinot table configuration, which uses segmentPartitionConfig.

text
$ bin/kafka-topics.sh --create --topic url-stat --partitions 64 --bootstrap-server ${YOUR_KAFKA_SERVER_ADDRESS}

1.3 Create Pinot Tables

  • Pinot table schema for Pinpoint URI statistics is provided in our github repository.
  • Please refer to Pinot documents to create necessary tables in your Pinot cluster.
  • Let's create the uriStat table by referencing the schema file and table settings from the provided path. To enable hybrid table functionality, let's create both REALTIME and OFFLINE tables for the 'uriStat' table.

1.4 Configure and Attach Pinpoint Agent

This section describes the URI stat configuration values added for URI statistics.

1.4.1 Configuration values for URI Statistics

Below are default agent configuration values for URI statistics.

text
###########################################################
# URI Stat
###########################################################
profiler.uri.stat.enable=true
profiler.uri.stat.spring.webmvc.enable=true
profiler.uri.stat.spring.webmvc.useuserinput=false
profiler.uri.stat.spring.webflux.enable=true
profiler.uri.stat.spring.webflux.useuserinput=false
profiler.uri.stat.vertx.enable=true
profiler.uri.stat.vertx.useuserinput=false
profiler.uri.stat.tomcat.useuserinput=false
profiler.uri.stat.jetty.useuserinput=false
  • profiler.uri.stat.enable: whether Pinpoint Agent collects URI statistics or not.

    • true: collects URI statistics
    • false: doesn't collect URI statistics
  • profiler.uri.stat.spring.webmvc.enable: whether Pinpoint Agent collects URI statistics from Spring Web MVC applications.

    • true: collects URI statistics from Spring Web MVC applications.
    • false: doesn't collect URI statistics from Spring Web MVC applications.
  • profiler.uri.stat.spring.webmvc.useuserinput: whether Pinpoint Agent uses user-input request attribute values for URI templates when available.

    • true: uses user-input request attribute values.
    • false: ignores user-input request attribute values.

    Set attribute pinpoint.metric.uri-template to your Spring web request as shown below to override default URI template provided by Pinpoint.

    text
    @RequestMapping("/testUserInputRequestAttribute")
      public Map<String, Object> testUserInputAttribute(HttpServletRequest request) {
          Map<String, Object> map = new HashMap<String, Object>();
          map.put("message", "test user input attribute");
          request.setAttribute("pinpoint.metric.uri-template", "/userInput");
          return map;
      }
  • profiler.uri.stat.spring.webflux.enable: whether Pinpoint Agent collects URI statistics from Spring Webflux applications.

    • true: collects URI statistics from Spring Webflux applications.
    • false: doesn't collect URI statistics from Spring Webflux applications.
  • profiler.uri.stat.spring.webflux.useuserinput: whether Pinpoint Agent uses user-input request attribute values for URI templates when available.

    • true: uses user-input request attribute values.
    • false: ignores user-input request attribute values.

    Set attribute pinpoint.metric.uri-template to your Spring web request as shown below to override default URI template provided by Pinpoint.

    text
    @GetMapping("/server/welcome/**")
      public Mono<String> welcome(ServerWebExchange exchange) {
          exchange.getAttributes().put("pinpoint.metric.uri-template", "/test");
          return Mono.just("Welcome Home");
      }
  • profiler.uri.stat.vertx.enable: whether Pinpoint Agent collects URI statistics from Vert.x applications.

    • true: collects URI statistics from Vert.x applications.
    • false: doesn't collect URI statistics from Vert.x applications.
  • profiler.uri.stat.vertx.useuserinput: whether Pinpoint Agent uses user-input routing context attribute values for URI templates when available.

    • true: uses user-input routing context attribute values.
    • false: ignores user-input routing context attribute values.

    Set attribute pinpoint.metric.uri-template to your Vert.x routing context as shown below to override default URI template provided by Pinpoint.

    text
    router.get("/routinContextAttributeAdded").handler(routingContext -> {
          routingContext.put("pinpoint.metric.uri-template", "/test");
          routingContext.response().end("pinpoint.metric.uri-tempate = /test");
      });
  • profiler.uri.stat.tomcat.useuserinput: (Added in v2.5.3) whether Pinpoint Agent uses user-input attribute values from Tomcat for URI templates when available.

    • true: collects URI statics from Tomcat user-input attribute values.
    • false: doesn't check Tomcat request attributes for URI statistics.

    This is provided to collect URI statistics information in Tomcat applications without supported frameworks(Spring WebMVC, Spring Webflux, VertX).
    If you are using supported frameworks, it is recommended to use framework-specific options and disable this option.
    Since there is no default URI template provided by tomcat, users need to set attribute pinpoint.metric.uri-template to your Tomcat request to start collecting URI statistics information.

  • profiler.uri.stat.jetty.useuserinput: (Added in v4.0.1) whether Pinpoint Agent uses user-input attribute values from Jetty for URI templates when available.

    • true: collects URI statistics from Jetty user-input attribute values.
    • false: doesn't check Jetty request attributes for URI statistics.

    This option works like the Tomcat option above, for Jetty applications without supported frameworks (e.g. JAX-RS on Jetty).
    It applies to both the Jetty plugin and the Jetty 12 plugin.
    Jetty does not provide a default URI template. Set attribute pinpoint.metric.uri-template on your Jetty request to start collecting URI statistics information.
    Set the attribute before the request handling returns. For asynchronous requests, an attribute set after the initial dispatch returns is not used.

    text
    @GET
      @Path("/orders/{orderId}")
      public Response getOrder(@PathParam("orderId") String orderId, @Context HttpServletRequest request) {
          request.setAttribute("pinpoint.metric.uri-template", "/orders/{orderId}");
          return Response.ok().build();
      }

To change the configuration values described above, update pinpoint.config under each profile directory and rebuild the project.
Or, you can simply pass these properties when starting your application with Pinpoint Agent (e.g. -Dprofiler.uri.stat.enable=false).

1.5 Configure and Run Pinpoint Collector & Web with URI Statistics

Configure and run the collector starter with BASIC or ALL type.
Configure and run the web starter to display URI Statistics data.

2. View Collected URI Statistics Data

  1. Click URL Statistic on the side bar menu in Pinpoint web.
  2. Search for the application name you used to configure Pinpoint Agent.
  3. Top 50 URIs used in your application will be displayed below the empty chart.
  4. Click each URI to load the chart.

URI ํ†ต๊ณ„

URI ํ†ต๊ณ„ ๊ธฐ๋Šฅ์€ ํ•€ํฌ์ธํŠธ v2.5.0์— ์‹ ๊ทœ๋กœ ์ถ”๊ฐ€๋˜์—ˆ๋‹ค.
ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ์—์„œ URI ํ…œํ”Œ๋ฆฟ ์ •๋ณด๋ฅผ ์ˆ˜์ง‘ํ•˜์—ฌ GRPC๋ฅผ ์‚ฌ์šฉํ•ด ํ•€ํฌ์ธํŠธ ์ฝœ๋ ‰ํ„ฐ์— ์ „๋‹ฌํ•˜๊ณ , ํ•€ํฌ์ธํŠธ ์ฝœ๋ ‰ํ„ฐ๋Š” ์•„ํŒŒ์น˜ ์นดํ”„์นด๋ฅผ ํ†ตํ•ด ์•„ํŒŒ์น˜ ํ”ผ๋…ธ์— ๊ฐ’์„ ์ €์žฅํ•œ๋‹ค.
ํ•€ํฌ์ธํŠธ ์›น์—์„œ ์ €์žฅ๋œ URI ํ†ต๊ณ„ ๋ฐ์ดํ„ฐ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

1. ์„ค์น˜ ๋ฐ ์„ค์ • ๋ฐฉ๋ฒ•

1.1 Pinot์™€ Kafka ์ค€๋น„

Pinot์™€ Kafka๊ฐ€ ์ด๋ฏธ ์„ค์น˜๋˜์–ด ์žˆ๋‹ค๋ฉด ์ด ์ค€๋น„ ๋‹จ๊ณ„๋Š” ๊ฑด๋„ˆ๋›ฐ์–ด๋„ ๋ฉ๋‹ˆ๋‹ค. ์•„์ง ์„ค์น˜ํ•˜์ง€ ์•Š์•˜๋‹ค๋ฉด URI Statistics์šฉ topic๊ณผ table์„ ์ƒ์„ฑํ•˜๊ธฐ ์ „์— Pinot ์„ค์น˜ ๊ฐ€์ด๋“œ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ Pinot์™€ Kafka๋ฅผ ์ค€๋น„ํ•ฉ๋‹ˆ๋‹ค.

1.2 Kafka topic ์ƒ์„ฑ

url-stat Kafka topic์„ 64 partitions๋กœ ์ƒ์„ฑํ•œ๋‹ค. ์ด ๊ฐ’์€ segmentPartitionConfig๋ฅผ ์‚ฌ์šฉํ•˜๋Š” Pinpoint ๊ธฐ๋ณธ Pinot table ์„ค์ •์˜ numPartitions ๊ฐ’๊ณผ ์ผ์น˜ํ•œ๋‹ค.

text
$ bin/kafka-topics.sh --create --topic url-stat --partitions 64 --bootstrap-server ${YOUR_KAFKA_SERVER_ADDRESS}

1.3 Pinot table ์ƒ์„ฑ

  • ํ•€ํฌ์ธํŠธ ๊นƒํ—™ ์ €์žฅ์†Œ์— URI ํ†ต๊ณ„๋ฅผ ์œ„ํ•œ ํ”ผ๋…ธ ํ…Œ์ด๋ธ” ์Šคํ‚ค๋งˆ์™€ ํ…Œ์ด๋ธ” ์ •๋ณด๊ฐ€ ์žˆ๋‹ค.
  • ์œ„ ๊ฒฝ๋กœ์—์„œ ์Šคํ‚ค๋งˆ ํŒŒ์ผ๊ณผ ํ…Œ์ด๋ธ” ์„ค์ •์„ ์ฐธ๊ณ ํ•ด์„œ uriStat ํ…Œ์ด๋ธ”์„ ์ƒ์„ฑํ•œ๋‹ค. hybrid table ๊ธฐ๋Šฅ ์‚ฌ์šฉ์„ ์œ„ํ•ด์„œ REALTIME, OFFLINE ํ…Œ์ด๋ธ” ๋‘˜๋‹ค ์ƒ์„ฑํ•˜์ž.
  • ํ”ผ๋…ธ์— ํ•„์š”ํ•œ ํ…Œ์ด๋ธ”์„ ๊ตฌ์„ฑํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ํ”ผ๋…ธ ๊ณต์‹ ๋ฌธ์„œ๋ฅผ ์ฐธ๊ณ ํ•˜์ž.

1.4 ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ ์„ค์ •

URI ํ†ต๊ณ„ ์ˆ˜์ง‘์„ ์œ„ํ•ด ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ์— ์„ค์ •ํ•ด์•ผ ํ•˜๋Š” ๊ฐ’๋“ค์„ ์•ˆ๋‚ดํ•œ๋‹ค.

1.4.1 URI ํ†ต๊ณ„ ์ˆ˜์ง‘์„ ์œ„ํ•œ ์„ค์ • ๊ฐ’

URI ํ†ต๊ณ„ ์ˆ˜์ง‘๊ณผ ๊ด€๋ จ๋œ ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ์˜ ์„ค์ • ๊ธฐ๋ณธ๊ฐ’๋“ค์€ ์•„๋ž˜์™€ ๊ฐ™๋‹ค.

text
###########################################################
# URI Stat
###########################################################
profiler.uri.stat.enable=true
profiler.uri.stat.spring.webmvc.enable=true
profiler.uri.stat.spring.webmvc.useuserinput=false
profiler.uri.stat.spring.webflux.enable=true
profiler.uri.stat.spring.webflux.useuserinput=false
profiler.uri.stat.vertx.enable=true
profiler.uri.stat.vertx.useuserinput=false
profiler.uri.stat.tomcat.useuserinput=false
profiler.uri.stat.jetty.useuserinput=false
  • profiler.uri.stat.enable: ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ๊ฐ€ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜๋Š”์ง€ ์—ฌ๋ถ€.

    • true: URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•œ๋‹ค.
    • false: URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜์ง€ ์•Š๋Š”๋‹ค.
  • profiler.uri.stat.spring.webmvc.enable: ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ๊ฐ€ ์Šคํ”„๋ง ์›น MVC ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜๋Š”์ง€ ์—ฌ๋ถ€.

    • true: ์Šคํ”„๋ง ์›น MVC ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํžŒ๋‹ค.
    • false: ์Šคํ”„๋ง ์›น MVC ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜์ง€ ์•Š๋Š”๋‹ค.
  • profiler.uri.stat.spring.webmvc.useuserinput: ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ๊ฐ€ ์Šคํ”„๋ง ์›น ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์šฐ์„ ์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š”์ง€ ์—ฌ๋ถ€.

    • true: ์Šคํ”„๋ง ์›น ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์šฐ์„ ์ ์œผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.
    • false: ์Šคํ”„๋ง ์›น ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ํ™•์ธํ•˜์ง€ ์•Š๊ณ  ํ•€ํฌ์ธํŠธ๊ฐ€ ์ˆ˜์ง‘ํ•œ ํ…œํ”Œ๋ฆฟ๋งŒ ์‚ฌ์šฉํ•œ๋‹ค.

    ํ•€ํฌ์ธํŠธ์—์„œ ์ˆ˜์ง‘ํ•˜๋Š” URI ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด, ์•„๋ž˜ ์˜ˆ์ œ์™€ ๊ฐ™์ด ์Šคํ”„๋ง ์›น ๋ฆฌํ€˜์ŠคํŠธ ๊ฐ์ฒด attribute์— pinpoint.metric.uri-template๋ฅผ key ๊ฐ’์œผ๋กœ ํ•˜๋Š” ์†์„ฑ ๊ฐ’์„ ์„ค์ •ํ•ด์•ผ ํ•œ๋‹ค.

    text
    @RequestMapping("/testUserInputRequestAttribute")
      public Map<String, Object> testUserInputAttribute(HttpServletRequest request) {
          Map<String, Object> map = new HashMap<String, Object>();
          map.put("message", "test user input attribute");
          request.setAttribute("pinpoint.metric.uri-template", "/userInput");
          return map;
      }
  • profiler.uri.stat.spring.webflux.enable: ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ๊ฐ€ ์Šคํ”„๋ง ์›นํ”Œ๋Ÿญ์Šค ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜๋Š”์ง€ ์—ฌ๋ถ€.

    • true: ์Šคํ”„๋ง ์›นํ”Œ๋Ÿญ์Šค ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํžŒ๋‹ค.
    • false: ์Šคํ”„๋ง ์›นํ”Œ๋Ÿญ์Šค ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜์ง€ ์•Š๋Š”๋‹ค.
  • profiler.uri.stat.spring.webflux.useuserinput: ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ๊ฐ€ ์Šคํ”„๋ง ์›นํ”Œ๋Ÿญ์Šค ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์šฐ์„ ์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š”์ง€ ์—ฌ๋ถ€.

    • true: ์Šคํ”„๋ง ์›นํ”Œ๋Ÿญ์Šค ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์šฐ์„ ์ ์œผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.
    • false: ์Šคํ”„๋ง ์›นํ”Œ๋Ÿญ์Šค ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ํ™•์ธํ•˜์ง€ ์•Š๊ณ  ํ•€ํฌ์ธํŠธ๊ฐ€ ์ˆ˜์ง‘ํ•œ ํ…œํ”Œ๋ฆฟ๋งŒ ์‚ฌ์šฉํ•œ๋‹ค.

    ํ•€ํฌ์ธํŠธ์—์„œ ์ˆ˜์ง‘ํ•˜๋Š” URI ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด, ์•„๋ž˜ ์˜ˆ์ œ์™€ ๊ฐ™์ด ์Šคํ”„๋ง ์›น ๋ฆฌํ€˜์ŠคํŠธ ๊ฐ์ฒด attribute์— pinpoint.metric.uri-template๋ฅผ key ๊ฐ’์œผ๋กœ ํ•˜๋Š” ์†์„ฑ ๊ฐ’์„ ์„ค์ •ํ•ด์•ผ ํ•œ๋‹ค.

    text
    @GetMapping("/server/welcome/**")
      public Mono<String> welcome(ServerWebExchange exchange) {
          exchange.getAttributes().put("pinpoint.metric.uri-template", "/test");
          return Mono.just("Welcome Home");
      }
  • profiler.uri.stat.vertx.enable: ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ๊ฐ€ Vert.x ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜๋Š”์ง€ ์—ฌ๋ถ€.

    • true: Vert.x ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํžŒ๋‹ค.
    • false: Vert.x ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜์ง€ ์•Š๋Š”๋‹ค.
  • profiler.uri.stat.vertx.useuserinput: ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ๊ฐ€ Vert.x ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์šฐ์„ ์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š”์ง€ ์—ฌ๋ถ€.

    • true: Vert.x ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์šฐ์„ ์ ์œผ๋กœ ์‚ฌ์šฉํ•œ๋‹ค.
    • false: Vert.x ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ํ™•์ธํ•˜์ง€ ์•Š๊ณ  ํ•€ํฌ์ธํŠธ๊ฐ€ ์ˆ˜์ง‘ํ•œ ํ…œํ”Œ๋ฆฟ๋งŒ ์‚ฌ์šฉํ•œ๋‹ค.

    ํ•€ํฌ์ธํŠธ์—์„œ ์ˆ˜์ง‘ํ•˜๋Š” URI ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด, ์•„๋ž˜ ์˜ˆ์ œ์™€ ๊ฐ™์ด Vert.x RoutingContext ๊ฐ์ฒด์— pinpoint.metric.uri-template ๋ฅผ key ๊ฐ’์œผ๋กœ ํ•˜๋Š” ์†์„ฑ ๊ฐ’์„ ์„ค์ •ํ•ด์•ผ ํ•œ๋‹ค.

    text
    router.get("/routinContextAttributeAdded").handler(routingContext -> {
          routingContext.put("pinpoint.metric.uri-template", "/test");
          routingContext.response().end("pinpoint.metric.uri-tempate = /test");
      });
  • profiler.uri.stat.tomcat.useuserinput: (v2.5.3์— ์ถ”๊ฐ€ ๋จ) ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ๊ฐ€ Tomcat ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜์—ฌ ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜๋Š”์ง€ ์—ฌ๋ถ€.

    • true: Tomcat ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜์—ฌ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•œ๋‹ค.
    • false: URI ํ†ต๊ณ„ ์ˆ˜์ง‘์„ ํ•  ๋•Œ Tomcat ๋ฆฌํ€˜์ŠคํŠธ attribute๋ฅผ ํ™•์ธํ•˜์ง€ ์•Š๋Š”๋‹ค.

    ์ด ์˜ต์…˜์€ ์ง€์›ํ•˜๋Š” ํ”„๋ ˆ์ž„์›Œํฌ(Spring WebMVC, Spring Webflux, VertX)๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” Tomcat ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜๊ธฐ ์œ„ํ•ด ์ถ”๊ฐ€๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
    ๋งŒ์•ฝ ์ง€์›ํ•˜๋Š” ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋‹ค๋ฉด, ํ•ด๋‹น ํ”„๋ ˆ์ž„์›Œํฌ ๊ด€๋ จ URI ํ†ต๊ณ„ ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๊ณ  ์ด ์˜ต์…˜์€ false๋กœ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.
    ์ง€์›ํ•˜๋Š” ํ”„๋ ˆ์ž„์›Œํฌ์—์„œ์™€๋Š” ๋‹ค๋ฅด๊ฒŒ Tomcat ์ž์ฒด์ ์œผ๋กœ URI ํ…œํ”Œ๋ฆฟ์„ ์ œ๊ณตํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์—, ์ด ์˜ต์…˜์„ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ, ์‚ฌ์šฉ์ž๊ฐ€ ์ง์ ‘ Tomcat request attribute์— pinpoint.metric.uri-template๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ์•ผ๋งŒ URI ํ†ต๊ณ„๊ฐ€ ์ˆ˜์ง‘๋ฉ๋‹ˆ๋‹ค.

  • profiler.uri.stat.jetty.useuserinput: (v4.0.1์— ์ถ”๊ฐ€ ๋จ) ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ๊ฐ€ Jetty ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜์—ฌ ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜๋Š”์ง€ ์—ฌ๋ถ€.

    • true: Jetty ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ์‚ฌ์šฉ์ž ์ •์˜ URI ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜์—ฌ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•œ๋‹ค.
    • false: URI ํ†ต๊ณ„ ์ˆ˜์ง‘์„ ํ•  ๋•Œ Jetty ๋ฆฌํ€˜์ŠคํŠธ attribute๋ฅผ ํ™•์ธํ•˜์ง€ ์•Š๋Š”๋‹ค.

    ์ด ์˜ต์…˜์€ ์œ„ Tomcat ์˜ต์…˜๊ณผ ๊ฐ™์€ ๋ฐฉ์‹์œผ๋กœ, ์ง€์›ํ•˜๋Š” ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” Jetty ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜(์˜ˆ: Jetty ์œ„์˜ JAX-RS)์—์„œ URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜๊ธฐ ์œ„ํ•ด ์ถ”๊ฐ€๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
    Jetty ํ”Œ๋Ÿฌ๊ทธ์ธ๊ณผ Jetty 12 ํ”Œ๋Ÿฌ๊ทธ์ธ ๋ชจ๋‘์— ์ ์šฉ๋ฉ๋‹ˆ๋‹ค.
    Jetty ์ž์ฒด์ ์œผ๋กœ URI ํ…œํ”Œ๋ฆฟ์„ ์ œ๊ณตํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์—, ์‚ฌ์šฉ์ž๊ฐ€ ์ง์ ‘ Jetty request attribute์— pinpoint.metric.uri-template๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ์•ผ๋งŒ URI ํ†ต๊ณ„๊ฐ€ ์ˆ˜์ง‘๋ฉ๋‹ˆ๋‹ค.
    attribute๋Š” ์š”์ฒญ ์ฒ˜๋ฆฌ๊ฐ€ ๋๋‚˜๊ธฐ ์ „์— ์„ค์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋น„๋™๊ธฐ ์š”์ฒญ์—์„œ ์ตœ์ดˆ dispatch๊ฐ€ ๋ฐ˜ํ™˜๋œ ๋’ค์— ์„ค์ •ํ•œ attribute๋Š” ์‚ฌ์šฉ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

    text
    @GET
      @Path("/orders/{orderId}")
      public Response getOrder(@PathParam("orderId") String orderId, @Context HttpServletRequest request) {
          request.setAttribute("pinpoint.metric.uri-template", "/orders/{orderId}");
          return Response.ok().build();
      }

์œ„ ์„ค์ • ๊ฐ’๋“ค์„ ๋ณ€๊ฒฝํ•˜๋ ค๋ฉด ์›ํ•˜๋Š” ํ•€ํฌ์ธํŠธ ํ”„๋กœํŒŒ์ผ ๊ฒฝ๋กœ์˜ pinpoint.config ํŒŒ์ผ์—์„œ ๊ฐ’์„ ๋ณ€๊ฒฝํ•˜์—ฌ ํ•€ํฌ์ธํŠธ๋ฅผ ์žฌ๋นŒ๋“œํ•œ๋‹ค. ํŒŒ์ผ์„ ์ˆ˜์ •ํ•˜์ง€ ์•Š๊ณ , ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ๋ฅผ ๋ถ™ํž ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์‹คํ–‰ํ•  ๋•Œ -Dprofiler.uri.stat.enable=false์™€ ๊ฐ™์ด ๊ฐ’์„ ๋„ฃ์–ด๋„ ๋œ๋‹ค.

1.5 ํ•€ํฌ์ธํŠธ ์ฝœ๋ ‰ํ„ฐ์™€ ํ•€ํฌ์ธํŠธ ์›น ์„ค์ • ๋ฐ ์‹คํ–‰

URI ํ†ต๊ณ„๋ฅผ ์ˆ˜์ง‘ํ•˜๋ ค๋ฉด collector starter๋ฅผ BASIC ๋˜๋Š” ALL ํƒ€์ž…์œผ๋กœ ์‹คํ–‰ํ•œ๋‹ค.
URI ํ†ต๊ณ„ ๋ฐ์ดํ„ฐ๋ฅผ ํ™•์ธํ•˜๋ ค๋ฉด web starter๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.

  • URI ํ†ต๊ณ„ ์ˆ˜์ง‘์„ ํ™œ์„ฑํ™”ํ•˜๋ ค๋ฉด pinpoint.collector.properties์— ์•„๋ž˜ ์„ค์ •๊ฐ’์„ ์ถ”๊ฐ€ํ•œ๋‹ค:

    text
    collector.stat.uri=true
  • URI Statistics ๋ฉ”๋‰ด๋ฅผ ํ‘œ์‹œํ•˜๋ ค๋ฉด pinpoint-web-uristat.properties์— ์•„๋ž˜ ์„ค์ •๊ฐ’์„ ์ถ”๊ฐ€ํ•œ๋‹ค:

    text
    config.show.urlStat=true

2. URI ํ†ต๊ณ„ ๋ฐ์ดํ„ฐ ์กฐํšŒ

  1. ํ•€ํฌ์ธํŠธ ์›น์„ ์‹คํ–‰ํ•˜์—ฌ ์™ผ์ชฝ URL Statistic ๋ฉ”๋‰ด๋ฅผ ์„ ํƒํ•œ๋‹ค.
  2. ์ƒ๋‹จ์˜ select box์—์„œ ํ•€ํฌ์ธํŠธ ์—์ด์ „ํŠธ์— ์„ค์ •ํ•œ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ด๋ฆ„์„ ์กฐํšŒํ•œ๋‹ค.
  3. ์ดˆ๊ธฐ ํ™”๋ฉด์—์„œ๋Š” ์„ ํƒํ•œ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์—์„œ ๊ฐ€์žฅ ๋งŽ์ด ์‚ฌ์šฉํ•œ ์ƒ์œ„ 50๊ฐœ URI๊ฐ€ ๋นˆ ์ฐจํŠธ ๋ฐ‘์— ํ‘œ์‹œ๋œ๋‹ค.
  4. ์›ํ•˜๋Š” URI๋ฅผ ํด๋ฆญํ•˜๋ฉด ์ฐจํŠธ์— ๋ฐ์ดํ„ฐ๊ฐ€ ํ‘œ์‹œ๋œ๋‹ค.