Sign inSign up

monasca/grafana-init

By monasca

•Updated about 5 years ago

Image
0

1M+

monasca/grafana-init repository overview

⁠grafana-init Dockerfile

This image runs a script to initialize a Grafana instance with a set of default resources, like a datasource and JSON dashboards. For more information on the Monasca project, see the wiki⁠.

Sources: grafana-init⁠ · Dockerfile⁠ · monasca-docker⁠

⁠Tags

Images in this repository are tagged as follows:

  • master: refers to the latest stable point release

⁠Usage

This image requires a running Grafana instance. The monasca/grafana⁠ image is recommended for use with Monasca, but any recent Grafana server should work (albeit with some minor modifications).

To use with defaults, run:

docker run --link grafana monasca/grafana-init:latest

The image will connect to a Grafana server at the default address (http://grafana:3000/), create a Monasca datasource, and import several default dashboards.

Note that this script will not run successfully on a Grafana instance that has already been initialized.

⁠Configuration

VariableDefaultDescription
LOG_LEVELINFOLogging level, e.g. DEBUG
GRAFANA_URLhttp://grafana:3000Location of Grafana server
DATASOURCE_TYPEmonascaAgent Keystone user domain
GRAFANA_ADMIN_USERNAMEadminAgent Keystone admin username
GRAFANA_ADMIN_PASSWORDpasswordAgent Keystone admin username
DATASOURCE_URLhttp://monasca:8070/Agent Keystone project name
DATASOURCE_ACCESS_MODEproxyGrafana access mode string
DATASOURCE_AUTHKeystoneGrafana authentication option (Keystone, Horizon, Token)
DATASOURCE_AUTH_TOKEN``Keystone token for authentication (for use when DATASOURCE_AUTH is set to Token)
DASHBOARDS_DIR/dashboards.dDirectory to scan for .json dashboards

Note that the only datasource type supported at the moment is monasca. Other datasources should be simple to implement as needed by adding logic to create_datasource_payload() in grafana.py⁠.

⁠Grafana users

GRAFANA_ADMIN_USERNAME and GRAFANA_ADMIN_PASSWORD

Grafan admin user is need for uploading dashboards.

⁠Custom Dashboards

This image comes with a default set of Monasca-specific dashboards, but these can be overridden. To do so, mount a directory containing .json files to /dashboards.d (path configurable via DASHBOARDS_DIR).

The directory will be scanned and each .json file will be imported. Files are sorted before importing, so filenames can be prefixed, e.g. 01-first.json, 99-last.json, to help ensure proper ordering in the Grafana UI,

Tag summary

Content type

Image

Digest

Size

14 MB

Last updated

about 8 years ago

docker pull monasca/grafana-init