Compatible with Locust 2.29.1
Inspired by ContainerSolutions/locust_exporter and mbolek/locust_exporter
This is a Locust exporter for Prometheus made on Python.
For the best experience of using this exporter you need to be installed:
- Prometheus
- Grafana
- Python 3.10-3.12
- (Optional) Docker
- Start Locust (you can use legacy and modern UI, but I prefer Legacy)
- Modify
prometheus.yml
and start Prometheus:- job_name: 'locust' scrape_interval: 2s scrape_timeout: 2s static_configs: - targets: ['<exporter_host>:<exporter_port>']
- Configure
config.json
in the root of this project as you need:- port – on this port export will start (this port also should be used in
prometheus.yml
) - host – where Locust is up
- port – on this port export will start (this port also should be used in
- Run
python3 LocustExporter.py --config config.json
- Use this Grafana Dashboard to watch your Locust.
Complete the first two steps from the previous section (Quick Start) and then use this:
Docker Hub or use Dockerfile
in the root of this project.
If you don't want to worry about anything you really should try out this way!
First of all, you need docker installed in your system!
When all is ready follow this steps:
-
clone or download this project
-
go to docker dir of the project
cd docker
-
Using your editor (vim, nano ...) change LOCUST_HOST in locust_exporter block of docker-compose.yml to desired one
- if your Locust is up on localhost you don't need to edit this file (pass edit step)
-
run docker compose up (first time)
docker compose up -d
OR (if U need to rebuild existing containers with new configs)
docker compose up -d --remove-orphans
-
ENJOY IT ;-)
- 3000/tcp - grafana
- 9090/tcp - prometheus
- 9191/tcp - locust_exporter
In order to change them, edit configs!