Class: Prometheus::ApiClient::Cadvisor::Pod
- Inherits:
-
CadvisorClient
- Object
- Prometheus::ApiClient::Client
- CadvisorClient
- 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.
Methods inherited from CadvisorClient
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 = {}) ⇒ Pod
Returns a new instance of Pod.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/prometheus/api_client/cadvisor.rb', line 53 def initialize( = {}) pod_name = [:pod_name] namespace = [:namespace] || 'default' # if no pod_name is given, assume we want data on all pods @labels = if pod_name 'job="kubernetes-cadvisor",container_name="POD",' \ "pod_name=\"#{pod_name}\",namespace=\"#{namespace}\"" else 'job="kubernetes-cadvisor",container_name="POD"' end super() end |