diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 12:09:31 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-03 12:09:31 +0300 |
commit | 04baa85554ff13bdd4d6f4e6bb24119d17608fee (patch) | |
tree | 7cb9c0977e09d97da340f48703d79b2dbd3579a0 /app/controllers | |
parent | 42f41de46525ce0065f02ee07c1a79f5669526a0 (diff) |
Add latest changes from gitlab-org/gitlab@master
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 |