Skip to content

Commit fc2f3a0

Browse files
committed
feat: Add otel support for prod
1 parent aa5a914 commit fc2f3a0

File tree

3 files changed

+59
-2
lines changed

3 files changed

+59
-2
lines changed

docker/docker-compose.override.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,19 @@ services:
3434
# codebase mounted for local dev
3535
volumes:
3636
- ..:/app
37-
- /app/node_modules
37+
- /app/node_modules
38+
39+
# uncomment for testing locally, but you'll need your own honeycomb account and creds
40+
# otel-collector:
41+
# image: otel/opentelemetry-collector:latest
42+
# container_name: rcb-discord-bot-otel-collector
43+
# environment:
44+
# HONEYCOMB_API_KEY: ${HONEYCOMB_API_KEY}
45+
# HONEYCOMB_DATASET: ${HONEYCOMB_DATASET}
46+
# volumes:
47+
# - ./otel-config.yaml:/etc/otel/config.yaml:ro
48+
# command: ["--config", "/etc/otel/config.yaml"]
49+
# ports:
50+
# - "4317:4317"
51+
# networks:
52+
# - app-network

docker/docker-compose.prod.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,19 @@ services:
1212
- NODE_ENV=production
1313

1414
jobs:
15-
image: ${APPLICATION_JOBS_IMAGE}
15+
image: ${APPLICATION_JOBS_IMAGE}
16+
17+
# add logging in production environment
18+
otel-collector:
19+
image: otel/opentelemetry-collector:latest
20+
container_name: rcb-discord-bot-otel-collector
21+
environment:
22+
HONEYCOMB_API_KEY: ${HONEYCOMB_API_KEY}
23+
HONEYCOMB_DATASET: ${HONEYCOMB_DATASET}
24+
volumes:
25+
- ./otel-config.yaml:/etc/otel/config.yaml:ro
26+
command: ["--config", "/etc/otel/config.yaml"]
27+
ports:
28+
- "4317:4317"
29+
networks:
30+
- 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]

0 commit comments

Comments
 (0)