From cc30618af8f14c94202331281b294e4f70b81d20 Mon Sep 17 00:00:00 2001 From: Roy Kim Date: Tue, 24 Mar 2020 14:42:11 +0900 Subject: [PATCH] [#53] expose thrift --- .env | 12 +++++++++++- docker-compose.yml | 10 ++++++++++ pinpoint-agent/.env | 6 ++++++ pinpoint-agent/build/scripts/configure-agent.sh | 8 ++++++++ pinpoint-agent/docker-compose.yml | 1 + pinpoint-collector/.env | 3 +++ pinpoint-collector/docker-compose.yml | 8 ++++++++ 7 files changed, 47 insertions(+), 1 deletion(-) diff --git a/.env b/.env index 9c8e20b..4f9f15b 100644 --- a/.env +++ b/.env @@ -63,6 +63,9 @@ COLLECTOR_RECEIVER_AGENT_PORT=9991 COLLECTOR_RECEIVER_METADATA_PORT=9991 COLLECTOR_RECEIVER_STAT_PORT=9992 COLLECTOR_RECEIVER_SPAN_PORT=9993 +COLLECTOR_RECEIVER_BASE_PORT=9994 +COLLECTOR_RECEIVER_STAT_UDP_PORT=9995 +COLLECTOR_RECEIVER_SPAN_UDP_PORT=9996 FLINK_CLUSTER_ENABLE=true FLINK_CLUSTER_ZOOKEEPER_ADDRESS=zoo1 @@ -73,12 +76,19 @@ COLLECTOR_DEBUG_LEVEL=INFO ### Pinpoint-Agent PINPOINT_AGENT_NAME=pinpoint-agent -COLLECTOR_IP=pinpoint-collector +#network module(GRPC,THRIFT) +PROFILER_TRANSPORT_MODULE=GRPC + +#collector information required +COLLECTOR_IP=pinpoint-collector PROFILER_TRANSPORT_AGENT_COLLECTOR_PORT=9991 PROFILER_TRANSPORT_METADATA_COLLECTOR_PORT=9991 PROFILER_TRANSPORT_STAT_COLLECTOR_PORT=9992 PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT=9993 +COLLECTOR_TCP_PORT=9994 +COLLECTOR_STAT_PORT=9995 +COLLECTOR_SPAN_PORT=9996 # Set sampling rate. If you set it to N, 1 out of N transaction will be sampled. PROFILER_SAMPLING_RATE=1 diff --git a/docker-compose.yml b/docker-compose.yml index 956db61..40fbd44 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -130,11 +130,20 @@ services: - "9991" - "9992" - "9993" + - "9994" + - "9995" + - "9996" ports: - "${COLLECTOR_RECEIVER_AGENT_PORT:-9991}:9991/udp" - "${COLLECTOR_RECEIVER_METADATA_PORT:-9991}:9991/tcp" - "${COLLECTOR_RECEIVER_STAT_PORT:-9992}:9992/udp" - "${COLLECTOR_RECEIVER_SPAN_PORT:-9993}:9993/udp" + - "${COLLECTOR_RECEIVER_BASE_PORT:-9994}:9994" + - "${COLLECTOR_RECEIVER_STAT_UDP_PORT:-9995}:9995/tcp" + - "${COLLECTOR_RECEIVER_SPAN_UDP_PORT:-9996}:9996/tcp" + - "${COLLECTOR_RECEIVER_STAT_UDP_PORT:-9995}:9995/udp" + - "${COLLECTOR_RECEIVER_SPAN_UDP_PORT:-9996}:9996/udp" + networks: - pinpoint environment: @@ -191,6 +200,7 @@ services: - PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT=${PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT} - PROFILER_SAMPLING_RATE=${PROFILER_SAMPLING_RATE} - DEBUG_LEVEL=${AGENT_DEBUG_LEVEL} + - PROFILER_TRANSPORT_MODULE=${PROFILER_TRANSPORT_MODULE} depends_on: - pinpoint-collector diff --git a/pinpoint-agent/.env b/pinpoint-agent/.env index 39bf3ac..b651b81 100644 --- a/pinpoint-agent/.env +++ b/pinpoint-agent/.env @@ -5,12 +5,18 @@ SPRING_PROFILES=release PINPOINT_AGENT_NAME=pinpoint-agent +#network module(GRPC,THRIFT) +PROFILER_TRANSPORT_MODULE=GRPC + #collector information required COLLECTOR_IP= PROFILER_TRANSPORT_AGENT_COLLECTOR_PORT=9991 PROFILER_TRANSPORT_METADATA_COLLECTOR_PORT=9991 PROFILER_TRANSPORT_STAT_COLLECTOR_PORT=9992 PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT=9993 +COLLECTOR_TCP_PORT=9994 +COLLECTOR_STAT_PORT=9995 +COLLECTOR_SPAN_PORT=9996 # Set sampling rate. If you set it to N, 1 out of N transaction will be sampled. PROFILER_SAMPLING_RATE=1 diff --git a/pinpoint-agent/build/scripts/configure-agent.sh b/pinpoint-agent/build/scripts/configure-agent.sh index 4ddbc01..7ed5bec 100644 --- a/pinpoint-agent/build/scripts/configure-agent.sh +++ b/pinpoint-agent/build/scripts/configure-agent.sh @@ -2,6 +2,14 @@ set -e set -x +sed -i "/profiler.transport.module=/ s/=.*/=${PROFILER_TRANSPORT_MODULE}/" /pinpoint-agent/pinpoint.config +sed -i "/profiler.transport.module=/ s/=.*/=${PROFILER_TRANSPORT_MODULE}/" /pinpoint-agent/profiles/${SPRING_PROFILES}/pinpoint-env.config + +sed -i "/profiler.collector.ip=/ s/=.*/=${COLLECTOR_IP}/" /pinpoint-agent/pinpoint.config +sed -i "/profiler.collector.tcp.port=/ s/=.*/=${COLLECTOR_TCP_PORT}/" /pinpoint-agent/pinpoint.config +sed -i "/profiler.collector.stat.port=/ s/=.*/=${COLLECTOR_STAT_PORT}/" /pinpoint-agent/pinpoint.config +sed -i "/profiler.collector.span.port=/ s/=.*/=${COLLECTOR_SPAN_PORT}/" /pinpoint-agent/pinpoint.config + sed -i "/profiler.transport.grpc.collector.ip=/ s/=.*/=${COLLECTOR_IP}/" /pinpoint-agent/pinpoint.config sed -i "/profiler.transport.grpc.collector.ip=/ s/=.*/=${COLLECTOR_IP}/" /pinpoint-agent/profiles/${SPRING_PROFILES}/pinpoint-env.config sed -i "/profiler.transport.grpc.agent.collector.port=/ s/=.*/=${PROFILER_TRANSPORT_AGENT_COLLECTOR_PORT}/" /pinpoint-agent/pinpoint.config diff --git a/pinpoint-agent/docker-compose.yml b/pinpoint-agent/docker-compose.yml index 210d807..69235b1 100644 --- a/pinpoint-agent/docker-compose.yml +++ b/pinpoint-agent/docker-compose.yml @@ -25,6 +25,7 @@ services: - PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT=${PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT} - PROFILER_SAMPLING_RATE=${PROFILER_SAMPLING_RATE} - DEBUG_LEVEL=${AGENT_DEBUG_LEVEL} + - PROFILER_TRANSPORT_MODULE=${PROFILER_TRANSPORT_MODULE} networks: - pinpoint diff --git a/pinpoint-collector/.env b/pinpoint-collector/.env index 4b41288..3901f20 100644 --- a/pinpoint-collector/.env +++ b/pinpoint-collector/.env @@ -17,6 +17,9 @@ COLLECTOR_RECEIVER_AGENT_PORT=9991 COLLECTOR_RECEIVER_METADATA_PORT=9991 COLLECTOR_RECEIVER_STAT_PORT=9992 COLLECTOR_RECEIVER_SPAN_PORT=9993 +COLLECTOR_RECEIVER_BASE_PORT=9994 +COLLECTOR_RECEIVER_STAT_UDP_PORT=9995 +COLLECTOR_RECEIVER_SPAN_UDP_PORT=9996 FLINK_CLUSTER_ENABLE=true FLINK_CLUSTER_ZOOKEEPER_ADDRESS=zoo1 diff --git a/pinpoint-collector/docker-compose.yml b/pinpoint-collector/docker-compose.yml index 1c8613e..423422e 100644 --- a/pinpoint-collector/docker-compose.yml +++ b/pinpoint-collector/docker-compose.yml @@ -16,11 +16,19 @@ services: - "9991" - "9992" - "9993" + - "9994" + - "9995" + - "9996" ports: - "${COLLECTOR_RECEIVER_AGENT_PORT:-9991}:9991/udp" - "${COLLECTOR_RECEIVER_METADATA_PORT:-9991}:9991/tcp" - "${COLLECTOR_RECEIVER_STAT_PORT:-9992}:9992/udp" - "${COLLECTOR_RECEIVER_SPAN_PORT:-9993}:9993/udp" + - "${COLLECTOR_RECEIVER_BASE_PORT:-9994}:9994" + - "${COLLECTOR_RECEIVER_STAT_UDP_PORT:-9995}:9995/tcp" + - "${COLLECTOR_RECEIVER_SPAN_UDP_PORT:-9996}:9996/tcp" + - "${COLLECTOR_RECEIVER_STAT_UDP_PORT:-9995}:9995/udp" + - "${COLLECTOR_RECEIVER_SPAN_UDP_PORT:-9996}:9996/udp" environment: - SPRING_PROFILES=${SPRING_PROFILES}