The Exporter exports the MaxScale metrics for Prometheus:
- Server connections
- Service session count
- MaxScale instance status
- Event statistics per started thread
The exporter uses exclusively MaxScale REST API
- Install Golang
- Create a new folder in your $GOPATH:
mkdir -p $GOPATH/src/github.com/
- Navigate to that folder:
$GOPATH/src/github.com
- Clone the repository:
git clone https://github.com/Vetal1977/maxctrl_exporter.git
The latest Docker image of maxctrl_exporter
is available here
- Change to the project root directory
- Run
go build
to build the binary for your platform - Build Linux binary:
GOOS=linux GOARCH=amd64 go build -o bin/linux/maxctrl_exporter
- Run
make build
We have prepared a Docker-compose file for a local try. Upon start, you get running MySQL, MaxScale and Exporter containers. Note that the Exported does not use command line arguments rather relies on environment variables:
- MAXSCALE_URL. URL of MaxScale server, default is http://127.0.0.1:8989
- MAXSCALE_USERNAME. MaxScale user name for connection to underlying MySQL database
- MAXSCALE_PASSWORD. MaxScale user password for connection to underlying MySQL database
- MAXSCALE_CA_CERTIFICATE. Certificate to use to verify a secure connection
- MAXSCALE_EXPORTER_PORT. Port that the Exporter expose to provide metrics for Prometheus
cd maxscale_docker
docker-compose up -d
docker-compose down
when you are finished
- The REST API of MaxScale is accessible at
localhost:8989
. E.g. http://localhost:8989/v1/servers - The Exporter of MaxScale is accessible at
localhost:8093
. E.g. http://localhost:8093/metrics
- Create a new branch
- Make changes
- Run MaxScale and
maxctrl_exporter
locally, e.g. in Docker - Check that you can access them and see reasonable output
- Commit and push the branch
- Create a PR
- Request a review from Vitaly Bezgachev, vitaly.bezgachev [the_at_symbol] gmail.com, Kadir Tugan, kadir.tugan [the_at_symbol] gmail.com