2021-03-25 14:09:07 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
class UsageDataQueries < ::API::Base
|
|
|
|
before { authenticated_as_admin! }
|
|
|
|
|
2021-07-06 14:08:17 -04:00
|
|
|
feature_category :service_ping
|
2022-05-11 11:07:26 -04:00
|
|
|
urgency :low
|
2021-03-25 14:09:07 -04:00
|
|
|
|
|
|
|
namespace 'usage_data' do
|
|
|
|
before do
|
2022-05-06 11:09:03 -04:00
|
|
|
not_found! unless Feature.enabled?(:usage_data_queries_api, type: :ops)
|
2021-03-25 14:09:07 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
desc 'Get raw SQL queries for usage data SQL metrics' do
|
|
|
|
detail 'This feature was introduced in GitLab 13.11.'
|
|
|
|
end
|
|
|
|
|
|
|
|
get 'queries' do
|
|
|
|
Gitlab::QueryLimiting.disable!('https://gitlab.com/gitlab-org/gitlab/-/issues/325534')
|
|
|
|
|
2022-02-08 10:12:33 -05:00
|
|
|
queries = Gitlab::Usage::ServicePingReport.for(output: :metrics_queries)
|
2021-03-25 14:09:07 -04:00
|
|
|
|
|
|
|
present queries
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|