Class: Fluent::Plugin::KubernetesMetricsInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_kubernetes_metrics.rb

Instance Method Summary collapse

Instance Method Details

#closeObject



97
98
99
100
101
# File 'lib/fluent/plugin/in_kubernetes_metrics.rb', line 97

def close
  @watchers.each &:finish if @watchers

  super
end

#configure(conf) ⇒ Object



76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/fluent/plugin/in_kubernetes_metrics.rb', line 76

def configure(conf)
  super

  if @use_rest_client
    raise Fluentd::ConfigError, 'node_name is required' if @node_name.nil? || @node_name.empty?
  else
    raise Fluentd::ConfigError, 'node_names is required' if @node_names.nil? || @node_names.empty?
  end

  parse_tag
  initialize_client
end

#startObject



89
90
91
92
93
94
95
# File 'lib/fluent/plugin/in_kubernetes_metrics.rb', line 89

def start
  super

  timer_execute :metric_scraper, @interval, &method(:scrape_metrics)
  timer_execute :stats_metric_scraper, @interval, &method(:scrape_stats_metrics)
  timer_execute :cadvisor_metric_scraper, @interval, &method(:scrape_cadvisor_metrics)
end