Deploy Pinpoint APM (Application Performance Management) in Docker Containers

Posted on 134 views

Application Performance Monitoring (APM) can be defined as the process of discovering, tracing, and performing diagnoses on cloud software applications in production. These tools enable better analysis of network topologies with improved metrics and user experiences.

Pinpoint is an open-source Application Performance Management(APM) with trusted millions of users around the world. Pinpoint, inspired by Google Dapper is written in JavaPHP, and Python programming languages. This project was started in July 2012 and later released to the public in January 2015. Since then, it has served as the best solution to analyze the structure as well as the interconnection between components across distributed applications.

Features of Pinpoint APM

  • Offers Cloud and server Monitoring.
  • Distributed transaction tracing to trace messages across distributed applications
  • Overview of the application topology – traces transactions between all components to identify potentially problematic issues.
  • Lightweight – has a minimal performance impact on the system.
  • Provides code-level visibility to easily identify points of failure and bottlenecks
  • Software as a Service.
  • Offers the ability to add a new functionality without code modifications by using the bytecode instrumentation technique
  • Automatically detection of the application topology that helps understand the configurations of an application
  • Real-time monitoring – observe active threads in real-time.
  • Horizontal scalability to support large-scale server group
  • Transaction code-level visibility – response patterns and request counts.

This guide aims to help you deploy Pinpoint APM (Application Performance Management) in Docker Containers.

Pinpoint APM Supported Modules

Below is a list of modules supported by Pinpoint APM (Application Performance Management):

  • ActiveMQ, RabbitMQ, Kafka, RocketMQ
  • Arcus, Memcached, Redis(Jedis, Lettuce), CASSANDRA, MongoDB, Hbase, Elasticsearch
  • MySQL, Oracle, MSSQL(jtds), CUBRID, POSTGRESQL, MARIA
  • Apache HTTP Client 3.x/4.x, JDK HttpConnector, GoogleHttpClient, OkHttpClient, NingAsyncHttpClient, Akka-http, Apache CXF
  • JDK 7 and above
  • Apache Tomcat 6/7/8/9, Jetty 8/9, JBoss EAP 6/7, Resin 4, Websphere 6/7/8, Vertx 3.3/3.4/3.5, Weblogic 10/11g/12c, Undertow
  • Spring, Spring Boot (Embedded Tomcat, Jetty, Undertow), Spring asynchronous communication
  • Thrift Client, Thrift Service, DUBBO PROVIDER, DUBBO CONSUMER, GRPC
  • iBATIS, MyBatis
  • log4j, Logback, log4j2
  • DBCP, DBCP2, HIKARICP, DRUID
  • gson, Jackson, Json Lib, Fastjson

Deploy Pinpoint APM (Application Performance Management) in Docker Containers

Deploying the PInpoint APM docker container can be achieved using the below steps:

Step 1 – Install Docker and Docker-Compose on Linux.

Pinpoint APM requires a Docker version 18.02.0 and above. The latest available version of Docker can be installed with the aid of the guide below:

Once installed, ensure that the service is started and enabled as below.

sudo systemctl start docker && sudo systemctl enable docker

Check the status of the service.

$ systemctl status docker
 docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2022-01-19 02:51:04 EST; 1min 4s ago
     Docs: https://docs.docker.com
 Main PID: 34147 (dockerd)
    Tasks: 8
   Memory: 31.3M
   CGroup: /system.slice/docker.service
           └─34147 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Verify the installed Docker version.

$ docker version
Client: Docker Engine - Community
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:45:22 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true
.....

Now proceed and install Docker-compose using the dedicated guide below:

Add your system user to the Docker group to be able to run docker commands without sudo

sudo usermod -aG docker $USER
newgrp docker

Step 2 – Deploy the Pinpoint APM (Application Performance Management)

The Pinpoint docker container can be deployed by pulling the official docker image as below. Ensure that git is installed on your system before you proceed.

git clone https://github.com/naver/pinpoint-docker.git

Once the image has been pulled, navigate into the directory.

cd pinpoint-docker

Now we will run the Pinpoint container that will have the following containers joined to the same network:

  • The Pinpoint-Web Server
  • Pinpoint-Agent
  • Pinpoint-Collector
  • Pinpoint-QuickStart(a sample application, 1.8.1+)
  • Pinpoint-Mysql(to support certain feature) This may take several minutes to download all necessary images.
  • Pinpoint-Flink(to support certain feature)
  • Pinpoint-Hbase
  • Pinpoint-Zookeeper

All these components and their configurations are defined in the docker-compose YAML file that can be viewed below.

cat docker-compose.yml 

Now start the container as below.

docker-compose pull
docker-compose up -d

Sample output:

.......
[+] Running 14/14
 ⠿ Network pinpoint-docker_pinpoint      Created                           0.3s
 ⠿ Volume "pinpoint-docker_mysql_data"   Created                           0.0s
 ⠿ Volume "pinpoint-docker_data-volume"  Created                           0.0s
 ⠿ Container pinpoint-docker-zoo3-1      Started                           3.7s
 ⠿ Container pinpoint-docker-zoo1-1      Started                           3.0s
 ⠿ Container pinpoint-docker-zoo2-1      Started                           3.4s
 ⠿ Container pinpoint-mysql              Sta...                            3.8s
 ⠿ Container pinpoint-flink-jobmanager   Started                           3.4s
 ⠿ Container pinpoint-hbase              Sta...                            4.0s
 ⠿ Container pinpoint-flink-taskmanager  Started                           5.4s
 ⠿ Container pinpoint-collector          Started                           6.5s
 ⠿ Container pinpoint-web                Start...                          5.6s
 ⠿ Container pinpoint-agent              Sta...                            7.9s
 ⠿ Container pinpoint-quickstart         Started                           9.1s

Once the process is complete, check the status of the containers.

$ docker ps
CONTAINER ID   IMAGE                                     COMMAND                  CREATED          STATUS          PORTS                                                                                                                                                                                        NAMES
cb17fe18e96d   pinpointdocker/pinpoint-quickstart        "catalina.sh run"        54 seconds ago   Up 44 seconds   0.0.0.0:8000->8080/tcp, :::8000->8080/tcp                                                                                                                                                    pinpoint-quickstart
732e5d6c2e9b   pinpointdocker/pinpoint-agent:2.3.3       "/usr/local/bin/conf…"   54 seconds ago   Up 46 seconds                                                                                                                                                                                                pinpoint-agent
4ece1d8294f9   pinpointdocker/pinpoint-web:2.3.3         "sh /pinpoint/script…"   55 seconds ago   Up 48 seconds   0.0.0.0:8079->8079/tcp, :::8079->8079/tcp, 0.0.0.0:9997->9997/tcp, :::9997->9997/tcp                                                                                                         pinpoint-web
79f3bd0e9638   pinpointdocker/pinpoint-collector:2.3.3   "sh /pinpoint/script…"   55 seconds ago   Up 47 seconds   0.0.0.0:9991-9996->9991-9996/tcp, :::9991-9996->9991-9996/tcp, 0.0.0.0:9995-9996->9995-9996/udp, :::9995-9996->9995-9996/udp                                                                 pinpoint-collector
4c4b5954a92f   pinpointdocker/pinpoint-flink:2.3.3       "/docker-bin/docker-…"   55 seconds ago   Up 49 seconds   6123/tcp, 0.0.0.0:6121-6122->6121-6122/tcp, :::6121-6122->6121-6122/tcp, 0.0.0.0:19994->19994/tcp, :::19994->19994/tcp, 8081/tcp                                                             pinpoint-flink-taskmanager
86ca75331b14   pinpointdocker/pinpoint-flink:2.3.3       "/docker-bin/docker-…"   55 seconds ago   Up 51 seconds   6123/tcp, 0.0.0.0:8081->8081/tcp, :::8081->8081/tcp                                                                                                                                          pinpoint-flink-jobmanager
e88a13155ce8   pinpointdocker/pinpoint-hbase:2.3.3       "/bin/sh -c '/usr/lo…"   55 seconds ago   Up 50 seconds   0.0.0.0:16010->16010/tcp, :::16010->16010/tcp, 0.0.0.0:16030->16030/tcp, :::16030->16030/tcp, 0.0.0.0:60000->60000/tcp, :::60000->60000/tcp, 0.0.0.0:60020->60020/tcp, :::60020->60020/tcp   pinpoint-hbase
4a2b7dc72e95   zookeeper:3.4                             "/docker-entrypoint.…"   56 seconds ago   Up 52 seconds   2888/tcp, 3888/tcp, 0.0.0.0:49154->2181/tcp, :::49154->2181/tcp                                                                                                                              pinpoint-docker-zoo2-1
3ae74b297e0f   zookeeper:3.4                             "/docker-entrypoint.…"   56 seconds ago   Up 52 seconds   2888/tcp, 3888/tcp, 0.0.0.0:49155->2181/tcp, :::49155->2181/tcp                                                                                                                              pinpoint-docker-zoo3-1
06a09c0e7760   zookeeper:3.4                             "/docker-entrypoint.…"   56 seconds ago   Up 52 seconds   2888/tcp, 3888/tcp, 0.0.0.0:49153->2181/tcp, :::49153->2181/tcp                                                                                                                              pinpoint-docker-zoo1-1
91464a430c48   pinpointdocker/pinpoint-mysql:2.3.3       "docker-entrypoint.s…"   56 seconds ago   Up 52 seconds   0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp                                                                                                                                         pinpoint-mysql

Access the Pinpoint APM (Application Performance Management) Web UI

The Pinpoint Web run on the default port 8079 and can be accessed using the URL http://IP_address:8079.

You will be granted the below page.

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers

Select the desired application to analyze. For this case, we will analyze our deployed Quickapp. Select the application and proceed.

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers-1-1024x745

Here, click on inspector to view the detailed metrics. Here select the app-in-docker

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers-2-1024x740

You can also make settings to Pinpoint such as setting user groups, alarms, themes e.t.c.

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers-3-1024x540

Under administration, you can view agent statistics for your application

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers-4-1024x540

Manage your applications under the agent management tab

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers-7-1024x493

To set an alarm, you first need to have a user group created.

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers-5

you also need to create a pinpoint user and add them to the user group as below.

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers-6-1024x495

With the user group, an alarm for your application can be created, a rule and notification methods to the group members added as shown.

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers-8-1024x600

Now you will have your alarm configured as below.

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers-9-1024x433

You can also switch to the dark theme which appears as below.

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers-10-1024x700

View the Apache Flink Task manager page using the URL http://IP_address:8081.

Deploy-Pinpoint-APM-Application-Performance-Management-in-Docker-Containers-11-1024x411

Voila!

We have triumphantly deployed Pinpoint APM (Application Performance Management) in Docker Containers. Now you can discover, trace, and perform diagnoses on your applications.

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.