Skip to content

Commit

Permalink
chore: adding otel setup logging (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar authored Nov 1, 2023
1 parent 973fa4b commit ea9d2b1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/src/telemetry/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { Resource } from '@opentelemetry/resources';
import * as dotenv from 'dotenv';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { SpanStatusCode } from '@opentelemetry/api';
import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api';

diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);

// Make sure all env variables are available in process.env
dotenv.config();
Expand Down
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,34 @@ services:
retries: 60
ports:
- 8081:8081
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
queue:
condition: service_healthy
jaeger:
condition: service_healthy
otel-collector:
condition: service_started

rpc:
build: .
environment:
REDIS_URL: cache
DATABASE_URL: postgresql://ashketchum:squirtle123@db:5432/pokeshop?schema=public
RABBITMQ_HOST: queue
POKE_API_BASE_URL: https://pokeapi.co/api/v2
COLLECTOR_ENDPOINT: http://otel-collector:4317
ZIPKIN_URL: http://localhost:9411
NPM_RUN_COMMAND: rpc
healthcheck:
test: ['CMD', 'wget', '--spider', 'localhost:8081/pokemon/healthcheck']
interval: 1s
timeout: 3s
retries: 60
ports:
- 8082:8082
depends_on:
db:
Expand Down

0 comments on commit ea9d2b1

Please sign in to comment.