Giter Site home page Giter Site logo

osshelp / ansible-sql-exporter Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 16 KB

Ansible role for SQL exporter

Home Page: https://github.com/burningalchemist/sql_exporter/

License: GNU General Public License v3.0

HTML 100.00%
ansible-role sql-exporter mysql postgresql clickhouse prometheus-exporter

ansible-sql-exporter's Introduction

sql-exporter

Build Status

Ansible role that installs and configures sql-exporter.

Usage (example)

    - role: sql-exporter
      sql_exporter_params:
        max_connections: 2
        max_idle_connections: 2
      sql_exporter_target:
        data_source_name: 'some_connection_string'
        collectors: 'test-collector'
      sql_exporter_collectors:
        - name: some-collector-name
          min_interval: 15s
          metrics:
            - name: mssql_local_time_seconds
              type: gauge
              help: 'Local time in seconds since epoch (Unix time).'
              values: unix_time
              query: "SELECT DATEDIFF(second, '19700101', GETUTCDATE()) AS unix_time"

Available parameters

sql_exporter_params

Global settings and defaults.

Param Description
scrape_timeout_offset Subtracted from Prometheus' scrape_timeout to give us some headroom and prevent Prometheus from timing out first.
min_interval Minimum interval between collector runs. By default (0s) - collectors are executed on every scrape.
max_connections Maximum number of open connections to any one target.
max_idle_connections Maximum number of idle connections to any one target.

sql_exporter_target

The target to monitor and the list of collectors to execute on it.

Param Description
data_source_name Data source name always has a URI schema that matches the driver name. In some cases (e.g. MySQL) the schema gets dropped or replaced to match the driver expected DSN format.
collectors Collectors (referenced by name) to execute on the target.

sql_exporter_collectors

Variables for collectors configuration:

Param Description
name With this name the collector will be referenced in the exporter configuration.
min_interval Override of the similar param from global settings (optional).
metrics List of metric specific params (see below).

Params available for usage in "metrics" list:

Param Description
type Set the type of the gathered metric (e.g. gauge or counter).
help Short description of exported metric.
values The value we'll recieve as a metric.
query The query for metric gathering itself.

FAQ

I have hundreds of metrics to export, playbook becomes huge

Configuration files are being generated via Jinja2, so there is no graceful way to avoid the playbook overgrowth for now, but we'll look into it.

Useful links

TODO

  • Improvements to params description (more readable and clear)

License

GPL3

Author

OSSHelp Team, see https://oss.help

ansible-sql-exporter's People

Watchers

 avatar  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.