Class: Prometheus::ApiClient::Cadvisor::Container
- Inherits:
-
CadvisorClient
- Object
- Prometheus::ApiClient::Client
- CadvisorClient
- 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.
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 = {}) ⇒ Container
Returns a new instance of Container.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/prometheus/api_client/cadvisor.rb', line 71 def initialize( = {}) container_name = [:container_name] pod_name = [:pod_name] namespace = [:namespace] || 'default' # if no container_name is given, assume we want data on all containers @labels = if container_name 'job="kubernetes-cadvisor",' \ "namespace=\"#{namespace}\",pod_name=\"#{pod_name}\"," \ "container_name=\"#{container_name}\"" else 'job="kubernetes-cadvisor",container_name!="POD"' end super() end |