Class: Prometheus::ApiClient::Cadvisor::Node

Inherits:
CadvisorClient show all
Defined in:
lib/prometheus/api_client/cadvisor.rb

Overview

A client with special labels for node cadvisor metrics

Constant Summary

Constants inherited from Prometheus::ApiClient::Client

Prometheus::ApiClient::Client::DEFAULT_ARGS

Instance Method Summary collapse

Methods inherited from CadvisorClient

#get, #update_query

Methods inherited from Prometheus::ApiClient::Client

#faraday_headers, #faraday_options, #faraday_proxy, #faraday_request, #faraday_ssl, #get, #label, #query, #query_range, #run_command, #targets

Constructor Details

#initialize(options = {}) ⇒ Node

Returns a new instance of Node.



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/prometheus/api_client/cadvisor.rb', line 36

def initialize(options = {})
  instance = options[:instance]

  # if no instance is given, assume we want data on all nodes
  @labels = if instance
              'job="kubernetes-cadvisor",id="/",' \
              "instance=\"#{instance}\""
            else
              'job="kubernetes-cadvisor",id="/"'
            end

  super(options)
end