|
|
|
@ -2,7 +2,7 @@ import { AnalyticsTask, AnalyticsTaskType } from '../models/analytics_task_model
|
|
|
|
|
import * as AnalyticUnit from '../models/analytic_unit_model'; |
|
|
|
|
import * as AnalyticUnitCache from '../models/analytic_unit_cache_model'; |
|
|
|
|
import { AnalyticsService } from './analytics_service'; |
|
|
|
|
import { HASTIC_API_KEY } from '../config'; |
|
|
|
|
import { HASTIC_API_KEY, GRAFANA_URL } from '../config'; |
|
|
|
|
|
|
|
|
|
import { queryByMetric } from 'grafana-datasource-kit'; |
|
|
|
|
|
|
|
|
@ -36,7 +36,15 @@ export class DataPuller {
|
|
|
|
|
throw Error(`data puller: can't pull undefined unit`); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return queryByMetric(unit.metric, unit.panelUrl, from, to, HASTIC_API_KEY); |
|
|
|
|
let panelUrl; |
|
|
|
|
if(GRAFANA_URL !== null) { |
|
|
|
|
panelUrl = GRAFANA_URL; |
|
|
|
|
} else { |
|
|
|
|
panelUrl = unit.panelUrl; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return queryByMetric(unit.metric, panelUrl, from, to, HASTIC_API_KEY); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private pushData(unit: AnalyticUnit.AnalyticUnit, data: any) { |
|
|
|
|