Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[loadgen] - expose loadgen with env vars #316

Merged
merged 3 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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://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))
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