Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adding otel setup logging #29

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading