Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/shared/integrations/prometheus')
-rw-r--r--app/views/shared/integrations/prometheus/_custom_metrics.html.haml28
-rw-r--r--app/views/shared/integrations/prometheus/_help.html.haml8
-rw-r--r--app/views/shared/integrations/prometheus/_metrics.html.haml38
-rw-r--r--app/views/shared/integrations/prometheus/_show.html.haml7
4 files changed, 81 insertions, 0 deletions
diff --git a/app/views/shared/integrations/prometheus/_custom_metrics.html.haml b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml
new file mode 100644
index 00000000000..896249c6163
--- /dev/null
+++ b/app/views/shared/integrations/prometheus/_custom_metrics.html.haml
@@ -0,0 +1,28 @@
+- project = local_assigns.fetch(:project)
+
+.col-lg-3
+ %p
+ = s_('PrometheusService|Custom metrics require Prometheus installed on a cluster with environment scope "*" OR a manually configured Prometheus to be available.')
+ = link_to s_('PrometheusService|More information'), help_page_path('operations/metrics/index.md', anchor: 'adding-custom-metrics'), target: '_blank', rel: "noopener noreferrer"
+
+.col-lg-9
+ .card.custom-monitored-metrics.js-panel-custom-monitored-metrics{ data: { qa_selector: 'custom_metrics_container', active_custom_metrics: project_prometheus_metrics_path(project), environments_data: environments_list_data, service_active: "#{integration.active}" } }
+ .card-header
+ %strong
+ = s_('PrometheusService|Custom metrics')
+ = gl_badge_tag 0, nil, class: 'js-custom-monitored-count'
+ = link_to s_('PrometheusService|New metric'), new_project_prometheus_metric_path(project), class: 'btn gl-button btn-confirm gl-ml-auto js-new-metric-button hidden', data: { qa_selector: 'new_metric_button' }
+ .card-body
+ .flash-container.hidden
+ .flash-warning
+ .flash-text
+ .loading-metrics.js-loading-custom-metrics
+ %p.m-3
+ = gl_loading_icon(inline: true, css_class: 'metrics-load-spinner')
+ = s_('PrometheusService|Finding custom metrics...')
+ .empty-metrics.hidden.js-empty-custom-metrics
+ %p.text-tertiary.m-3.js-no-active-integration-text.hidden
+ = s_('PrometheusService|Enable Prometheus to define custom metrics, using either option above')
+ %p.text-tertiary.m-3.js-new-metric-text.hidden
+ = s_('PrometheusService|No custom metrics have been created. Create one using the button above')
+ %ul.list-unstyled.metrics-list.hidden.js-custom-metrics-list
diff --git a/app/views/shared/integrations/prometheus/_help.html.haml b/app/views/shared/integrations/prometheus/_help.html.haml
new file mode 100644
index 00000000000..f40d8638845
--- /dev/null
+++ b/app/views/shared/integrations/prometheus/_help.html.haml
@@ -0,0 +1,8 @@
+- if @project
+ = render 'shared/prometheus_configuration_banner', project: @project, integration: integration, header_tag: :h4
+ %hr
+
+%h4.gl-mb-3
+ = s_('PrometheusService|Manual configuration')
+%p
+ = s_('PrometheusService|Auto configuration settings are used unless you override their values here.')
diff --git a/app/views/shared/integrations/prometheus/_metrics.html.haml b/app/views/shared/integrations/prometheus/_metrics.html.haml
new file mode 100644
index 00000000000..8ee0ddfa1b1
--- /dev/null
+++ b/app/views/shared/integrations/prometheus/_metrics.html.haml
@@ -0,0 +1,38 @@
+- project = local_assigns.fetch(:project)
+
+= render 'shared/integrations/prometheus/custom_metrics', project: project, integration: integration
+
+.col-lg-3
+ %p
+ = s_('PrometheusService|Common metrics are automatically monitored based on a library of metrics from popular exporters.')
+ = link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus'), target: '_blank', rel: "noopener noreferrer"
+
+.col-lg-9
+ .card.js-panel-monitored-metrics{ data: { active_metrics: active_common_project_prometheus_metrics_path(project, :json), metrics_help_path: help_page_path('user/project/integrations/prometheus_library/index') } }
+ .card-header
+ %strong
+ = s_('PrometheusService|Common metrics')
+ = gl_badge_tag 0, nil, class: 'js-monitored-count'
+ .card-body
+ .loading-metrics.js-loading-metrics
+ %p.m-3
+ = gl_loading_icon(inline: true, css_class: 'metrics-load-spinner')
+ = s_('PrometheusService|Finding and configuring metrics...')
+ .empty-metrics.hidden.js-empty-metrics
+ %p.text-tertiary.m-3
+ = s_('PrometheusService|Waiting for your first deployment to an environment to find common metrics')
+ %ul.list-unstyled.metrics-list.hidden.js-metrics-list
+
+ .card.hidden.js-panel-missing-env-vars
+ .card-header
+ = sprite_icon('chevron-lg-right', css_class: 'panel-toggle js-panel-toggle-right' )
+ = sprite_icon('chevron-lg-down', css_class: 'panel-toggle js-panel-toggle-down hidden' )
+ = s_('PrometheusService|Missing environment variable')
+ = gl_badge_tag 0, nil, class: 'js-env-var-count'
+ .card-body.hidden
+ .flash-container
+ .flash-notice
+ .flash-text
+ = s_("PrometheusService|To set up automatic monitoring, add the environment variable %{variable} to exporter's queries." % { variable: "<code>$CI_ENVIRONMENT_SLUG</code>" }).html_safe
+ = link_to s_('PrometheusService|More information'), help_page_path('operations/metrics/dashboards/variables.md', anchor: 'query-variables')
+ %ul.list-unstyled.metrics-list.js-missing-var-metrics-list
diff --git a/app/views/shared/integrations/prometheus/_show.html.haml b/app/views/shared/integrations/prometheus/_show.html.haml
new file mode 100644
index 00000000000..0e133e66794
--- /dev/null
+++ b/app/views/shared/integrations/prometheus/_show.html.haml
@@ -0,0 +1,7 @@
+.row
+ .col-lg-3
+ %h4.gl-mt-0
+ = s_('PrometheusService|Metrics')
+
+.row.gl-mb-3.prometheus-metrics-monitoring.js-prometheus-metrics-monitoring
+ = render 'shared/integrations/prometheus/metrics', project: @project, integration: integration