@@ -11,10 +11,12 @@ services:
1111 command :
1212 - --set=receivers.otlp.protocols.grpc.endpoint=0.0.0.0:4317
1313 - --set=receivers.otlp.protocols.http.endpoint=0.0.0.0:4318
14+ - --feature-gates=-telemetry.UseLocalHostAsDefaultMetricsAddress # Expose telemetry on 0.0.0.0:8888
1415 ports :
1516 - " 16686:16686" # Jaeger UI
16- - " 4317" # OTLP gRPC (internal)
17- - " 4318" # OTLP HTTP (internal)
17+ - " 4317" # OTLP gRPC (internal)
18+ - " 4318" # OTLP HTTP (internal)
19+ - " 14269:8888" # Internal telemetry metrics (Jaeger's port 8888 mapped to host 14269)
1820 environment :
1921 - COLLECTOR_OTLP_ENABLED=true
2022 networks :
@@ -54,26 +56,25 @@ services:
5456 otel-collector :
5557 image : otel/opentelemetry-collector-contrib:0.139.0
5658 container_name : otel-collector
57- command : ["--config=/etc/otelcol-contrib/config.yaml"]
59+ command :
60+ - " --config=/etc/otelcol-contrib/config.yaml"
61+ - " --feature-gates=-telemetry.UseLocalHostAsDefaultMetricsAddress" # Expose metrics on 0.0.0.0
5862 volumes :
5963 - ./otel-collector/config.yaml:/etc/otelcol-contrib/config.yaml:ro
6064 ports :
61- - " 4317:4317" # OTLP gRPC receiver
62- - " 4318:4318" # OTLP HTTP receiver
63- - " 8888:8888" # Collector metrics
64- - " 8889:8889" # Prometheus exporter
65+ - " 4317:4317" # OTLP gRPC receiver
66+ - " 4318:4318" # OTLP HTTP receiver
67+ - " 8888:8888" # Collector internal telemetry metrics
68+ - " 8889:8889" # Application metrics + spanmetrics
69+ - " 13133:13133" # Health check endpoint
6570 networks :
6671 - observability
6772 depends_on :
6873 jaeger :
6974 condition : service_healthy
7075 prometheus :
7176 condition : service_healthy
72- healthcheck :
73- test : ["CMD", "wget", "--spider", "-q", "http://localhost:13133/"]
74- interval : 10s
75- timeout : 5s
76- retries : 5
77+ restart : unless-stopped
7778
7879 # Grafana - Visualization and dashboards
7980 grafana :
@@ -117,8 +118,7 @@ services:
117118 networks :
118119 - observability
119120 depends_on :
120- otel-collector :
121- condition : service_healthy
121+ - otel-collector
122122 restart : unless-stopped
123123
124124 # gRPC Client - Demo client making requests to server
@@ -128,7 +128,6 @@ services:
128128 dockerfile : demo/grpc/client/Dockerfile
129129 container_name : grpc-client
130130 environment :
131- - GRPC_SERVER_ADDRESS=grpc-server:50051
132131 - OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
133132 - OTEL_EXPORTER_OTLP_PROTOCOL=grpc
134133 - OTEL_SERVICE_NAME=grpc-client
@@ -141,21 +140,80 @@ services:
141140 - otel-collector
142141 restart : unless-stopped
143142
144- # k6 - Load testing (optional, comment out if not needed)
145- k6 :
143+ # HTTP Server - Demo HTTP application with compile-time instrumentation
144+ http-server :
145+ build :
146+ context : ../../..
147+ dockerfile : demo/http/server/Dockerfile
148+ container_name : http-server
149+ ports :
150+ - " 8080:8080"
151+ environment :
152+ - OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
153+ - OTEL_EXPORTER_OTLP_PROTOCOL=grpc
154+ - OTEL_SERVICE_NAME=http-server
155+ - OTEL_RESOURCE_ATTRIBUTES=service.namespace=demo,service.version=1.0.0
156+ - OTEL_LOG_LEVEL=info
157+ networks :
158+ - observability
159+ depends_on :
160+ - otel-collector
161+ restart : unless-stopped
162+
163+ # HTTP Client - Demo client making requests to HTTP server
164+ http-client :
165+ build :
166+ context : ../../..
167+ dockerfile : demo/http/client/Dockerfile
168+ container_name : http-client
169+ command : ["-addr", "http://http-server:8080", "-count", "10000", "-method", "GET"]
170+ environment :
171+ - OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
172+ - OTEL_EXPORTER_OTLP_PROTOCOL=grpc
173+ - OTEL_SERVICE_NAME=http-client
174+ - OTEL_RESOURCE_ATTRIBUTES=service.namespace=demo,service.version=1.0.0
175+ - OTEL_LOG_LEVEL=info
176+ networks :
177+ - observability
178+ depends_on :
179+ - http-server
180+ - otel-collector
181+ restart : unless-stopped
182+
183+ # k6 gRPC Load Testing - Generates continuous load against gRPC server
184+ k6-grpc :
146185 image : grafana/k6:1.3.0
147- container_name : k6
186+ container_name : k6-grpc
148187 command : run --quiet /scripts/grpc-load-test.js
149188 volumes :
150189 - ./k6:/scripts:ro
190+ - ../../grpc/server/greeter.proto:/proto/greeter.proto:ro
151191 networks :
152192 - observability
153193 depends_on :
154194 - grpc-server
155195 profiles :
156196 - load-testing
157197 environment :
158- - K6_OUT=json=/tmp/k6-results.json
198+ - K6_OUT=json=/tmp/k6-grpc-results.json
199+ restart : unless-stopped
200+
201+ # k6 HTTP Load Testing - Generates continuous load against HTTP server
202+ k6-http :
203+ image : grafana/k6:1.3.0
204+ container_name : k6-http
205+ command : run --quiet /scripts/http-load-test.js
206+ volumes :
207+ - ./k6:/scripts:ro
208+ networks :
209+ - observability
210+ depends_on :
211+ - http-server
212+ profiles :
213+ - load-testing
214+ environment :
215+ - K6_OUT=json=/tmp/k6-http-results.json
216+ restart : unless-stopped
159217
160218networks :
161219 observability :
0 commit comments