-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add jaeger java instrumentation example via an otel extension (#…
…1470) * fix: add jaeger java instrumentation example * rm jars * .dockerignore * cleanup buildscript example * cleanup imports & newlines * update to non snapshots
- Loading branch information
1 parent
c0d4152
commit 90f21bf
Showing
28 changed files
with
806 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
version: '3.9' | ||
|
||
services: | ||
jaeger: | ||
image: 'jaegertracing/all-in-one:1.31' | ||
ports: | ||
- '6831:6831/udp' | ||
- '16686:16686' | ||
- '14268:14268' | ||
- '14250:14250' | ||
|
||
pyroscope: | ||
image: 'pyroscope/pyroscope:latest' | ||
environment: | ||
- PYROSCOPE_CONFIG=/pyroscope.yaml | ||
- PYROSCOPE_LOG_LEVEL=debug | ||
ports: | ||
- '4040:4040' | ||
volumes: | ||
- ./pyroscope.yaml:/pyroscope.yaml | ||
command: | ||
- 'server' | ||
|
||
grafana: | ||
image: pyroscope/grafana:dev | ||
volumes: | ||
- ./grafana/provisioning:/etc/grafana/provisioning | ||
- ./grafana/grafana.ini:/etc/grafana/grafana.ini | ||
environment: | ||
- 'GF_INSTALL_PLUGINS=pyroscope-panel' | ||
ports: | ||
- '3000:3000' | ||
|
||
us-east: | ||
env_file: | ||
- config.env | ||
environment: | ||
- REGION=us-east | ||
build: | ||
context: 'go/rideshare' | ||
dockerfile: Dockerfile | ||
|
||
eu-north: | ||
env_file: | ||
- config.env | ||
environment: | ||
- REGION=eu-north | ||
build: | ||
context: 'go/rideshare' | ||
dockerfile: Dockerfile | ||
|
||
ap-south: | ||
env_file: | ||
- config.env | ||
environment: | ||
- REGION=ap-south | ||
build: | ||
context: 'go/rideshare' | ||
dockerfile: Dockerfile | ||
|
||
us-east-java: | ||
env_file: | ||
- config.env | ||
environment: | ||
- REGION=us-east | ||
build: | ||
context: 'java/rideshare' | ||
dockerfile: Dockerfile | ||
|
||
eu-north-java: | ||
env_file: | ||
- config.env | ||
environment: | ||
- REGION=eu-north | ||
build: | ||
context: 'java/rideshare' | ||
dockerfile: Dockerfile | ||
|
||
ap-south-java: | ||
env_file: | ||
- config.env | ||
environment: | ||
- REGION=ap-south | ||
build: | ||
context: 'java/rideshare' | ||
dockerfile: Dockerfile | ||
|
||
eu-north-java-instrumentation: | ||
env_file: | ||
- config.env | ||
build: | ||
context: 'java-instrumentation/rideshare' | ||
dockerfile: Dockerfile | ||
|
||
load-generator: | ||
env_file: | ||
- config.env | ||
build: | ||
context: 'go/rideshare' | ||
dockerfile: Dockerfile.loadgen | ||
depends_on: | ||
- ap-south | ||
- eu-north | ||
- us-east | ||
- ap-south-java | ||
- eu-north-java | ||
- us-east-java | ||
|
||
jaeger-ui: | ||
build: | ||
context: '' | ||
dockerfile: jaeger-ui/Dockerfile | ||
ports: | ||
- '4000:3000' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
examples/tracing/jaeger/java-instrumentation/rideshare/.dockerignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
build/ | ||
out/ | ||
.gradle/ | ||
.idea/ |
5 changes: 5 additions & 0 deletions
5
examples/tracing/jaeger/java-instrumentation/rideshare/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
build/ | ||
.idea/ | ||
.gradle | ||
pyroscope.jar | ||
out/ |
42 changes: 42 additions & 0 deletions
42
examples/tracing/jaeger/java-instrumentation/rideshare/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
FROM openjdk:11-slim-bullseye | ||
|
||
WORKDIR /opt/app | ||
|
||
|
||
COPY gradlew . | ||
COPY gradle gradle | ||
RUN ./gradlew --no-daemon | ||
|
||
|
||
COPY build.gradle.kts settings.gradle.kts ./ | ||
RUN ./gradlew getDeps --no-daemon | ||
ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.17.0/opentelemetry-javaagent.jar opentelemetry-javaagent.jar | ||
# ADD https://s01.oss.sonatype.org/content/repositories/snapshots/io/pyroscope/otel/0.10.1.2-SNAPSHOT/otel-0.10.1.2-20220907.093035-3.jar pyroscope-otel.jar | ||
ADD https://repo1.maven.org/maven2/io/pyroscope/otel/0.10.1.3/otel-0.10.1.3.jar pyroscope-otel.jar | ||
|
||
COPY src src | ||
RUN ./gradlew assemble --no-daemon | ||
|
||
ENV OTEL_SERVICE_NAME=ride-sharing-app-java-instrumentation | ||
ENV OTEL_METRICS_EXPORTER=none | ||
ENV OTEL_TRACES_EXPORTER=jaeger | ||
ENV OTEL_EXPORTER_JAEGER_ENDPOINT=http://localhost:14250 | ||
ENV OTEL_TRACES_SAMPLER=always_on | ||
ENV OTEL_PROPAGATORS=tracecontext | ||
ENV OTEL_JAVAAGENT_EXTENSIONS=./pyroscope-otel.jar | ||
|
||
ENV OTEL_PYROSCOPE_ADD_PROFILE_URL=true | ||
ENV OTEL_PYROSCOPE_ADD_PROFILE_BASELINE_URL=true | ||
ENV OTEL_PYROSCOPE_START_PROFILING=true | ||
ENV OTEL_PYROSCOPE_ENDPOINT=http://localhost:4040 | ||
|
||
ENV PYROSCOPE_APPLICATION_NAME=ride-sharing-app-java-instrumentation | ||
ENV PYROSCOPE_FORMAT=jfr | ||
ENV PYROSCOPE_PROFILER_EVENT=itimer | ||
ENV PYROSCOPE_SERVER_ADDRESS=http://localhost:4040 | ||
ENV PYROSCOPE_LABELS="region=eu-north" | ||
ENV REGION=eu-north | ||
|
||
CMD [ "java", "-javaagent:./opentelemetry-javaagent.jar", "-jar", "./build/libs/rideshare-instrumentation-1.0-SNAPSHOT.jar"] | ||
|
||
|
38 changes: 38 additions & 0 deletions
38
examples/tracing/jaeger/java-instrumentation/rideshare/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
plugins { | ||
id("java") | ||
id("org.springframework.boot") version "2.7.1" | ||
id("io.spring.dependency-management") version "1.0.11.RELEASE" | ||
} | ||
|
||
group = "org.example" | ||
version = "1.0-SNAPSHOT" | ||
|
||
repositories { | ||
mavenCentral() | ||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") //todo replace when otel is not shnapshot | ||
maven("https://repo.spring.io/snapshot") | ||
maven("https://repo.spring.io/milestone") | ||
maven("https://repo.spring.io/release") | ||
|
||
} | ||
|
||
dependencies { | ||
implementation("org.springframework.boot:spring-boot-starter-web") | ||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2") | ||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") | ||
} | ||
dependencyManagement { | ||
imports { | ||
mavenBom("org.springframework.cloud:spring-cloud-dependencies:2021.0.3") | ||
mavenBom("org.springframework.cloud:spring-cloud-sleuth-otel-dependencies:1.1.0-M7") | ||
} | ||
} | ||
|
||
tasks.getByName<Test>("test") { | ||
useJUnitPlatform() | ||
} | ||
|
||
tasks.create<Copy>("getDeps") { | ||
from(configurations.getByName("compileClasspath")) | ||
into("compileClasspath/") | ||
} |
Binary file added
BIN
+58.4 KB
examples/tracing/jaeger/java-instrumentation/rideshare/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions
5
...es/tracing/jaeger/java-instrumentation/rideshare/gradle/wrapper/gradle-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.