Skip to content

Commit f5893fc

Browse files
authored
[loadgen] - expose loadgen with env vars (#316)
1 parent 1996384 commit f5893fc

6 files changed

Lines changed: 19 additions & 6 deletions

File tree

.env

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4317
77
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT}
88
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT}
99

10-
# Load Generator
11-
USERS=10
12-
1310
# Frontend
1411
FRONTEND_PORT=8080
1512
FRONTEND_ADDR=frontend:${FRONTEND_PORT}
@@ -51,6 +48,13 @@ FEATURE_FLAG_SERVICE_ADDR=featureflagservice:${FEATURE_FLAG_SERVICE_PORT}
5148
FEATURE_FLAG_GRPC_SERVICE_PORT=50053
5249
FEATURE_FLAG_GRPC_SERVICE_ADDR=featureflagservice:${FEATURE_FLAG_GRPC_SERVICE_PORT}
5350

51+
# Load Generator
52+
LOCUST_WEB_PORT=8089
53+
LOCUST_USERS=10
54+
LOCUST_HOST=http://${FRONTEND_ADDR}
55+
LOCUST_AUTOSTART=true
56+
LOCUST_HEADLESS=false
57+
5458
# Prometheus
5559
PROMETHEUS_SERVICE_PORT=9090
5660

.github/.mlc_config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{"pattern": "^http://localhost:3000"},
44
{"pattern": "^http://localhost:8080"},
55
{"pattern": "^http://localhost:8081"},
6+
{"pattern": "^http://localhost:8089"},
67
{"pattern": "^http://localhost:9090"},
78
{"pattern": "^http://localhost:16686"},
89
{"pattern": "^https://calendar.google.com/calendar"}

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,5 @@ significant modifications will be credited to OpenTelemetry Authors.
7575
([#245](https://github.com/open-telemetry/opentelemetry-demo/pull/245))
7676
* Added Frontend Instrumentation
7777
([#293](https://github.com/open-telemetry/opentelemetry-demo/pull/293))
78+
* Enable Locust loadgen environment variable config options
79+
([#316](https://github.com/open-telemetry/opentelemetry-demo/pull/316))

docker-compose.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,14 @@ services:
341341
build:
342342
context: ./
343343
dockerfile: ./src/loadgenerator/Dockerfile
344+
ports:
345+
- "${LOCUST_WEB_PORT}:${LOCUST_WEB_PORT}"
344346
environment:
345-
- FRONTEND_ADDR
346-
- USERS
347+
- LOCUST_WEB_PORT
348+
- LOCUST_USERS
349+
- LOCUST_HOST
350+
- LOCUST_HEADLESS
351+
- LOCUST_AUTOSTART
347352
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
348353
- OTEL_SERVICE_NAME=loadgenerator
349354
- PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python

docs/docker_deployment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Once the images are built and containers are started you can access:
5050
- Prometheus: <http://localhost:9090/>
5151
- Grafana: <http://localhost:3000/>
5252
- Feature Flags UI: <http://localhost:8081/>
53+
- Load Generator UI: <http://localhost:8089/>
5354

5455
## Bring your own backend
5556

src/loadgenerator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ COPY ./src/loadgenerator/ ./
2020

2121
RUN pip install --prefix="/usr/local/" -r ./requirements.txt
2222

23-
ENTRYPOINT locust --host="http://${FRONTEND_ADDR}" --headless -u "${USERS}"
23+
ENTRYPOINT locust

0 commit comments

Comments
 (0)