Add Stackdriver Profiler Java agent to adservice (#210)
* Add Stackdriver Profiler Java agent to adservice. * Add Stackdriver Profiler Java agent to adservice.
This commit is contained in:
parent
86fb1662a3
commit
876d4f966f
2 changed files with 13 additions and 4 deletions
|
@ -11,9 +11,16 @@ COPY . .
|
||||||
RUN chmod +x gradlew
|
RUN chmod +x gradlew
|
||||||
RUN ./gradlew installDist
|
RUN ./gradlew installDist
|
||||||
|
|
||||||
FROM openjdk:8-alpine
|
FROM openjdk:8-slim
|
||||||
|
|
||||||
RUN apk add --no-cache libc6-compat
|
# Download Stackdriver Profiler Java agent
|
||||||
|
RUN apt-get -y update && apt-get install -qqy \
|
||||||
|
wget \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN mkdir -p /opt/cprof && \
|
||||||
|
wget -q -O- https://storage.googleapis.com/cloud-profiler/java/latest/profiler_java_agent.tar.gz \
|
||||||
|
| tar xzv -C /opt/cprof && \
|
||||||
|
rm -rf profiler_java_agent.tar.gz
|
||||||
|
|
||||||
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.1 && \
|
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.1 && \
|
||||||
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
|
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
|
||||||
|
|
|
@ -118,7 +118,8 @@ task adService(type: CreateStartScripts) {
|
||||||
outputDir = new File(project.buildDir, 'tmp')
|
outputDir = new File(project.buildDir, 'tmp')
|
||||||
classpath = jar.outputs.files + project.configurations.runtime
|
classpath = jar.outputs.files + project.configurations.runtime
|
||||||
defaultJvmOpts =
|
defaultJvmOpts =
|
||||||
["-Dlog4j2.contextDataInjector=io.opencensus.contrib.logcorrelation.log4j2.OpenCensusTraceContextDataInjector"]
|
["-Dlog4j2.contextDataInjector=io.opencensus.contrib.logcorrelation.log4j2.OpenCensusTraceContextDataInjector",
|
||||||
|
"-agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=adservice,-cprof_service_version=1.0.0"]
|
||||||
}
|
}
|
||||||
|
|
||||||
task adServiceClient(type: CreateStartScripts) {
|
task adServiceClient(type: CreateStartScripts) {
|
||||||
|
@ -127,7 +128,8 @@ task adServiceClient(type: CreateStartScripts) {
|
||||||
outputDir = new File(project.buildDir, 'tmp')
|
outputDir = new File(project.buildDir, 'tmp')
|
||||||
classpath = jar.outputs.files + project.configurations.runtime
|
classpath = jar.outputs.files + project.configurations.runtime
|
||||||
defaultJvmOpts =
|
defaultJvmOpts =
|
||||||
["-Dlog4j2.contextDataInjector=io.opencensus.contrib.logcorrelation.log4j2.OpenCensusTraceContextDataInjector"]
|
["-Dlog4j2.contextDataInjector=io.opencensus.contrib.logcorrelation.log4j2.OpenCensusTraceContextDataInjector",
|
||||||
|
"-agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=adserviceclient,-cprof_service_version=1.0.0"]
|
||||||
}
|
}
|
||||||
|
|
||||||
applicationDistribution.into('bin') {
|
applicationDistribution.into('bin') {
|
||||||
|
|
Loading…
Reference in a new issue