Class: Prometheus::ApiClient::Cadvisor::Node
- Inherits:
-
Prometheus::ApiClient::Client
- Object
- Prometheus::ApiClient::Client
- Prometheus::ApiClient::Cadvisor::Node
- Defined in:
- lib/prometheus/api_client/cadvisor.rb
Overview
Create a Prometheus API client:
A default client is created if options is omitted.
Constant Summary
Constants inherited from Prometheus::ApiClient::Client
Prometheus::ApiClient::Client::DEFAULT_ARGS
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Node
constructor
A new instance of Node.
- #query(options) ⇒ Object
- #query_range(options) ⇒ Object
Methods inherited from Prometheus::ApiClient::Client
#faraday_headers, #faraday_options, #faraday_proxy, #faraday_verify_ssl, #get, #label, #run_command, #targets, #update_query
Constructor Details
#initialize(options = {}) ⇒ Node
Returns a new instance of Node.
23 24 25 26 27 28 29 |
# File 'lib/prometheus/api_client/cadvisor.rb', line 23 def initialize( = {}) instance = [:instance] @labels = "job=\"kubernetes-cadvisor\",instance=\"#{instance}\"," \ 'id="/"' super() end |
Instance Method Details
#query(options) ⇒ Object
31 32 33 34 |
# File 'lib/prometheus/api_client/cadvisor.rb', line 31 def query() [:query] = update_query([:query], @labels) super() end |
#query_range(options) ⇒ Object
36 37 38 39 |
# File 'lib/prometheus/api_client/cadvisor.rb', line 36 def query_range() [:query] = update_query([:query], @labels) super() end |