A plugin had an unrecoverable error. Will restart this plugin

[2024-06-11T15:18:52,306][ERROR][logstash.javapipeline ][main][426367acac36cefc65edfdc25912c990f3c7b8ca6c411d526967d63232a012e3] A plugin had an unrecoverable error. Will restart this plugin.

", "i-"]}, id=>"426367acac36cefc65edfdc25912c990f3c7b8ca6c411d526967d63232a012e3", region=>"af-south-1", statistics=>["Average", "Minimum", "Maximum"], enable_metric=>true, role_session_name=>"logstash", use_aws_bundled_ca=>false, combined=>false>
Error: No metrics to query
Exception: RuntimeError
Stack: /usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/logstash-integration-aws-7.1.6-java/lib/logstash/inputs/cloudwatch.rb:154:in run' /usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:414:in inputworker'
/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:405:in `block in start_input'
My code.conf

input {
  cloudwatch {
    namespace => "/AWS/EC2"
    metrics => ["CPUUtilization", "EBSReadBytes", "EBSWriteBytes", "EBSReadBytes"]
    filters => { "InstanceId" => ["i-", "i-", "i-"] }
    region => "af-south-1"
    statistics => [ "Average", "Minimum", "Maximum"]
    interval => 900
    #role_session_name => "LogstashRORole"
    period => 300
    codec => "json"


output {
  elasticsearch {
    hosts => ["http://ip:9200/"]
    index => "logstash-test-10-06"
  stdout { codec => rubydebug }

Hi @thami,

Welcome to the community! I see you're using logstash-integration-aws-7.1.6-java. Which version of Logstash are you using it with?

Have you removed the AWS credentials for the purpose of posting? I wonder if you need to specify the credentials as specified in this StackOverflow post.

Let us know!

Hi CArly, I am curently on logstash-8.14.1

Thanks for confirming.

I wonder if you are having the same issue as this one with the cloudwatch plugin. Have you tried specifying filters in your config?