Collects MySQL database metrics
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This project will no longer be maintained by Intel. Intel will not provide or guarantee development of or support for this project, including but not limited to, maintenance, bug fixes, new releases or updates. Patches to this project are no longer accepted by Intel. If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the community, please create your own fork of the project.

Snap collector plugin - MySQL

This plugin collects metrics from MySQL database.

It's used in the Snap framework.

  1. Getting Started
  1. Documentation
  1. Community Support
  2. Contributing
  3. License
  4. Acknowledgements

Getting Started

System Requirements

Operating systems

All OSs currently supported by snap:

  • Linux/amd64


Download mysql plugin binary:

You can get the pre-built binaries for your OS and architecture from the plugin's GitHub Releases page.

To build the plugin binary:


Clone repo into $GOPATH/src/

$ git clone<yourGithubID>/snap-plugin-collector-mysql.git

Build the plugin by running make within the cloned repo:

$ make

This builds the plugin in ./build

Configuration and Usage


###Global config Global configuration files are described in snap's documentation. You have to add "mysql" section with following entries:

  • "mysql_connection_string" - it's DSN with format described here. ex. "root:r00tme@tcp(localhost:3306)/" where root is username and r00tme is password, localhost is host address and 3306 is port where mysql is listening.
  • "mysql_use_innodb" - possible values are true and false. Specifies if InnoDB statistics are collected. If you set this value to true and they are unavailable plugin will fail to start.

See exemplary Global configuration files in [examples/configs/] (

Collected Metrics

List of collected metrics is described in


Example running mysql and writing data to a file using snap-plugin-publisher-file.

Create Global Config, see examples in [examples/configs/] (

Set up the Snap framework, in one terminal window, run snapteld (in this case with logging set to 1, trust disabled and global configuration saved in config.json):

$ snapteld -l 1 -t 0 --config config.json

In another terminal window:

Download and load Snap plugins:

$ wget
$ wget
$ snaptel plugin load snap-plugin-publisher-file
$ snaptel plugin load snap-plugin-collector-mysql

See available metrics for your system

$ snaptel metric list

Create a task manifest file (exemplary files in [examples/tasks/] (

  "version": 1,
  "schedule": {
    "type": "simple",
    "interval": "1s"
  "workflow": {
    "collect": {
      "metrics": {
        "/intel/mysql/*": {}
      "publish": [
          "plugin_name": "file",
          "config": {
            "file": "/tmp/published_mysql"

Create a task:

$ snaptel task create -t examples/tasks/task.json

Stop previously created task:

$ snaptel task stop <task_id>


There isn't a current roadmap for this plugin, but it is in active development. As we launch this plugin, we do not have any outstanding requirements for the next release. If you have a feature request, please add it as an issue and/or submit a pull request.

Community Support

This repository is one of many plugins in Snap, a powerful telemetry framework. See the full project at

To reach out to other users, head to the main framework.


We love contributions!

There's more than one way to give back, from examples to blogs to code updates. See our recommended process in

And thank you! Your contribution, through code and participation, is incredibly important to us.


Snap, along with this plugin, is an Open Source software released under the Apache 2.0 License.