diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-31 15:06:41 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-31 15:06:41 +0000 |
commit | 083d64c6468a070ae7b0b406ead8d87da27d1d22 (patch) | |
tree | ba92a9b5b6418f805ede9ef05b371d82d2c1d27d /app/controllers/projects/grafana_api_controller.rb | |
parent | 0be510a49f6e4f8e27b19b707fd1dac61571f78f (diff) | |
download | gitlab-ce-083d64c6468a070ae7b0b406ead8d87da27d1d22.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/projects/grafana_api_controller.rb')
-rw-r--r-- | app/controllers/projects/grafana_api_controller.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/projects/grafana_api_controller.rb b/app/controllers/projects/grafana_api_controller.rb index 4bdf4c12cac..85f47b92e58 100644 --- a/app/controllers/projects/grafana_api_controller.rb +++ b/app/controllers/projects/grafana_api_controller.rb @@ -2,6 +2,9 @@ class Projects::GrafanaApiController < Projects::ApplicationController include RenderServiceResults + include MetricsDashboard + + before_action :validate_feature_enabled!, only: [:metrics_dashboard] def proxy result = ::Grafana::ProxyService.new( @@ -19,6 +22,14 @@ class Projects::GrafanaApiController < Projects::ApplicationController private + def metrics_dashboard_params + params.permit(:embedded, :grafana_url) + end + + def validate_feature_enabled! + render_403 unless Feature.enabled?(:gfm_grafana_integration) + end + def query_params params.permit(:query, :start, :end, :step) end |