Skip to content

Commit

Permalink
Get the Trace Analytics sample app running again. This includes versi…
Browse files Browse the repository at this point in the history
…on updates for dependencies and some corrections from the previous PR which started using Temurin which brought in Ubuntu in the image.

Signed-off-by: David Venable <[email protected]>
  • Loading branch information
dlvenable committed Sep 16, 2023
1 parent c95eb92 commit 865c70e
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 25 deletions.
20 changes: 10 additions & 10 deletions examples/trace-analytics-sample-app/sample-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ COPY analytics-service /home/gradle/src/
WORKDIR /home/gradle/src
RUN gradle bootJar --daemon

RUN wget https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.0.1/opentelemetry-javaagent-all.jar
RUN wget https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.30.0/opentelemetry-javaagent.jar

FROM eclipse-temurin:17-jre-jammy

RUN apk update \
&& apk upgrade \
RUN apt-get -y update \
&& apt-get -y upgrade \
# add for grpcio
&& apk add --no-cache g++ \
&& apt-get -y install g++ \
# add for grpcio
&& apk add --no-cache linux-headers \
&& apk add --no-cache bash \
&& apk add --no-cache --virtual=build-dependencies unzip \
&& apk add --no-cache curl \
&& apt-get -y install linux-generic \
&& apt-get -y install bash \
&& apt-get -y install unzip \
&& apt-get -y install curl \
# add python3-dev for grpcio
&& apk add --no-cache python3 python3-dev
&& apt-get -y install python3 python3-pip python3-dev

RUN mkdir /app
COPY . /app/
COPY --from=build /home/gradle/src/build/libs/*.jar /app/spring-boot-application.jar
COPY --from=build /home/gradle/src/opentelemetry-javaagent-all.jar /app/opentelemetry-javaagent-all.jar
COPY --from=build /home/gradle/src/opentelemetry-javaagent.jar /app/opentelemetry-javaagent.jar

RUN pip3 install --upgrade pip
RUN pip3 install -r /app/requirements.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ COPY . /home/gradle/src/
WORKDIR /home/gradle/src
RUN gradle bootJar --daemon

RUN wget https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.0.1/opentelemetry-javaagent-all.jar
RUN wget https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.30.0/opentelemetry-javaagent.jar

FROM eclipse-temurin:17-jre-jammy
EXPOSE 8087
RUN mkdir /app
COPY --from=build /home/gradle/src/build/libs/*.jar /app/spring-boot-application.jar
COPY --from=build /home/gradle/src/opentelemetry-javaagent-all.jar /app/opentelemetry-javaagent-all.jar
ENTRYPOINT ["java","-javaagent:/app/opentelemetry-javaagent-all.jar","-jar","/app/spring-boot-application.jar"]
COPY --from=build /home/gradle/src/opentelemetry-javaagent.jar /app/opentelemetry-javaagent.jar
ENTRYPOINT ["java","-javaagent:/app/opentelemetry-javaagent.jar","-jar","/app/spring-boot-application.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
retry_strategy = Retry(
total=2,
status_forcelist=[401, 401.1, 429, 503],
method_whitelist=["HEAD", "GET", "POST", "PUT", "DELETE", "OPTIONS", "TRACE"]
allowed_methods=["HEAD", "GET", "POST", "PUT", "DELETE", "OPTIONS", "TRACE"]
)

@app.errorhandler(Error)
Expand Down
2 changes: 1 addition & 1 deletion examples/trace-analytics-sample-app/sample-app/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def displayClick(btn1, btn2, btn3, btn4, btn5, old_output):
retry_strategy = Retry(
total=2,
status_forcelist=[401, 401.1, 429, 503],
method_whitelist=["HEAD", "GET", "POST", "PUT", "DELETE", "OPTIONS", "TRACE"]
allowed_methods=["HEAD", "GET", "POST", "PUT", "DELETE", "OPTIONS", "TRACE"]
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
retry_strategy = Retry(
total=2,
status_forcelist=[401, 401.1, 429, 503],
method_whitelist=["HEAD", "GET", "POST", "PUT", "DELETE", "OPTIONS", "TRACE"]
allowed_methods=["HEAD", "GET", "POST", "PUT", "DELETE", "OPTIONS", "TRACE"]
)

@app.errorhandler(Error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
retry_strategy = Retry(
total=2,
status_forcelist=[401, 401.1, 429, 503],
method_whitelist=["HEAD", "GET", "POST", "PUT", "DELETE", "OPTIONS", "TRACE"]
allowed_methods=["HEAD", "GET", "POST", "PUT", "DELETE", "OPTIONS", "TRACE"]
)

@app.errorhandler(Error)
Expand Down
16 changes: 9 additions & 7 deletions examples/trace-analytics-sample-app/sample-app/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
dash==1.17.0
dash==2.13.0
mysql-connector==2.2.9
opentelemetry-exporter-otlp==1.12.0
opentelemetry-instrumentation-flask==0.33b0
opentelemetry-instrumentation-mysql==0.33b0
opentelemetry-instrumentation-requests==0.33b0
opentelemetry-sdk==1.12.0
protobuf==3.19.6
opentelemetry-exporter-otlp==1.20.0
opentelemetry-instrumentation-flask==0.41b0
opentelemetry-instrumentation-mysql==0.41b0
opentelemetry-instrumentation-requests==0.41b0
opentelemetry-sdk==1.20.0
protobuf==3.20.3
urllib3==2.0.4
werkzeug==2.2.3
2 changes: 1 addition & 1 deletion examples/trace-analytics-sample-app/sample-app/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# SPDX-License-Identifier: Apache-2.0
#

java -javaagent:/app/opentelemetry-javaagent-all.jar -jar /app/spring-boot-application.jar &
java -javaagent:/app/opentelemetry-javaagent.jar -jar /app/spring-boot-application.jar &

until [[ $(curl -o /dev/null -s -w "%{http_code}\n" http://localhost:8087) != 000 ]]; do
echo "Waiting for analytics-service to be ready"
Expand Down

0 comments on commit 865c70e

Please sign in to comment.