Explorar o código

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

Craig Miskell %!s(int64=8) %!d(string=hai) anos
pai
achega
61e6f63b32
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      public/app/plugins/datasource/prometheus/datasource.ts

+ 3 - 0
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) +