Skip to content

Commit d2d57d3

Browse files
committed
feat: Add otel support for prod and improve logging
1 parent 29303ba commit d2d57d3

14 files changed

Lines changed: 360 additions & 49 deletions

docker/docker-compose.override.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,18 @@ services:
77
volumes:
88
- ..:/app
99
- /app/node_modules
10+
11+
# uncomment for testing locally, but you'll need your own honeycomb account and creds
12+
# otel-collector:
13+
# image: otel/opentelemetry-collector:latest
14+
# container_name: rcb-discord-bot-otel-collector
15+
# environment:
16+
# HONEYCOMB_API_KEY: ${HONEYCOMB_API_KEY}
17+
# HONEYCOMB_DATASET: ${HONEYCOMB_DATASET}
18+
# volumes:
19+
# - ./otel-config.yaml:/etc/otel/config.yaml:ro
20+
# command: ["--config", "/etc/otel/config.yaml"]
21+
# ports:
22+
# - "4317:4317"
23+
# networks:
24+
# - app-network

docker/docker-compose.prod.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,18 @@
22
services:
33
api:
44
image: ${APPLICATION_IMAGE}
5+
6+
# add logging in production environment
7+
otel-collector:
8+
image: otel/opentelemetry-collector:latest
9+
container_name: rcb-discord-bot-otel-collector
10+
environment:
11+
HONEYCOMB_API_KEY: ${HONEYCOMB_API_KEY}
12+
HONEYCOMB_DATASET: ${HONEYCOMB_DATASET}
13+
volumes:
14+
- ./otel-config.yaml:/etc/otel/config.yaml:ro
15+
command: ["--config", "/etc/otel/config.yaml"]
16+
ports:
17+
- "4317:4317"
18+
networks:
19+
- app-network

otel-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
receivers:
2+
otlp:
3+
protocols:
4+
grpc:
5+
endpoint: 0.0.0.0:4317
6+
7+
exporters:
8+
otlp:
9+
endpoint: api.honeycomb.io:443
10+
headers:
11+
x-honeycomb-team: ${HONEYCOMB_API_KEY}
12+
x-honeycomb-dataset: ${HONEYCOMB_DATASET}
13+
compression: gzip
14+
15+
processors:
16+
batch:
17+
18+
service:
19+
pipelines:
20+
logs:
21+
receivers: [otlp]
22+
processors: [batch]
23+
exporters: [otlp]
24+
traces:
25+
receivers: [otlp]
26+
processors: [batch]
27+
exporters: [otlp]

package-lock.json

Lines changed: 183 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"mongodb": "^6.16.0",
2929
"swagger-jsdoc": "^6.2.8",
3030
"swagger-ui-express": "^5.0.1",
31-
"uuid": "^9.0.1"
31+
"uuid": "^9.0.1",
32+
"winston": "^3.17.0"
3233
},
3334
"devDependencies": {
3435
"@eslint/js": "^9.20.0",

0 commit comments

Comments
 (0)