Giter Club home page Giter Club logo

maxctrl_exporter's Introduction

MaxScale Exporter

The Exporter exports the MaxScale metrics for Prometheus:

  • Server connections
  • Service session count
  • MaxScale instance status
  • Event statistics per started thread

MaxScale requirements

The exporter uses exclusively MaxScale REST API

Installation

  1. Install Golang
  2. Install dep
  3. Create a new folder in your $GOPATH: mkdir -p $GOPATH/src/github.com/
  4. Navigate to that folder: $GOPATH/src/github.com
  5. Clone the repository: git clone https://github.com/Vetal1977/maxctrl_exporter.git

Build

Manually

  1. Change to the project root directory
  2. Run dep ensure --update to update the dependencies
  3. Run go build to build the binary for your platform
  4. Build Linux binary: GOOS=linux GOARCH=amd64 go build -o bin/linux/maxctrl_exporter

With Makefile

  1. Run make build

Run and test locally

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_ADDRESS. URL of MaxScale server, default is 127.0.0.1
  • MAXSCALE_PORT. Exposed MaxScale server port, default is 8989
  • MAXSCALE_USERNAME. MaxScale user name for connection to underlying MySQL database
  • MAXSCALE_PASSWORD. MaxScale user password for connection to underlying MySQL database
  • MAXSCALE_EXPORTER_PORT. Port that the Exporter expose to provide metrics for Prometheus

Run

  1. cd maxscale_docker
  2. docker-compose up -d
  3. docker-compose down when you are finished

Test

  1. The REST API of MaxScale is accessible at localhost:8989. E.g. http://localhost:8989/v1/servers
  2. The Exporter of MaxScale is accessible at localhost:8093. E.g. http://localhost:8093/metrics

maxctrl_exporter's People

Contributors

vbezgachev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.