1
0
Fork 0
mirror of synced 2024-12-22 06:31:06 -05:00
Grafana SaltStack Formula
Find a file
Guillaume Thouvenin 885c5fc79c Provides a base panel to construct the main dashboard
This patch adds a default panel that will be used when another service
will add a new panel into the main dashboard through grains. This is the
common part between all panels of the main dashboard.

It replaces the static main dashboard that has been removed.
2017-01-26 13:26:29 +01:00
_states Provides a base panel to construct the main dashboard 2017-01-26 13:26:29 +01:00
debian Add salt-master into build depends 2016-04-14 11:57:49 +02:00
grafana Provides a base panel to construct the main dashboard 2017-01-26 13:26:29 +01:00
metadata/service Provides a base panel to construct the main dashboard 2017-01-26 13:26:29 +01:00
Makefile Add missing Makefile 2016-04-14 14:11:51 +02:00
metadata.yml Add metadata.yml 2016-04-14 14:56:42 +02:00
README.rst Make more explicit the configuration of binding parameters 2016-12-13 11:20:42 +01:00
VERSION Debian packaging 2016-03-31 21:06:44 +02:00

=======
Grafana
=======

A beautiful, easy to use and feature rich Graphite dashboard replacement and graph editor.


Sample pillars
==============


Server deployments
------------------

Server installed from system package and listening on 1.2.3.4:3000 (the default
is 0.0.0.0:3000)

.. code-block:: yaml

    grafana:
      server:
        enabled: true
        bind:
          address: 1.2.3.4
          port: 3000
        admin:
          user: admin
          password: passwd
        database:
          engine: sqlite

Server installed with PostgreSQL database

.. code-block:: yaml

    grafana:
      server:
        enabled: true
        admin:
          user: admin
          password: passwd
        database:
          engine: postgresql
          host: localhost
          port: 5432
          name: grafana
          user: grafana
          password: passwd

Server installed with LDAP authentication and all authenticated users are
administrators

.. code-block:: yaml

    grafana:
      server:
        enabled: true
        admin:
          user: admin
          password: passwd
        auth:
          ldap:
            enabled: true
            host: '127.0.0.1'
            port: 389
            use_ssl: false
            bind_dn: "cn=admin,dc=grafana,dc=org"
            bind_password: "grafana"
            user_search_filter: "(cn=%s)"
            user_search_base_dns:
            - "dc=grafana,dc=org"

Server installed with LDAP and basic authentication

.. code-block:: yaml

    grafana:
      server:
        enabled: true
        admin:
          user: admin
          password: passwd
        auth:
          basic:
            enabled: true
          ldap:
            enabled: true
            host: '127.0.0.1'
            port: 389
            use_ssl: false
            bind_dn: "cn=admin,dc=grafana,dc=org"
            bind_password: "grafana"
            user_search_filter: "(cn=%s)"
            user_search_base_dns:
            - "dc=grafana,dc=org"

Server installed with LDAP for authentication and authorization

.. code-block:: yaml

    grafana:
      server:
        enabled: true
        admin:
          user: admin
          password: passwd
        auth:
          ldap:
            enabled: true
            host: '127.0.0.1'
            port: 389
            use_ssl: false
            bind_dn: "cn=admin,dc=grafana,dc=org"
            bind_password: "grafana"
            user_search_filter: "(cn=%s)"
            user_search_base_dns:
            - "dc=grafana,dc=org"
            group_search_filter: "(&(objectClass=posixGroup)(memberUid=%s))"
            group_search_base_dns:
            - "ou=groups,dc=grafana,dc=org"
            authorization:
              enabled: true
              admin_group: "admins"
              editor_group: "editors"
              viewer_group: "viewers"

Server installed with default StackLight JSON dashboards. This will
be replaced by the possibility for a service to provide its own dashboard
using salt-mine.

.. code-block:: yaml

    grafana:
      server:
        enabled: true
        dashboards:
          enabled: true
          path: /var/lib/grafana/dashboards

Server with theme overrides

.. code-block:: yaml

    grafana:
      server:
        enabled: true
        theme:
          light:
            css_override:
              source: http://path.to.theme
              source_hash: sha256=xyz
              build: xyz
          dark:
            css_override:
              source: salt://path.to.theme


Collector setup
---------------

Used to aggregate dashboards from monitoring node.

.. code-block:: yaml

    grafana:
      collector:
        enabled: true


Client setups
-------------

Client with token based auth

.. code-block:: yaml

    grafana:
      client:
        enabled: true
        server:
          protocol: https
          host: grafana.host
          port: 3000
          token: token

Client with base auth

.. code-block:: yaml

    grafana:
      client:
        enabled: true
        server:
          protocol: https
          host: grafana.host
          port: 3000
          user: admin
          password: password

Client enforcing graphite data source

.. code-block:: yaml

    grafana:
      client:
        enabled: true
        datasource:
          graphite:
            type: graphite
            host: mtr01.domain.com
            protocol: https
            port: 443

Client enforcing elasticsearch data source

.. code-block:: yaml

    grafana:
      client:
        enabled: true
        datasource:
          elasticsearch:
            type: elasticsearch
            host: log01.domain.com
            port: 80
            index: grafana-dash

Client defined and enforced dashboard

.. code-block:: yaml

    grafana:
      client:
        enabled: true
        server:
          host: grafana.host
          port: 3000
          token: token
        dashboard:
          system_metrics:
            title: "Generic system metrics"
            style: dark
            editable: false
            row:
              top:
                title: "First row"

Client enforced dashboards defined in salt-mine

.. code-block:: yaml

    grafana:
      client:
        enabled: true
        remote_data:
          engine: salt_mine
        server:
          host: grafana.host
          port: 3000
          token: token


Usage
=====

There's a difference between JSON dashboard representation and models we us.
The lists used in JSON format [for rows, panels and target] were replaced by
dictionaries. This form of serialization allows better merging and overrides
of hierarchical data structures that dashboard models are.

The default format of Grafana dashboards with lists for rows, panels and targets.

.. code-block:: yaml

    system_metrics:
      title: graph
      editable: true
      hideControls: false
      rows:
      - title: Usage
        height: 250px
        panels:
        - title: Panel Title
          span: 6
          editable: false
          type: graph
          targets:
          - refId: A
            target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle"
          datasource: graphite01
          renderer: flot
        showTitle: true

The modified version of Grafana dashboard format with dictionary declarations.
Please note that dictionary keys are only for logical separation and are not
displayed in generated dashboards.

.. code-block:: yaml

    system_metrics:
        system_metrics2:
          title: graph
          editable: true
          hideControls: false
          row:
            usage:
              title: Usage
              height: 250px
              panel:
                usage-panel:
                  title: Panel Title
                  span: 6
                  editable: false
                  type: graph
                  target:
                    A:
                      refId: A
                      target: "support_prd.cfg01_iot_tcpcloud_eu.cpu.0.idle"
                  datasource: graphite01
                  renderer: flot
              showTitle: true


Read more
=========

* http://grafana.org/
* http://docs.grafana.org/reference/export_import/