obfuscurity / tasseo

Live dashboard for Graphite
Other
1.53k stars 127 forks source link

Uncaught TypeError: Cannot read property 'points' of undefined #97

Closed mauricioabreu closed 9 years ago

mauricioabreu commented 9 years ago

Hey,

I am sorry if my report lacks of information.

I am having this error after starting tasseo running foreman start I can see this error on Google Chrome console.

Versions used: Ruby 1.9.2 (same as listed in the documentation) Centos 6.4 (ruby-devel package and rvm) collectd 5.4.x InfluxDB 0.9

I am setting INFLUXDB_URL and INFLUXDB_AUTH environment variables pointing to my local machine.

INFLUXDB_URL = http://192.168.33.15:8086/db/test
INFLUXDB_AUTH=test:test

Why do I need to use open as described in the docs?

Follows the code raising the error in the title:

  refreshMetric: function(metric, period) {
    var self = this;

    $.ajax({
      url: this.urlForMetric(metric, period),
      dataType: 'json',
      error: function(xhr, textStatus, errorThrown) { console.log(errorThrown); },
      success: function(metricResult) {
        var datapoints = metricResult[0].points;
        var newDatapoints = _.map(datapoints, function(datapoint) {
          return { x: datapoint[0], y: datapoint[datapoint.length - 1] } // <--- THIS LINE
        })
        metric.update(newDatapoints)
      }
    })
  },

Do you need more info? My InfluxDB and collectd instances are up and running fine.

obfuscurity commented 9 years ago

Much of InfluxDB has changed since the initial implementation was added back in 2013. I don't use it personally. If someone is able to maintain this backend it would be great to get a fix, but if not, we may need to deprecate support for it.

mauricioabreu commented 9 years ago

I agree with you. It is probably a InfluxDB / Tasseo incompatibility. Well I don't know Ruby but I think I am going to learn some Ruby to get a fix here.

Thank you! :-)

Can I close this?

obfuscurity commented 9 years ago

Actually the relevant bits are all Javascript. Sure, you can close it if you'd like, or leave it open and reference it when/if you submit a PR.

michalbachowski commented 9 years ago

InfluxDB has changed a lot in version 0.9 (eg: the endpoint URL and response structure). I have working datasource for 0.9, will create pull request, just have to clean it up a bit.

obfuscurity commented 9 years ago

Fixed in https://github.com/obfuscurity/tasseo/pull/102.