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 ---
- Files Extracted: 1
- Estimated Token Budget: ~24 tokens
- Canonical Reference: https://codewiki.google/github.com/pinpoint-apm/reactor
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?
- Overview / History / Tech Details to get to know more about Pinpoint
- Videos - Checkout our videos on Pinpoint
{% embed url="https://youtu.be/U4EwnB34Dus" %}
Getting Started
- Quick-start guide(Lastest Snapshot) for simple test run of Pinpoint
- Installation guide(Lastest Snapshot) for further instructions.
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.
config.sendUsage=falseIs 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?
License
Pinpoint is licensed under the Apache License, Version 2.0. See LICENSE for full license 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-docsneed tests in its__test__/directory. Runnpm ciand thennpm testin that directory.
Workflow
- 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 asinput โ expected resultbullets that run locally. Reference links go last. - Branch: create a feature branch from
upstream/main. - Code changes: implement the feature or fix.
- Testing: add or update tests, then run them. While they run, show the developer the PR draft (title, body, milestone).
- Review: stop and wait for the developer to review the diff. Do not proceed until they explicitly approve.
- 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. - PR: create it with
gh pr create. Same milestone as the issue;Closes #ISSUE_NUMBERin the body. - 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 planwith the checked results andCloses #N. No other headers.
File: faq.md
title: FAQ sidebar: mydoc_sidebar keywords: 'faq, question, answer, frequently asked questions, FAQ, question and answer' last_updated: 'Feb 1, 2018' permalink: faq.html toc: false disqus: false
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=$PASSWORDRemove agent id -
/admin/removeAgentId.pinpoint?applicationName=$APPLICATION_NAME&agentId=$AGENT_ID&password=$PASSWORDNote that the value for the password parameter is what you defined
admin.passwordproperty in pinpoint-web.properties. Since 4.0.1, the admin APIs are disabled until you setadmin.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=falseto 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.
config.sendUsage=falseI'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
- [#14502] Prepare 4.0.1-SNAPSHOT by @intr3p1d in https://github.com/pinpoint-apm/pinpoint/pull/14505
- [#noissue] Update the live demo address by @jaehong-kim in https://github.com/pinpoint-apm/pinpoint/pull/14509
- [#14521] Dispatch only the release id to pinpoint-apm.github.io by @feelform in https://github.com/pinpoint-apm/pinpoint/pull/14522
- [#noissue] Document the authorization scope of basic login by @ga-ram in https://github.com/pinpoint-apm/pinpoint/pull/14506
- [#14510] Bump spring framework from 6.2.18 to 6.2.19 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14523
- [#14511] Bump spring boot from 3.5.14 to 3.5.16 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14524
- [#14514] Bump spring batch from 5.2.5 to 5.2.6 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14525
- [#14515] Bump spring security from 6.5.10 to 6.5.11 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14526
- [#14516] Bump spring retry from 2.0.12 to 2.0.13 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14527
- [#14512] Bump jackson from 2.21.4 to 2.21.8 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14528
- [#14513] Bump log4j2 from 2.25.4 to 2.25.5 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14529
- Bump snappy-java from 1.1.10.4 to 1.1.10.12 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14532
- [#14533] Reject admin API calls when admin.password is not set by @ga-ram in https://github.com/pinpoint-apm/pinpoint/pull/14531
- [#14534] Switch the alarm modules from thymeleaf to thymeleaf-spring6 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14535
- [#14517] Bump spring data from 3.5.11 to 3.5.13 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14536
- [#14519] Bump spring cloud from 4.3.0 to 4.3.3 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14537
- [#14520] Bump spring kafka from 3.3.15 to 3.3.16 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14538
- [#noissue] Hide the group by remove button when the error table cannot remove a group by @jihea-park in https://github.com/pinpoint-apm/pinpoint/pull/14539
- [#14540] Bump spring shell from 3.4.2 to 3.4.3 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14541
- [#14542] Bump tomcat embed from 10.1.55 to 10.1.61 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14543
- [#14544] Collector does not apply the durability setting to SpanChunk by @koo-taejin in https://github.com/pinpoint-apm/pinpoint/pull/14545
- [#noissue] Skip the spring beans retransform when the bean declares nโฆ by @jaehong-kim in https://github.com/pinpoint-apm/pinpoint/pull/14547
- [#14550] Bump HikariCP from 7.0.1 to 7.1.0 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14551
- [#14546] Support the user-supplied URI template for URI stat in the Jetty plugins by @ga-ram in https://github.com/pinpoint-apm/pinpoint/pull/14549
- [#14517] Manage spring-data-commons in the root pom so spring-batch rโฆ by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14552
- [#9246] Keep the original constant pool indices when rewriting a clasโฆ by @jaehong-kim in https://github.com/pinpoint-apm/pinpoint/pull/14548
- [#14553] Bump commons-lang3 from 3.18.0 to 3.21.0 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14554
- [#noissue] Remove the commons-io dependency from the agent testwebs by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14555
- [#14556] Bump commons-collections4 from 4.4 to 4.6.0 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14557
- [#noissue] Remove the unused cglib-nodep version pin by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14559
- [#14560] Bump hamcrest from 2.2 to 3.0 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14561
- [#noissue] Remove the MySQL Connector/J 6.x branches from the mysql-jdbc plugin by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14563
- [#14564] Bump commons-pool2 from 2.12.0 to 2.13.1 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14566
- [#14562] Bump commons-codec from 1.17.1 to 1.23.0 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14565
- [#noissue] Remove the MySQL Connector/J 6.x plugin ITs by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14567
- [#14568] Bump bouncycastle from 1.81 to 1.86 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14569
- [#noissue] Remove the unused jakarta.transaction-api version pin by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14570
- [#14571] Bump httpclient5 from 5.4.4 to 5.6.5 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14572
- [#14573] Bump commons-io from 2.20.0 to 2.22.0 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14574
- [#14575] Bump zstd-jni from 1.5.7-16 to 1.5.7-25 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14576
- [#14577] Bump jna from 5.18.1 to 5.19.1 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14578
- [#14579] Bump snakeyaml from 2.4 to 2.7 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14580
- [#14581] Bump oshi-core from 6.9.1 to 7.7.3 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14583
- [#14584] Bump fastjson from 1.2.83 to 1.2.84 by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14586
- [#noissue] Fix the server map popups when the menu is disabled and the hover popup placement by @jihea-park in https://github.com/pinpoint-apm/pinpoint/pull/14585
- [#noissue] Add a search box to the sidebar service selector by @jihea-park in https://github.com/pinpoint-apm/pinpoint/pull/14588
- [#14592] Propagate unsampled traces across coroutine dispatch by @cj848 in https://github.com/pinpoint-apm/pinpoint/pull/14593
- [#14594] Propagate unsampled traces across Reactor subscribe and retry by @cj848 in https://github.com/pinpoint-apm/pinpoint/pull/14595
- [#noissue] Fix web-frontend npm Dependabot alerts by @jihea-park in https://github.com/pinpoint-apm/pinpoint/pull/14597
- [#noissue] Decrease depth in DisableTrace and DisableChildTrace traceBlockEnd() by @cj848 in https://github.com/pinpoint-apm/pinpoint/pull/14599
- [#14605] Downgrade commons-codec to 1.22.1 for Base64 decoding compatibility by @ga-ram in https://github.com/pinpoint-apm/pinpoint/pull/14606
- [#noissue] Fix the agent path and the agent JVM arguments of the agenโฆ by @jaehong-kim in https://github.com/pinpoint-apm/pinpoint/pull/14607
- [#14600] Apply the search option to the DEFAULT servicemap by @cj848 in https://github.com/pinpoint-apm/pinpoint/pull/14601
- [#14604] Seed the AsyncContext at reactor publishOn, subscribeOn, delโฆ by @jaehong-kim in https://github.com/pinpoint-apm/pinpoint/pull/14609
- [#noissue] Remove the unused StackTraceProcessor SPI by @emeroad in https://github.com/pinpoint-apm/pinpoint/pull/14611
- [#noissue] Add serviceName to the span event ContextData by @donghun-cho in https://github.com/pinpoint-apm/pinpoint/pull/14608
- [#noissue] Clean up native scrollbar color and the extra server view scroll by @jihea-park in https://github.com/pinpoint-apm/pinpoint/pull/14613
- [#14612] 4.0.1 release by @intr3p1d in https://github.com/pinpoint-apm/pinpoint/pull/14614
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
title: Performance Analysis keywords: 'performance, test' last_updated: 'Oct 23, 2019' sidebar: mydoc_sidebar permalink: performance.html disqus: false
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.
Check the default log option for Pinpoint-Agent (Default was
DEBUGprior to v1.8.1)JVM option
- use G1 for the GC Type
- fix initial/maximum memory allocation pool with same size. ex) -Xms4g -Xmx4g
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
title: Powered by Pinpoint keywords: 'pinpoint, used, working, use, inuse, poweredby' last_updated: 'Jun 23, 2022' sidebar: mydoc_sidebar permalink: poweredby.html disqus: false
Powered by Pinpoint
This page, documents alphabetical list of organizations using Pinpoint.
Sites using Pinpoint
- Coupang (www.coupang.com)
- Echemi (www.echemi.com)
- HANATOUR (www.hanatour.com)
- NAVER (www.naver.com)
- NHN Entertainment
- Pikicast (www.pikicast.com)
- SKPlanet (www.skplanet.com)
- THE PIRATES(www.tpirates.com)
- Toss (toss.im)
- XLGAMES (www.xlgames.com)
Naver
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
title: Resources keywords: 'resources, other sites' last_updated: 'Feb 1, 2018' sidebar: mydoc_sidebar permalink: resources.html disqus: false
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\)
- ์ ์ฉํ ์๋ฃ๋ฅผ ์์ฑํ์ จ๋ค๋ฉด ๊ณต์ ๋ถํ๋๋ฆฝ๋๋ค!!!
- Pinpoint ๊ฐ๋ฐ์๊ฐ ์์ฑํ Pinpoint ๊ธฐ์ ๋ฌธ์ (helloworld.naver.com)
- ์ค์น ๊ฐ์ด๋ ๋์์ ๊ฐ์ข 1 (okjsp ๋ํ ํ๊ด๋จ๋)
- ์ค์น ๊ฐ์ด๋ ๋์์ ๊ฐ์ข 2 (okjsp ๋ํ ํ๊ด๋จ๋)
Resources \(ENGLISH\)
- Anyone who would like to share any document are always welcome
- Technical Overview of Pinpoint
- Official Docker Repository
- Notes on Jetty Plugin for Pinpoint (@cijung)
Resources \(ไธญๆ\)
- Pinpointๅญฆไน ็ฌ่ฎฐ๏ผไธญๆ่ตๆๆถ้ๆด็ๅๆด้่ฆ็-ไธญๆ็ฟป่ฏ๏ผ
- Pinpoint - ๅบ็จๆง่ฝ็ฎก็(APM)ๅนณๅฐๅฎ่ทตไน้จ็ฝฒ็ฏ
- ๅผๆบAPMๅทฅๅ ทPinpoint็บฟไธ้จ็ฝฒ
File: SUMMARY.md
Table of contents
Want a quick tour?
Getting Started
Documents
- Plugin Developer Guide
- Setting Alarm
- New Inspector
- System Metric
- URI Statistics
- URI Statistics Alarm
- OpenTelemetry Metric
- Heatmap
- Error Analysis
- Service
- How to use Application Inspector
- Realtime Request Monitoring
- Separate Logging Per Request
- Marking Transaction as Fail
- Monitoring Proxy Server
- Upgrade Database Hbase2
- HBase Table Changes
Contribution
- Performance Analysis
- Release Notes
- FAQ
- Powered by Pinpoint
- Questions & answers
- Fork me at Github
- Earlier documents
- Resources
File: contribution-1/contribution.md
title: Contribution keywords: help last_updated: 'Feb 1, 2018' sidebar: mydoc_sidebar permalink: contribution.html disqus: false
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 -ihelps) - 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:
- Configuration key names must start with
profiler.[pluginName]. - At least 1 plugin integration test.
Once your plugin is complete, please open an issue to contribute the plugin as below:
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
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
DEFAULTservice continues to run inalarmJobof thebatchmodule. - 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
- Select the service to set alarms for.
- At the bottom left, click Service โ Alarm.
- 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
ANDorOR, 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 Responsecounts the requests that the application receives.Calls To Another Applicationcounts 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 Applicationsupports filters. For a data source without filter support, the add filter button is disabled. calleespecifies the target application.callee_hostspecifies 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
- On the Channels tab, click Add Channel.
- Enter the name, the channel type, and the recipient, and click Add.
| Type | Recipient | Remarks |
|---|---|---|
| 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
- On the Templates tab, click Add Template.
- Select the rules for the template and click Start with N rules. You can select many items from the three groups below.
- 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
- On the Rules tab, select an application.
- 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
- Make the Service Alarm rule in the disabled state.
- Compare the service, condition, threshold, target, and recipients with the legacy rule.
- Disable the legacy rule and enable the Service Alarm rule immediately.
- 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
alarmJobof thebatchmodule and checks only the applications of theDEFAULTservice. - Service Alarm is evaluated and sent by Alarm Batch.
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.
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.
web/src/main/resources/sql/SpringBatchJobRepositorySchema-mysql.sql12. 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. |
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 ์๋ ๋ฃฐ์ ๋ค์ ๋ฑ๋กํด์ผ ํฉ๋๋ค.
DEFAULTService์ ๊ธฐ์กด ์๋์batch๋ชจ๋์alarmJob์์ ๊ณ์ ๋์ํฉ๋๋ค.- ์ ํ ๊ธฐ๊ฐ์ ๊ฐ์ ์กฐ๊ฑด์ ๊ธฐ์กด ์๋๊ณผ Service ์๋์์ ๋ชจ๋ ์ผ๋ฉด ์๋ฆผ์ด ์ค๋ณต๋ฉ๋๋ค.
Service ์๋์ ์ด์ํ๋ ค๋ฉด ๋ณ๋์ Alarm Batch ํ๋ก์ธ์ค๊ฐ ํ์ํฉ๋๋ค. 10. ๊ตฌ์ฑ ์์๋ถํฐ ์ด์ ๋ฐฉ๋ฒ์ ์ค๋ช ํฉ๋๋ค.
์ฌ์ฉ ๊ฐ์ด๋
1. ์๋ ํ๋ฉด ์ด๊ธฐ
- ์๋์ ์ค์ ํ Service๋ฅผ ์ ํํฉ๋๋ค.
- ์ผ์ชฝ ์๋ Service โ Alarm์ ๋๋ฆ ๋๋ค.
- ์๋จ์์ 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. ์ฑ๋ ๋ฑ๋ก
- Channels ํญ์์ Add Channel์ ๋๋ฆ ๋๋ค.
- ์ด๋ฆ, ์ฑ๋ ์ข ๋ฅ, ์์ ๋์์ ์ ๋ ฅํ๊ณ Add๋ฅผ ๋๋ฆ ๋๋ค.
| ์ข ๋ฅ | ์์ ๋์ | ๋น๊ณ |
|---|---|---|
| User Group | User Group ๊ตฌ์ฑ์์ ์ด๋ฉ์ผ๋ก ๋ณด๋ ๋๋ค. | |
| SMS | User Group | ์ด์์๊ฐ SMS ๋ฐ์ก ๊ตฌํ์ ๋ฑ๋กํด์ผ ํฉ๋๋ค. 12. Alarm Batch ์คํ์ ์ฐธ๊ณ ํฉ๋๋ค. |
| WEBHOOK | URL | ํ์์ DEFAULT ๋๋ SLACK. ์ฌ์ค ์ฃผ์๋ ์ด์์๊ฐ ํ์ฉํ ํธ์คํธ๋ง ์ฌ์ฉํ ์ ์์ผ๋ฉฐ, ํ์ฉ๋์ง ์์ ์ฃผ์๋ ์ ์ฅ๋์ด๋ ์๋ฆผ์ด ๋ฐ์ก๋์ง ์์ต๋๋ค. |
์ฑ๋์ ๋ค์๊ณผ ๊ฐ์ด ๋์ํฉ๋๋ค.
- ์์ ์๊ฐ ์๋ User Group์ ์ ํํ๋ฉด ์ฑ๋ ๋ชฉ๋ก๊ณผ ๋ฃฐยทํ ํ๋ฆฟ์ ์ฑ๋ ์ ํ ํ๋ฉด์ ๊ฒฝ๊ณ ๊ฐ ํ์๋ฉ๋๋ค.
- ์ฑ๋์ ๊ฐ์ Service์ ์ฌ๋ฌ ๋ฃฐ๊ณผ ํ ํ๋ฆฟ์์ ์ฌ์ฌ์ฉํ ์ ์์ต๋๋ค.
- ์ฑ๋ ์ ๋ณด๋ฅผ ์์ ํ๋ฉด ๊ทธ ์ฑ๋์ ์ฌ์ฉํ๋ ์ดํ ์๋ฆผ์ ๋ชจ๋ ๋ฐ์๋ฉ๋๋ค.
5. ํ ํ๋ฆฟ๊ณผ Preset
ํ ํ๋ฆฟ์ ์ฌ๋ฌ ๋ฃฐ์ ํ๋๋ก ๋ฌถ์ ๊ฒ์ ๋๋ค. ํ ํ๋ฆฟ ํ๋๋ฅผ ์ฌ๋ฌ Application์ ์ ์ฉํ๋ฉด ๊ฐ์ ๊ธฐ์ค์ผ๋ก ์๋์ ์ค์ ํ ์ ์์ต๋๋ค.
ํ ํ๋ฆฟ ๋ง๋ค๊ธฐ
- Templates ํญ์์ Add Template์ ๋๋ฆ ๋๋ค.
- ํ ํ๋ฆฟ์ ๋ฃ์ ๋ฃฐ์ ๊ณ ๋ฅด๊ณ Start with N rules๋ฅผ ๋๋ฆ ๋๋ค. ์๋ ์ธ ๊ทธ๋ฃน์์ ์ฌ๋ฌ ๊ฐ๋ฅผ ํจ๊ป ๊ณ ๋ฅผ ์ ์์ต๋๋ค.
- ํ ํ๋ฆฟ ์ด๋ฆ, ์ฑ๋, ๋ฃฐ์ ์กฐ์ ํ๊ณ Save๋ฅผ ๋๋ฆ ๋๋ค.
| ๊ทธ๋ฃน | ์ค๋ช |
|---|---|
| Start from a preset | ๊ธฐ๋ณธ ์ ๊ณต ๋ฃฐ ๋ฌถ์. ๊ธฐ๋ณธ ์ ๊ณต Preset์ ์ฐธ๊ณ ํฉ๋๋ค. |
| Copy one of my templates | ์ด Service์ ๋ฑ๋กํ ํ ํ๋ฆฟ |
| Import standalone rules | Application์ ์ง์ ๋ฑ๋กํ ๋ฃฐ |
- ๊ณ ๋ฅธ ๋ฃฐ์ ์ ํ ํ๋ฆฟ์ผ๋ก ๋ณต์ฌ๋ฉ๋๋ค. ์๋ณธ Preset, ํ ํ๋ฆฟ, ๋ฃฐ์ ๋์ค์ ๋ฐ๊ฟ๋ ์ ํ ํ๋ฆฟ์ ๋ฐ๋์ง ์์ต๋๋ค.
- ์๋ฌด๊ฒ๋ ๊ณ ๋ฅด์ง ์์ผ๋ฉด Start empty๋ฅผ ๋๋ฌ ๋น ํ ํ๋ฆฟ์ผ๋ก ์์ํฉ๋๋ค.
Application์ ์ ์ฉ
- Rules ํญ์์ Application์ ์ ํํฉ๋๋ค.
- 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์ ์ฑ๋์ ๋ฑ๋กํ๊ณ ๋ฃฐ์ ์ฐ๊ฒฐํฉ๋๋ค.
์ ํ ์์
- Service ์๋ ๋ฃฐ์ ๊บผ์ง ์ํ๋ก ๋ง๋ญ๋๋ค.
- ๊ธฐ์กด ๋ฃฐ๊ณผ Service, ์กฐ๊ฑด, ์๊ณ๊ฐ, ํธ์ถ ๋์, ์์ ์๋ฅผ ๋์กฐํฉ๋๋ค.
- ๊ธฐ์กด ๋ฃฐ์ ๋๊ณ ๋ฐ๋ก Service ์๋ ๋ฃฐ์ ์ผญ๋๋ค.
- ์ค์ ๋ก ์๋ฆผ์ด ์ค๋์ง, ์ด๋ ฅ์ด ๋จ๋์ง ํ์ธํฉ๋๋ค.
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์์ ํ๊ฐํ๋ฉฐ,DEFAULTService์ Application๋ง ๊ฒ์ฌํฉ๋๋ค. - Service ์๋์ Alarm Batch์์ ํ๊ฐํ๊ณ ๋ฐ์กํฉ๋๋ค.
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 ํ์ ์ ๋๋ค.
๋ค์ ์คํฌ๋ฆฝํธ๋ก ์๋ ํ ์ด๋ธ์ ๋ง๋ญ๋๋ค.
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 ๋ฉํ๋ฐ์ดํฐ ์คํค๋ง๋ฅผ ์๋์ผ๋ก ๋ง๋ค์ง ์์ต๋๋ค. ๋ค์ ์คํฌ๋ฆฝํธ๋ก ์ง์ ๋ง๋ญ๋๋ค.
web/src/main/resources/sql/SpringBatchJobRepositorySchema-mysql.sql12. 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
title: How to use Application Inspector keywords: 'inspector, how, how-to' last_updated: 'Feb 1, 2018' sidebar: mydoc_sidebar permalink: applicationinspector.html disqus: false
How to use Application Inspector
Application Inspector
1. Introduction
Application inspector provides an aggregate view of all the agent's resource data (cpu, memory, tps, datasource connection count, etc) registered under the same application name. A separate view is provided for the application inspector with stat charts similar to the agent inspector.
To access application inspector, click on the application inspector menu on the left side of the screen.
- 1 : application inspector menu, 2 : application stat data
The Heap Usage chart above for example, shows the average(Avg), smallest(Min), greatest(Max) heap usage of the agents registered under the same application name along with the id of the agent that had the smallest/greatest heap usage at a certain point in time. The application inspector also provides other statistics found in the agent inspector in a similar fashion.
Application inspector requires flink and zookeeper. Please read on for more detail.
2. Architecture
A. Run a streaming job on flink.
B. The taskmanager server is registered to zookeeper as a data node once the job starts.
C. The Collector obtains the flink server info from zookeeper to create a tcp connection with it and starts sending agent data.
D. The flink server aggregates data sent by the Collector and stores them into hbase.
3. Configuration
In order to enable application inspector, you will need to do the following and run Pinpoint.
A. Create ApplicationStatAggre table (refer to create table script), which stores application stat data.
B. Configure zookeeper address in Pinpoint-flink.properties which will be used to store flink's taskmanager server information.
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=19994C. 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.
textflink.StreamExecutionEnvironment=server
D. Configure hbase address in hbase.properties which will be used to store aggregated application data.
hbase.client.host=YOUR_HBASE_ADDRESS
hbase.client.port=2181E. Build Pinpoint-flink and run the streaming job file created under target directory on the flink server.
- The name of the streaming job is
pinpoint-flink-job-{pinpoint.version}.jar. - For details on how to run the job, please refer to the flink website.
- You must put
spring.profiles.active releaseorspring.profiles.active localas the job parameter so that the job can refer to the configuration file configured above when running. It must be entered because it uses the spring profile function inside the job to refer to the configuration file.
F. Configure zookeeper address in Pinpoint-Collector.properties so that the Collector can connect to the flink server.
flink.cluster.enable=true
flink.cluster.zookeeper.address=YOUR_ZOOKEEPER_ADDRESS
flink.cluster.zookeeper.sessiontimeout=3000G. Enable application inspector in the web-ui by enabling the following configuration in pinpoint-web.properties.
config.show.applicationStat=true4. 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
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.127applicationContext-batch-schedule.xml
<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 ์ฃผ์๋ฅผ ์ค์ ํ๋ค.
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=19994C. flink ํ๋ก์ ํธ ์ค์ ํ์ผ(Pinpoint-flink.properties)์ job์ ์คํ ๋ฐฉ๋ฒ๊ณผ Collector์์ ๋ฐ์ดํฐ๋ฅผ ๋ฐ๋ listener์ ๊ฐ์๋ฅผ ์ค์ ํ๋ค.
- flink๋ฅผ cluster๋ก ๊ตฌ์ถํด์ ์ฌ์ฉํ๋ค๋ฉด _flink.StreamExecutionEnvironment_์๋ server๋ฅผ ์ค์ ํ๋ค.
- flink๋ฅผ Standalone ํํ๋ก ์คํํ๋ค๋ฉด _flink.StreamExecutionEnvironment_์๋ local์ ์ค์ ํ๋ค.
flink.StreamExecutionEnvironment=server
flink.sourceFunction.Parallel=1D. flink ํ๋ก์ ํธ ์ค์ ํ์ผ(hbase.properties)์ ์ง๊ณ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ hbase ์ฃผ์๋ฅผ ์ค์ ํ๋ค.
hbase.client.host=YOUR_HBASE_ADDRESS
hbase.client.port=2181E. flink ํ๋ก์ ํธ๋ฅผ ๋น๋ํ์ฌ target ํด๋ ํ์์ ์์ฑ๋ streaming job ํ์ผ์ flink ์๋ฒ์ job์ ์คํํ๋ค.
- streaming job ํ์ผ ์ด๋ฆ์
pinpoint-flink-job-{pinpoint.version}.jar์ด๋ค. - ์คํ๋ฐฉ๋ฒ์ flink ์ฌ์ดํธ๋ฅผ ์ฐธ์กฐํ๋ค.
- ๋ฐ๋์ ์คํ์ job์ด ์์์ ์ค์ ํ ์ค์ ํ์ผ์ ์ฐธ๊ณ ํ ์ ์๋๋ก job parameter๋ก
spring.profiles.active releaseorspring.profiles.active local๋ฅผ ๋ฃ์ด์ฃผ์ผ ํ๋ค. job ๋ด๋ถ์์ spring profile ๊ธฐ๋ฅ์ ์ฌ์ฉํ์ฌ ์ค์ ํ์ผ์ ์ฐธ๊ณ ํ๊ณ ์๊ธฐ๋๋ฌธ์ ๋ฐ๋์ ์ ๋ ฅํด์ผํ๋ค.
F. Collector์์ flink์ ์ฐ๊ฒฐ์ ๋งบ์ ์ ์๋๋ก ์ค์ ํ์ผ(Pinpoint-Collector.properties)์ zookeeper ์ฃผ์๋ฅผ ์ค์ ํ๋ค.
flink.cluster.enable=true
flink.cluster.zookeeper.address=YOUR_ZOOKEEPER_ADDRESS
flink.cluster.zookeeper.sessiontimeout=3000G. web์์ application inspector ๋ฒํผ์ ํ์ฑํ ํ๊ธฐ ์ํด์ ์ค์ ํ์ผ(pinpoint-web.properties)์ ์์ ํ๋ค.
config.show.applicationStat=true4. streaming job ๋์ ํ์ธ ๋ชจ๋ํฐ๋ง batch
Pinpoint streaming job์ด ์คํ๋๊ณ ์๋์ง ํ์ธํ๋ batch job์ด ์๋ค. batch job์ ๋์ ์ํค๊ณ ์ถ๋ค๋ฉด Pinpoint web ํ๋ก์ ํธ์ ์ค์ ํ์ผ์ ์์ ํ๋ฉด ๋๋ค.
batch.properties
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.127applicationContext-batch-schedule.xml
<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
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:
$ 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:
###########################################################
# 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=20profiler.exceptiontrace.enabletrue: Collects exceptions that occur. Defaultfalse: Does not collect exceptions that occur.
profiler.exceptiontrace.new.throughput- Default:
1000 - Determines how many exceptions per second to collect from the agent.
- Default:
profiler.exceptiontrace.errormessage.max- Default:
2048 - Determines the maximum length of the error message for exceptions collected by the agent.
- Default:
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.
- Default:
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.
- Default:
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.show.exceptionTrace=trueError 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 ํ ํฝ์ ์์ฑํ๋ค.
$ 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 ์ ๋ค์ ํ ์ด๋ธ์ ์๋ก ์์ฑํ๋ค.
exceptionTrace
ํ ์ด๋ธ ์์ฑ ์คํค๋ง ํ์ผ์ ํ ์ด๋ธ ์ ๋ณด๋ฅผ ์ฐธ๊ณ ํ์ฌ ์์ฑํ๋ค.
1.4 ํํฌ์ธํธ ์์ด์ ํธ ์ค์
Error Analysis ๋ฐ์ดํฐ ์์ง๊ณผ ๊ด๋ จ๋ ์ค์ ์ด๋ค.
release ํ๋กํ์ ๊ธฐ๋ณธ ์ค์ ์ ๋ค์๊ณผ ๊ฐ๋ค.
###########################################################
# 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=20profiler.exceptiontrace.enabletrue: ๋ฐ์ํ๋ 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
- Create the new HBase tables.
- Enable dual write for each feature (see each feature's Transition).
- Switch reads to the legacy tables during migration (see each feature's Transition).
- Run the copy APIs to migrate historical data, if supported.
- Switch reads back to the new tables, if changed in step 3.
- 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
pinpoint.collector.application.index.v1.enabled=false
pinpoint.collector.application.index.v2.enabled=trueWeb
# 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=trueBatch
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=30Transition
- Collector: set
pinpoint.collector.application.index.v1.enabled=truefor dual write. - Web: set
pinpoint.web.application.index.v1.enabled=trueto delete from the legacy table during migration. - Web: set
pinpoint.web.application.index.read.v2=falseto read from the legacy table during migration. - Batch: set
pinpoint.batch.application.index.read.v2=falseto 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
AgentInfotable; Java agents sendAgentInfoperiodically, sodurationDayscan include long-running active agents. - Some agents may not send
AgentInfoperiodically; useserviceTypeCodefor them. durationDaysand/agents/allcopy a wider range of data, so they may take longer to complete.applicationNameandserviceTypeCodecopy the least required data.
Example:
# 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
# v2: legacy table, v3: new table, dual: dual write for data migration
pinpoint.modules.uid.version=v3Web
# v2: legacy table, v3: new table
pinpoint.modules.uid.version=v3Transition
- Collector: set
pinpoint.modules.uid.version=dualfor dual write. - Web: set
pinpoint.modules.uid.version=v2to read from the legacy tables during migration.
TraceIndex
Tables
| Legacy | New |
|---|---|
ApplicationTraceIndex |
TraceIndex |
Properties
Collector
pinpoint.collector.application.trace.index.v1.enabled=false
pinpoint.collector.application.trace.index.v2.enabled=trueWeb
pinpoint.web.trace.index.read.v2=trueTransition
- Collector: set
pinpoint.collector.application.trace.index.v1.enabled=truefor dual write. - Web: set
pinpoint.web.trace.index.read.v2=falseto read from the legacy table during migration.
File: documents/hbase-upgrade.md
title: Hbase Upgrade keywords: 'hbase, upgrade' last_updated: 'Mar 8, 2019' sidebar: mydoc_sidebar permalink: hbaseupgrade.html disqus: false
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
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:
- Pinpoint Agent sends span data to Pinpoint Collector via gRPC.
- Collector aggregates response time data and publishes to Kafka (
heatmap-stat-app-*topics). - Apache Pinot ingests from Kafka into the
heatmapStatApptable, aggregating counts per time bucket (10-second intervals). - 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
$ 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:
pinpoint:
modules:
collector:
heatmap:
enabled: trueCollector Kafka settings are configured by default in heatmap-collector.properties:
kafka.heatmap.topic.count=1
kafka.heatmap.topic.prefix=heatmap-stat-app-
kafka.heatmap.topic.padding.length=2
kafka.heatmap.key.partition.count=1Web
Configure and run the web starter.
Heatmap is enabled by default in the application.yml of web-starter:
pinpoint:
modules:
web:
heatmap:
enabled: trueWeb Pinot settings are configured by default in heatmap-web.properties:
pinot.heatmap.topic.count=1
pinot.heatmap.topic.prefix=heatmap-stat-
pinot.heatmap.topic.padding.length=24 Usage
- Select an application in Pinpoint Web.
- Click the toggle button on the Scatter Chart area to switch to the Heatmap view.
- The heatmap displays transaction distribution with color intensity indicating density โ darker colors represent higher transaction counts.
- 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 ๋ฐ์ดํฐ๋ ๋ค์ ํ์ดํ๋ผ์ธ์ผ๋ก ์ฒ๋ฆฌ๋ฉ๋๋ค:
- Pinpoint Agent๊ฐ gRPC๋ก span ๋ฐ์ดํฐ๋ฅผ Collector์ ์ ์กํฉ๋๋ค.
- Collector๊ฐ ์๋ต์๊ฐ ๋ฐ์ดํฐ๋ฅผ ์ง๊ณํ์ฌ Kafka (
heatmap-stat-app-*topic)์ ๋ฐํํฉ๋๋ค. - Apache Pinot๊ฐ Kafka์์ ๋ฐ์ดํฐ๋ฅผ ์์งํ์ฌ
heatmapStatAppํ ์ด๋ธ์ ์ ์ฅํฉ๋๋ค (10์ด ๋จ์๋ก ์ง๊ณ). - 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
$ 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์์ ๊ธฐ๋ณธ์ ์ผ๋ก ํ์ฑํ๋์ด ์์ต๋๋ค:
pinpoint:
modules:
collector:
heatmap:
enabled: trueCollector Kafka ์ค์ ์ heatmap-collector.properties์ ๊ธฐ๋ณธ์ ์ผ๋ก ์ค์ ๋์ด ์์ต๋๋ค:
kafka.heatmap.topic.count=1
kafka.heatmap.topic.prefix=heatmap-stat-app-
kafka.heatmap.topic.padding.length=2
kafka.heatmap.key.partition.count=1Web
web starter๋ฅผ ์คํํฉ๋๋ค.
Heatmap ๊ธฐ๋ฅ์ web-starter์ application.yml์์ ๊ธฐ๋ณธ์ ์ผ๋ก ํ์ฑํ๋์ด ์์ต๋๋ค:
pinpoint:
modules:
web:
heatmap:
enabled: trueWeb Pinot ์ค์ ์ heatmap-web.properties์ ๊ธฐ๋ณธ์ ์ผ๋ก ์ค์ ๋์ด ์์ต๋๋ค:
pinot.heatmap.topic.count=1
pinot.heatmap.topic.prefix=heatmap-stat-
pinot.heatmap.topic.padding.length=24 ์ฌ์ฉ ๋ฐฉ๋ฒ
- Pinpoint Web์์ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ ํํฉ๋๋ค.
- Scatter Chart ์์ญ์ ํ ๊ธ ๋ฒํผ์ ํด๋ฆญํ์ฌ Heatmap ๋ทฐ๋ก ์ ํํฉ๋๋ค.
- Heatmap์ ์์ ๋๋๋ก ํธ๋์ญ์ ๋ถํฌ๋ฅผ ํ์ํฉ๋๋ค โ ์์ด ์งํ ์๋ก ํธ๋์ญ์ ์๊ฐ ๋ง์ต๋๋ค.
- ์ ์ ํด๋ฆญํ๋ฉด ํด๋น ์๊ฐ/์๋ต์๊ฐ ๊ตฌ๊ฐ์ ๊ฐ๋ณ ํธ๋์ญ์ ์ ํ์ธํ ์ ์์ต๋๋ค.
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
title: Marking Transaction as Fail keywords: 'http, code fail, failure, http status' last_updated: 'Feb 1, 2018' sidebar: mydoc_sidebar permalink: httpstatuscodefailure.html disqus: false
Marking Transaction as Fail
HTTP Status Code with Request Failure.
Pinpoint Configuration
pinpoint.config
profiler.http.status.code.errors=5xx, 401, 403, 406Comma 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
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 |
$ 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
BASICorALLtype โ 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.
3 Related Settings of Pinpoint Components
- 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.ymlfile incollector-startermodule:
pinpoint:
modules:
collector:
inspector:
enabled: truePinpoint Web
application.ymlfile inweb-startermodule:
pinpoint:
modules:
web:
inspector:
enabled: truePinpoint Batch
batch-root.propertiesfile inbatchmodule:
alarm.collector.version=24 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
pinpoint:
modules:
collector:
inspector:
hbase:
enabled: true- java vm option
-Dpinpoint.modules.collector.inspector.hbase.enabled=trueModify batch-root.properties file in batch module OR add java vm option when running Pinpoint Batch.
- batch-root.properties
alarm.collector.version=1- java vm option
-Dalarm.collector.version=1B 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
kafka:
inspector:
agent:
table:
count: N- java vm option
-Dkafka.inspector.agent.topic.count=NModify application.yml file in web-starter module OR add java vm option when running Pinpoint Web
- application.yml
pinot:
inspector:
agent:
table:
count: N- java vm option
-Dpinot.inspector.agent.topic.count=NModify batch-root.properties file in batch module OR add java vm option when running Pinpoint Batch
- batch-root.properties
job.alarm.agent.inspector.stat.table.count=N- java vm option
-Djob.alarm.agent.inspector.stat.table.count=N1 ๊ฐ์
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 |
$ 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ํ์ผ:
pinpoint:
modules:
collector:
inspector:
enabled: truePinpoint Web
web-starter๋ชจ๋์application.ymlํ์ผ:
pinpoint:
modules:
web:
inspector:
enabled: truePinpoint Batch
batch๋ชจ๋์batch-root.propertiesํ์ผ:
alarm.collector.version=24 Q&A
A HBase์ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ Legacy Inspector๋ฅผ ์ฌ์ฉํ ์ ์๋์?
๊ฐ๋ฅํฉ๋๋ค. ๊ทธ๋ฌ๋ 3.0.1 ๋ฒ์ ์ด์ ๋ถํฐ๋ Legacy Inspector๋ฅผ ์ญ์ ํ ์์ ์ด๋ฏ๋ก Pinpoint ๋ฒ์ ์ด ์ฌ๋ผ๊ฐ์๋ก ๊ธฐ๋ฅ์ ์ฌ์ฉํ ์ ์์ผ๋ฏ๋ก New Inspector๋ฅผ ์ฌ์ฉํ๋๊ฒ์ ๊ถ์ฅํฉ๋๋ค.
๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ ค๋ฉด Pinpoint ์ปดํฌ๋ํธ๋ค์ ์๋ ์ค์ ์ ์ถ๊ฐํด์ผํฉ๋๋ค.
collector-starter ํ๋ก์ ํธ์ application.yml ํ์ผ์ด๋ java vm option์ ์๋ ์ค์ ์ ์ถ๊ฐํด์ฃผ์ธ์.
- application.yml
pinpoint:
modules:
collector:
inspector:
hbase:
enabled: true- java vm option
-Dpinpoint.modules.collector.inspector.hbase.enabled=truebatch ํ๋ก์ ํธ์์ batch-root.properties ํ์ผ์ด๋ java vm option์ ์๋ ์ค์ ์ ์ถ๊ฐํด์ฃผ์ธ์.
- batch-root.properties
alarm.collector.version=1- java vm option
-Dalarm.collector.version=1B ์ฌ์ฉ์์๊ฒ ์ ๊ณต๋๋ ๊ธฐ๋ฅ์ ๋น์ทํ๋ฐ 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
kafka:
inspector:
agent:
table:
count: N- java vm option
-Dkafka.inspector.agent.topic.count=Nweb-starter ๋ชจ๋์ application.yml ํ์ผ์ด๋ java vm option์ ์๋ ์ค์ ์ ์ถ๊ฐํด ์ฃผ์ธ์.
- application.yml
pinot:
inspector:
agent:
table:
count: N- java vm option
-Dpinot.inspector.agent.topic.count=Nbatch ๋ชจ๋์ batch-root.properties ํ์ผ์ด๋ java vm option์ ์๋ ์ค์ ์ ์ถ๊ฐํด ์ฃผ์ธ์.
- batch-root.properties
job.alarm.agent.inspector.stat.table.count=N- java vm option
-Djob.alarm.agent.inspector.stat.table.count=NFile: documents/otel_metric.md
โ This document is currently being written.
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-00otlp-metric-long-00otlp-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.
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
<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.
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
- Micrometer quick guide: https://www.baeldung.com/micrometer
- Micrometer OTLP export guide: https://docs.micrometer.io/micrometer/reference/implementations/otlp.html
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-00otlp-metric-long-00otlp-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์ ์์ต๋๋ค.
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 ์ถ๊ฐ
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-otlp</artifactId>
<version>1.13.3</version>
</dependency>7.2 application.yml ์ค์
Micrometer metric ๋ฐ์ดํฐ๋ฅผ OpenTelemetry ํํ๋ก ์ ์ก๋๋๋ก ์ค์ ์ ์ถ๊ฐํฉ๋๋ค.
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 ๊ฐ์ด๋
- Micrometer quick guide: https://www.baeldung.com/micrometer
- Micrometer OTLP export guide: https://docs.micrometer.io/micrometer/reference/implementations/otlp.html
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
title: Separate Logging Per Request keywords: history last_updated: 'Feb 1, 2018' sidebar: mydoc_sidebar permalink: perrequestfeatureguide.html disqus: false
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
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
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
###########################################################
# log4j
###########################################################
profiler.log4j.logging.transactioninfo=trueex) pinpoint.config when using log4j2
###########################################################
# log4j2
###########################################################
profiler.log4j2.logging.transactioninfo=trueex) pinpoint.config when using logback
###########################################################
# logback
###########################################################
profiler.logback.logging.transactioninfo=true2-2 log4j, log4j2, logback configuration
Change the log message format to print the transactionId, and spanId saved in MDC.
ex) log4j : log4j.xml
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
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
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.
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 : SPORTS3. 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)
@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.
log.enable= true
log.page.url=XXXX.pinpoint
log.button.name= logstep 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.
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
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
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 ๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ
###########################################################
# log4j
###########################################################
profiler.log4j.logging.transactioninfo=trueex) Pinpoint.config - log4j2 ๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ
###########################################################
# log4j2
###########################################################
profiler.log4j2.logging.transactioninfo=trueex) Pinpoint.config - logback ๋ฅผ ์ฌ์ฉํ ๊ฒฝ์ฐ
###########################################################
# logback
###########################################################
profiler.logback.logging.transactioninfo=true2-2 log4j, log4j2, logback ์ค์ ํ์ผ ์ค์
logging ์ค์ ํ์ผ์ log message pattern ์ค์ ์ Pinpoint์์ MDC์ ์ ์ฅํ transactionId, spanId๊ฐ์ด ์ถ๋ ฅ๋ ์ ์๋๋ก ์ค์ ์ ์ถ๊ฐํ์.
ex) log4j - log4j.xml
๋ณ๊ฒฝ ์
<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
๋ณ๊ฒฝ ์
<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
๋ณ๊ฒฝ ์
<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 ์ ๋ณด๊ฐ ์ถ๋ ฅ๋๋๊ฒ์ ํ์ธํ๋ฉด ๋๋ค.
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 : SPORTS3. Pinpoint web์์ ๋ก๊ทธ ํ์ธ
Pinpoint web์ transaction list ํ๋ฉด์์ log๋ฅผ ์ถ๋ ฅํ๋ ๋งํฌ๋ฅผ ์ ๊ณตํ๊ณ ์ถ๋ค๋ฉด ์๋์ ๊ฐ์ด ์ค์ ๋ฐ ๊ตฌํ์ ์ถ๊ฐํ๋ฉด ๋๋ค. Pinpoint web์์๋ ๋ฒํผ ์ ์ถ๊ฐํด์ฃผ๊ธฐ๋ง ํ๊ณ ๋ก๊ทธ๋ฅผ ๊ฐ์ ธ์ค๋ ๋ก์ง์ ์ง์ ๊ตฌํ์ ํด์ผํ๋ค.
๋ก๊ทธ ๋ฉ์์ง๋ฅผ Pinpoint web์์ ๋ณด์ฌ์ฃผ๊ธฐ ์ํด์๋ ์๋์ ๊ฐ์ด 2๊ฐ์ง step์ ๋ฐ๋ผ์ผ ํ๋ค.
step 1 transactionId์ spanId, transaction ์์ ์๊ฐ์ ํ๋ผ๋ฏธํฐ๋ก ๋ฐ์์ ๋ก๊ทธ ๋ฉ์์ง๋ฅผ ๊ฐ์ ธ์ค๋ controller์ ๊ตฌํํด์ผํ๋ค.
example)
@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์ ์ด๋ฆ์ ์ถ๊ฐํด์ฃผ์.
log.enable=true
log.page.url=XXXX.Pinpoint
log.button.name=logstep 3 pinpoint 1.5 ์ดํ ๋ฒ์ ๋ถํฐ log ๊ธฐ๋ก ์ฌ๋ถ์ ๋ฐ๋ผ log ๋ฒํผ์ ํ์ฑํ๊ฐ ๊ฒฐ์ ๋๋๋ก ๊ฐ์ ๋๊ธฐ ๋๋ฌธ์ ๋น์ ์ด ์ฌ์ฉํ๋ logging appender์ ๋ก๊น ๋ฉ์๋์ logging ์ฌ๋ถ๋ฅผ ์ ์ฅํ๋ interceptor๋ฅผ ์ถ๊ฐํ๋ ํ๋ฌ๊ทธ์ธ์ ๊ฐ๋ฐํด์ผ ํ๋ค. ํ๋ฌ๊ทธ์ธ ๊ฐ๋ฐ ๋ฐฉ๋ฒ์ ๋ค์ ๋งํฌ๋ฅผ ์ฐธ๊ณ ํ๋ฉด ๋๋ค(Link). interceptor ๋ก์ง์ด ์ถ๊ฐ๋ผ์ผ ํ๋ ์์น๋ appender class ๋ด์ LoggingEvent ๊ฐ์ฒด์ ๋ฐ์ดํฐ๋ฅผ ์ด์ฉํ์ฌ ๋ก๊น ์ ํ๋ ๋ฉ์๋๋ค. ์๋๋ interceptor ์์ ์ด๋ค.
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
title: Plugin Developer Guide keywords: 'plugin, plug-in, plug' last_updated: 'Jan 21, 2019' sidebar: mydoc_sidebar permalink: plugindevguide.html disqus: false
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.
- There is a fast auto pinpoint agent plugin generate tool from a 3rd party for creating a simple plug-in, if you'd like to check out.
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.
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.
// 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:
- Pinpoint Agent is started when the JVM starts.
- Pinpoint Agent loads all plugins under
plugindirectory. - Pinpoint Agent invokes
ProfilerPlugin.setup(ProfilerPluginSetupContext)for each loaded plugin. - In the
setupmethod, the plugin registers aTransformerCallbackto all classes that are going to be transformed. - Target application starts.
- Every time a class is loaded, Pinpoint Agent looks for the
TransformerCallbackregistered to the class. - If a
TransformerCallbackis registered, the Agent invokes it'sdoInTransformmethod. TransformerCallbackmodifies the target class' byte code. (e.g. add interceptors, add fields, etc.)- The modified byte code is returned to the JVM, and the class is loaded with the returned byte code.
- Application continues running.
- When a modified method is invoked, the injected interceptor's
beforeandaftermethods are invoked. - 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:
- Pass transaction data as HTTP headers. You can find header names here
- Client plugin records
IP:PORTof the server asdestinationId. - Client plugin passes
destinationIdvalue to server asHeader.HTTP_HOSTheader. - Server plugin records
Header.HTTP_HOSTheader value asacceptorHost.
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.
@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
title: Monitoring Proxy Server keywords: 'proxy, http, header' last_updated: 'Feb 1, 2018' sidebar: mydoc_sidebar permalink: proxyhttpheader.html disqus: false
Monitoring Proxy Server
Proxy monitoring using HTTP headers
It is used to know the elapsed time between proxy and WAS.
Pinpoint Configuration
pinpoint.config
profiler.proxy.http.header.enable=trueProxy Configuration
Apache HTTP Server
Add HTTP header.
Pinpoint-ProxyApache: t=991424704447256 D=3775428 i=51 b=49e.g.
httpd.conf
<IfModule mod_jk.c>
...
RequestHeader set Pinpoint-ProxyApache "%t %D %i %b"
...
</IfModule>%t is required value.
Nginx
- http://nginx.org/en/docs/http/ngx_http_core_module.html
- http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header
Add HTTP header.
Pinpoint-ProxyNginx: t=1504248328.423 D=0.123e.g.
nginx.conf
...
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
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.
Pinpoint-ProxyApp: t=1594316309407 app=foo-bart=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.
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:6379If 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.
@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
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.
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-021-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.
[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.
Turn on the Service feature
โ Create a service
โ Set the service on the agents
โ Verify the data2-1. Turning On the Service Feature
- Click Configuration at the bottom left.
- Select Experimental.
- Turn on Enable service-based application map grouping.
- 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
- Click Service at the bottom left.
- Click Service Setting.
- Click New Service.
- Enter the service name and click Save.
- 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.
- Stop the agents that use the service, or change them to another service.
- 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. |
-Dpinpoint.serviceName=demo-shop-commerce
-Dpinpoint.applicationName=Shopping-Order
-Dpinpoint.agentName=shop-order-01pinpoint.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
- Apply the settings and restart the agent.
- Check in the agent log whether registration succeeded.
- Select the registered service in Pinpoint Web.
- Check that the configured application appears in the application list and on the Service Map.
- 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.
- The Pinpoint Agent is 4.0.0 or later.
- The service was created before the agent.
pinpoint.serviceNamesatisfies the allowed characters and the length limit (3 to 254 characters), andpinpoint.applicationNamesatisfies the allowed characters and the 254-character limit.pinpoint.serviceNamematches the registered service, including letter case.- If the service was created after the agent, wait up to 10 minutes and restart the agent.
- The agent registration log shows no errors.
- 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
exceptionTracetable: column added- Change:
serviceNamecolumn added (STRING, defaultDEFAULT) - Schema: pinot-exceptionTrace-schema.json
- Change:
7-2. MySQL
- Create the
servicetable- Schema: Service-Schema.sql
- 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
- Tables:
7-3. HBase
- The service-related tables were already added in version 3.1.0.
- If you upgrade to 4.0.0 from a version earlier than 3.1.0, add the HBase tables by referring to the guide below.
- https://pinpoint-apm.gitbook.io/pinpoint/documents/hbase-table-changes#id-3.1.0
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 ์ธ์คํด์ค๋ก ์คํ๋๋ค๊ณ ๊ฐ์ ํฉ๋๋ค.
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-021-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๋ฅผ ์ ํํ๋ฉด ํธ์ถ ๊ด๊ณ๋ ๋ค์๊ณผ ๊ฐ์ด ํ์๋ฉ๋๋ค.
[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 ์ค์ ์ ์์๋๋ก ์ ์ฉํฉ๋๋ค.
์ฒ์ ์ค์ ํ ๋๋ ๋ค์ ์์๋ฅผ ๊ถ์ฅํฉ๋๋ค.
Service ๊ธฐ๋ฅ ์ผ๊ธฐ
โ Service ์์ฑ
โ Agent์ Service ์ง์
โ ๋ฐ์ดํฐ ํ์ธ2-1. Service ๊ธฐ๋ฅ ์ผ๊ธฐ
- ์ผ์ชฝ ์๋ Configuration์ ๋๋ฆ ๋๋ค.
- Experimental์ ์ ํํฉ๋๋ค.
- **Enable service-based application map grouping.**์ ์ผญ๋๋ค.
- ์ผ์ชฝ ๋ฉ๋ด์ Service์ Servicemap์ด ํ์๋๋์ง ํ์ธํฉ๋๋ค.
์ด ์ค์ ์ ๋ธ๋ผ์ฐ์ ๋ณ๋ก ์ ์ฅ๋ฉ๋๋ค.
๋ค๋ฅธ ๋ธ๋ผ์ฐ์ ๋ ๊ธฐ๊ธฐ์์๋ ๋ค์ ์ค์ ํด์ผ ํฉ๋๋ค.
์ต์ ์ด๋ ๋ฉ๋ด๊ฐ ๋ณด์ด์ง ์์ผ๋ฉด Pinpoint ์ด์์์๊ฒ ๋ฌธ์ํฉ๋๋ค.
2-2. Service ์์ฑ
- ์ผ์ชฝ ์๋ Service๋ฅผ ๋๋ฆ ๋๋ค.
- Service Setting์ ๋๋ฆ ๋๋ค.
- New Service๋ฅผ ๋๋ฆ ๋๋ค.
- Service ์ด๋ฆ์ ์ ๋ ฅํ๊ณ Save๋ฅผ ๋๋ฆ ๋๋ค.
- ์์ฑํ 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๋ฅผ ์ฌ๊ธฐ๋ํ๋ฉด ๋ฑ๋ก์ด ์คํจํ๊ณ ์ ๊ท ๋ฐ์ดํฐ๊ฐ ์์ง๋์ง ์์ ์ ์์ต๋๋ค.
์ญ์ ๊ฐ ํ์ํ ๊ฒฝ์ฐ ๋ค์ ์์๋ฅผ ๋ฐ๋ฆ ๋๋ค.
- ํด๋น Service๋ฅผ ์ฌ์ฉํ๋ Agent๋ฅผ ์ค์งํ๊ฑฐ๋ ๋ค๋ฅธ Service๋ก ๋ณ๊ฒฝํฉ๋๋ค.
- ๋ณ๊ฒฝํ 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 |
์คํ ์ค์ธ ์ธ์คํด์ค๋ฅผ ๊ตฌ๋ถํ๋ ์ด๋ฆ์ ๋๋ค. ์ ํ ํญ๋ชฉ์ ๋๋ค. |
-Dpinpoint.serviceName=demo-shop-commerce
-Dpinpoint.applicationName=Shopping-Order
-Dpinpoint.agentName=shop-order-01pinpoint.serviceName๊ณผ pinpoint.applicationName์ ๋ฐ๋์ ์ค์ ํฉ๋๋ค.
pinpoint.agentName์ ์๋ตํ๋ฉด Agent๊ฐ ์ธ์คํด์ค ์ด๋ฆ์ ์๋์ผ๋ก ์์ฑํฉ๋๋ค.
์ฌ๊ธฐ๋ ์ ํ์ ์ธ์คํด์ค๋ฅผ ์ฝ๊ฒ ๊ตฌ๋ถํ๋ ค๋ฉด ์ด๋ฆ์ ์ง์ ์ง์ ํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค.
3-3. ์ค์ ์ ์ฉ๊ณผ ํ์ธ
- ์ค์ ์ ๋ฐ์ํ ๋ค Agent๋ฅผ ์ฌ๊ธฐ๋ํฉ๋๋ค.
- Agent ๋ก๊ทธ์์ ๋ฑ๋ก ์ฑ๊ณต ์ฌ๋ถ๋ฅผ ํ์ธํฉ๋๋ค.
- Pinpoint Web์์ ๋ฑ๋กํ Service๋ฅผ ์ ํํฉ๋๋ค.
- Application ๋ชฉ๋ก๊ณผ Service Map์์ ์ค์ ํ Application์ด ํ์๋๋์ง ํ์ธํฉ๋๋ค.
- ์ต๊ทผ ์๊ฐ ๋ฒ์์์ 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์ด ๋ณด์ด์ง ์์ต๋๋ค
๋ค์์ ์์๋๋ก ํ์ธํฉ๋๋ค.
- Pinpoint Agent๊ฐ 4.0.0 ์ด์์ธ์ง ํ์ธํฉ๋๋ค.
- Agent๋ณด๋ค ๋จผ์ Service๋ฅผ ๋ง๋ค์๋์ง ํ์ธํฉ๋๋ค.
pinpoint.serviceName์ด ํ์ฉ ๋ฌธ์์ ๊ธธ์ด(3~254์) ์ ํ์,pinpoint.applicationName์ด ํ์ฉ ๋ฌธ์์ 254์ ์ ํ์ ๋ง์กฑํ๋์ง ํ์ธํฉ๋๋ค.pinpoint.serviceName์ด ๋ฑ๋กํ Service์ ๋์๋ฌธ์๊น์ง ๊ฐ์์ง ํ์ธํฉ๋๋ค.- Service๋ฅผ Agent๋ณด๋ค ๋ฆ๊ฒ ๋ง๋ค์๋ค๋ฉด ์ต๋ 10๋ถ ๊ธฐ๋ค๋ฆฐ ๋ค Agent๋ฅผ ์ฌ๊ธฐ๋ํฉ๋๋ค.
- Agent ๋ฑ๋ก ๋ก๊ทธ์์ ์ค๋ฅ๊ฐ ์๋์ง ํ์ธํฉ๋๋ค.
- 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ํ ์ด๋ธ ์์ฑ- ์คํค๋ง: Service-Schema.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 - ์๊ตฌ ์ฌํญ: 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
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
- Telegraf agent sends system metrics data to Pinpoint collector.
- Pinpoint collector saves data to Pinot through Kafka.
- Kafka is necessary to stream data to Pinot.
- Pinpoint web accesses Pinot to display collected metrics data.
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-typesystem-metric-tagsystem-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:
config.show.systemMetric=true3.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.conffile to send collected metrics to Pinpoint collector via http.- Note: Starting from Pinpoint v3.0.2, the metric port has been changed from
15200to9995. - 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 collectorhostGroupName: 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
DEFAULTservice.defaultis also stored asDEFAULT. - Use 3 to 254 characters of letters, digits,
.,_, and-. The collector rejects other values with400 Bad Request.
- If you omit it, the collector stores the metrics in the
- Note: Starting from Pinpoint v3.0.2, the metric port has been changed from
4 View Collected System Metrics Data
- Click
Infrastructureon the side bar menu in Pinpoint web. - 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
serviceNameheader. - Metrics collected before v4.1.0 have no service. They are shown in the
DEFAULTservice until they expire.
- The list shows only the host groups of the selected service. Select the service set in the
- 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์ ์๋ ์ค์ ๊ฐ์ ์ถ๊ฐํ๋ค:
config.show.systemMetric=true3.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"
- ์ฐธ๊ณ : Pinpoint v3.0.2๋ถํฐ ๋ฉํธ๋ฆญ ํฌํธ๊ฐ
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๋
DEFAULTservice๋ก ์ ์ฅํ๋ค.default๋DEFAULT๋ก ์ ์ฅํ๋ค. - ์๋ฌธ์, ์ซ์,
.,_,-๋ก 3~254์๋ฅผ ์ฌ์ฉํ๋ค. ๋ค๋ฅธ ๊ฐ์ collector๊ฐ400 Bad Request๋ก ๊ฑฐ๋ถํ๋ค.
- ์๋ตํ๋ฉด collector๋
- http ํ๋กํ ์ฝ๋ก ๋ฐ์ดํฐ๋ฅผ ์ ๋ฌ์ ์๋๋ก output http plugin ์๋ ์ค์ ์ ์ถ๊ฐํ๋ค.
- telegraf.conf ์ค์ ๋ฐฉ๋ฒ
4 ๋ฐ์ดํฐ ์กฐํ
- pinpoint-web์์ ์ผ์ชฝ
Infrastructure๋ฉ๋ด๋ฅผ ์ ํํ์ฌ system metric ํ๋ฉด์ผ๋ก ์ด๋ํ๋ค. - ์๋จ์ select box์์ telegraf.conf ํ์ผ์ ์ค์ ํ hostGroupName ๊ฐ์ ์ฐพ์์ ์ ํํ๋ค.
- ๋ชฉ๋ก์๋ ์ ํํ service์ ์๋ฒ ๊ทธ๋ฃน๋ง ๋์จ๋ค.
serviceNameํค๋์ ์ค์ ํ service๋ฅผ ์ ํํด์ผ ํ๋ค. - v4.1.0 ์ด์ ์ ์์งํ ๋ฉํธ๋ฆญ์๋ service๊ฐ ์๋ค. ์ด ๋ฐ์ดํฐ๋ ๋ณด๊ด ๊ธฐ๊ฐ์ด ๋๋ ๋๊น์ง
DEFAULTservice์์ ๋ณด์ธ๋ค.
- ๋ชฉ๋ก์๋ ์ ํํ service์ ์๋ฒ ๊ทธ๋ฃน๋ง ๋์จ๋ค.
- ์๋์ ๊ฐ์ด ์ผ์ชฝ์ ํธ์คํธ ๋ชฉ๋ก์ด ๋์ค๊ณ , ํธ์คํธ๋ฅผ ์ ํํด์ system metric ๋ฐ์ดํฐ๋ฅผ ํ์ธํ ์ ์๋ค.
5 ๊ธฐํ
- pinot์๋ system metric ๋ฟ๋ง์๋๋ผ pinpoint์ ๋ค์ํ ๋ฉํธ๋ฆญ ๋ฐ์ดํฐ์ ํต๊ณ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ ์์ ์ด๋ค. ์ฆ pinot๋ ๋ค์ํ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ ๋ชฉ์ ์ผ๋ก ์ฌ์ฉ๋ ๊ฒ์ด๋ค.
- system metric์ ๊ฒฝ์ฐ ๋น๋ถ๊ฐ์ beta ๊ธฐ๋ฅ์ผ๋ก ์ ๊ณตํ ๊ฒ์ด๊ณ ์์ ์ ์ผ๋ก ๊ธฐ๋ฅ์ด ์ด์๋๋ ๊ฒฝํ์ด ์์ด๋ฉด ๊ณต์์ ์ผ๋ก ๊ธฐ๋ฅ์ ์ ๊ณตํ ๊ฒ์ด๋ค.
- 2.5.0 ์ดํ ๋ฒ์ ์์ system metric ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ค๊ฐ ๋ฒ์ ์ ์ ๊ทธ๋ ์ด๋ ํ๋ ๊ฒฝ์ฐ guide ์ค๋ช ์ ์ฐธ๊ณ ํ์.
File: documents/uri_statistics.md
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.
$ 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.
###########################################################
# 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=falseprofiler.uri.stat.enable: whether Pinpoint Agent collects URI statistics or not.
true: collects URI statisticsfalse: 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-templateto 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-templateto 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-templateto your Vert.x routing context as shown below to override default URI template provided by Pinpoint.textrouter.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 attributepinpoint.metric.uri-templateto 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 attributepinpoint.metric.uri-templateon 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.
Enable URI statistics collection by adding the below line at pinpoint-collector.properties:
textcollector.stat.uri=trueShow the URI Statistics menu by adding the below line at pinpoint-web-uristat.properties:
textconfig.show.urlStat=true
2. View Collected URI Statistics Data
- Click
URL Statisticon the side bar menu in Pinpoint web. - Search for the application name you used to configure Pinpoint Agent.
- Top 50 URIs used in your application will be displayed below the empty chart.
- 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 ๊ฐ๊ณผ ์ผ์นํ๋ค.
$ 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 ํต๊ณ ์์ง๊ณผ ๊ด๋ จ๋ ํํฌ์ธํธ ์์ด์ ํธ์ ์ค์ ๊ธฐ๋ณธ๊ฐ๋ค์ ์๋์ ๊ฐ๋ค.
###########################################################
# 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=falseprofiler.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 ๊ฐ์ผ๋ก ํ๋ ์์ฑ ๊ฐ์ ์ค์ ํด์ผ ํ๋ค.textrouter.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์ ์๋ ์ค์ ๊ฐ์ ์ถ๊ฐํ๋ค:
textcollector.stat.uri=trueURI Statistics ๋ฉ๋ด๋ฅผ ํ์ํ๋ ค๋ฉด pinpoint-web-uristat.properties์ ์๋ ์ค์ ๊ฐ์ ์ถ๊ฐํ๋ค:
textconfig.show.urlStat=true
2. URI ํต๊ณ ๋ฐ์ดํฐ ์กฐํ
- ํํฌ์ธํธ ์น์ ์คํํ์ฌ ์ผ์ชฝ
URL Statistic๋ฉ๋ด๋ฅผ ์ ํํ๋ค. - ์๋จ์ select box์์ ํํฌ์ธํธ ์์ด์ ํธ์ ์ค์ ํ ์ดํ๋ฆฌ์ผ์ด์ ์ด๋ฆ์ ์กฐํํ๋ค.
- ์ด๊ธฐ ํ๋ฉด์์๋ ์ ํํ ์ดํ๋ฆฌ์ผ์ด์ ์์ ๊ฐ์ฅ ๋ง์ด ์ฌ์ฉํ ์์ 50๊ฐ URI๊ฐ ๋น ์ฐจํธ ๋ฐ์ ํ์๋๋ค.
- ์ํ๋ URI๋ฅผ ํด๋ฆญํ๋ฉด ์ฐจํธ์ ๋ฐ์ดํฐ๊ฐ ํ์๋๋ค.