diff --git a/.env b/.env index d84d30d370..c37d32dbc2 100644 --- a/.env +++ b/.env @@ -7,9 +7,6 @@ OTEL_EXPORTER_OTLP_ENDPOINT=http://otelcol:4317 OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT} OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT} -# Load Generator -USERS=10 - # Frontend FRONTEND_PORT=8080 FRONTEND_ADDR=frontend:${FRONTEND_PORT} @@ -51,6 +48,13 @@ FEATURE_FLAG_SERVICE_ADDR=featureflagservice:${FEATURE_FLAG_SERVICE_PORT} FEATURE_FLAG_GRPC_SERVICE_PORT=50053 FEATURE_FLAG_GRPC_SERVICE_ADDR=featureflagservice:${FEATURE_FLAG_GRPC_SERVICE_PORT} +# Load Generator +LOCUST_WEB_PORT=8089 +LOCUST_USERS=10 +LOCUST_HOST=http://${FRONTEND_ADDR} +LOCUST_AUTOSTART=true +LOCUST_HEADLESS=false + # Prometheus PROMETHEUS_SERVICE_PORT=9090 diff --git a/.github/.mlc_config.json b/.github/.mlc_config.json index 1001c8f675..346efed04a 100644 --- a/.github/.mlc_config.json +++ b/.github/.mlc_config.json @@ -3,6 +3,7 @@ {"pattern": "^http://localhost:3000"}, {"pattern": "^http://localhost:8080"}, {"pattern": "^http://localhost:8081"}, + {"pattern": "^http://localhost:8089"}, {"pattern": "^http://localhost:9090"}, {"pattern": "^http://localhost:16686"}, {"pattern": "^https://calendar.google.com/calendar"} diff --git a/CHANGELOG.md b/CHANGELOG.md index aa92cd0745..3388e161de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,3 +75,5 @@ significant modifications will be credited to OpenTelemetry Authors. ([#245](https://github.com/open-telemetry/opentelemetry-demo/pull/245)) * Added Frontend Instrumentation ([#293](https://github.com/open-telemetry/opentelemetry-demo/pull/293)) +* Enable Locust loadgen environment variable config options +([#316](https://github.com/open-telemetry/opentelemetry-demo/pull/316)) diff --git a/docker-compose.yml b/docker-compose.yml index b12d61810a..62a536584d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -341,9 +341,14 @@ services: build: context: ./ dockerfile: ./src/loadgenerator/Dockerfile + ports: + - "${LOCUST_WEB_PORT}:${LOCUST_WEB_PORT}" environment: - - FRONTEND_ADDR - - USERS + - LOCUST_WEB_PORT + - LOCUST_USERS + - LOCUST_HOST + - LOCUST_HEADLESS + - LOCUST_AUTOSTART - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - OTEL_SERVICE_NAME=loadgenerator - PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python diff --git a/docs/docker_deployment.md b/docs/docker_deployment.md index ac52981ea5..2905470aa0 100644 --- a/docs/docker_deployment.md +++ b/docs/docker_deployment.md @@ -50,6 +50,7 @@ Once the images are built and containers are started you can access: - Prometheus: - Grafana: - Feature Flags UI: +- Load Generator UI: ## Bring your own backend diff --git a/src/loadgenerator/Dockerfile b/src/loadgenerator/Dockerfile index 0d8970169a..503757f4ba 100644 --- a/src/loadgenerator/Dockerfile +++ b/src/loadgenerator/Dockerfile @@ -20,4 +20,4 @@ COPY ./src/loadgenerator/ ./ RUN pip install --prefix="/usr/local/" -r ./requirements.txt -ENTRYPOINT locust --host="http://${FRONTEND_ADDR}" --headless -u "${USERS}" +ENTRYPOINT locust