@@ -20,13 +20,10 @@ module Cadvisor
2020 #
2121 # A default client is created if options is omitted.
2222 class Node < Client
23- def initialize ( ** options )
23+ def initialize ( options = { } )
2424 instance = options [ :instance ]
25- region = options [ :region ] || 'infra'
26- zone = options [ :zone ] || 'default'
2725
28- @labels = "job=\" kubernetes-cadvisor\" ,region=\" #{ region } \" ," \
29- "zone=\" #{ zone } \" ,instance=\" #{ instance } \" "
26+ @labels = "job=\" kubernetes-cadvisor\" ,instance=\" #{ instance } \" "
3027 super ( options )
3128 end
3229
@@ -43,14 +40,11 @@ def query_range(options)
4340
4441 # A client with special labels for pod cadvisor metrics
4542 class Pod < Client
46- def initialize ( ** options )
43+ def initialize ( options = { } )
4744 pod_name = options [ :pod_name ]
4845 namespace = options [ :namespace ] || 'default'
49- region = options [ :region ] || 'infra'
50- zone = options [ :zone ] || 'default'
5146
52- @labels = "job=\" kubernetes-cadvisor\" ,region=\" #{ region } \" ," \
53- "zone=\" #{ zone } \" ,namespace=\" #{ namespace } \" ," \
47+ @labels = "job=\" kubernetes-cadvisor\" ,namespace=\" #{ namespace } \" ," \
5448 "pod_name=\" #{ pod_name } \" ,container_name=\" POD\" "
5549 super ( options )
5650 end
@@ -68,15 +62,12 @@ def query_range(options)
6862
6963 # A client with special labels for container cadvisor metrics
7064 class Container < Client
71- def initialize ( ** options )
65+ def initialize ( options = { } )
7266 container_name = args [ :container_name ]
7367 pod_name = args [ :pod_name ]
7468 namespace = args [ :namespace ] || 'default'
75- region = options [ :region ] || 'infra'
76- zone = options [ :zone ] || 'default'
7769
78- @labels = "job=\" kubernetes-cadvisor\" ,region=\" #{ region } \" ," \
79- "zone=\" #{ zone } \" ,namespace=\" #{ namespace } \" ," \
70+ @labels = "job=\" kubernetes-cadvisor\" ,namespace=\" #{ namespace } \" ," \
8071 "pod_name=\" #{ pod_name } \" ,container_name=\" #{ container_name } \" "
8172 super ( options )
8273 end
0 commit comments