-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
121 lines (113 loc) · 4.23 KB
/
docker-compose.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
services:
tempo:
image: grafana/tempo:${TEMPO_VERSION}
command: [ "-config.file=/etc/tempo.yaml" ]
volumes:
- ./config/tempo.yaml:/etc/tempo.yaml
- ./data/tempo:/tmp/tempo
stop_grace_period: 10s
ports:
- "3200:3200" # tempo
- "9095:9095" # tempo grp
prom:
container_name: prometheus
image: prom/prometheus:${PROMETHEUS_VERSION}
restart: always
user: root
command:
[
"--config.file=/etc/prometheus/prometheus.yml",
"--enable-feature=exemplar-storage",
"--web.enable-remote-write-receiver",
"--enable-feature=native-histograms"
]
volumes:
- ./config/prometheus.yaml:/etc/prometheus/prometheus.yml
- ./data/prometheus:/etc/prometheus
ports:
- "9090:9090"
loki:
image: grafana/loki:latest
volumes:
- ./config/loki-config.yaml:/etc/loki/local-config.yaml
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
# Collector https://opentelemetry.io/docs/collector/installation/
otel:
image: otel/opentelemetry-collector-contrib:${OTEL_VERSION}
restart: always
command:
[
"--config=/etc/otel-collector-config.yaml",
]
volumes:
- ./config/otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "1888:1888" # pprof extension
- "8888:8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- "13133:13133" # health_check extension
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
- "55679:55679" # zpages extension
grafana:
image: grafana/grafana:${GRAFANA_VERSION}
ports:
- '3000:3000'
environment:
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_BASIC_ENABLED=false
- GF_FEATURE_TOGGLES_ENABLE=traceqlEditor
volumes:
- ./config/dashboards:/var/lib/grafana/dashboards
- ./config/grafana-dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yaml
- ./config/grafana-datasource.yml:/etc/grafana/provisioning/datasources/datasource.yaml
dependency1:
build:
context: ./source/dependency
dockerfile: Dockerfile
environment:
- "Logging__Console__LogLevel__Default=Information"
- "OTEL_DOTNET_AUTO_LOGS_INSTRUMENTATION_ENABLED=true" #Default: true
- "OTEL_DOTNET_AUTO_METRICS_INSTRUMENTATION_ENABLED=true" #Default: true
- "OTEL_DOTNET_AUTO_TRACES_INSTRUMENTATION_ENABLED=true" #Default: true
- "OTEL_TRACES_EXPORTER=otlp" #Default: otlp - OpenTelemetry Line Protocol
- "OTEL_METRICS_EXPORTER=otlp" #Default: otlp
- "OTEL_LOGS_EXPORTER=otlp" #Default: otlp
- "OTEL_EXPORTER_OTLP_ENDPOINT=http://otel:4318" #Default: http://localhost:4317 - PS did not work with :4317 (gRPC) so using :4318 (HTTP
- "OTEL_SERVICE_NAME=dependency1"
- "OTEL_RESOURCE_ATTRIBUTES=service.version=1.0.0"
- "OTEL_DOTNET_AUTO_FAIL_FAST_ENABLED=true" #Default: fail fast for easier debugging
- "OTEL_DOTNET_AUTO_TRACES_CONSOLE_EXPORTER_ENABLED=false" #Default: false
- "OTEL_DOTNET_AUTO_METRICS_CONSOLE_EXPORTER_ENABLED=false" #Default: false
- "OTEL_DOTNET_AUTO_LOGS_CONSOLE_EXPORTER_ENABLED=false" #Default: false
- "OTEL_DOTNET_AUTO_LOGS_INCLUDE_FORMATTED_MESSAGE=true" #Default: false - PS: is convinient but has a performance impact
- "OTEL_LOG_LEVEL=debug" #Default: Information
ports:
- "8080:8080"
dependency2:
build:
context: ./source/dependency
dockerfile: Dockerfile
environment:
- Logging__Console__LogLevel__Default=Information
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel:4318
- OTEL_SERVICE_NAME=dependency2
- OTEL_RESOURCE_ATTRIBUTES=service.version=5.3.1
- OTEL_DOTNET_AUTO_FAIL_FAST_ENABLED=true
ports:
- "8081:8080"
dependency3:
build:
context: ./source/dependency
dockerfile: Dockerfile
environment:
- Logging__Console__LogLevel__Default=Information
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel:4318
- OTEL_SERVICE_NAME=dependency3
- OTEL_RESOURCE_ATTRIBUTES=service.version=2.0.0
- OTEL_DOTNET_AUTO_FAIL_FAST_ENABLED=true
ports:
- "8082:8080"