Class: Prometheus::ApiClient::Cadvisor::Pod
- Inherits:
-
Prometheus::ApiClient::Client
- Object
- Prometheus::ApiClient::Client
- Prometheus::ApiClient::Cadvisor::Pod
- Defined in:
- lib/prometheus/api_client/cadvisor.rb
Overview
A client with special labels for pod cadvisor metrics
Constant Summary
Constants inherited from Prometheus::ApiClient::Client
Prometheus::ApiClient::Client::DEFAULT_ARGS
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Pod
constructor
A new instance of Pod.
- #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 = {}) ⇒ Pod
Returns a new instance of Pod.
44 45 46 47 48 49 50 51 |
# File 'lib/prometheus/api_client/cadvisor.rb', line 44 def initialize( = {}) pod_name = [:pod_name] namespace = [:namespace] || 'default' @labels = "job=\"kubernetes-cadvisor\",namespace=\"#{namespace}\"," \ "pod_name=\"#{pod_name}\",container_name=\"POD\"" super() end |
Instance Method Details
#query(options) ⇒ Object
53 54 55 56 |
# File 'lib/prometheus/api_client/cadvisor.rb', line 53 def query() [:query] = update_query([:query], @labels) super() end |
#query_range(options) ⇒ Object
58 59 60 61 |
# File 'lib/prometheus/api_client/cadvisor.rb', line 58 def query_range() [:query] = update_query([:query], @labels) super() end |