Prometheus exporter for Locust. This exporter was inspired by mbolek/locust_exporter.
This package is available for Docker:
-
Run Locust (example docker-compose)
-
Run Locust Exporter
with docker:
docker run --net=host containersol/locust_exporter
or with docker-compose:
version: "3.0" services: locust-exporter: image: containersol/locust_exporter network_mode: "host"
-
Modify
prometheus.yml
to add target to Prometheusscrape_configs: - job_name: 'locust' static_configs: - targets: ['<LOCUST_IP>:9646']
-
Add dashboard to Grafana with ID 11985
Note: With additional changes made to the dashboard JSON file, instead of importing the dashboard with ID, consider importing the
locust_dashboard.json
file instead.
The default way to build is:
The current best way to execute:
go install github.com/gohjiayi/locust_exporter@latest
./go/bin/locust_exporter.exe
-
--locust.uri
Address of Locust. Default ishttp://localhost:8089
. -
--locust.timeout
Timeout request to Locust. Default is5s
. -
--web.listen-address
Address to listen on for web interface and telemetry. Default is:9646
. -
--web.telemetry-path
Path under which to expose metrics. Default is/metrics
. -
--locust.namespace
Namespace for prometheus metrics. Defaultlocust
. -
--log.level
Set logging level: one ofdebug
,info
,warn
,error
,fatal
-
--log.format
Set the log output target and format. e.g.logger:syslog?appname=bob&local=7
orlogger:stdout?json=true
Defaults tologger:stderr
.
The following environment variables configure the exporter:
-
LOCUST_EXPORTER_URI
Address of Locust. Default ishttp://localhost:8089
. -
LOCUST_EXPORTER_TIMEOUT
Timeout reqeust to Locust. Default is5s
. -
LOCUST_EXPORTER_WEB_LISTEN_ADDRESS
Address to listen on for web interface and telemetry. Default is:9646
. -
LOCUST_EXPORTER_WEB_TELEMETRY_PATH
Path under which to expose metrics. Default is/metrics
. -
LOCUST_METRIC_NAMESPACE
Namespace for prometheus metrics. Defaultlocust
.
The grafana dashboard has beed published with ID 11985 and was exported to locust_dashboard.json.
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Apache License. Please see License File for more information.