Skip to content

Commit

Permalink
feat(tracing): added tracing with opentelemetry
Browse files Browse the repository at this point in the history
the application now utilizes opentelemetry for tracing. In production, metrics are send to
prometheus wheras in development, metrics and traces are sent to jaeger. For this, the
docker-compose file spins up an instance of jaeger.
  • Loading branch information
noctua84 committed Jan 19, 2024
1 parent 4934317 commit 9264e5a
Show file tree
Hide file tree
Showing 6 changed files with 744 additions and 19 deletions.
27 changes: 27 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# This file is used to spin up the application stack in development mode.
# It will spin up the following services:
# - api: The application instance.
# - postgres: The database instance.
# - tracing: A Jaeger instance for tracing.
services:
# This will spin up an application instance in development mode.
api:
build:
dockerfile: Dockerfile
Expand All @@ -9,6 +15,8 @@ services:
env_file:
- ../.env
environment:
NODE_ENV: development
ENABLE_TRACING: "true"
BASE_URL: https://${HOSTNAME}:${PORT}
DATABASE_URL: postgresql://${DB_USER}:${DB_PASSWORD}@postgres:${DB_PORT}/${DB_NAME}?schema=public
command: >
Expand All @@ -18,6 +26,25 @@ services:
depends_on:
- postgres

# This will spin up a Jaeger instance for tracing. It can be used to monitor the application in development.
tracing:
image: jaegertracing/all-in-one
ports:
- 6831:6831/udp
- 6832:6832/udp
- 5778:5778
- 16686:16686
- 4317:4317
- 4318:4318
- 14250:14250
- 14268:14268
- 14269:14269
- 9411:9411
environment:
COLLECTOR_ZIPKIN_HOST_PORT: 9411
COLLECTOR_OTLP_ENABLED: "true"

# This will spin up a Postgres instance for the application to connect to.
postgres:
image: postgres:16
restart: always
Expand Down
Loading

0 comments on commit 9264e5a

Please sign in to comment.