stephenyeargin / hubot-grafana

📈🤖 Query Grafana dashboards
http://docs.grafana.org/tutorials/hubot_howto/
MIT License
154 stars 48 forks source link

Update to use panel ID's from Grafana #42

Closed ShonM closed 8 years ago

ShonM commented 8 years ago

Previously it was iterating all panels and assuming their ID's were in the order iterated, but they actually all contain ID's and reorganizing the dashboard will give wildly different graphs than expected before this fix.

This is Grafana 2.6.0. Here's some panel JSON:

{ aliasColors: {},
  bars: false,
  datasource: null,
  editable: true,
  error: false,
  fill: 0,
  grid:
   { leftLogBase: 1,
     leftMax: null,
     leftMin: null,
     rightLogBase: 1,
     rightMax: null,
     rightMin: null,
     threshold1: null,
     threshold1Color: 'rgba(216, 200, 27, 0.27)',
     threshold2: null,
     threshold2Color: 'rgba(234, 112, 112, 0.22)' },
  id: 13,
  legend:
   { avg: false,
     current: true,
     max: false,
     min: false,
     show: true,
     total: false,
     values: true },
  lines: true,
  linewidth: 1,
  links: [],
  nullPointMode: 'connected',
  percentage: false,
  pointradius: 5,
  points: false,
  renderer: 'flot',
  seriesOverrides: [],
  span: 6,
  stack: false,
  steppedLine: false,
  targets:
   [ { refId: 'A',
       target: 'aliasByMetric(sitespeed.io.https.www_chess_com.slash.rules.*)',
       textEditor: true } ],
  timeFrom: null,
  timeShift: null,
  title: 'Rule score',
  tooltip: { shared: true, value_type: 'cumulative' },
  type: 'graph',
  'x-axis': true,
  'y-axis': true,
  y_formats: [ 'short', 'short' ] }
stephenyeargin commented 8 years ago

Take a look at #26 for some thoughts on this. We are looking at a compromise solution.

ShonM commented 8 years ago

Aha. Here's how I ended up at this pull request:

  1. I read the docs at http://docs.grafana.org/tutorials/hubot_howto/ and not the docs from this specific module
  2. I checked open pulls but not issues, since it seemed very straight-forward

Thank you for linking me to the correct issue so I can watch it for changes.