Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#134] Add profiling sample configurations for agents #142

Merged
merged 3 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ 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
PROFILER_SAMPLING_TYPE=COUNTING
PROFILER_SAMPLING_COUNTING_SAMPLING_RATE=20
PROFILER_SAMPLING_PERCENT_SAMPLING_RATE=5
PROFILER_SAMPLING_NEW_THROUGHPUT=0
PROFILER_SAMPLING_CONTINUE_THROUGHPUT=0

AGENT_ID=app-in-docker
APP_NAME=quickapp
Expand Down
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@ services:
- PROFILER_TRANSPORT_METADATA_COLLECTOR_PORT=${PROFILER_TRANSPORT_METADATA_COLLECTOR_PORT}
- PROFILER_TRANSPORT_STAT_COLLECTOR_PORT=${PROFILER_TRANSPORT_STAT_COLLECTOR_PORT}
- PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT=${PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT}
- PROFILER_SAMPLING_RATE=${PROFILER_SAMPLING_RATE}
- PROFILER_SAMPLING_TYPE=${PROFILER_SAMPLING_TYPE}
- PROFILER_SAMPLING_COUNTING_SAMPLING_RATE=${PROFILER_SAMPLING_COUNTING_SAMPLING_RATE}
- PROFILER_SAMPLING_PERCENT_SAMPLING_RATE=${PROFILER_SAMPLING_PERCENT_SAMPLING_RATE}
- PROFILER_SAMPLING_NEW_THROUGHPUT=${PROFILER_SAMPLING_NEW_THROUGHPUT}
- PROFILER_SAMPLING_CONTINUE_THROUGHPUT=${PROFILER_SAMPLING_CONTINUE_THROUGHPUT}
- DEBUG_LEVEL=${AGENT_DEBUG_LEVEL}
- PROFILER_TRANSPORT_MODULE=${PROFILER_TRANSPORT_MODULE}
depends_on:
Expand Down
19 changes: 17 additions & 2 deletions pinpoint-agent-attach-example/java/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
### Pinpoint with Java
PINPOINT_VERSION=2.4.0
SPRING_PROFILES=release
AGENT_ID=app-in-docker
APP_NAME=quickapp
AGENT_ID=java-app-in-docker
APP_NAME=JavaAttachExample


#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

# Sampling configurations
PROFILER_SAMPLING_TYPE=COUNTING
PROFILER_SAMPLING_COUNTING_SAMPLING_RATE=20
PROFILER_SAMPLING_PERCENT_SAMPLING_RATE=5
PROFILER_SAMPLING_NEW_THROUGHPUT=0
PROFILER_SAMPLING_CONTINUE_THROUGHPUT=0
26 changes: 23 additions & 3 deletions pinpoint-agent/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PINPOINT_VERSION=2.3.3
PINPOINT_VERSION=2.4.0
SPRING_PROFILES=release

### Pinpoint-Agent
Expand All @@ -18,8 +18,28 @@ 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
# Profiler Sampling Configurations
# If this value set to COUNTING(default), sampling rate is 1/n.
# If this value set to PERCENT, sampling rate is n%.
PROFILER_SAMPLING_TYPE=COUNTING

# depend on profiler.samplging.rate.type,

# if it's COUNTING(the default), then 1 out of n transactions will be sampled where n is the rate.
# eg. 1: 100% 20: 5% 50: 2% 100: 1%
PROFILER_SAMPLING_COUNTING_SAMPLING_RATE=20

# if it's PERCENT, then first x transactions out of y transactions will be sampled.
# Support from 100% to 0.01%
# eg. 100: 100% 50: 50% 5: 5% 0.01: 0.01%
PROFILER_SAMPLING_PERCENT_SAMPLING_RATE=5

# Permits per second, if throughput is 0, it is unlimited.
# "New" is a transaction that is newly traced.
PROFILER_SAMPLING_NEW_THROUGHPUT=0
# "Continue" is a transaction that is already being tracked.
PROFILER_SAMPLING_CONTINUE_THROUGHPUT=0


AGENT_ID=app-in-docker
APP_NAME=quickapp
Expand Down
6 changes: 5 additions & 1 deletion pinpoint-agent/build/scripts/configure-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ sed -i "/profiler.transport.grpc.agent.collector.port=/ s/=.*/=${PROFILER_TRANSP
sed -i "/profiler.transport.grpc.metadata.collector.port=/ s/=.*/=${PROFILER_TRANSPORT_METADATA_COLLECTOR_PORT}/" /pinpoint-agent/pinpoint-root.config
sed -i "/profiler.transport.grpc.stat.collector.port=/ s/=.*/=${PROFILER_TRANSPORT_STAT_COLLECTOR_PORT}/" /pinpoint-agent/pinpoint-root.config
sed -i "/profiler.transport.grpc.span.collector.port=/ s/=.*/=${PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT}/" /pinpoint-agent/pinpoint-root.config
sed -i "/profiler.sampling.rate=/ s/=.*/=${PROFILER_SAMPLING_RATE}/" /pinpoint-agent/profiles/${SPRING_PROFILES}/pinpoint.config
sed -i "/profiler.sampling.type=/ s/=.*/=${PROFILER_SAMPLING_TYPE}/" /pinpoint-agent/profiles/${SPRING_PROFILES}/pinpoint.config
sed -i "/profiler.sampling.counting.sampling-rate=/ s/=.*/=${PROFILER_SAMPLING_COUNTING_SAMPLING_RATE}/" /pinpoint-agent/profiles/${SPRING_PROFILES}/pinpoint.config
sed -i "/profiler.sampling.percent.sampling-rate=/ s/=.*/=${PROFILER_SAMPLING_PERCENT_SAMPLING_RATE}/" /pinpoint-agent/profiles/${SPRING_PROFILES}/pinpoint.config
sed -i "/profiler.sampling.new.throughput=/ s/=.*/=${PROFILER_SAMPLING_NEW_THROUGHPUT}/" /pinpoint-agent/profiles/${SPRING_PROFILES}/pinpoint.config
sed -i "/profiler.sampling.continue.throughput=/ s/=.*/=${PROFILER_SAMPLING_CONTINUE_THROUGHPUT}/" /pinpoint-agent/profiles/${SPRING_PROFILES}/pinpoint.config

sed -i "/Root level=/ s/=.*/=\"${DEBUG_LEVEL}\">/g" /pinpoint-agent/profiles/${SPRING_PROFILES}/log4j2.xml

Expand Down
6 changes: 5 additions & 1 deletion pinpoint-agent/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ services:
- PROFILER_TRANSPORT_METADATA_COLLECTOR_PORT=${PROFILER_TRANSPORT_METADATA_COLLECTOR_PORT}
- PROFILER_TRANSPORT_STAT_COLLECTOR_PORT=${PROFILER_TRANSPORT_STAT_COLLECTOR_PORT}
- PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT=${PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT}
- PROFILER_SAMPLING_RATE=${PROFILER_SAMPLING_RATE}
- PROFILER_SAMPLING_TYPE=${PROFILER_SAMPLING_TYPE}
- PROFILER_SAMPLING_COUNTING_SAMPLING_RATE=${PROFILER_SAMPLING_COUNTING_SAMPLING_RATE}
- PROFILER_SAMPLING_PERCENT_SAMPLING_RATE=${PROFILER_SAMPLING_PERCENT_SAMPLING_RATE}
- PROFILER_SAMPLING_NEW_THROUGHPUT=${PROFILER_SAMPLING_NEW_THROUGHPUT}
- PROFILER_SAMPLING_CONTINUE_THROUGHPUT=${PROFILER_SAMPLING_CONTINUE_THROUGHPUT}
- DEBUG_LEVEL=${AGENT_DEBUG_LEVEL}
- PROFILER_TRANSPORT_MODULE=${PROFILER_TRANSPORT_MODULE}
networks:
Expand Down
2 changes: 1 addition & 1 deletion pinpoint-flink/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM flink:1.14.2
FROM flink:1.14-java11
ARG PINPOINT_VERSION=${PINPOINT_VERSION:-2.4.0}
ARG INSTALL_URL=https://github.com/pinpoint-apm/pinpoint/releases/download/v${PINPOINT_VERSION}/pinpoint-flink-job-${PINPOINT_VERSION}.jar

Expand Down
2 changes: 2 additions & 0 deletions pinpoint-flink/build/profiles/release/hbase.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ hbase.ipc.client.tcpnodelay=true
hbase.rpc.timeout=10000
# hbase default:Integer.MAX_VALUE
hbase.client.operation.timeout=10000
# hbase default: 20m
hbase.client.meta.operation.timeout=10000

# hbase socket read timeout. default: 200000
hbase.ipc.client.socket.timeout.read=20000
Expand Down
9 changes: 3 additions & 6 deletions pinpoint-mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ FROM mysql:5.7

ARG PINPOINT_VERSION=${PINPOINT_VERSION:-2.4.0}

RUN apt update \
&& apt-get install -y --no-install-recommends ca-certificates wget \
&& wget -O /docker-entrypoint-initdb.d/CreateTableStatement-mysql.sql "https://raw.githubusercontent.com/pinpoint-apm/pinpoint/v$PINPOINT_VERSION/web/src/main/resources/sql/CreateTableStatement-mysql.sql" \
&& wget -O /docker-entrypoint-initdb.d/SpringBatchJobRepositorySchema-mysql.sql "https://raw.githubusercontent.com/pinpoint-apm/pinpoint/v$PINPOINT_VERSION/web/src/main/resources/sql/SpringBatchJobRepositorySchema-mysql.sql" \
RUN curl -SL "https://raw.githubusercontent.com/pinpoint-apm/pinpoint/v$PINPOINT_VERSION/web/src/main/resources/sql/CreateTableStatement-mysql.sql" -o /docker-entrypoint-initdb.d/CreateTableStatement-mysql.sql \
&& curl -SL "https://raw.githubusercontent.com/pinpoint-apm/pinpoint/v$PINPOINT_VERSION/web/src/main/resources/sql/SpringBatchJobRepositorySchema-mysql.sql" -o /docker-entrypoint-initdb.d/SpringBatchJobRepositorySchema-mysql.sql \
&& sed -i '/^--/d' /docker-entrypoint-initdb.d/CreateTableStatement-mysql.sql \
&& sed -i '/^--/d' /docker-entrypoint-initdb.d/SpringBatchJobRepositorySchema-mysql.sql \
&& apt-get purge -y --auto-remove ca-certificates wget
&& sed -i '/^--/d' /docker-entrypoint-initdb.d/SpringBatchJobRepositorySchema-mysql.sql
8 changes: 6 additions & 2 deletions pinpoint-quickstart/.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ PROFILER_TRANSPORT_METADATA_COLLECTOR_PORT=9991
PROFILER_TRANSPORT_STAT_COLLECTOR_PORT=9992
PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT=9993

# Set sampling rate. If you set it to N, 1 out of N transaction will be sampled.
PROFILER_SAMPLING_RATE=1
# Sampling Configurations
PROFILER_SAMPLING_TYPE=COUNTING
PROFILER_SAMPLING_COUNTING_SAMPLING_RATE=20
PROFILER_SAMPLING_PERCENT_SAMPLING_RATE=5
PROFILER_SAMPLING_NEW_THROUGHPUT=0
PROFILER_SAMPLING_CONTINUE_THROUGHPUT=0

AGENT_ID=app-in-docker
APP_NAME=quickapp
Expand Down
2 changes: 2 additions & 0 deletions pinpoint-quickstart/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ COPY /build/pinpoint-quickstart-testapp.war quickstart.war

RUN rm -rf /usr/local/tomcat/webapps \
&& mkdir -p /usr/local/tomcat/webapps \
&& apt-get update \
&& apt-get install --no-install-recommends -y unzip\
&& unzip quickstart.war -d /usr/local/tomcat/webapps/ROOT \
&& rm -rf quickstart.war

Expand Down
6 changes: 5 additions & 1 deletion pinpoint-quickstart/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ services:
- COLLECTOR_TCP_PORT=${COLLECTOR_TCP_PORT}
- COLLECTOR_STAT_PORT=${COLLECTOR_STAT_PORT}
- COLLECTOR_SPAN_PORT=${COLLECTOR_SPAN_PORT}
- PROFILER_SAMPLING_RATE=${PROFILER_SAMPLING_RATE}
- PROFILER_SAMPLING_TYPE=${PROFILER_SAMPLING_TYPE}
- PROFILER_SAMPLING_COUNTING_SAMPLING_RATE=${PROFILER_SAMPLING_COUNTING_SAMPLING_RATE}
- PROFILER_SAMPLING_PERCENT_SAMPLING_RATE=${PROFILER_SAMPLING_PERCENT_SAMPLING_RATE}
- PROFILER_SAMPLING_NEW_THROUGHPUT=${PROFILER_SAMPLING_NEW_THROUGHPUT}
- PROFILER_SAMPLING_CONTINUE_THROUGHPUT=${PROFILER_SAMPLING_CONTINUE_THROUGHPUT}
- DEBUG_LEVEL=${AGENT_DEBUG_LEVEL}

volumes:
Expand Down