-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* working hugo, docker and python * working dev and prod environment of hugo * otel in action part traces * code for otel in action lab * working hugo, docker and python (#1) Co-authored-by: Jens Plüddemann <[email protected]> * newer docker cli * working docker-in-docker --------- Co-authored-by: Jens Plüddemann <[email protected]> Co-authored-by: Matthias Haeussler <[email protected]>
- Loading branch information
1 parent
d4daf15
commit b0b651d
Showing
18 changed files
with
139 additions
and
109 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 @@ | ||
**/__pycache__ |
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
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,3 @@ | ||
# otel-manual-instrumentation-lab | ||
|
||
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/jtl-novatec/otel-manual-instrumentation-lab) [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/jtl-novatec/otel-manual-instrumentation-lab) |
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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
import time | ||
|
||
import requests | ||
from client import ChaosClient, FakerClient | ||
from flask import Flask, make_response | ||
from client import FakerClient, ChaosClient | ||
|
||
# global variables | ||
app = Flask(__name__) | ||
|
||
@app.route('/users', methods=['GET']) | ||
@app.route("/users", methods=["GET"]) | ||
def get_user(): | ||
user, status = db.get_user(123) | ||
data = {} | ||
if user is not None: | ||
data = { | ||
"id": user.id, | ||
"name": user.name, | ||
"address": user.address | ||
} | ||
data = {"id": user.id, "name": user.name, "address": user.address} | ||
response = make_response(data, status) | ||
return response | ||
|
||
|
||
def do_stuff(): | ||
time.sleep(.1) | ||
time.sleep(0.1) | ||
url = "http://httpbin:80/anything" | ||
response = requests.get(url) | ||
_response = requests.get(url) | ||
|
||
@app.route('/') | ||
|
||
@app.route("/") | ||
def index(): | ||
do_stuff() | ||
current_time = time.strftime("%a, %d %b %Y %H:%M:%S", time.gmtime()) | ||
return f"Hello, World! It's currently {current_time}" | ||
|
||
|
||
if __name__ == "__main__": | ||
db = ChaosClient(client=FakerClient()) | ||
app.run(host="0.0.0.0", debug = True) | ||
app.run(host="0.0.0.0", debug=True) |
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
|
||
class User(): | ||
def __init__(self, id, name, address): | ||
class User: | ||
def __init__(self, id: int, name: str, address: str): | ||
self.id = id | ||
self.name = name | ||
self.address = address | ||
|
||
def __str__(self): | ||
return ", ".join((f"{item}: {self.__dict__[item]}" for item in self.__dict__)) |
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 |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
from abc import ABC, abstractmethod | ||
|
||
from faker import Faker | ||
|
||
from model.user import User | ||
|
||
|
||
|
File renamed without changes.
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 |
---|---|---|
@@ -1,6 +1,25 @@ | ||
FROM docker.io/maven:3-eclipse-temurin-21 as build | ||
WORKDIR /workspace/app | ||
|
||
COPY pom.xml . | ||
COPY src src | ||
|
||
RUN --mount=type=cache,target=/root/.m2 mvn install -DskipTests | ||
# RUN mvn install -DskipTests | ||
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar) | ||
|
||
FROM docker.io/eclipse-temurin:21-jdk-alpine | ||
RUN mkdir -p /opt/todobackend | ||
WORKDIR /opt/todobackend | ||
ADD --chmod=555 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar . | ||
COPY target/todobackend-0.0.1-SNAPSHOT.jar /opt/todobackend | ||
CMD ["java", "-javaagent:/opt/todobackend/opentelemetry-javaagent.jar", "-jar", "todobackend-0.0.1-SNAPSHOT.jar"] | ||
#RUN addgroup -S demo && adduser -S demo -G demo | ||
#USER demo | ||
VOLUME /tmp | ||
ARG DEPENDENCY=/workspace/app/target/dependency | ||
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /opt/todobackend/app/lib | ||
COPY --from=build ${DEPENDENCY}/META-INF /opt/todobackend/app/META-INF | ||
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /opt/todobackend/app | ||
|
||
#ADD --chmod=555 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar /opt/todobackend | ||
ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar /opt/todobackend | ||
|
||
ENTRYPOINT ["java", "-cp", "/opt/todobackend/app:/opt/todobackend/app/lib/*", "-javaagent:/opt/todobackend/opentelemetry-javaagent.jar","io.novatec.todobackend.TodobackendApplication"] |
25 changes: 0 additions & 25 deletions
25
labs/otel-in-action/todobackend-springboot/Dockerfile-multistage
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
FROM docker.io/eclipse-temurin:21-jdk-alpine | ||
RUN mkdir -p /opt/todobackend | ||
WORKDIR /opt/todobackend | ||
ADD --chmod=555 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar . | ||
COPY target/todobackend-0.0.1-SNAPSHOT.jar /opt/todobackend | ||
CMD ["java", "-javaagent:/opt/todobackend/opentelemetry-javaagent.jar", "-jar", "todobackend-0.0.1-SNAPSHOT.jar"] |
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 |
---|---|---|
@@ -1,6 +1,19 @@ | ||
FROM docker.io/maven:3-eclipse-temurin-21 as build | ||
WORKDIR /workspace/app | ||
|
||
COPY pom.xml . | ||
COPY src src | ||
|
||
RUN --mount=type=cache,target=/root/.m2 mvn install -DskipTests | ||
RUN mvn install -DskipTests | ||
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar) | ||
|
||
FROM docker.io/eclipse-temurin:21-jdk-alpine | ||
RUN mkdir -p /opt/todoui | ||
WORKDIR /opt/todoui | ||
ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar . | ||
COPY target/todoui-0.0.1-SNAPSHOT.jar /opt/todoui | ||
CMD ["java", "-javaagent:/opt/todoui/opentelemetry-javaagent.jar", "-jar", "todoui-0.0.1-SNAPSHOT.jar"] | ||
RUN addgroup -S demo && adduser -S demo -G demo | ||
USER demo | ||
VOLUME /tmp | ||
ARG DEPENDENCY=/workspace/app/target/dependency | ||
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib | ||
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF | ||
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app | ||
ENTRYPOINT ["java","-cp","app:app/lib/*","io.novatec.todoui.TodouiApplication"] |
19 changes: 0 additions & 19 deletions
19
labs/otel-in-action/todoui-thymeleaf/Dockerfile-multistage
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.