Skip to content

Everything-at-a-glance dashboard for time series data from graphite, ganglia and many more.

License

Notifications You must be signed in to change notification settings

kishoreyellamraju/dashiki

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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.

About

Everything-at-a-glance dashboard for time series data from graphite, ganglia and many more.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published