Code Monkey home page Code Monkey logo

mysqlrouter_exporter's Introduction

mysqlrouter_exporter

lint release

Supported MySQL Router version

check here

Usage

  1. Enable REST API on your MySQL Router here
  2. Download binary from release.
  3. Move to /usr/local/bin/
  4. Add systemd script.
  5. Start
[Unit]
Description=mysqlrouter-exporter
Documentation=https://github.com/rluisr/mysqlrouter-exporter
After=network-online.target

[Service]
Type=simple
Environment="MYSQLROUTER_EXPORTER_URL=url"
Environment="MYSQLROUTER_EXPORTER_USER=user"
Environment="MYSQLROUTER_EXPORTER_PASS=pass"
ExecStart=/usr/local/bin/mysqlrouter_exporter

[Install]
WantedBy=multi-user.target

Container

docker pull ghcr.io/rluisr/mysqlrouter_exporter:latest

Packages

Environment

Edit systemd script or add an environment variables.

Name Default Require Description
MYSQLROUTER_EXPORTER_URL - yes MySQL Router Rest API URL
MYSQLROUTER_EXPORTER_USER - no Username for REST API
MYSQLROUTER_EXPORTER_PASS - no Password for REST API
MYSQLROUTER_TLS_CACERT_PATH - no TLS CA cert path
MYSQLROUTER_TLS_CERT_PATH - no TLS cert path
MYSQLROUTER_TLS_KEY_PATH - no TLS key path

You can also set it as a flag. See below.

Application Options:
      --url=                                                 MySQL Router Rest API URL [$MYSQLROUTER_EXPORTER_URL]
      --user=                                                Username for REST API [$MYSQLROUTER_EXPORTER_USER]
      --pass=                                                Password for REST API [$MYSQLROUTER_EXPORTER_PASS]
  -p, --listen-port=                                         Listen port (default: 49152)
      --service-name=                                        Service name for MySQL Router [$MYSQLROUTER_EXPORTER_SERVICE_NAME]
      --tls-ca-cert-path=                                    TLS CA cacert path [$MYSQLROUTER_TLS_CACERT_PATH]
      --tls-cert-path=                                       TLS cert path [$MYSQLROUTER_TLS_CERT_PATH]
      --tls-key-path=                                        TLS key path [$MYSQLROUTER_TLS_KEY_PATH]
  -k, --skip-tls-verify                                      Skip TLS Verification
      --collect-interval=                                    Collect interval time in sec. (default: 2)
      --collect.metadata.status                              Collect metrics from metadata status. CPU usage will increase.
      --collect.route.connections.byte_from_server           Collect metrics from route connections. CPU usage will increase.
      --collect.route.connections.byte_to_server             Collect metrics from route connections. CPU usage will increase.
      --collect.route.connections.time_started               Collect metrics from route connections. CPU usage will increase.
      --collect.route.connections.time_connected_to_server   Collect metrics from route connections. CPU usage will increase.
      --collect.route.connections.time_last_sent_to_server   Collect metrics from route connections. CPU usage will increase.
      --collect.route.connections.time_received_from_server  Collect metrics from route connections. CPU usage will increase.
  -v, --version                                              Show version

Help Options:
  -h, --help                                                 Show this help message

Collector Flags

mysqlrouter_exporter can all get metrics. MySQL Router REST API Reference

Name Default Description
collect.metadata.status false Collect metrics from metadata status. CPU usage will increase.
collect.route.connections.byte_from_server false Collect metrics from route connections. CPU usage will increase.
collect.route.connections.byte_to_server false Collect metrics from route connections. CPU usage will increase.
collect.route.connections.time_started false Collect metrics from route connections. CPU usage will increase.
collect.route.connections.time_connected_to_server false Collect metrics from route connections. CPU usage will increase.
collect.route.connections.time_last_sent_to_server false Collect metrics from route connections. CPU usage will increase.
collect.route.connections.time_received_from_server false Collect metrics from route connections. CPU usage will increase.

Prometheus configuration

scrape_configs:
  - job_name: 'mysqlrouter'
    static_configs:
      - targets:
        - mysqlrouter01.luis.local:49152

Grafana Dashboard

Grafana Dashboard

Download dashboard

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.