Skip to content
Ric Lister edited this page May 24, 2013 · 2 revisions

Errplane source uses the errplane v2 API to display count and timing data for all available actions.

Metric options

  • type: errplane
  • app_id: your application will have an ID string, available in Settings/Applications
  • api_key: read/write key available in Settings/Organization
  • environment: environment name (lowercase), e.g. production/staging/etc
  • target: name of a time-series to show as type[/controller#method]

Example

Dash.stats()
  .config({
    type:        'errplane',
    environment: 'production',
    app_id:      '12a34bc5-de67-8ab9-a1b2-345c6defabc7',
    api_key:     'a12b3456'
  });
  .add(
    {
      title:  'Exceptions',
      target: 'exceptions',
      show:   'counts'
    },
    {
      title:   'Mean controller response time',
      target:  'controllers',
      show:    'responsetime',
      display: 'avg',
      format:  Dash.Format.Microseconds
    },
    {
      title:  'Users created',
      target: 'controllers/UserController#create',
      show:   'count'
    }
  );

Find

Errplane source .find() method will return all time-series for the given environment, you will need to filter results.

For example, to show all controller counts:

Dash.stats()
  .config({
    type:        'errplane',
    environment: 'production',
    app_id:      '12a34bc5-de67-8ab9-a1b2-345c6defabc7',
    api_key:     'a12b3456',
    show:        'counts'
  })
  .find({
    done: function(metrics) {
      metrics.filter(function(metric) {
        return metric.match(/controller/);
      }).forEach(function(metric) {
          this.add({
            title:  metric.replace(/controllers\//, ' ').replace(/#/, ' '),
            target: metric
          });
      }, this);
    }
  })
Clone this wiki locally