Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

VividCortex/grafana-datasource

Repository files navigation

CircleCI codecov

SolarWinds DPM Metrics Datasource Plugin

How to use

First, clone or download this repository's files and place them in your Grafana plugins folder, typically found in <path/to/grafana>/data/plugins or, on Linux systems, the plugin directory is /var/lib/grafana/plugins. You can place them in a DPM folder, such as /var/lib/grafana/plugins/dpm/.

Restart Grafana, log in, and go to Configuration > Data Sources > Add data source:

Add a Data Source

Select SolarWinds DPM:

Select SolarWinds DPM

Enter your DPM API token. To generate an API token, log into SolarWinds DPM and select the environment you want to pull metrics from. Go to Settings, and under Environment Settings, choose API Tokens.

Enter API Token

Then Save. It should display a success message if the configured token is working.

Successfully saved

Optional: if, for any reason, you need to configure a different API URL, you can use the API URL field in the datasource configuration. Otherwise you can leave it empty, as it's not required.

Configuring your graph

In the panel configuration, select the SolarWinds DPM Data Source:

Use the SolarWinds DPM Data Source

You will see a row with a dropdown (to select the metric) and a text input (to filter your hosts).

The dropdown will show metrics that match what you have typed, which makes searching easier:

Metric Autocomplete

The hosts filter shares some features with the DPM app:

  • By default, if you type api, any host whose name includes the substring api will become part of the set of active hosts.
  • You can match hostnames exactly by wrapping them with the double quotes sign. The string "api2", for example, will match a host named api2 but not one named api20.
  • You can exclude hosts from the selection by negating them with a minus sign. For example, -"api20".
  • You can select hosts by their type (os, mysql, pgsql, redis and mongo at present), with syntax such as type=os or type=mysql.

Select a metric, filter your desired hosts and click on the eye icon to preview.

Learn more about metric categories

Sample configuration:

sample configuration

Use with Grafana variables

When defining a graph, it's supported in both the metric picker and host filter the use of variables. These variables will be interpolated with the currently selected value when the datasource requests for data.

variables in the query editor

Variables, with SolarWinds DPM as the datasource, will use the query field to match with metric names (e.g. mysql. will match with mysql metrics). Alternatively, you can use the special string $hosts and get host names as possible values.

Read more about variables in the Grafana documentation.

Development guide

  1. Place this project in your plugins directory or /data/plugins
  2. Install dependencies. yarn install or npm install
  3. Run the tests. yarn test or npm run test
  4. Build to distribute or test. yarn build or npm run build
  5. Alternatively, use the watch script with yarn watch or npm run watch

Coding style

The code is automatically formatted using Prettier in a pre-commit hook.

Code linting

Run the linter with yarn lint or npm run lint.

Contribute

Change the files as you need and send a PR with no build files on it. After you get your PR approved you can merge it to master.

Release

We follow the Semantic Versioning guidelines.

Acknowledgments

About

Datasource plugin for connecting your Grafana dashboard to SolarWind's DPM

Resources

Stars

Watchers

Forks

Packages

No packages published