Skip to content

Commit

Permalink
[pinpoint-apm#134] Add profiling sample configurations for agents
Browse files Browse the repository at this point in the history
  • Loading branch information
ga-ram committed Jul 25, 2022
1 parent 2a2e7c5 commit ad8e87d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
24 changes: 22 additions & 2 deletions pinpoint-agent/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ad8e87d

Please sign in to comment.