diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/grafana_api_controller.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/controllers/projects/grafana_api_controller.rb b/app/controllers/projects/grafana_api_controller.rb index 380a18818ab..c9870f1be2b 100644 --- a/app/controllers/projects/grafana_api_controller.rb +++ b/app/controllers/projects/grafana_api_controller.rb @@ -9,7 +9,7 @@ class Projects::GrafanaApiController < Projects::ApplicationController project, params[:datasource_id], params[:proxy_path], - query_params.to_h + prometheus_params ).execute return continue_polling_response if result.nil? @@ -25,6 +25,15 @@ class Projects::GrafanaApiController < Projects::ApplicationController end def query_params - params.permit(:query, :start, :end, :step) + params.permit(:query, :start_time, :end_time, :step) + end + + def prometheus_params + query_params.to_h + .except(:start_time, :end_time) + .merge( + start: query_params[:start_time], + end: query_params[:end_time] + ) end end |