-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.jmxmetricsgatherer.yaml
104 lines (96 loc) · 2.9 KB
/
docker-compose.jmxmetricsgatherer.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
version: '3.9'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
KAFKA_OPTS: "-Dzookeeper.4lw.commands.whitelist=*"
ports:
- 2181:2181
healthcheck:
test: ["CMD", "sh", "-c", "echo ruok | nc localhost 2181 | grep imok"]
interval: 30s
timeout: 10s
retries: 5
kafka:
image: confluentinc/cp-kafka:latest
depends_on:
- zookeeper
ports:
- 29092:29092
- 9092:9092
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_JMX_OPTS: "-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=kafka -Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.rmi.port=1099"
JMX_PORT: 1099
producer:
depends_on:
- kafka
- otelcol
container_name: producer
build:
context: .
dockerfile: ./Dockerfile.producer
environment:
KAFKA_SERVICE_ADDR: kafka:9092
OTEL_LOGS_EXPORTER: otlp
OTEL_TRACES_EXPORTER: otlp
OTEL_EXPORTER_OTLP_ENDPOINT: http://otelcol:4317
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
OTEL_RESOURCE_ATTRIBUTES: service.name=producer,deployment.environment=docker
consumer:
depends_on:
- kafka
- otelcol
container_name: consumer
build:
context: .
dockerfile: ./Dockerfile.consumer
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_SERVICE_ADDR: kafka:9092
OTEL_LOGS_EXPORTER: otlp
OTEL_TRACES_EXPORTER: otlp
OTEL_EXPORTER_OTLP_ENDPOINT: http://otelcol:4317
OTEL_EXPORTER_OTLP_PROTOCOL: grpc
OTEL_RESOURCE_ATTRIBUTES: service.name=consumer,deployment.environment=docker
otelcol:
depends_on:
- kafka
image: otel/opentelemetry-collector-contrib:0.93.0
container_name: otel-col
restart: always
volumes:
- ./otel-collector-config-gatherer.yaml:/etc/otelcol-contrib/config.yaml
ports:
- "4317:4317"
- "4318:4318"
environment:
- DD_API_KEY
kafka-gatherer:
depends_on:
- kafka
container_name: kafka-gatherer
build:
context: .
dockerfile: ./Dockerfile.kafka-gatherer
consumer-gatherer:
depends_on:
- consumer
container_name: consumer-gatherer
build:
context: .
dockerfile: ./Dockerfile.consumer-gatherer
producer-gatherer:
depends_on:
- producer
container_name: producer-gatherer
build:
context: .
dockerfile: ./Dockerfile.producer-gatherer