-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update examples, add docker compose / tilt setup
- Loading branch information
1 parent
5579b02
commit 45d9974
Showing
22 changed files
with
1,691 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
include: | ||
- ../docker-compose.yaml |
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 +1,9 @@ | ||
docker_compose('docker-compose.yaml') | ||
docker_compose(['configs/compose/infra.yaml', 'configs/compose/examples.yaml']) | ||
|
||
dc_resource('am', labels=["infra"]) | ||
dc_resource('grafana', labels=["infra"]) | ||
dc_resource('otel-collector', labels=["infra"]) | ||
dc_resource('push-gateway', labels=["infra"]) | ||
dc_resource('django', labels=["examples"]) | ||
dc_resource('fastapi', labels=["examples"]) | ||
dc_resource('starlette', labels=["examples"]) |
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,44 @@ | ||
version: "3.8" | ||
|
||
services: | ||
django: | ||
container_name: django | ||
build: | ||
context: ../.. | ||
dockerfile: configs/docker/base.Dockerfile | ||
args: | ||
PORT: 9464 | ||
COPY_PATH: examples/django_example | ||
COMMAND: ./run_example.sh | ||
ports: | ||
- "9464:9464" | ||
fastapi: | ||
container_name: fastapi | ||
build: | ||
context: ../.. | ||
dockerfile: configs/docker/base.Dockerfile | ||
args: | ||
PORT: 8080 | ||
COPY_PATH: examples/fastapi-example.py | ||
COMMAND: poetry run python3 fastapi-example.py | ||
ports: | ||
- "9465:8080" | ||
starlette: | ||
container_name: starlette | ||
build: | ||
context: ../.. | ||
dockerfile: configs/docker/base.Dockerfile | ||
args: | ||
PORT: 8080 | ||
COPY_PATH: examples/starlette-otel-exemplars.py | ||
COMMAND: poetry run python3 starlette-otel-exemplars.py | ||
ports: | ||
- "9466:8080" | ||
otlp: | ||
container_name: otlp | ||
build: | ||
context: ../.. | ||
dockerfile: configs/docker/base.Dockerfile | ||
args: | ||
COPY_PATH: examples/export_metrics/otlp-http.py | ||
COMMAND: poetry run python3 otlp-http.py |
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,48 @@ | ||
version: "3.8" | ||
|
||
volumes: | ||
app-logs: {} | ||
grafana-storage: {} | ||
|
||
services: | ||
am: | ||
container_name: am | ||
image: autometrics/am:latest | ||
extra_hosts: | ||
- host.docker.internal:host-gateway | ||
ports: | ||
- "6789:6789" | ||
- "9090:9090" | ||
command: "start http://otel-collector:9464/metrics host.docker.internal:9464 host.docker.internal:9465 host.docker.internal:9466" | ||
environment: | ||
- LISTEN_ADDRESS=0.0.0.0:6789 | ||
restart: unless-stopped | ||
volumes: | ||
- app-logs:/var/log | ||
otel-collector: | ||
container_name: otel-collector | ||
image: otel/opentelemetry-collector-contrib:latest | ||
command: ["--config=/etc/otel-collector-config.yaml"] | ||
volumes: | ||
- ../otel-collector-config.yaml:/etc/otel-collector-config.yaml | ||
ports: | ||
- "4317:4317" | ||
- "4318:4318" | ||
- "8888:8888" # expose container metrics in prometheus format | ||
- "55680:55680" | ||
- "55679:55679" | ||
restart: unless-stopped | ||
push-gateway: | ||
container_name: push-gateway | ||
image: ghcr.io/zapier/prom-aggregation-gateway:latest | ||
grafana: | ||
container_name: grafana | ||
image: grafana/grafana-oss | ||
restart: unless-stopped | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- grafana-storage:/var/lib/grafana | ||
- ../grafana/config.ini:/etc/grafana/grafana.ini | ||
- ../grafana/dashboards:/var/lib/grafana/dashboards | ||
- ../grafana/provisioning:/etc/grafana/provisioning |
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,17 @@ | ||
|
||
FROM python:latest | ||
ARG COPY_PATH | ||
ARG COMMAND | ||
ARG PORT | ||
WORKDIR /app | ||
RUN apt-get update | ||
RUN pip install poetry | ||
COPY pyproject.toml poetry.lock src ./ | ||
RUN poetry config virtualenvs.create false | ||
RUN poetry install --no-interaction --no-root --with examples --extras "exporter-otlp-proto-http" | ||
COPY $COPY_PATH ./ | ||
ENV OTEL_EXPORTER_OTLP_ENDPOINT http://host.docker.internal:4318 | ||
ENV COMMAND $COMMAND | ||
ENV PORT $PORT | ||
EXPOSE $PORT | ||
CMD ["sh", "-c", "$COMMAND"] |
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 @@ | ||
[auth.anonymous] | ||
disable_login_form = true | ||
enabled = true | ||
org_role = Admin |
Oops, something went wrong.