Newrelic: подключаемый модуль Cloudwatch с ответами AWS Autoscaling Groups, возвращающими нуль?

Я использую подключаемый модуль Cloudwatch для Newrelic, который можно найти здесь: https://github.com/brettcave/newrelic_aws_cloudwatch_plugin.

Однако по какой-то причине все мои ответы возвращаются nil:

[2014-09-19 12:43:15 UTC] INFO: Retrieving statistics: {:namespace=>"AWS/EC2", :metric_name=>"DiskWriteOps", :statistic=>"Sum", :unit=>"Count", :dimension=>{:name=>"AutoScalingGroupName", :value=>"AUTOSCALER-BackendGroup-19N8SYDEIPGYV"}, :period=>60, :start_time=>"2014-09-19T12:41:15Z", :component_name=>"AUTOSCALER-BackendGroup-19N8SYDEIPGYV", :end_time=>"2014-09-19T12:41:45Z", :dimensions=>[{:name=>"AutoScalingGroupName", :value=>"AUTOSCALER-BackendGroup-19N8SYDEIPGYV"}]}
[2014-09-19 12:43:15 UTC] INFO: Retrieved statistics: {:datapoints=>[], :label=>"DiskWriteOps", :response_metadata=>{:request_id=>"3cb0c8a6-3ffa-11e4-aea1-91b035de76f7"}}
[2014-09-19 12:43:15 UTC] DEBUG: metric_name: DiskWriteOps, statistic: Sum, unit: Count, response: nil

Это код, описанный в приведенной выше ссылке, который соответствует выводу команды aws cloudwatch list-metrics --namespace "AWS/EC2".

module NewRelicAWS
 module Collectors
    class ASG < Base
      def initialize(access_key, secret_key, region, options)
        super(access_key, secret_key, region, options)
        @asg = AWS::AutoScaling.new(
          :access_key_id => @aws_access_key,
          :secret_access_key => @aws_secret_key,
          :region => @aws_region
        )
      end

def groups @asg.groups end def metric_list [ ["CPUUtilization", "Average", "Percent"], ["DiskReadOps", "Sum", "Count"], ["DiskWriteOps", "Sum", "Count"], ["DiskWriteBytes" , "Sum", "Bytes"], ["NetworkIn", "Sum", "Bytes"], ["NetworkOut", "Sum", "Bytes"] ] end def collect data_points = [] groups.each do |group| metric_list.each do |(metric_name, statistic, unit)| data_point = get_data_point( :namespace => "AWS/EC2", :metric_name => metric_name, :statistic => statistic, :unit => unit, :dimension => { :name => "AutoScalingGroupName", :value => group.name }, :period => 60, :start_time => (Time.now.utc-120).iso8601, :component_name => group.name ) NewRelic::PlatformLogger.debug("metric_name: #{metric_name}, statistic: #{statistic}, unit: #{unit}, response: #{data_point.inspect}") unless data_point.nil? data_points << data_point end end end data_points end end end end

This is nearly identical to the EC2 plugin, though the EC2 plugin works. Any idea what could be wrong?

Заранее спасибо.


person stephencoetzee    schedule 19.09.2014    source источник


Ответы (1)


У вас работает официальный плагин New Relic? https://github.com/newrelic-platform/newrelic_aws_cloudwatch_plugin

person karlpcrowley    schedule 19.09.2014
comment
К сожалению, официальный плагин не поддерживает ASG, и этот плагин работал у меня раньше. - person stephencoetzee; 20.09.2014