2022-07-16 23:28:13 +05:30
= gitlab_ui_form_for @application_setting, url: metrics_and_profiling_admin_application_settings_path(anchor: 'js-prometheus-settings'), html: { class: 'fieldset-form' } do |f|
2022-10-11 01:57:18 +05:30
= form_errors(@application_setting)
2018-05-09 12:01:36 +05:30
%fieldset
.form-group
2022-07-16 23:28:13 +05:30
- prometheus_help_link_url = help_page_path('administration/monitoring/prometheus/gitlab_metrics')
- prometheus_help_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: prometheus_help_link_url }
= f.gitlab_ui_checkbox_component :prometheus_metrics_enabled,
2022-10-11 01:57:18 +05:30
_('Enable GitLab Prometheus metrics endpoint'),
help_text: s_('AdminSettings|Enable collection of application metrics. Restart required. %{link_start}Learn how to export metrics to Prometheus%{link_end}.').html_safe % { link_start: prometheus_help_link_start, link_end: '</a>'.html_safe }
2022-07-16 23:28:13 +05:30
.form-text.gl-text-gray-500.gl-pl-6
2018-11-08 19:23:39 +05:30
- unless Gitlab::Metrics.metrics_folder_present?
2022-07-16 23:28:13 +05:30
- icon_link = link_to sprite_icon('question-o'), help_page_path('administration/monitoring/prometheus/gitlab_metrics', anchor: 'metrics-shared-directory'), target: '_blank', rel: 'noopener noreferrer'
= s_('AdminSettings|%{strongStart}WARNING:%{strongEnd} Environment variable %{environment_variable} does not exist or is not pointing to a valid directory. %{icon_link}').html_safe % { strongStart: '<strong class="gl-text-red-500">'.html_safe, strongEnd: '</strong>'.html_safe, environment_variable: '<code>prometheus_multiproc_dir</code>'.html_safe, icon_link: icon_link }
2020-05-24 23:13:21 +05:30
.form-group
2021-10-27 15:23:28 +05:30
= f.label :metrics_method_call_threshold, _('Method call threshold (ms)'), class: 'label-bold'
2021-03-11 19:13:27 +05:30
= f.number_field :metrics_method_call_threshold, class: 'form-control gl-form-input'
2020-05-24 23:13:21 +05:30
.form-text.text-muted
2021-10-27 15:23:28 +05:30
Only track method calls that take longer to complete than the given duration.
2018-05-09 12:01:36 +05:30
2022-11-25 23:54:43 +05:30
= f.submit _('Save changes'), pajamas_button: true