Skip to content

Commit

Permalink
[loadgen] - expose loadgen with env vars (open-telemetry#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
puckpuck authored Aug 18, 2022
1 parent c6c117f commit 29012ed
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions .github/.mlc_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,5 @@ significant modifications will be credited to OpenTelemetry Authors.
([#245](https:/open-telemetry/opentelemetry-demo/pull/245))
* Added Frontend Instrumentation
([#293](https:/open-telemetry/opentelemetry-demo/pull/293))
* Enable Locust loadgen environment variable config options
([#316](https:/open-telemetry/opentelemetry-demo/pull/316))
9 changes: 7 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/docker_deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Once the images are built and containers are started you can access:
- Prometheus: <http://localhost:9090/>
- Grafana: <http://localhost:3000/>
- Feature Flags UI: <http://localhost:8081/>
- Load Generator UI: <http://localhost:8089/>

## Bring your own backend

Expand Down
2 changes: 1 addition & 1 deletion src/loadgenerator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 29012ed

Please sign in to comment.