2.0.1 • Published 4 years ago

@financial-times/grafana-tools v2.0.1

Weekly downloads
54
License
MIT
Repository
-
Last release
4 years ago

Grafana Tools MIT licensed

Automate your project Grafana dashboards.

grafana pull <slug> <file>
grafana push <slug> <file>

Table Of Contents

Requirements

Running Grafana tools requires Node.js 10.x and npm.

Install

npm install -g @financial-times/grafana-tools

Usage

Pull a JSON representation of a dashboard and save it locally:

Usage: grafana pull <name> <file> [options]

Options:

  -h, --help             output usage information
  -V, --version          output the version number
  -a, --api-key <key>    the API key to use when accessing the Grafana API
  -H, --hostname <host>  the hostname Grafana runs on

Push a local JSON representation of a dashboard to the server:

Usage: grafana-push <name> <file> [options]

Options:

  -h, --help             output usage information
  -V, --version          output the version number
  -a, --api-key <key>    the API key to use when accessing the Grafana API
  -H, --hostname <host>  the hostname Grafana runs on
  -o, --overwrite        whether to overwrite any changes on the server

Note: the --api-key option can also be set with a GRAFANA_API_KEY environment variable.

Testing

To run tests on your machine you'll need to install Node.js and run make install. Then you can run the following commands:

make test              # run all the tests
make test-unit         # run the unit tests

You can run the unit tests with coverage reporting, which expects 90% coverage or more:

make test-unit-coverage verify-coverage

The code will also need to pass linting on CI, you can run the linter locally with:

make verify

We run the tests and linter on CI, you can view ci. make test and make lint must pass before we merge a pull request.

Deployment

New versions of the module are published automatically by CI when a new tag is created matching the pattern /v.*/.

Migration guide

StateMajor VersionLast Minor ReleaseMigration guide
✨ active2N/Amigrate to v2
⚠ maintained11.0N/A

License

The Financial Times has published this software under the MIT license.

2.0.1

4 years ago

2.0.0

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.1

6 years ago

1.0.0

7 years ago

0.2.1

7 years ago