Class: Gitlab::Prometheus::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/prometheus/adapter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project, cluster) ⇒ Adapter



8
9
10
11
# File 'lib/gitlab/prometheus/adapter.rb', line 8

def initialize(project, cluster)
  @project = project
  @cluster = cluster
end

Instance Attribute Details

#clusterObject (readonly)

Returns the value of attribute cluster.



6
7
8
# File 'lib/gitlab/prometheus/adapter.rb', line 6

def cluster
  @cluster
end

#projectObject (readonly)

Returns the value of attribute project.



6
7
8
# File 'lib/gitlab/prometheus/adapter.rb', line 6

def project
  @project
end

Instance Method Details

#find_cluster_prometheus_adapterObject



17
18
19
20
# File 'lib/gitlab/prometheus/adapter.rb', line 17

def find_cluster_prometheus_adapter
  integration = cluster&.integration_prometheus
  integration if integration&.available?
end

#prometheus_adapterObject



13
14
15
# File 'lib/gitlab/prometheus/adapter.rb', line 13

def prometheus_adapter
  @prometheus_adapter ||= find_cluster_prometheus_adapter
end