From 29d01e943d77c3bab2ea571fc03cd5a673074183 Mon Sep 17 00:00:00 2001 From: Dawid Malinowski Date: Thu, 9 Jul 2015 00:09:54 +0200 Subject: [PATCH] Initial version --- pinpoint-agent/Dockerfile | 18 ++ pinpoint-agent/pinpoint.config | 209 ++++++++++++++++++ pinpoint-collector/Dockerfile | 25 +++ pinpoint-collector/hbase.properties | 22 ++ .../pinpoint-collector.properties | 30 +++ pinpoint-collector/start.sh | 21 ++ pinpoint-hbase/Dockerfile | 40 ++++ pinpoint-hbase/hbase-site.xml | 18 ++ pinpoint-web/Dockerfile | 21 ++ pinpoint-web/hbase.properties | 22 ++ pinpoint-web/pinpoint-web.properties | 14 ++ pinpoint-web/start.sh | 14 ++ 12 files changed, 454 insertions(+) create mode 100644 pinpoint-agent/Dockerfile create mode 100644 pinpoint-agent/pinpoint.config create mode 100644 pinpoint-collector/Dockerfile create mode 100644 pinpoint-collector/hbase.properties create mode 100644 pinpoint-collector/pinpoint-collector.properties create mode 100644 pinpoint-collector/start.sh create mode 100644 pinpoint-hbase/Dockerfile create mode 100644 pinpoint-hbase/hbase-site.xml create mode 100644 pinpoint-web/Dockerfile create mode 100644 pinpoint-web/hbase.properties create mode 100644 pinpoint-web/pinpoint-web.properties create mode 100644 pinpoint-web/start.sh diff --git a/pinpoint-agent/Dockerfile b/pinpoint-agent/Dockerfile new file mode 100644 index 0000000..a630680 --- /dev/null +++ b/pinpoint-agent/Dockerfile @@ -0,0 +1,18 @@ +# DESCRIPTION Pinpoint APM Agent Volume +# TO_BUILD docker build -t pinpoint-agent . +# TO_RUN docker run --name=pinpoint-agent pinpoint-agent + +#FROM progrium/busybox:latest +FROM java:8-jdk + +ENV PINPOINT_VERSION 1.1.0 + +#RUN opkg-install bash curl + +RUN mkdir -p /opt/app \ + && curl -L -O -k "https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-agent-$PINPOINT_VERSION.tar.gz" -o pinpoint-agent.tar.gz \ + && gunzip pinpoint-agent-$PINPOINT_VERSION.tar.gz \ + && tar -xf pinpoint-agent-$PINPOINT_VERSION.tar -C /opt/app \ + && rm pinpoint-agent-$PINPOINT_VERSION.tar + +RUN sed -i 's/profiler.collector.ip=127.0.0.1/profiler.collector.ip=192.168.59.103/' /opt/app/pinpoint-agent/pinpoint.config diff --git a/pinpoint-agent/pinpoint.config b/pinpoint-agent/pinpoint.config new file mode 100644 index 0000000..ffa3616 --- /dev/null +++ b/pinpoint-agent/pinpoint.config @@ -0,0 +1,209 @@ +# +# Pinpoint agent configuration +# + +########################################################### +# Collector server # +########################################################### +profiler.collector.ip=collector + +# placeHolder support "${key}" +profiler.collector.span.ip=${profiler.collector.ip} +profiler.collector.span.port=9996 + +# placeHolder support "${key}" +profiler.collector.stat.ip=${profiler.collector.ip} +profiler.collector.stat.port=9995 + +# placeHolder support "${key}" +profiler.collector.tcp.ip=${profiler.collector.ip} +profiler.collector.tcp.port=9994 + + +########################################################### +# Profiler Global Configuration # +########################################################### +profiler.enable=true + +profiler.jvm.collect.interval=1000 + +profiler.sampling.enable=true + +# Set sampling rate. If you set it to 10, 1 out of 10 transaction will be sampled. +profiler.sampling.rate=1 + +profiler.io.buffering.enable=true +profiler.io.buffering.buffersize=20 + +profiler.spandatasender.write.queue.size=5120 +#profiler.spandatasender.socket.sendbuffersize=1048576 +#profiler.spandatasender.socket.timeout=3000 +profiler.spandatasender.chunk.size=16384 + +profiler.statdatasender.write.queue.size=5120 +#profiler.statdatasender.socket.sendbuffersize=1048576 +#profiler.statdatasender.socket.timeout=3000 +profiler.statdatasender.chunk.size=16384 + +profiler.agentInfo.send.retry.interval=300000 + +# Allows TCP data command +profiler.tcpdatasender.command.accept.enable=true + +########################################################### +# application type # +########################################################### +#profiler.applicationservertype=TOMCAT +#profiler.applicationservertype=BLOC + + +########################################################### +# user defined classes # +########################################################### +profiler.include= + +########################################################### +# TOMCAT # +########################################################### +profiler.tomcat.hidepinpointheader=true +profiler.tomcat.excludeurl=/aa/test.html, /bb/exclude.html + +########################################################### +# JDBC # +########################################################### +profiler.jdbc=true +profiler.jdbc.sqlcachesize=1024 +profiler.jdbc.maxsqlbindvaluesize=1024 + +# +# MYSQL +# +profiler.jdbc.mysql=true +profiler.jdbc.mysql.setautocommit=true +profiler.jdbc.mysql.commit=true +profiler.jdbc.mysql.rollback=true + +# +# MSSQL Jtds +# +profiler.jdbc.jtds=true +profiler.jdbc.jtds.setautocommit=true +profiler.jdbc.jtds.commit=true +profiler.jdbc.jtds.rollback=true + +# +# Oracle +# +profiler.jdbc.oracle=true +profiler.jdbc.oracle.setautocommit=true +profiler.jdbc.oracle.commit=true +profiler.jdbc.oracle.rollback=true + +# +# CUBRID +# +profiler.jdbc.cubrid=true +profiler.jdbc.cubrid.setautocommit=true +profiler.jdbc.cubrid.commit=true +profiler.jdbc.cubrid.rollback=true + +# +# DBCP +# +profiler.jdbc.dbcp=true +profiler.jdbc.dbcp.connectionclose=true + + +########################################################### +# Apache HTTP Client 3.x # +########################################################### +profiler.apache.httpclient3=true +profiler.apache.httpclient3.cookie=true + +# When cookies should be dumped. It could be ALWAYS or EXCEPTION. +profiler.apache.httpclient3.cookie.dumptype=ALWAYS +profiler.apache.httpclient3.cookie.sampling.rate=1 + +# Dump entities of POST or PUT request. limited to entities which is HttpEtity.isRepeatable() == true. +profiler.apache.httpclient3.entity=true + +# When entities should be dumped. ALWAYS or EXCEPTION. +profiler.apache.httpclient3.entity.dumptype=ALWAYS +profiler.apache.httpclient3.entity.sampling.rate=1 + + +########################################################### +# Apache HTTP Client 4.x # +########################################################### +profiler.apache.httpclient4=true +profiler.apache.httpclient4.cookie=true + +# When cookies should be dumped. It could be ALWAYS or EXCEPTION. +profiler.apache.httpclient4.cookie.dumptype=ALWAYS +profiler.apache.httpclient4.cookie.sampling.rate=1 + +# Dump entities of POST or PUT request. limited to entities which is HttpEtity.isRepeatable() == true. +profiler.apache.httpclient4.entity=true + +# When entities should be dumped. ALWAYS or EXCEPTION. +profiler.apache.httpclient4.entity.dumptype=ALWAYS +profiler.apache.httpclient4.entity.sampling.rate=1 + +# Can profile status code value +profiler.apache.httpclient4.entity.statuscode=true + +# Not supported yet +#profiler.apache.nio.httpclient4=true + + +########################################################### +# Ning Async HTTP Client # +########################################################### +profiler.ning.asynchttpclient=true +profiler.ning.asynchttpclient.cookie=true +profiler.ning.asynchttpclient.cookie.dumptype=ALWAYS +profiler.ning.asynchttpclient.cookie.dumpsize=1024 +profiler.ning.asynchttpclient.cookie.sampling.rate=1 +profiler.ning.asynchttpclient.entity=true +profiler.ning.asynchttpclient.entity.dumptype=ALWAYS +profiler.ning.asynchttpclient.entity.dumpsize=1024 +profiler.ning.asynchttpclient.entity.sampling.rate=1 +profiler.ning.asynchttpclient.param=true +profiler.ning.asynchttpclient.param.dumptype=ALWAYS +profiler.ning.asynchttpclient.param.dumpsize=1024 +profiler.ning.asynchttpclient.param.sampling.rate=1 + + +########################################################### +# Arcus # +########################################################### +profiler.arcus=true +profiler.arcus.keytrace=true + + +########################################################### +# Memcached # +########################################################### +profiler.memcached=true +profiler.memcached.keytrace=true + + +########################################################### +# ibatis # +########################################################### +profiler.orm.ibatis=true + + +########################################################### +# mybatis # +########################################################### +profiler.orm.mybatis=true + + +########################################################### +# spring-beans +########################################################### +profiler.spring.beans=true +profiler.spring.beans.name.pattern= +profiler.spring.beans.class.pattern= +profiler.spring.beans.annotation=org.springframework.stereotype.Controller,org.springframework.stereotype.Service,org.springframework.stereotype.Repository diff --git a/pinpoint-collector/Dockerfile b/pinpoint-collector/Dockerfile new file mode 100644 index 0000000..4687a72 --- /dev/null +++ b/pinpoint-collector/Dockerfile @@ -0,0 +1,25 @@ +# DESCRIPTION Pinpoint APM Collector +# TO_BUILD docker build -t pinpoint-collector . +# TO_RUN docker run -d --net=host -e HBASE_HOST= -e HBASE_PORT=2181 -e COLLECTOR_TCP_PORT=9994 -e COLLECTOR_UDP_STAT_LISTEN_PORT=9995 -e COLLECTOR_UDP_SPAN_LISTEN_PORT=9996 -p 9994:9994 -p 9995:9995/udp -p 9996:9996/udp --name=pinpoint-collector pinpoint-collector + +FROM tomcat:8-jre8 + +ENV PINPOINT_VERSION 1.1.0 + +RUN curl -SL "https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-collector-$PINPOINT_VERSION.war" -o pinpoint-collector.war && \ + rm -rf /usr/local/tomcat/webapps && \ + mkdir -p /usr/local/tomcat/webapps && \ + sed -i -e 's/8005/9005/' /usr/local/tomcat/conf/server.xml && \ + sed -i -e 's/8080/9080/' /usr/local/tomcat/conf/server.xml && \ + sed -i -e 's/8009/9009/' /usr/local/tomcat/conf/server.xml && \ + sed -i -e 's/8443/9443/' /usr/local/tomcat/conf/server.xml && \ + unzip pinpoint-collector.war -d /usr/local/tomcat/webapps/ROOT && \ + rm -rf pinpoint-collector.war + +ADD start.sh /usr/local/tomcat/start.sh +RUN chmod a+x /usr/local/tomcat/start.sh + +ADD hbase.properties /assets/hbase.properties +ADD pinpoint-collector.properties /assets/pinpoint-collector.properties + +CMD ["/usr/local/tomcat/start.sh"] diff --git a/pinpoint-collector/hbase.properties b/pinpoint-collector/hbase.properties new file mode 100644 index 0000000..4161185 --- /dev/null +++ b/pinpoint-collector/hbase.properties @@ -0,0 +1,22 @@ +hbase.client.host=HBASE_HOST +hbase.client.port=HBASE_PORT + +# hbase timeout option================================================================================== +# hbase default:true +hbase.ipc.client.tcpnodelay=true +# hbase default:60000 +hbase.rpc.timeout=10000 +# hbase default:Integer.MAX_VALUE +hbase.client.operation.timeout=10000 + +# hbase socket read timeout. default: 200000 +hbase.ipc.client.socket.timeout.read=20000 +# socket write timeout. hbase default: 600000 +hbase.ipc.client.socket.timeout.write=60000 + +# ================================================================================== +# hbase client thread pool option +hbase.client.thread.max=128 +hbase.client.threadPool.queueSize=5120 +# prestartAllCoreThreads +hbase.client.threadPool.prestart=false \ No newline at end of file diff --git a/pinpoint-collector/pinpoint-collector.properties b/pinpoint-collector/pinpoint-collector.properties new file mode 100644 index 0000000..8cc0875 --- /dev/null +++ b/pinpoint-collector/pinpoint-collector.properties @@ -0,0 +1,30 @@ +# tcp listen ip +collector.tcpListenIp=0.0.0.0 +collector.tcpListenPort=COLLECTOR_TCP_PORT + +# udp listen ip +collector.udpStatListenIp=0.0.0.0 +collector.udpStatListenPort=COLLECTOR_UDP_STAT_LISTEN_PORT + +collector.l4.ip= + +collector.udpStatWorkerThread=16 +collector.udpStatWorkerQueueSize=512 + +collector.udpStatSocketReceiveBufferSize=4194304 + + +# span listen port --------------------------------------------------------------------- +collector.udpSpanListenIp=0.0.0.0 +collector.udpSpanListenPort=COLLECTOR_UDP_SPAN_LISTEN_PORT + +collector.udpSpanWorkerThread=32 +collector.udpSpanWorkerQueueSize=1024 + +collector.udpSpanSocketReceiveBufferSize=4194304 + +statistics.flushPeriod=1000 + +cluster.enable=false +cluster.zookeeper.address= +cluster.zookeeper.sessiontimeout= \ No newline at end of file diff --git a/pinpoint-collector/start.sh b/pinpoint-collector/start.sh new file mode 100644 index 0000000..f1b41c1 --- /dev/null +++ b/pinpoint-collector/start.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -e +set -x + +COLLECTOR_TCP_PORT=${COLLECTOR_TCP_PORT:-} +COLLECTOR_UDP_STAT_LISTEN_PORT=${COLLECTOR_UDP_STAT_LISTEN_PORT:-} +COLLECTOR_UDP_SPAN_LISTEN_PORT=${COLLECTOR_UDP_SPAN_LISTEN_PORT:-} +HBASE_HOST=${HBASE_HOST:-} +HBASE_PORT=${HBASE_PORT:-} + +cp /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties.bck +cp /assets/pinpoint-collector.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties +cp /assets/hbase.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties + +sed 's/COLLECTOR_TCP_PORT/'"${COLLECTOR_TCP_PORT}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties +sed 's/COLLECTOR_UDP_STAT_LISTEN_PORT/'"${COLLECTOR_UDP_STAT_LISTEN_PORT}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties +sed 's/COLLECTOR_UDP_SPAN_LISTEN_PORT/'"${COLLECTOR_UDP_SPAN_LISTEN_PORT}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-collector.properties +sed 's/HBASE_HOST/'"${HBASE_HOST}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties +sed 's/HBASE_PORT/'"${HBASE_PORT}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties + +/usr/local/tomcat/bin/catalina.sh run diff --git a/pinpoint-hbase/Dockerfile b/pinpoint-hbase/Dockerfile new file mode 100644 index 0000000..5fce92a --- /dev/null +++ b/pinpoint-hbase/Dockerfile @@ -0,0 +1,40 @@ +# DESCRIPTION Pinpoint APM HBase (Data Storage) +# TO_BUILD docker build -t pinpoint-hbase . +# TO_RUN docker run -d --net=host -p 2181:2181 -p 60000:60000 -p 60010:60010 -p 60020:60020 -p 60030:60030 --name=pinpoint-hbase pinpoint-hbase + +FROM java:8-jdk + +ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/ +ENV HBASE_VERSION 1.0.1.1 +ENV HBASE_HOME /opt/hbase/hbase-$HBASE_VERSION +ENV PINPOINT_VERSION 1.1.0 + +RUN mkdir -p /opt/hbase && \ + cd /opt/hbase && \ + curl -SL "http://apache.mirrors.pair.com/hbase/$HBASE_VERSION/hbase-$HBASE_VERSION-bin.tar.gz" -o hbase.tar.gz && \ + tar xfvz hbase.tar.gz && \ + rm -rf hbase.tar.gz + +ADD hbase-site.xml /opt/hbase/hbase-$HBASE_VERSION/conf/hbase-site.xml + +RUN curl -SL "https://raw.githubusercontent.com/naver/pinpoint/$PINPOINT_VERSION/scripts/hbase-create.hbase" -o /opt/hbase/hbase-create.hbase && \ + $HBASE_HOME/bin/start-hbase.sh && \ + sleep 10 && \ + $HBASE_HOME/bin/hbase shell /opt/hbase/hbase-create.hbase && \ + $HBASE_HOME/bin/stop-hbase.sh + +VOLUME /home/pinpoint/hbase +VOLUME /home/pinpoint/zookeeper + +# zookeeper +EXPOSE 2181 +# HBase Master API port +EXPOSE 60000 +# HBase Master Web UI +EXPOSE 60010 +# Regionserver API port +EXPOSE 60020 +# HBase Regionserver web UI +EXPOSE 60030 + +CMD /opt/hbase/hbase-$HBASE_VERSION/bin/hbase master start diff --git a/pinpoint-hbase/hbase-site.xml b/pinpoint-hbase/hbase-site.xml new file mode 100644 index 0000000..99d11dd --- /dev/null +++ b/pinpoint-hbase/hbase-site.xml @@ -0,0 +1,18 @@ + + + hbase.rootdir + file:///home/pinpoint/hbase + + + hbase.zookeeper.property.dataDir + /home/pinpoint/zookeeper + + + hbase.master.port + 60000 + + + hbase.regionserver.port + 60020 + + \ No newline at end of file diff --git a/pinpoint-web/Dockerfile b/pinpoint-web/Dockerfile new file mode 100644 index 0000000..2cf6b51 --- /dev/null +++ b/pinpoint-web/Dockerfile @@ -0,0 +1,21 @@ +# DESCRIPTION Pinpoint APM Web (User Interface) +# TO_BUILD docker build -t pinpoint-web . +# TO_RUN docker run -d -p 8080:8080 --net=host -e HBASE_HOST= -e HBASE_PORT=2181 --name=pinpoint-web pinpoint-web + +FROM tomcat:8-jre8 + +ENV PINPOINT_VERSION 1.1.0 + +RUN curl -SL "https://github.com/naver/pinpoint/releases/download/$PINPOINT_VERSION/pinpoint-web-$PINPOINT_VERSION.war" -o pinpoint-web.war && \ + rm -rf /usr/local/tomcat/webapps && \ + mkdir -p /usr/local/tomcat/webapps && \ + unzip pinpoint-web.war -d /usr/local/tomcat/webapps/ROOT && \ + rm -rf pinpoint-web.war + +ADD start.sh /usr/local/tomcat/start.sh +RUN chmod a+x /usr/local/tomcat/start.sh + +ADD hbase.properties /assets/hbase.properties +ADD pinpoint-web.properties /assets/pinpoint-web.properties + +CMD ["/usr/local/tomcat/start.sh"] diff --git a/pinpoint-web/hbase.properties b/pinpoint-web/hbase.properties new file mode 100644 index 0000000..4161185 --- /dev/null +++ b/pinpoint-web/hbase.properties @@ -0,0 +1,22 @@ +hbase.client.host=HBASE_HOST +hbase.client.port=HBASE_PORT + +# hbase timeout option================================================================================== +# hbase default:true +hbase.ipc.client.tcpnodelay=true +# hbase default:60000 +hbase.rpc.timeout=10000 +# hbase default:Integer.MAX_VALUE +hbase.client.operation.timeout=10000 + +# hbase socket read timeout. default: 200000 +hbase.ipc.client.socket.timeout.read=20000 +# socket write timeout. hbase default: 600000 +hbase.ipc.client.socket.timeout.write=60000 + +# ================================================================================== +# hbase client thread pool option +hbase.client.thread.max=128 +hbase.client.threadPool.queueSize=5120 +# prestartAllCoreThreads +hbase.client.threadPool.prestart=false \ No newline at end of file diff --git a/pinpoint-web/pinpoint-web.properties b/pinpoint-web/pinpoint-web.properties new file mode 100644 index 0000000..b61c347 --- /dev/null +++ b/pinpoint-web/pinpoint-web.properties @@ -0,0 +1,14 @@ +# local +cluster.enable=false +cluster.web.tcp.port=9995 +cluster.zookeeper.address=127.0.0.1:22213 +cluster.zookeeper.sessiontimeout=3000 +cluster.zookeeper.retry.interval=5000 + +# FIXME - should be removed for proper authentication +admin.password=admin + +#log site link +#log.enable=false +#log.page.url= +#log.button.name= \ No newline at end of file diff --git a/pinpoint-web/start.sh b/pinpoint-web/start.sh new file mode 100644 index 0000000..056e046 --- /dev/null +++ b/pinpoint-web/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -e +set -x + +HBASE_HOST=${HBASE_HOST:-} +HBASE_PORT=${HBASE_PORT:-} + +cp /assets/pinpoint-web.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/pinpoint-web.properties +cp /assets/hbase.properties /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties + +sed 's/HBASE_HOST/'"${HBASE_HOST}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties +sed 's/HBASE_PORT/'"${HBASE_PORT}"'/g' -i /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/hbase.properties + +/usr/local/tomcat/bin/catalina.sh run \ No newline at end of file