nuclon.sql_exporter

Ansible Role: sql_exporter

License Ansible Role GitHub tag

Description

Deploy sql_exporter using ansible.

Requirements

  • Ansible >= 2.7 (It might work on previous versions, but we cannot guarantee it)

Role Variables

All variables which can be overridden are stored in defaults/main.yml file as well as in table below.

Name Default Value Description
sql_exporter_web_listen_address "0.0.0.0:9399" Address on which sql_exporter will listen

Example

Playbook

Use it in a playbook as follows:

- hosts: all
  roles:
    - role: nuclon.sql_exporter
      sql_exporter_data_source_name: "mysql://user:password@tcp(mysql-host.corp.local:3306)/database_name"
      sql_exporter_collectors:
        - collector_name: service_data
          metrics:
            - metric_name: service_pending_events
              type: gauge
              help: "Not processed events count"
              values: [cnt]
              query: |
                SELECT count(*) as cnt
                FROM events
                WHERE status=0
            - metric_name: service_failed_events
              type: gauge
              help: "Failed events count"
              values: [cnt]
              query: |
                SELECT count(*) as cnt
                FROM events
                WHERE
                  failed = 1

The role will generate a file for every entry in sql_exporter_collectors.

Contributing

See contributor guideline.

Troubleshooting

See troubleshooting.

License

This project is licensed under MIT License. See LICENSE for more details.

About

Deploy sql_exporter

Install
ansible-galaxy install nuclon.sql_exporter
GitHub repository
License
mit
Downloads
100