From 3d9836aff47fe4647c2b2f227e3a15cc73bd60c6 Mon Sep 17 00:00:00 2001 From: Rainer Hahnekamp Date: Fri, 9 Oct 2015 23:49:27 +0200 Subject: [PATCH 1/2] bug fixes --- lib/cloudwatch/sender/base.rb | 2 +- lib/cloudwatch/sender/fetcher/base.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cloudwatch/sender/base.rb b/lib/cloudwatch/sender/base.rb index a0b5637..31fdbab 100644 --- a/lib/cloudwatch/sender/base.rb +++ b/lib/cloudwatch/sender/base.rb @@ -5,7 +5,7 @@ class Base def initialize(options, metric_prefix) @metric_prefix = metric_prefix - @influxdb = InfluxDB::Client.new "graphite", + @influxdb = InfluxDB::Client.new options["influx_database"] || "graphite", :username => options["influx_username"], :password => options["influx_password"], :use_ssl => options["influx_ssl"] || false, diff --git a/lib/cloudwatch/sender/fetcher/base.rb b/lib/cloudwatch/sender/fetcher/base.rb index 1f799b6..fff1160 100644 --- a/lib/cloudwatch/sender/fetcher/base.rb +++ b/lib/cloudwatch/sender/fetcher/base.rb @@ -26,7 +26,7 @@ def extract_class_name(component_meta) end def fetcher(component_meta) - namespace.start_with?("AWS/") ? Object.const_get(class_namespace component_meta) : Cloudwatch::Sender::Fetcher::Custom + namespace.start_with?("AWS/EC2") || namespace.start_with?("AWS/SQS") ? Object.const_get(class_namespace component_meta) : Cloudwatch::Sender::Fetcher::Custom end def class_namespace(component_meta) From b60e9942becc1e402d224098bdde5975abf239f7 Mon Sep 17 00:00:00 2001 From: Rainer Hahnekamp Date: Mon, 12 Oct 2015 17:15:44 +0200 Subject: [PATCH 2/2] fixed issues according to comments from last commit --- lib/cloudwatch/sender/base.rb | 2 +- lib/cloudwatch/sender/fetcher/base.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cloudwatch/sender/base.rb b/lib/cloudwatch/sender/base.rb index 31fdbab..637442b 100644 --- a/lib/cloudwatch/sender/base.rb +++ b/lib/cloudwatch/sender/base.rb @@ -5,7 +5,7 @@ class Base def initialize(options, metric_prefix) @metric_prefix = metric_prefix - @influxdb = InfluxDB::Client.new options["influx_database"] || "graphite", + @influxdb = InfluxDB::Client.new options["influx_database"], :username => options["influx_username"], :password => options["influx_password"], :use_ssl => options["influx_ssl"] || false, diff --git a/lib/cloudwatch/sender/fetcher/base.rb b/lib/cloudwatch/sender/fetcher/base.rb index fff1160..ae5320a 100644 --- a/lib/cloudwatch/sender/fetcher/base.rb +++ b/lib/cloudwatch/sender/fetcher/base.rb @@ -26,7 +26,7 @@ def extract_class_name(component_meta) end def fetcher(component_meta) - namespace.start_with?("AWS/EC2") || namespace.start_with?("AWS/SQS") ? Object.const_get(class_namespace component_meta) : Cloudwatch::Sender::Fetcher::Custom + Object.const_defined?(class_namespace component_meta) ? Object.const_get(class_namespace component_meta) : Cloudwatch::Sender::Fetcher::Custom end def class_namespace(component_meta)