Skip to content

Commit 7ead838

Browse files
author
rtkay123
committed
refactor: opt-in to logging/monitoring services
1 parent c2a2caa commit 7ead838

14 files changed

+205
-125
lines changed

.env

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ NATS_UTILITIES_BRANCH=main
1313
CMS_BRANCH=main
1414
BATCH_PPA_BRANCH=main
1515

16-
SIDECAR_BRANCH=dev
17-
LUMBERJACK_BRANCH=dev
16+
SIDECAR_BRANCH=main
17+
LUMBERJACK_BRANCH=main
1818

1919
ADMIN_BRANCH=main
2020
AUTH_SERVICE_BRANCH=main
@@ -27,7 +27,8 @@ ADMIN_PORT=5100
2727
# TLS
2828
NODE_TLS_REJECT_UNAUTHORIZED='0'
2929

30-
STACK_VERSION=8.15.1
30+
EVENT_SIDECAR_PORT=15000
31+
ELASTIC_STACK_VERSION=8.15.1
3132
ES_PORT=9200
3233
KIBANA_PORT=5601
3334
APMSERVER_PORT=8200

docker-compose.dev.apm-elastic.yaml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
include:
2+
- path:
3+
- docker-compose.dev.elastic.yaml
4+
5+
services:
6+
apm-server:
7+
image: elastic/apm-server:${ELASTIC_STACK_VERSION}
8+
container_name: apm-server
9+
command: > # -e because logs
10+
apm-server -e
11+
-E apm-server.rum.enabled=true
12+
-E setup.kibana.host=http://kibana:5601
13+
-E setup.template.settings.index.number_of_replicas=0
14+
-E apm-server.kibana.enabled=true
15+
-E apm-server.kibana.host=http://kibana:5601
16+
-E output.elasticsearch.host=http://elasticsearch:9200
17+
ports:
18+
- ${APMSERVER_PORT}:8200
19+
depends_on:
20+
elasticsearch:
21+
condition: service_healthy
22+
kibana:
23+
condition: service_healthy
24+
25+
tms:
26+
depends_on:
27+
elasticsearch:
28+
condition: service_healthy
29+
environment:
30+
APM_ACTIVE: true
31+
APM_URL: http://apm-server:8200
32+
APM_SECRET_TOKEN: ""
33+
34+
ed:
35+
depends_on:
36+
elasticsearch:
37+
condition: service_healthy
38+
environment:
39+
APM_ACTIVE: true
40+
APM_URL: http://apm-server:8200
41+
APM_SECRET_TOKEN: ""
42+
43+
rule-901:
44+
depends_on:
45+
elasticsearch:
46+
condition: service_healthy
47+
environment:
48+
APM_ACTIVE: true
49+
APM_URL: http://apm-server:8200
50+
APM_SECRET_TOKEN: ""
51+
52+
tp:
53+
depends_on:
54+
elasticsearch:
55+
condition: service_healthy
56+
environment:
57+
APM_ACTIVE: true
58+
APM_URL: http://apm-server:8200
59+
APM_SECRET_TOKEN: ""
60+
61+
tadp:
62+
depends_on:
63+
elasticsearch:
64+
condition: service_healthy
65+
environment:
66+
APM_ACTIVE: true
67+
APM_URL: http://apm-server:8200
68+
APM_SECRET_TOKEN: ""

docker-compose.dev.elastic.yaml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
services:
2+
elasticsearch:
3+
image: elasticsearch:${ELASTIC_STACK_VERSION}
4+
volumes:
5+
- esdata:/usr/share/elasticsearch/data
6+
ports:
7+
- ${ES_PORT}:9200
8+
environment:
9+
- node.name=elasticsearch
10+
- discovery.type=single-node
11+
- bootstrap.memory_lock=true
12+
- xpack.security.enabled=false
13+
mem_limit: ${ES_MEM_LIMIT}
14+
ulimits:
15+
memlock:
16+
soft: -1
17+
hard: -1
18+
healthcheck:
19+
test:
20+
[
21+
"CMD-SHELL",
22+
"curl http://elasticsearch:9200",
23+
]
24+
interval: 10s
25+
timeout: 10s
26+
retries: 120
27+
28+
kibana:
29+
depends_on:
30+
elasticsearch:
31+
condition: service_healthy
32+
image: kibana:${ELASTIC_STACK_VERSION}
33+
volumes:
34+
- kibanadata:/usr/share/kibana/data
35+
ports:
36+
- ${KIBANA_PORT}:5601
37+
environment:
38+
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
39+
mem_limit: ${KB_MEM_LIMIT}
40+
healthcheck:
41+
test:
42+
[
43+
"CMD-SHELL",
44+
"curl http://localhost:5601",
45+
]
46+
interval: 10s
47+
timeout: 10s
48+
retries: 120
49+
50+
volumes:
51+
esdata:
52+
driver: local
53+
kibanadata:
54+
driver: local

docker-compose.dev.logs-base.yaml

+35-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,47 @@
11
services:
2+
tms:
3+
depends_on:
4+
- event-sidecar
5+
environment:
6+
SIDECAR_HOST: event-sidecar:${EVENT_SIDECAR_PORT}
7+
8+
ed:
9+
depends_on:
10+
- event-sidecar
11+
environment:
12+
SIDECAR_HOST: event-sidecar:${EVENT_SIDECAR_PORT}
13+
14+
rule-901:
15+
depends_on:
16+
- event-sidecar
17+
environment:
18+
SIDECAR_HOST: event-sidecar:${EVENT_SIDECAR_PORT}
19+
20+
tp:
21+
depends_on:
22+
- event-sidecar
23+
environment:
24+
SIDECAR_HOST: event-sidecar:${EVENT_SIDECAR_PORT}
25+
26+
tadp:
27+
depends_on:
28+
- event-sidecar
29+
environment:
30+
SIDECAR_HOST: event-sidecar:${EVENT_SIDECAR_PORT}
31+
32+
233
# event-sidecar
334
event-sidecar:
435
build:
536
context: https://github.com/tazama-lf/event-sidecar.git#${SIDECAR_BRANCH}
637
args:
738
- GH_TOKEN
839
env_file:
9-
- env/sidecar.env
1040
- .env
41+
environment:
42+
NATS_SERVER: nats:4222
43+
NATS_SUBJECT: Lumberjack
44+
PORT: ${EVENT_SIDECAR_PORT}
1145
restart: always
1246
depends_on:
1347
- nats

docker-compose.dev.logs-elastic.yaml

+14-87
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,16 @@
1-
services:
2-
elasticsearch:
3-
image: elasticsearch:${STACK_VERSION}
4-
volumes:
5-
- esdata01:/usr/share/elasticsearch/data
6-
ports:
7-
- ${ES_PORT}:9200
8-
environment:
9-
- node.name=elasticsearch
10-
- discovery.type=single-node
11-
- bootstrap.memory_lock=true
12-
- xpack.security.enabled=false
13-
mem_limit: ${ES_MEM_LIMIT}
14-
ulimits:
15-
memlock:
16-
soft: -1
17-
hard: -1
18-
healthcheck:
19-
test:
20-
[
21-
"CMD-SHELL",
22-
"curl http://elasticsearch:9200",
23-
]
24-
interval: 10s
25-
timeout: 10s
26-
retries: 120
27-
28-
kibana:
29-
depends_on:
30-
elasticsearch:
31-
condition: service_healthy
32-
image: kibana:${STACK_VERSION}
33-
volumes:
34-
- kibanadata:/usr/share/kibana/data
35-
ports:
36-
- ${KIBANA_PORT}:5601
37-
environment:
38-
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
39-
mem_limit: ${KB_MEM_LIMIT}
40-
healthcheck:
41-
test:
42-
[
43-
"CMD-SHELL",
44-
"curl http://localhost:5601",
45-
]
46-
interval: 10s
47-
timeout: 10s
48-
retries: 120
1+
include:
2+
- path:
3+
- docker-compose.dev.elastic.yaml
494

50-
logstash:
51-
depends_on:
52-
elasticsearch:
53-
condition: service_healthy
54-
kibana:
55-
condition: service_healthy
56-
image: logstash:${STACK_VERSION}
57-
mem_limit: ${LS_MEM_LIMIT}
58-
volumes:
59-
- logstashdata:/usr/share/logstash/data
5+
services:
6+
event-sidecar:
7+
extends:
8+
file: docker-compose.dev.logs-base.yaml
9+
service: event-sidecar
10+
lumberjack:
11+
extends:
12+
file: docker-compose.dev.logs-base.yaml
13+
service: lumberjack
6014
environment:
61-
- xpack.monitoring.enabled=true
62-
- ELASTIC_HOSTS=http://elasticsearch:9200
63-
- ELASTIC_USER=elastic
64-
- ELASTIC_PASSWORD=""
65-
66-
apm-server:
67-
image: elastic/apm-server:${STACK_VERSION}
68-
container_name: apm-server
69-
command: > # -e because logs
70-
apm-server -e
71-
-E apm-server.rum.enabled=true
72-
-E setup.kibana.host=http://kibana:5601
73-
-E setup.template.settings.index.number_of_replicas=0
74-
-E apm-server.kibana.enabled=true
75-
-E apm-server.kibana.host=http://kibana:5601
76-
-E output.elasticsearch.host=http://elasticsearch:9200
77-
ports:
78-
- ${APMSERVER_PORT}:8200
79-
depends_on:
80-
elasticsearch:
81-
condition: service_healthy
82-
83-
volumes:
84-
esdata01:
85-
driver: local
86-
kibanadata:
87-
driver: local
88-
logstashdata:
89-
driver: local
15+
ELASTIC_SEARCH_VERSION: ${ELASTIC_STACK_VERSION}
16+
ELASTIC_HOST: http://elasticsearch:9200

docker-compose.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ services:
1717
ports:
1818
- ${TMS_PORT}:3000
1919
depends_on:
20-
- event-sidecar
2120
- redis
2221
- arango
2322
- nats
@@ -34,7 +33,6 @@ services:
3433
restart: always
3534
depends_on:
3635
- redis
37-
- event-sidecar
3836
- arango
3937
- nats
4038

@@ -50,7 +48,6 @@ services:
5048
restart: always
5149
depends_on:
5250
- redis
53-
- event-sidecar
5451
- arango
5552
- nats
5653

@@ -66,7 +63,6 @@ services:
6663
restart: always
6764
depends_on:
6865
- redis
69-
- event-sidecar
7066
- arango
7167
- nats
7268

env/ed.env

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ PORT=3000
77
QUOTING=false
88
NODE_ENV=dev
99
CACHE_TTL=300
10-
SIDECAR_HOST=event-sidecar:15000
10+
SIDECAR_HOST=
1111

1212
# APM
13-
APM_URL=http://apm-server:8200
14-
APM_SECRET_TOKEN=""
15-
APM_ACTIVE=true
13+
APM_URL=http://apm:8200
14+
APM_SECRET_TOKEN=
15+
APM_ACTIVE=false
1616

1717
# DB
1818
# # REDIS

env/lumberjack.env

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
NATS_SERVER=nats:4222
22
NATS_SUBJECT=Lumberjack
3-
ELASTIC_SEARCH_VERSION=8
4-
ELASTIC_HOST=http://elasticsearch:9200
5-
ELASTIC_USERNAME=""
6-
ELASTIC_PASSWORD=""
73
FLUSHBYTES=1 # low volume
84
STDOUT_ENABLED=true
5+
ELASTIC_HOST=http://example.com

env/rule-executer.env

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ RULE_NAME="901"
77
NODE_ENV=dev
88
MAX_CPU=1
99
SUPPRESS_ALERTS=true
10-
SIDECAR_HOST=event-sidecar:15000
10+
SIDECAR_HOST=
1111
CACHE_TTL=300
1212

1313
# APM
14-
APM_URL=http://apm-server:8200
15-
APM_SECRET_TOKEN=""
16-
APM_ACTIVE=true
14+
APM_URL=http://apm:8200
15+
APM_SECRET_TOKEN=
16+
APM_ACTIVE=false
1717

1818
# REDIS
1919
REDIS_DB=0

env/sidecar.env

-3
This file was deleted.

env/tadp.env

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ FUNCTION_NAME=transaction-aggregation-decisioning-processor
55
NODE_ENV=dev
66
MAX_CPU=1
77
SUPPRESS_ALERTS=true
8-
SIDECAR_HOST=event-sidecar:15000
8+
SIDECAR_HOST=
99

1010
# APM
11-
APM_URL=http://apm-server:8200
12-
APM_SECRET_TOKEN=""
13-
APM_ACTIVE=true
11+
APM_URL=http://apm:8200
12+
APM_SECRET_TOKEN=
13+
APM_ACTIVE=false
1414

1515
# REDIS
1616
REDIS_DB=0

0 commit comments

Comments
 (0)