Pass utcOffset

This commit is contained in:
Ivana
2021-09-21 18:38:05 +02:00
parent 9e0a871c54
commit 520772fdf2
@@ -295,7 +295,12 @@ export class PrometheusDatasource extends DataSourceWithBackend<PromQuery, PromO
this.access === 'proxy' && options.app === CoreApp.Explore && !options.targets.some((query) => query.exemplar);
if (shouldRunBackendQuery) {
return super.query(options).pipe(map((response) => transformV2(response, options)));
const targets = options.targets.map((target) => ({
...target,
// We need to pass utcOffsetSec to backend to calculate aligned range
utcOffsetSec: this.timeSrv.timeRange().to.utcOffset() * 60,
}));
return super.query({ ...options, targets }).pipe(map((response) => transformV2(response, options)));
// Run queries trough browser/proxy
} else {
const start = this.getPrometheusTime(options.range.from, false);