Giter VIP home page Giter VIP logo

dashiki's Introduction

Dashiki

What does it do?

Dashiki allows you to build dashboards that surface data from graphite, ganglia and other sources of time series data.

How do I run it?

bundle install
ln -s cfg-examples cfg
rackup

What's it look like?

Dashiki Screenshot

Configuration

Configuration files should like under cfg/. See examples in cfg-examples.

Please see the wiki for much more comprehensive documentation on configuration for the various sources.

Simple configuration

Configuration files are javascript files, organized in directory trees under cfg/. Files starting with underscore are ignored (use this for defaults and events configurations to be loaded explicitly).

The default data source is a graphite server reachable at http://graphite/, so to add a project with two graphite metrics:

Dash.stats()
  .add(
    {
      title:   'Current Foo Bar',
      target:  'stats_counts.production.foo.bar',
      display: 'last'
    },
    {
      title:   'Mean Barf Count',
      target:  'stats_counts.production.barf.count',
      display: 'mean'
    }
  )

Alternative data sources

See public/js/Dash.Source.*.js. To use an alternative data source, such as ganglia:

Dash.stats()
  .add({
    title:     'Web server Current CPU',
    type:      'ganglia',
    source:    'http://ganglia-01',
    graph:     'cpu_report',
    cluster:   'WebServers',
    aggregate: 'sum',
    format:    function(x) { return x.toFixed(0) + '%' },
    display:   'last'
   })

Note the format function, which takes the display value and can return a string to display in its place (in this case set precision and append percent sign). The default format function is the supplied Dash.Format.Metric, which converts e.g. '1000' to '1K', etc. See public/Dash.Format.js for some more useful format functions.

  • Graphite: default data source
  • Ganglia: extracts cluster time series data from e.g. cpu_report, load_report, etc
  • Ganglia_events: event lines for data stored using ganglia events API
  • Logstash: timeseries data on occurrence of a search pattern, as in the kibana histogram
  • Opscenter: any cassandra cluster metric exposed by opscenter
  • Pingdom: uptime or responsetime metrics from pingdom
  • Google analytics: hourly metric data retrieved using GA API
  • Errplane: count and times data by method
  • Sendgrid: daily stats
  • Test: fake time series data generated by dashiki for your testing pleasure

Consistent config

A consistent config can be applied to multiple stats as follows:

Dash.stats()
  .config(
    {
      type:      'ganglia',
      source:    'http://ganglia-01',
      graph:     'cpu_report',
      aggregate: 'sum',
      format:    function(x) { return x.toFixed(0) + '%' },
      display:   'last'
    }
  )
  .add(
    {
      title:     'Web server Current CPU',
      cluster:   'WebServers'
    },
    {
      title:     'Database Current CPU',
      cluster:   'DbServers'
    }
  )

Thresholds

Thresholds work in a similar fashion to format functions: they take the display value and if function returns true, apply the given class(es) to the display box.

Dash.stats()
  .add({
    title:  'Volume',
    target: 'stats.gauges.amp.volume',
    display: 'last',
    thresholds: [
      { class: 'green',     test: function(x) { return x<8 } },
      { class: 'red',       test: function(x) { return x>=8 && x<=10 } },
      { class: 'spinaltap', test: function(x) { return x==11 } }
    ]
  })

Dynamically finding metrics

For graphite it is possible to configure stats dynamically using a wildcard metric:

Dash.stats()
  .find({
    target: 'stats.gauges.amp.*',
    done: function(metrics) {
      metrics.forEach(function(metric) {
        var control = metric.split('.').slice(-1).join();
        this.add({
          title:   Dash.capitalize(control),
          target:  metric,
          display: 'last',
        });
      }, this);
    }
  })

There are convenience callbacks that may be used as alternatives to done: each: function(metric) {...} puts an implicit loop over metrics, and add: function(metric) {...} is each with an implicit this.add on the object returned.

Proxy

Say your browser can't reach a given data source with an XHR, because of firewall restrictions or same-origin policy (which you are unable to configure around on the source for some reason). Set proxy: true for the given stat and dashboard will route the request through a simple GET proxy on the dashboard server.

Events

Events are sparse data lines that are superimposed on the big graph in the boxes view. Default events are configured in cfg/_events_.js, but can also be added in individual dashboard cfgs.

For example, we increment a counter via statsd every time a production deploy is done with capistrano, and also use the ganglia events api to store start and end times of nightly backups and DB repairs.

Dash.events()
  .add(
    {
      title:  'Production Deploys',
      target: 'stats_counts.events.deploy.production.*',
      class:  'production_deploys'
    },
    {
      title:  'Puppet Configuration Changes',
      target: 'stats_counts.events.puppet.*',
      class:  'puppet_deploys'
    },
    {
      title:  'Ganglia events',
      type:   'ganglia_events',
      source: 'http://ganglia',
      class:  'ganglia_events'
    }
  );

A CSS class may be applied to give different styling to different events (see public/css/dashboard.css).

License

Dashiki is distributed under the MIT license. See the attached LICENSE file for all the sordid details.

dashiki's People

Contributors

heffergm avatar rlister avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.