-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.e2e.yml
More file actions
224 lines (216 loc) · 7.8 KB
/
Copy pathdocker-compose.e2e.yml
File metadata and controls
224 lines (216 loc) · 7.8 KB
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
# =============================================================================
# TelemetryFlow Go SDK - E2E Test Docker Compose
# =============================================================================
#
# TelemetryFlow Go SDK - Community Enterprise Observability Platform (CEOP)
# Copyright (c) 2024-2026 Telemetri Data Indonesia. All rights reserved.
#
# Usage:
# # Start E2E test environment
# docker-compose -f docker-compose.e2e.yml up -d
#
# # Wait for services to be ready
# ./scripts/wait-for-services.sh
#
# # Run E2E tests
# make test-e2e
#
# # Stop E2E test environment
# docker-compose -f docker-compose.e2e.yml down
#
# =============================================================================
# OTLP HTTP Endpoints (Dual Ingestion Support)
# =============================================================================
#
# TelemetryFlow Platform (Recommended - TFO Standalone):
# POST http://localhost:4318/v2/traces
# POST http://localhost:4318/v2/metrics
# POST http://localhost:4318/v2/logs
#
# OTEL Community (Backwards Compatible - OCB/Standard):
# POST http://localhost:4318/v1/traces
# POST http://localhost:4318/v1/metrics
# POST http://localhost:4318/v1/logs
#
# gRPC (Both versions via same port):
# localhost:4317
#
# NOTE: v2 endpoints require TFO Standalone build.
# OCB builds support v1 endpoints only.
#
# =============================================================================
services:
# ---------------------------------------------------------------------------
# SDK Generator E2E Test
# ---------------------------------------------------------------------------
sdk-e2e:
build:
context: .
dockerfile: Dockerfile
container_name: telemetryflow-sdk-e2e
entrypoint: ["/bin/sh", "-c"]
command:
- |
echo "TelemetryFlow SDK E2E Test Container"
echo "Running SDK generator tests..."
/usr/local/bin/telemetryflow-gen version
/usr/local/bin/telemetryflow-restapi version
echo "Generators are working correctly!"
# Keep container running for test execution
tail -f /dev/null
volumes:
- ./workspace:/workspace
- ./tests/e2e/testdata:/testdata:ro
working_dir: /workspace
depends_on:
otel-collector:
condition: service_healthy
networks:
- e2e-test
# ---------------------------------------------------------------------------
# Generated API E2E Test
# ---------------------------------------------------------------------------
generated-api:
build:
context: ./workspace/e2e-test-api
dockerfile: Dockerfile
container_name: generated-api-e2e
environment:
- APP_ENV=test
- APP_PORT=8080
- DB_DRIVER=sqlite
- DB_NAME=:memory:
- TELEMETRYFLOW_ENDPOINT=otel-collector:4317
- TELEMETRYFLOW_ENABLE_TELEMETRY=true
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
depends_on:
otel-collector:
condition: service_healthy
networks:
- e2e-test
profiles:
- api-test
# ---------------------------------------------------------------------------
# OpenTelemetry Collector
# ---------------------------------------------------------------------------
# Supports dual ingestion: v1 (OTEL standard) and v2 (TelemetryFlow enhanced)
otel-collector:
platform: linux/amd64
# =============================================================================
# TelemetryFlow Collector (TFO-Collector) - Custom TFO format with OTLP support (v1.2.1+)
image: telemetryflow/telemetryflow-collector:${TFO_VERSION:-latest}
command: ["--config=/etc/tfo-collector/tfo-collector.yaml"]
# =============================================================================
# TelemetryFlow Collector OCB (TFO-Collector-OCB) - Standard OTEL format
# image: telemetryflow/telemetryflow-collector-ocb:${TFO_VERSION:-latest}
# command: ["--config=/etc/tfo-collector/otel-collector.yaml"]
# =============================================================================
# OTEL Collector Community Contributor (Standard OTEL format)
# image: otel/opentelemetry-collector-contrib:${OTEL_VERSION:-0.142.0}
# command: ["--config=/etc/otelcol-contrib/config.yaml"]
# =============================================================================
container_name: otel-collector-e2e
restart: unless-stopped
volumes:
# TelemetryFlow Collector config (Custom TFO format)
- ./tests/e2e/testdata/tfo-collector.yaml:/etc/tfo-collector/tfo-collector.yaml:ro
# =============================================================================
# TelemetryFlow Collector OCB config (Standard OTEL format)
# - ./tests/e2e/testdata/otel-collector.yaml:/etc/tfo-collector/otel-collector.yaml:ro
# =============================================================================
# OTEL Collector Community Contributor config (Standard OTEL format)
# - ./tests/e2e/testdata/otel-collector.yaml:/etc/otelcol-contrib/config.yaml:ro
ports:
- "4317:4317" # OTLP gRPC (v1 & v2)
- "4318:4318" # OTLP HTTP (v1 & v2)
- "8888:8888" # Prometheus metrics (self)
- "8889:8889" # Prometheus exporter
- "13133:13133" # Health check
- "55679:55679" # zPages
- "1777:1777" # pprof
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:13133"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- e2e-test
# ---------------------------------------------------------------------------
# Mock TelemetryFlow Backend
# ---------------------------------------------------------------------------
mock-backend:
image: nginx:alpine
container_name: mock-backend-e2e
ports:
- "3100:80"
volumes:
- ./tests/e2e/testdata/nginx.conf:/etc/nginx/nginx.conf:ro
- ./tests/e2e/testdata/mock-responses:/usr/share/nginx/html:ro
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost/health"]
interval: 10s
timeout: 5s
retries: 3
networks:
- e2e-test
# ---------------------------------------------------------------------------
# PostgreSQL (for generated API testing)
# ---------------------------------------------------------------------------
postgres:
image: postgres:16-alpine
container_name: postgres-e2e
environment:
- POSTGRES_USER=test
- POSTGRES_PASSWORD=test
- POSTGRES_DB=e2e_test
ports:
- "5432:5432"
volumes:
- postgres-e2e-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U test -d e2e_test"]
interval: 10s
timeout: 5s
retries: 5
networks:
- e2e-test
profiles:
- api-test
# ---------------------------------------------------------------------------
# Redis (for caching tests)
# ---------------------------------------------------------------------------
redis:
image: redis:7-alpine
container_name: redis-e2e
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
networks:
- e2e-test
profiles:
- api-test
# -----------------------------------------------------------------------------
# Volumes
# -----------------------------------------------------------------------------
volumes:
postgres-e2e-data:
driver: local
# -----------------------------------------------------------------------------
# Networks
# -----------------------------------------------------------------------------
networks:
e2e-test:
driver: bridge
name: telemetryflow-e2e-network