summaryrefslogtreecommitdiff
path: root/app/controllers/projects/ci/prometheus_metrics/histograms_controller.rb
blob: 003441d4b9124ed42f09a0b02af414d7463363c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

module Projects
  module Ci
    module PrometheusMetrics
      class HistogramsController < Projects::ApplicationController
        feature_category :pipeline_authoring

        respond_to :json, only: [:create]

        def create
          result = ::Ci::PrometheusMetrics::ObserveHistogramsService.new(project, permitted_params).execute

          render json: result.payload, status: result.http_status
        end

        private

        def permitted_params
          params.permit(histograms: [:name, :value])
        end
      end
    end
  end
end