Git Product home page Git Product logo

dockerized-mysql-plugin's Introduction

Archived header

The New Relic MySQL Plugin

This is the New Relic Plugin for monitoring MySQL databases. It is the same one that can be found in Plugin Central and on GitHub as newrelic-platform/newrelic_mysql_java_plugin, but packaged as a Docker container image for ease of use!

In order to use the MySQL Plugin, you will need an active New Relic account and a New Relic license key.

How to use this image

The MySQL Plugin image is configured by environment variables. These are mandatory:

  • NEW_RELIC_LICENSE_KEY
  • AGENT_HOST
  • AGENT_USER
  • AGENT_PASSWD

Optionally, you can also set:

  • NEW_RELIC_LOG_LEVEL (default is info)
  • AGENT_NAME (to change what name the Plugin reports as)
  • AGENT_METRICS (see metric.category.json for details)

Example

$ docker run -d \
  -e NEW_RELIC_LICENSE_KEY=foobarbaz \
  -e AGENT_HOST=your-db-host \
  -e AGENT_USER=newrelic \
  -e AGENT_PASSWD=SuPeRsEcUrE \
  newrelic/mysql-plugin

Additional Configuration

HTTP Proxy

If you are running your plugin from a machine that runs outbound traffic through a proxy, you can use the following optional configurations:

  • PROXY_HOST - The proxy host (e.g. webcache.example.com)
  • PROXY_PORT - The proxy port (e.g. 8080). Defaults to 80 if a proxy_host is set
  • PROXY_USERNAME - The proxy username
  • PROXY_PASSWORD - The proxy password

Monitoring MySQL Replication

To monitor stats like Replication Lag and Relay Log Volume are disabled by default. To monitor MySQL Replication the plugin needs to be told to check those additional metric sets by changing the AGENT_METRICS variable. The default is newrelic,status.

On your MySQL replicas: AGENT_METRICS="newrelic,status,slave"

On your MySQL master: AGENT_METRICS="newrelic,status,master"

Getting logs and troubleshooting

To prevent filling up the container filesystem, no logs are written locally inside the container. Instead they are sent to Docker's logging system. By default, the logging level is info, however when troubleshooting it may be useful to set NEW_RELIC_LOG_LEVEL=debug.

If the plugin is failing to report data, we recommend trying to run it attached to the terminal with docker run -t instead of in daemon mode -d.

docker run -t \
  -e NEW_RELIC_LOG_LEVEL=debug \
  -e NEW_RELIC_LICENSE_KEY=foobarbaz \
  -e AGENT_HOST=your-db-host-but-with-a-typo \
  -e AGENT_USER=newrelic \
  -e AGENT_PASSWD=SuPeRsEcUrE \
  newrelic/mysql-plugin

Contributing

You are welcome to send pull requests to us - however, by doing so you agree that you are granting New Relic a non-exclusive, non-revokable, no-cost license to use the code, algorithms, patents, and ideas in that code in our products if we so choose. You also agree the code is provided as-is and you provide no warranties as to its fitness or correctness for any purpose.

dockerized-mysql-plugin's People

Contributors

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