Align queries to prometheus with the step to ensure 'rate' type expressions get consistent results

pull/10434/head
Craig Miskell 8 years ago
parent ccf1a5124b
commit 61e6f63b32
  1. 3
      public/app/plugins/datasource/prometheus/datasource.ts

@ -173,6 +173,9 @@ export class PrometheusDatasource {
throw { message: 'Invalid time range' };
}
start = start - (start % query.step);
end = end - (end % query.step) + query.step;
var url =
'/api/v1/query_range?query=' +
encodeURIComponent(query.expr) +

Loading…
Cancel
Save