Skip to content

Commit

Permalink
added docker compose files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Plüddemann committed Jun 19, 2024
1 parent 7d71184 commit 021332e
Show file tree
Hide file tree
Showing 22 changed files with 63 additions and 23 deletions.
5 changes: 2 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ RUN apt-get update \
gradle \
maven \
python3 \
python-is-python3 \
python3-dev \
python3-pip \
python3-setuptools \
python3-wheel \
python3-psutil && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
python3-psutil

RUN pip install \
flask \
Expand Down
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "otel-getting-started",
"workspaceFolder": "/workspaces/opentelemetry-training/labs",
"image": "ghcr.io/novatecconsulting/opentelemetry-training-application:latest",
"build": {
"dockerfile": "./Dockerfile",
"context": "../."
},
"runArgs": [
"--privileged"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_user():

def do_stuff():
time.sleep(0.1)
url = "http://echo:6000/"
url = "http://localhost:6000/"
response = requests.get(url)
return response

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_user():

def do_stuff():
time.sleep(0.1)
url = "http://echo:6000/"
url = "http://localhost:6000/"
response = requests.get(url)
return response

Expand Down
7 changes: 6 additions & 1 deletion labs/collector/initial/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ services:
- ./otel-collector-config.yml:/etc/otel-collector-config.yml
ports:
- 4317:4317
- 4318:4318
- 4318:4318

echo:
image: ealen/echo-server:0.9.2
ports:
- 6000:80
2 changes: 1 addition & 1 deletion labs/collector/initial/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def do_stuff():
time.sleep(0.1)
headers = {}
inject(headers)
url = "http://echo:6000/"
url = "http://localhost:6000/"
response = requests.get(url)
print(response.json())
logging.info(str(response.json()))
Expand Down
7 changes: 6 additions & 1 deletion labs/collector/solution/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ services:
- ./otel-collector-config.yml:/etc/otel-collector-config.yml
ports:
- 4317:4317
- 4318:4318
- 4318:4318

echo:
image: ealen/echo-server:0.9.2
ports:
- 6000:80
2 changes: 1 addition & 1 deletion labs/collector/solution/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def do_stuff():
time.sleep(0.1)
headers = {}
inject(headers)
url = "http://echo:6000/"
url = "http://localhost:6000/"
response = requests.get(url)
print(response.json())
logging.info(str(response.json()))
Expand Down
5 changes: 5 additions & 0 deletions labs/manual-instrumentation-logs/initial/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
echo:
image: ealen/echo-server:0.9.2
ports:
- 6000:80
2 changes: 1 addition & 1 deletion labs/manual-instrumentation-logs/initial/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_user():

def do_stuff():
time.sleep(0.1)
url = "http://echo:6000/"
url = "http://localhost:6000/"
response = requests.get(url)
return response

Expand Down
5 changes: 5 additions & 0 deletions labs/manual-instrumentation-logs/solution/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
echo:
image: ealen/echo-server:0.9.2
ports:
- 6000:80
2 changes: 1 addition & 1 deletion labs/manual-instrumentation-logs/solution/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_user():

def do_stuff():
time.sleep(0.1)
url = "http://echo:6000/"
url = "http://localhost:6000/"
response = requests.get(url)
logging.info(response.json())
return response
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
echo:
image: ealen/echo-server:0.9.2
ports:
- 6000:80
2 changes: 1 addition & 1 deletion labs/manual-instrumentation-metrics/initial/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_user():

def do_stuff():
time.sleep(0.1)
url = "http://echo:6000/"
url = "http://localhost:6000/"
response = requests.get(url)
return response

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
echo:
image: ealen/echo-server:0.9.2
ports:
- 6000:80
2 changes: 1 addition & 1 deletion labs/manual-instrumentation-metrics/solution/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_user():

def do_stuff():
time.sleep(0.1)
url = "http://echo:6000/"
url = "http://localhost:6000/"
response = requests.get(url)
return response

Expand Down
5 changes: 5 additions & 0 deletions labs/manual-instrumentation-traces/initial/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
echo:
image: ealen/echo-server:0.9.2
ports:
- 6000:80
2 changes: 1 addition & 1 deletion labs/manual-instrumentation-traces/initial/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_user():

def do_stuff():
time.sleep(0.1)
url = "http://echo:6000/"
url = "http://localhost:6000/"
response = requests.get(url)
return response

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
echo:
image: ealen/echo-server:0.9.2
ports:
- 6000:80
10 changes: 5 additions & 5 deletions labs/manual-instrumentation-traces/solution/src/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pyright: reportMissingTypeStubs=false, reportUnknownParameterType=false, reportMissingParameterType=false, reportUnknownArgumentType=false

import time
import json
import time

import requests
from client import ChaosClient, FakerClient
Expand Down Expand Up @@ -47,15 +47,15 @@ def do_stuff():
inject(headers)

time.sleep(.1)
url = "http://echo:6000/"
url = "http://localhost:6000/"
response = requests.get(url, headers=headers)

# debug
print("Headers included in outbound request:")
print(json.dumps(response.json()["request"]["headers"], indent=2))

return response

@app.route('/')
@tracer.start_as_current_span("index")
def index():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# pyright: reportMissingTypeStubs=false, reportUnknownParameterType=false, reportMissingParameterType=false, reportUnknownArgumentType=false, reportUnknownMemberType=false, reportAttributeAccessIssue=false, reportArgumentType=false

from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def get_user():

def do_stuff():
time.sleep(0.1)
url = "http://echo:6000/"
url = "http://localhost:6000/"
response = requests.get(url)
return response

Expand Down

0 comments on commit 021332e

Please sign in to comment.