logstash-plugins / logstash-input-cloudwatch

A Logstash input to pull events from the Amazon Web Services CloudWatch API
Apache License 2.0
43 stars 28 forks source link

Cloudwatch input plugin- No Metrics to Query Error in 6.3.0 #51

Open maggieghamry opened 5 years ago

maggieghamry commented 5 years ago

Can you please help identify if there is a specific issue related to the namespace or IAM profile in this instance There are some indications based on the discuss thread that this worked in 6.2.1. Not sure if this is a new bug?

[2019-02-01T13:08:39,269][INFO ][logstash.inputs.cloudwatch] Polling CloudWatch API 
[2019-02-01T13:08:39,270][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin. 
Pipeline_id:cloudwatch 
Plugin: <LogStash::Inputs::CloudWatch access_key_id=>"secret", secret_access_key=><password>, namespace=>"AWS/EBS", metrics=>["VolumeQueueLength"], filters=>{"tag:Monitoring"=>"Yes"}, region=>"us-west-2", id=>"304367d8a0857399d9c633e61239f211e0b842b926b448773fa8b72b8ae166aa", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_43df151a-dca4-4e32-b603-f45d9bcf6a05", enable_metric=>true, charset=>"UTF-8">, role_session_name=>"logstash", statistics=>["SampleCount", "Average", "Minimum", "Maximum", "Sum"], interval=>900, period=>300, combined=>false> 
Error: No metrics to query 
Exception: RuntimeError 
Stack: /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-cloudwatch-2.2.4/lib/logstash/inputs/cloudwatch.rb:154:in `run' 
/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:512:in `inputworker' 
/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:505:in `block in start_input' 
input { 
cloudwatch { 
access_key_id => "secret" 
secret_access_key => "secret" 
namespace => "AWS/EBS" 
metrics => ["VolumeQueueLength"] 
filters => { "tag:Monitoring" => "Yes" } 
region => "us-west-2" 
} 
}
bhavya-cloudaeye commented 3 years ago

@maggieghamry I know its too long ago. But recently I too ran into the same issue. Were you able to resolve this back then?

arjunkrishnasb commented 3 years ago

I have the same issue :( I see similar questions in multiple sites, but still no replies. Kindly provide a solution for this. In my case i got the same lines as mentioned above. but at the beginning of the logs it says invalid token. But the creds i use are admin role based one and i am sure that should have access.

[2021-07-27T06:38:52,836][INFO ][logstash.inputs.cloudwatch][main][5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698] Polling CloudWatch API
[2021-07-27T06:38:52,877][INFO ][logstash.agent           ] Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
Version 2 of the Ruby SDK will enter maintenance mode as of November 20, 2020. To continue receiving service updates and new features, please upgrade to Version 3. More information can be found here: https://aws.amazon.com/blogs/developer/deprecation-schedule-for-aws-sdk-for-ruby-v2/
[2021-07-27T06:38:57,796][INFO ][logstash.inputs.cloudwatch][main][5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698] [Aws::CloudWatch::Client 403 2.13857 0 retries] list_metrics(namespace:"AWS/EC2") Aws::CloudWatch::Errors::InvalidClientTokenId The security token included in the request is invalid.

[2021-07-27T06:38:57,812][ERROR][logstash.javapipeline    ][main][5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698] A plugin had an unrecoverable error. Will restart this plugin.
  Pipeline_id:main
  Plugin: <LogStash::Inputs::CloudWatch access_key_id=>"ASIAYFEUE3R3SPB6LSGU", namespace=>"AWS/EC2", secret_access_key=><password>, metrics=>["CPUUtilization"], id=>"5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698", region=>"us-east-2", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_47a35d02-6648-4235-8a02-455ff0135ccb", enable_metric=>true, charset=>"UTF-8">, role_session_name=>"logstash", statistics=>["SampleCount", "Average", "Minimum", "Maximum", "Sum"], interval=>900, period=>300, combined=>false>
  Error: The security token included in the request is invalid.
  Exception: Aws::CloudWatch::Errors::InvalidClientTokenId
  Stack: /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/aws-sdk-core-2.11.632/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call'
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/aws-sdk-core-2.11.632/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in `call'
.....
......
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-cloudwatch-2.2.4/lib/logstash/inputs/cloudwatch.rb:270:in `block in metrics_available'
org/jruby/RubyHash.java:765:in `default'
org/jruby/RubyHash.java:1170:in `[]'
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-cloudwatch-2.2.4/lib/logstash/inputs/cloudwatch.rb:260:in `metrics_for'
/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-cloudwatch-2.2.4/lib/logstash/inputs/cloudwatch.rb:154:in `run'
/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:405:in `inputworker'
/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:396:in `block in start_input'
[2021-07-27T06:38:58,840][INFO ][logstash.inputs.cloudwatch][main][5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698] Polling CloudWatch API
[2021-07-27T06:38:58,846][ERROR][logstash.javapipeline    ][main][5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698] A plugin had an unrecoverable error. Will restart this plugin.
  Pipeline_id:main
  Plugin: <LogStash::Inputs::CloudWatch access_key_id=>"ASIAYFEUE3R3SPB6LSGU", namespace=>"AWS/EC2", secret_access_key=><password>, metrics=>["CPUUtilization"], id=>"5772a169ac916ad4268acd37974e918d32c63cd2e05f01891d870ce64c6dc698", region=>"us-east-2", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_47a35d02-6648-4235-8a02-455ff0135ccb", enable_metric=>true, charset=>"UTF-8">, role_session_name=>"logstash", statistics=>["SampleCount", "Average", "Minimum", "Maximum", "Sum"], interval=>900, period=>300, combined=>false>
  Error: No metrics to query
Dusty-Meg commented 2 years ago

You may want to check further up your logs. In terms of @arjunkrishnasb you have the error further up, specifically. Error: The security token included in the request is invalid.