javascript - Developing Grafana Datasource -
i wanna build own datasource show data in grafana graph. now, testing de fake simple json in grafana, figure out how things work behind scenes. have code, query data wanna show in grafana:
query(options) { var query = this.buildqueryparameters(options); query.targets = query.targets.filter(t => !t.hide); if (query.targets.length <= 0) { return this.q.when({data: []}); } console.log('query return: '); console.log(this.dorequest({url: this.url + '/query',data: query,method: 'post'})); console.log('\n'); var teste = this.dorequest({ url: this.url + '/query', data: query, method: 'post' }); console.log('teste return: '); console.log(teste); console.log('\n'); return teste; } and, receive return : result of console.log(teste)
how can acess teste.$$state.value.data["0"].datapoints["0"] example?
if tried acess teste or teste.$$state, thats ok. wheh try teste.$$state.pur or atributtes in teste.$$state tree got undefined response.
Comments
Post a Comment