grafana-info

command module
v0.0.0-...-5abdd38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2016 License: GPL-3.0 Imports: 9 Imported by: 0

README

[WIP] grafana-info

It is just draft with basic functions.

Displays on the terminal a brief info about Grafana objects. It can be useful when you have a lot of backups from Grafana in JSON-files. Utility will help you find for example a right dashboard by tag or panel name.

The code based on autograf library.

Planned features:

  • treats input as JSON and parse it for Grafana objects
  • recognize dashboards, datasources, users
  • get a bunch objects at once (from files or stdin)
  • show brief info about each succesfully parsed object
  • output important fields in key=value format (for easy grepping)

Usage example:

$ grafana-info < myfile.json

Example output:

=== Dashboard <175980> "Example API" ===
Tags: [autogenerated] [example] [dev]
Templating Vars: [env] [database] [datasource] 
--- Row New row ---
  | MAX DB response time     | Max per handler time  |
  | singlestat               | singlestat            | 
--- Row Information By Hosts ---
  | Handler Max AVG [1min] r | DB Max AVG[1min] resp |
  | graph                    | graph                 |
--- Row Handlers Response Time ---
  | Top handlers response ti | Top handlers response | Handler RPS             |
  | graph                    | graph                 | table                   |
--- Row DB ---
  | DB Top Query Duration    | Top Hits Queries coun | AVG Response Time by db |
  | graph                    | graph                 |                         |

Or for conjunction with grep:

$ grafana-info --keys *.json 

id: 175980
175980.slug: example-api
example-api.175980.dashboard: Example API
example-api.175980.tag: autogenerated
example-api.175980.tag: example
example-api.175980.tag: dev
example-api.175980.templating: env
example-api.175980.templating: datasource
example-api.175980.row: New row
example-api.175980.panel: MAX DB response time
example-api.175980.type: singlestat

So you easily can find slug and ID of the dashboard:

$ grafana-info --keys *.json | grep tag: "(dev|staging)"

example-api.175980.tag: dev

Future usage examples:

$ grafana-info path/to/backups/*.json

$ for f in *json; do cat $f; done | grafana-info --color

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL