v.2.5.3
This commit is contained in:
20
pinpoint-agent-attach-example/java/.env
Normal file
20
pinpoint-agent-attach-example/java/.env
Normal file
@@ -0,0 +1,20 @@
|
||||
### Pinpoint with Java
|
||||
PINPOINT_VERSION=2.5.3
|
||||
SPRING_PROFILES=release
|
||||
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=1
|
||||
PROFILER_SAMPLING_PERCENT_SAMPLING_RATE=100
|
||||
PROFILER_SAMPLING_NEW_THROUGHPUT=0
|
||||
PROFILER_SAMPLING_CONTINUE_THROUGHPUT=0
|
||||
13
pinpoint-agent-attach-example/java/Dockerfile
Normal file
13
pinpoint-agent-attach-example/java/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM java:8
|
||||
|
||||
ARG PINPOINT_VERSION
|
||||
ARG AGENT_ID
|
||||
ARG APP_NAME
|
||||
ENV JAVA_OPTS="-javaagent:/pinpoint-agent/pinpoint-bootstrap-${PINPOINT_VERSION}.jar -Dpinpoint.agentId=${AGENT_ID} -Dpinpoint.applicationName=${APP_NAME} -Dspring.profiles.active=${SPRING_PROFILES}"
|
||||
|
||||
RUN mkdir -p javasample
|
||||
COPY build/Sample.java javasample
|
||||
WORKDIR javasample
|
||||
|
||||
RUN javac Sample.java
|
||||
CMD java ${JAVA_OPTS} Sample
|
||||
14
pinpoint-agent-attach-example/java/build/Sample.java
Normal file
14
pinpoint-agent-attach-example/java/build/Sample.java
Normal file
@@ -0,0 +1,14 @@
|
||||
public class Sample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Sample Java Start");
|
||||
try {
|
||||
while (true) {
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
}
|
||||
catch (java.lang.InterruptedException e) {
|
||||
System.out.println("Test Finished");
|
||||
}
|
||||
}
|
||||
}
|
||||
22
pinpoint-agent-attach-example/java/docker-compose.yml
Normal file
22
pinpoint-agent-attach-example/java/docker-compose.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
version: "2.1"
|
||||
|
||||
services:
|
||||
java:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
- PINPOINT_VERSION=${PINPOINT_VERSION}
|
||||
- AGENT_ID=${AGENT_ID}
|
||||
- APP_NAME=${APP_NAME}
|
||||
- SPRING_PROFILES=${SPRING_PROFILES}
|
||||
container_name: "java"
|
||||
image: "Your Image"
|
||||
|
||||
volumes_from:
|
||||
- container:pinpoint-agent
|
||||
|
||||
networks:
|
||||
default:
|
||||
external:
|
||||
name: pinpoint-agent_pinpoint
|
||||
Reference in New Issue
Block a user