Class: Fluent::Plugin::JfrogSendMetricsOutput

Inherits:
Output
  • Object
show all
Defined in:
lib/fluent/plugin/out_jfrog_send_metrics.rb

Instance Method Summary collapse

Instance Method Details

#configure(conf) ⇒ Object

‘configure` is called before `start`. ’conf’ is a ‘Hash` that includes the configuration parameters. If the configuration is invalid, raise `Fluent::ConfigError`.

Raises:

  • (Fluent::ConfigError)


37
38
39
40
41
42
# File 'lib/fluent/plugin/out_jfrog_send_metrics.rb', line 37

def configure(conf)
  super
  raise Fluent::ConfigError, 'Must define the vendor to use for getting the metrics.' if @target_platform == ''

  raise Fluent::ConfigError, 'Must define the apikey to use for authentication.' if @apikey == ''
end

#process(tag, es) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fluent/plugin/out_jfrog_send_metrics.rb', line 44

def process(tag, es)
  es.each do |time, record|
    if @target_platform == 'NEWRELIC'
      vendor = NewRelicMetrics.new(@apikey, @url)
      vendor.send_metrics(record, @http_proxy)
    elsif @target_platform == 'DATADOG'
      vendor = DatadogMetrics.new(@apikey, @url)
      vendor.send_metrics(@ddtags, record, @http_proxy)
    end
  end
end