Class: Gitlab::AlertManagement::Payload::ManagedPrometheus
- Inherits:
-
Prometheus
- Object
- Base
- Prometheus
- Gitlab::AlertManagement::Payload::ManagedPrometheus
- Defined in:
- lib/gitlab/alert_management/payload/managed_prometheus.rb
Constant Summary
Constants inherited from Prometheus
Prometheus::ADDITIONAL_SEVERITY_MAPPING, Prometheus::METRIC_TIME_WINDOW
Constants inherited from Base
Base::SEVERITY_MAPPING, Base::UNMAPPED_SEVERITY
Instance Attribute Summary
Attributes inherited from Base
#integration, #payload, #project
Instance Method Summary collapse
Methods inherited from Prometheus
#has_required_attributes?, #monitoring_tool
Methods included from Utils::Override
#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!
Methods inherited from Base
#alert_params, attribute, #gitlab_fingerprint, #has_required_attributes?, #resolved?, #severity
Methods included from Routing
add_helpers, includes_helpers, redirect_legacy_paths, url_helpers
Methods included from Utils::StrongMemoize
#clear_memoization, #strong_memoize, #strong_memoized?
Instance Method Details
#environment ⇒ Object
34 35 36 |
# File 'lib/gitlab/alert_management/payload/managed_prometheus.rb', line 34 def environment gitlab_alert&.environment || super end |
#full_query ⇒ Object
30 31 32 |
# File 'lib/gitlab/alert_management/payload/managed_prometheus.rb', line 30 def full_query gitlab_alert&.full_query || super end |
#gitlab_alert ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/gitlab/alert_management/payload/managed_prometheus.rb', line 16 def gitlab_alert strong_memoize(:gitlab_alert) do next unless metric_id || gitlab_prometheus_alert_id alerts = Projects::Prometheus::AlertsFinder .new(project: project, metric: metric_id, id: gitlab_prometheus_alert_id) .execute next if alerts.blank? || alerts.size > 1 alerts.first end end |
#metrics_dashboard_url ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/gitlab/alert_management/payload/managed_prometheus.rb', line 38 def metrics_dashboard_url return unless gitlab_alert metrics_dashboard_project_prometheus_alert_url( project, gitlab_alert.prometheus_metric_id, environment_id: environment.id, embedded: true, ** ) end |