forked from open-telemetry/opentelemetry-demo
-
Notifications
You must be signed in to change notification settings - Fork 17
/
docker-compose.yml
1033 lines (995 loc) · 28.1 KB
/
docker-compose.yml
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
version: "3.9"
x-default-logging: &logging
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
volumes:
opensearch-data1:
opensearch-data2:
prometheus_data:
networks:
opensearch-otel-demo:
services:
# ******************
# Core Demo Services
# ******************
# Accounting service
accountingservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-accountingservice
container_name: accounting-service
build:
context: ./
dockerfile: ./src/accountingservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-accountingservice
deploy:
resources:
limits:
memory: 120M
restart: unless-stopped
environment:
- KAFKA_SERVICE_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=accountingservice
depends_on:
otelcol:
condition: service_started
kafka:
condition: service_healthy
logging: *logging
networks:
- opensearch-otel-demo
# AdService
adservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-adservice
container_name: ad-service
build:
context: ./
dockerfile: ./src/adservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-adservice
deploy:
resources:
limits:
memory: 500M
restart: unless-stopped
ports:
- "${AD_SERVICE_PORT}"
environment:
- AD_SERVICE_PORT
- FEATURE_FLAG_GRPC_SERVICE_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_LOGS_EXPORTER=otlp
- OTEL_SERVICE_NAME=adservice
depends_on:
otelcol:
condition: service_started
logging: *logging
networks:
- opensearch-otel-demo
# Cart service
cartservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-cartservice
container_name: cart-service
build:
context: ./
dockerfile: ./src/cartservice/src/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-cartservice
deploy:
resources:
limits:
memory: 450M
restart: unless-stopped
ports:
- "${CART_SERVICE_PORT}"
environment:
- CART_SERVICE_PORT
- REDIS_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=cartservice
- ASPNETCORE_URLS=http://*:${CART_SERVICE_PORT}
depends_on:
redis-cart:
condition: service_started
otelcol:
condition: service_started
logging: *logging
networks:
- opensearch-otel-demo
# Checkout service
checkoutservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-checkoutservice
container_name: checkout-service
build:
context: ./
dockerfile: ./src/checkoutservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-checkoutservice
deploy:
resources:
limits:
memory: 120M
restart: unless-stopped
ports:
- "${CHECKOUT_SERVICE_PORT}"
environment:
- CHECKOUT_SERVICE_PORT
- CART_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
- EMAIL_SERVICE_ADDR
- PAYMENT_SERVICE_ADDR
- PRODUCT_CATALOG_SERVICE_ADDR
- SHIPPING_SERVICE_ADDR
- KAFKA_SERVICE_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=checkoutservice
depends_on:
cartservice:
condition: service_started
currencyservice:
condition: service_started
emailservice:
condition: service_started
paymentservice:
condition: service_started
productcatalogservice:
condition: service_started
shippingservice:
condition: service_started
otelcol:
condition: service_started
kafka:
condition: service_healthy
logging: *logging
networks:
- opensearch-otel-demo
# Currency service
currencyservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-currencyservice
container_name: currency-service
build:
context: ./src/currencyservice
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-currencyservice
args:
- GRPC_VERSION=1.46.0
- OPENTELEMETRY_VERSION=1.5.0
deploy:
resources:
limits:
memory: 250M
restart: unless-stopped
ports:
- "${CURRENCY_SERVICE_PORT}"
environment:
- CURRENCY_SERVICE_PORT
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES},service.name=currencyservice # The C++ SDK does not support OTEL_SERVICE_NAME
depends_on:
otelcol:
condition: service_started
logging: *logging
networks:
- opensearch-otel-demo
# Email service
emailservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-emailservice
container_name: email-service
build:
context: ./src/emailservice
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-emailservice
deploy:
resources:
limits:
memory: 500M
restart: unless-stopped
ports:
- "${EMAIL_SERVICE_PORT}"
environment:
- APP_ENV=production
- EMAIL_SERVICE_PORT
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:4318/v1/traces
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=emailservice
depends_on:
otelcol:
condition: service_started
logging: *logging
networks:
- opensearch-otel-demo
# Feature Flag service
featureflagservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-featureflagservice
container_name: feature-flag-service
build:
context: ./
dockerfile: ./src/featureflagservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-featureflagservice
deploy:
resources:
limits:
memory: 500M
restart: unless-stopped
ports:
- "${FEATURE_FLAG_SERVICE_PORT}:${FEATURE_FLAG_SERVICE_PORT}" # Feature Flag Service UI
- "${FEATURE_FLAG_GRPC_SERVICE_PORT}" # Feature Flag Service gRPC API
environment:
- FEATURE_FLAG_SERVICE_PORT
- FEATURE_FLAG_GRPC_SERVICE_PORT
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=grpc
- OTEL_SERVICE_NAME=featureflagservice
- DATABASE_URL=ecto://ffs:ffs@ffs_postgres:5432/ffs
healthcheck:
test: ["CMD", "curl", "-H", "baggage: synthetic_request=true", "-f", "http://localhost:${FEATURE_FLAG_SERVICE_PORT}"]
depends_on:
ffs_postgres:
condition: service_healthy
logging: *logging
networks:
- opensearch-otel-demo
# Fraud Detection service
frauddetectionservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-frauddetectionservice
container_name: frauddetection-service
build:
context: ./
dockerfile: ./src/frauddetectionservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-frauddetectionservice
deploy:
resources:
limits:
memory: 400M
restart: unless-stopped
environment:
- KAFKA_SERVICE_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=frauddetectionservice
depends_on:
otelcol:
condition: service_started
kafka:
condition: service_healthy
logging: *logging
networks:
- opensearch-otel-demo
# Frontend
frontend:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-frontend
container_name: frontend
build:
context: ./
dockerfile: ./src/frontend/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-frontend
deploy:
resources:
limits:
memory: 850M
restart: unless-stopped
ports:
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
environment:
- PORT=${FRONTEND_PORT}
- FRONTEND_ADDR
- AD_SERVICE_ADDR
- CART_SERVICE_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
- PRODUCT_CATALOG_SERVICE_ADDR
- RECOMMENDATION_SERVICE_ADDR
- SHIPPING_SERVICE_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_RESOURCE_ATTRIBUTES=${OTEL_RESOURCE_ATTRIBUTES}
- ENV_PLATFORM
- OTEL_SERVICE_NAME=frontend
- PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- WEB_OTEL_SERVICE_NAME=frontend-web
depends_on:
adservice:
condition: service_started
cartservice:
condition: service_started
checkoutservice:
condition: service_started
currencyservice:
condition: service_started
productcatalogservice:
condition: service_started
quoteservice:
condition: service_started
recommendationservice:
condition: service_started
shippingservice:
condition: service_started
otelcol:
condition: service_started
logging: *logging
networks:
- opensearch-otel-demo
# Load Generator
loadgenerator:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-loadgenerator
container_name: load-generator
build:
context: ./
dockerfile: ./src/loadgenerator/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-loadgenerator
deploy:
resources:
limits:
memory: 500M
restart: unless-stopped
ports:
- "${LOCUST_WEB_PORT}:${LOCUST_WEB_PORT}"
environment:
- LOCUST_WEB_PORT
- LOCUST_USERS
- LOCUST_HOST
- LOCUST_HEADLESS
- LOCUST_AUTOSTART
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=loadgenerator
- PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
depends_on:
frontend:
condition: service_started
logging: *logging
networks:
- opensearch-otel-demo
# Payment service
paymentservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-paymentservice
container_name: payment-service
build:
context: ./
dockerfile: ./src/paymentservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-paymentservice
deploy:
resources:
limits:
memory: 500M
restart: unless-stopped
ports:
- "${PAYMENT_SERVICE_PORT}"
environment:
- PAYMENT_SERVICE_PORT
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=paymentservice
depends_on:
otelcol:
condition: service_started
logging: *logging
networks:
- opensearch-otel-demo
# Product Catalog service
productcatalogservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-productcatalogservice
container_name: product-catalog-service
build:
context: ./
dockerfile: ./src/productcatalogservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-productcatalogservice
deploy:
resources:
limits:
memory: 250M
restart: unless-stopped
ports:
- "${PRODUCT_CATALOG_SERVICE_PORT}"
environment:
- PRODUCT_CATALOG_SERVICE_PORT
- FEATURE_FLAG_GRPC_SERVICE_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=productcatalogservice
depends_on:
otelcol:
condition: service_started
logging: *logging
networks:
- opensearch-otel-demo
# Quote service
quoteservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-quoteservice
container_name: quote-service
build:
context: ./
dockerfile: ./src/quoteservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-quoteservice
deploy:
resources:
limits:
memory: 450M
restart: unless-stopped
ports:
- "${QUOTE_SERVICE_PORT}"
environment:
- FEATURE_FLAG_GRPC_SERVICE_ADDR
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:4318
- OTEL_PHP_AUTOLOAD_ENABLED=true
- QUOTE_SERVICE_PORT
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=quoteservice
- OTEL_PHP_INTERNAL_METRICS_ENABLED=true
depends_on:
otelcol:
condition: service_started
logging: *logging
networks:
- opensearch-otel-demo
# Recommendation service
recommendationservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-recommendationservice
container_name: recommendation-service
build:
context: ./
dockerfile: ./src/recommendationservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-recommendationservice
deploy:
resources:
limits:
memory: 850M # This is high to enable supporting the recommendationCache feature flag use case
restart: unless-stopped
ports:
- "${RECOMMENDATION_SERVICE_PORT}"
environment:
- RECOMMENDATION_SERVICE_PORT
- PRODUCT_CATALOG_SERVICE_ADDR
- FEATURE_FLAG_GRPC_SERVICE_ADDR
- OTEL_PYTHON_LOG_CORRELATION=true
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=recommendationservice
- PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
depends_on:
featureflagservice:
condition: service_started
productcatalogservice:
condition: service_started
otelcol:
condition: service_started
logging: *logging
networks:
- opensearch-otel-demo
# Frontend Nginx Proxy service
nginx:
image: nginx:latest
container_name: nginx
volumes:
- ./src/nginx-otel/default.conf:/etc/nginx/conf.d/default.conf
ports:
- 90:90
depends_on:
- frontend
- fluentbit
- otelcol
- loadgenerator
links:
- fluentbit
logging:
driver: "fluentd"
options:
fluentd-address: 127.0.0.1:24224
tag: nginx.access
networks:
- opensearch-otel-demo
# Fluent-bit logs shipper service
fluentbit:
container_name: fluentbit
image: fluent/fluent-bit:latest
volumes:
- ./src/fluent-bit:/fluent-bit/etc
ports:
- "24224:24224"
- "24224:24224/udp"
depends_on:
- opensearch-dashboards
networks:
- opensearch-otel-demo
# Shipping service
shippingservice:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-shippingservice
container_name: shipping-service
build:
context: ./
dockerfile: ./src/shippingservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-shippingservice
deploy:
resources:
limits:
memory: 250M
restart: unless-stopped
ports:
- "${SHIPPING_SERVICE_PORT}"
environment:
- SHIPPING_SERVICE_PORT
- QUOTE_SERVICE_ADDR
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:4317/v1/traces
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=shippingservice
depends_on:
otelcol:
condition: service_started
logging: *logging
networks:
- opensearch-otel-demo
# ******************
# Dependent Services
# ******************
# Postgres used by Feature Flag service
ffs_postgres:
image: postgres:16.0
container_name: postgres
user: postgres
deploy:
resources:
limits:
memory: 500M
restart: unless-stopped
environment:
- POSTGRES_USER=ffs
- POSTGRES_DB=ffs
- POSTGRES_PASSWORD=ffs
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ffs -U ffs"]
interval: 10s
timeout: 5s
retries: 5
logging: *logging
networks:
- opensearch-otel-demo
# Kafka used by Checkout, Accounting, and Fraud Detection services
kafka:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-kafka
container_name: kafka
build:
context: ./
dockerfile: ./src/kafka/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-kafka
deploy:
resources:
limits:
memory: 1500M
restart: unless-stopped
environment:
- KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092
- OTEL_EXPORTER_OTLP_ENDPOINT
- OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=kafka
- KAFKA_HEAP_OPTS=-Xmx200m -Xms200m
healthcheck:
test: nc -z kafka 9092
start_period: 10s
interval: 5s
timeout: 10s
retries: 10
logging: *logging
networks:
- opensearch-otel-demo
# Redis used by Cart service
redis-cart:
image: redis:7.2-alpine
container_name: redis-cart
user: redis
deploy:
resources:
limits:
memory: 250M
restart: unless-stopped
ports:
- "${REDIS_PORT}"
logging: *logging
networks:
- opensearch-otel-demo
# ********************
# Telemetry Components
# ********************
# Jaeger
jaeger:
image: jaegertracing/jaeger-collector:latest
container_name: jaeger
command:
- "--metrics-backend=prometheus"
- "--es.server-urls=https://opensearch-node1:9200"
- "--es.tls.enabled=true"
deploy:
resources:
limits:
memory: 500M
restart: unless-stopped
ports:
- "${JAEGER_SERVICE_PORT}" # Jaeger UI
- "4317" # OTLP gRPC default port
- "14269:14269"
- "14268:14268"
- "14267:14267"
- "14250:14250"
- "9411:9411"
environment:
- COLLECTOR_OTLP_ENABLED=true
- METRICS_STORAGE_TYPE=prometheus
- SPAN_STORAGE_TYPE=opensearch
- ES_TAGS_AS_FIELDS_ALL=true
- ES_USERNAME=admin
- ES_PASSWORD=${OPENSEARCH_ADMIN_PASSWORD}
- ES_TLS_SKIP_HOST_VERIFY=true
logging: *logging
depends_on:
- opensearch-dashboards
networks:
- opensearch-otel-demo
jaeger-agent:
image: jaegertracing/jaeger-agent:latest
container_name: jaeger-agent
hostname: jaeger-agent
command: ["--reporter.grpc.host-port=jaeger:14250"]
ports:
- "${GRAFANA_SERVICE_PORT}"
- "5775:5775/udp"
- "6831:6831/udp"
- "6832:6832/udp"
- "5778:5778"
restart: on-failure
environment:
- SPAN_STORAGE_TYPE=opensearch
depends_on:
- jaeger
networks:
- opensearch-otel-demo
# Grafana
grafana:
image: grafana/grafana:10.2.0
container_name: grafana
deploy:
resources:
limits:
memory: 100M
environment:
- "GF_INSTALL_PLUGINS=grafana-opensearch-datasource"
volumes:
- ./src/grafana/grafana.ini:/etc/grafana/grafana.ini
- ./src/grafana/provisioning/:/etc/grafana/provisioning/
ports:
- "${GRAFANA_SERVICE_PORT}:${GRAFANA_SERVICE_PORT}"
logging: *logging
networks:
- opensearch-otel-demo
# OpenTelemetry Collector
otelcol:
image: otel/opentelemetry-collector-contrib:0.93.0
container_name: otel-col
deploy:
resources:
limits:
memory: 250M
restart: unless-stopped
command:
[
"--config=/etc/otelcol-config.yml",
"--config=/etc/otelcol-config-extras.yml",
]
volumes:
- ./src/otelcollector/otelcol-config.yml:/etc/otelcol-config.yml
- ./src/otelcollector/otelcol-config-extras.yml:/etc/otelcol-config-extras.yml
ports:
- "4317" # OTLP over gRPC receiver
- "4318:4318" # OTLP over HTTP receiver
- "13133:13133" # health check port
- "9464" # Prometheus exporter
- "8888" # metrics endpoint
depends_on:
- jaeger-agent
- data-prepper
logging: *logging
environment:
- ENVOY_PORT
networks:
- opensearch-otel-demo
# Prometheus
prometheus:
image: quay.io/prometheus/prometheus:v2.47.2
container_name: prometheus
command:
- --web.console.templates=/etc/prometheus/consoles
- --web.console.libraries=/etc/prometheus/console_libraries
- --storage.tsdb.retention.time=1h
- --config.file=/etc/prometheus/prometheus-config.yaml
- --storage.tsdb.path=/prometheus
- --web.enable-lifecycle
- --web.route-prefix=/
- --enable-feature=exemplar-storage
- --enable-feature=otlp-write-receiver
volumes:
- prometheus_data:/usr/share/prometheus/data
- ./src/prometheus/prometheus-config.yaml:/etc/prometheus/prometheus-config.yaml
deploy:
resources:
limits:
memory: 500M
ports:
- "${PROMETHEUS_SERVICE_PORT}:${PROMETHEUS_SERVICE_PORT}"
logging: *logging
networks:
- opensearch-otel-demo
opensearch-node1:
image: opensearchproject/opensearch:${OPENSEARCH_VERSION}
container_name: opensearch-node1
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node1
- discovery.seed_hosts=opensearch-node1,opensearch-node2
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2
- plugins.query.datasources.encryption.masterkey=8e3f206ea7c07cc1bfc5cf40
- bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
- "OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_ADMIN_PASSWORD}"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems
hard: 65536
volumes:
- opensearch-data1:/usr/share/opensearch/data/${OPENSEARCH_VERSION}
ports:
- 9200:9200
- 9600:9600 # required for Performance Analyzer
networks:
- opensearch-otel-demo
opensearch-node2:
image: opensearchproject/opensearch:${OPENSEARCH_VERSION}
container_name: opensearch-node2
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch-node2
- discovery.seed_hosts=opensearch-node1,opensearch-node2
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2
- bootstrap.memory_lock=true
- plugins.query.datasources.encryption.masterkey=8e3f206ea7c07cc1bfc5cf40
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
- "OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_ADMIN_PASSWORD}"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- opensearch-data2:/usr/share/opensearch/data/${OPENSEARCH_VERSION}
networks:
- opensearch-otel-demo
opensearch-dashboards:
image: opensearchproject/opensearch-dashboards:${OPENSEARCH_VERSION}
container_name: opensearch-dashboards
ports:
- 5601:5601
expose:
- "5601"
environment:
- 'OPENSEARCH_HOSTS=["https://opensearch-node1:9200","https://opensearch-node2:9200"]'
depends_on:
- opensearch-node1
- opensearch-node2
networks:
- opensearch-otel-demo
volumes:
- ./src/dashboards/config/opensearch_dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml
# OpenSearch store - dashboard
data-prepper:
platform: linux/amd64
image: opensearchproject/data-prepper:${DATA_PREP_VERSION}
container_name: dataprepper
volumes:
- /data/service-map/
- ./src/dataprepper/templates/ss4o_metrics.json:/usr/share/data-prepper/templates/ss4o_metrics.json
- ./src/dataprepper/templates/ss4o_logs.json:/usr/share/data-prepper/templates/ss4o_logs.json
- ./src/dataprepper/templates/ss4o_traces.json:/usr/share/data-prepper/templates/ss4o_traces.json
- ./src/dataprepper/pipelines.yaml:/usr/share/data-prepper/pipelines/pipelines.yaml
- ./src/dataprepper/data-prepper-config.yaml:/usr/share/data-prepper/config/data-prepper-config.yaml
ports:
- "21890:21890"
- "21891:21891"
- "21892:21892"
expose:
- "21890"
- "21891"
- "21892"
logging: *logging
depends_on:
- opensearch-dashboards
networks:
- opensearch-otel-demo
# *****
# Tests
# *****
# Frontend Tests
frontendTests:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-frontend-tests
container_name: frontend-tests
build:
context: ./
dockerfile: ./src/frontend/Dockerfile.cypress
profiles:
- tests
volumes:
- ./src/frontend/cypress/videos:/app/cypress/videos
- ./src/frontend/cypress/screenshots:/app/cypress/screenshots
environment:
- CYPRESS_baseUrl=http://${FRONTEND_ADDR}
- FRONTEND_ADDR
- NODE_ENV=production
depends_on:
- frontend
networks:
- opensearch-otel-demo
# Integration Tests
integrationTests:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-integrationTests
container_name: integrationTests
profiles:
- tests
build:
context: ./
dockerfile: ./test/Dockerfile
environment:
- AD_SERVICE_ADDR
- CART_SERVICE_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
- EMAIL_SERVICE_ADDR
- PAYMENT_SERVICE_ADDR
- PRODUCT_CATALOG_SERVICE_ADDR
- RECOMMENDATION_SERVICE_ADDR
- SHIPPING_SERVICE_ADDR
depends_on:
- adservice
- cartservice
- checkoutservice
- currencyservice
- emailservice
- paymentservice
- productcatalogservice
- recommendationservice
- shippingservice
- quoteservice
networks:
- opensearch-otel-demo
# Tracebased Tests
traceBasedTests:
image: ${IMAGE_NAME}:${IMAGE_VERSION}-traceBasedTests
container_name: traceBasedTests
profiles:
- tests
build:
context: ./
dockerfile: ./test/tracetesting/Dockerfile
environment:
- AD_SERVICE_ADDR
- CART_SERVICE_ADDR
- CHECKOUT_SERVICE_ADDR
- CURRENCY_SERVICE_ADDR
- EMAIL_SERVICE_ADDR
- FRONTEND_ADDR
- PAYMENT_SERVICE_ADDR
- PRODUCT_CATALOG_SERVICE_ADDR
- RECOMMENDATION_SERVICE_ADDR
- SHIPPING_SERVICE_ADDR
- KAFKA_SERVICE_ADDR
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./test/tracetesting:/app/test/tracetesting
- ./pb:/app/pb
depends_on:
tracetest-server:
condition: service_healthy
# adding demo services as dependencies
frontend:
condition: service_started
adservice:
condition: service_started
cartservice:
condition: service_started
checkoutservice:
condition: service_started
currencyservice:
condition: service_started
emailservice:
condition: service_started
paymentservice:
condition: service_started
productcatalogservice:
condition: service_started
recommendationservice:
condition: service_started
shippingservice:
condition: service_started
quoteservice:
condition: service_started
accountingservice:
condition: service_started
frauddetectionservice:
condition: service_started
networks:
- opensearch-otel-demo
tracetest-server:
image: kubeshop/tracetest:v0.14.5
platform: linux/amd64
container_name: tracetest-server
profiles:
- tests
volumes:
- type: bind
source: ./test/tracetesting/tracetest-config.yaml
target: /app/tracetest.yaml
- type: bind
source: ./test/tracetesting/tracetest-provision.yaml
target: /app/provision.yaml
command: --provisioning-file /app/provision.yaml
ports: