Class: Prometheus::ApiClient::Cadvisor::Container
- Inherits:
-
Prometheus::ApiClient::Client
- Object
- Prometheus::ApiClient::Client
- Prometheus::ApiClient::Cadvisor::Container
- Defined in:
- lib/prometheus/api_client/cadvisor.rb
Overview
A client with special labels for container cadvisor metrics
Constant Summary
Constants inherited from Prometheus::ApiClient::Client
Prometheus::ApiClient::Client::DEFAULT_ARGS
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Container
constructor
A new instance of Container.
- #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 = {}) ⇒ Container
Returns a new instance of Container.
66 67 68 69 70 71 72 73 74 |
# File 'lib/prometheus/api_client/cadvisor.rb', line 66 def initialize( = {}) container_name = args[:container_name] pod_name = args[:pod_name] namespace = args[:namespace] || 'default' @labels = "job=\"kubernetes-cadvisor\",namespace=\"#{namespace}\"," \ "pod_name=\"#{pod_name}\",container_name=\"#{container_name}\"" super() end |
Instance Method Details
#query(options) ⇒ Object
76 77 78 79 |
# File 'lib/prometheus/api_client/cadvisor.rb', line 76 def query() [:query] = update_query([:query], @labels) super() end |
#query_range(options) ⇒ Object
81 82 83 84 |
# File 'lib/prometheus/api_client/cadvisor.rb', line 81 def query_range() [:query] = update_query([:query], @labels) super() end |