noxdafox / rabbitmq-cloudwatch-exporter

RabbitMQ Plugin for publishing cluster metrics to AWS CloudWatch
Mozilla Public License 2.0
41 stars 9 forks source link

Issue on region regular expression matching #1

Closed FlyersWeb closed 5 years ago

FlyersWeb commented 5 years ago

When I add the following region to my configuration :

{ex_aws, [{access_key_id, "***"},
           {secret_access_key, "***"},
           {region, "eu-west-3"}]},
{rabbitmq_cloudwatch_exporter, [{metrics, [overview, vhost, node, exchange, queue, connection, channel]}]}

I get the following errors in logs :

** Started from <0.613.0>
** When function  == fun Elixir.RabbitMQ.CloudWatchExporter.Exporter:run/2
**      arguments == [[{period,60},{collectors,[overview,vhost,node,exchange,queue,connection,channel]},{namespace,<<"RabbitMQ">>}],[]]
** Reason for termination ==
** {function_clause,[{'Elixir.Regex',run,[#{'__struct__' => 'Elixir.Regex',opts => <<>>,re_pattern => {re_pattern,1,0,0,<<69,82,67,80,121,0,0,0,16,0,0,0,65,0,0,0,255,255,255,255,255,255,255,255,0,0,45,0,0,0,1,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,131,0,53,27,133,0,9,0,1,29,117,29,115,119,0,7,29,101,29,117,119,0,7,29,97,29,112,119,0,7,29,115,29,97,119,0,7,29,99,29,97,120,0,37,29,45,95,11,29,45,95,7,25,120,0,53,0>>},re_version => {<<"8.41 2017-07-05">>,little},source => <<"^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$">>},"eu-west-3",[]],[{file,"lib/regex.ex"},{line,279}]},{'Elixir.Enum',find_list,3,[{file,"lib/enum.ex"},{line,2948}]},{'Elixir.ExAws.Config.Defaults',host,2,[{file,"lib/ex_aws/config/defaults.ex"},{line,53}]},{'Elixir.ExAws.Config.Defaults',get,2,[{file,"lib/ex_aws/config/defaults.ex"},{line,42}]},{'Elixir.ExAws.Config',build_base,2,[{file,"lib/ex_aws/config.ex"},{line,47}]},{'Elixir.ExAws.Config',new,2,[{file,"lib/ex_aws/config.ex"},{line,34}]},{'Elixir.ExAws',request,2,[{file,"lib/ex_aws.ex"},{line,49}]},{'Elixir.ExAws','request!',2,[{file,"lib/ex_aws.ex"},{line,61}]}]}
2019-05-14 09:06:16.970 [error] <0.659.0> CRASH REPORT Process <0.659.0> with 0 neighbours crashed with reason: no function clause matching 'Elixir.Regex':run(#{'__struct__' => 'Elixir.Regex',opts => <<>>,re_pattern => {re_pattern,1,0,0,<<69,82,67,80,121,...>>},...}, "eu-west-3", []) line 279
2019-05-14 09:06:16.971 [error] <0.613.0> Supervisor {<0.613.0>,'Elixir.Supervisor.Default'} had child 'Elixir.RabbitMQ.CloudWatchExporter.Exporter' started with 'Elixir.RabbitMQ.CloudWatchExporter.Exporter':start_link([]) at <0.659.0> exit with reason no function clause matching 'Elixir.Regex':run(#{'__struct__' => 'Elixir.Regex',opts => <<>>,re_pattern => {re_pattern,1,0,0,<<69,82,67,80,121,...>>},...}, "eu-west-3", []) line 279 in context child_terminated
noxdafox commented 5 years ago

Hello,

thanks for reporting this. This is an issue with the README documentation which I just fixed.

The correct configuration syntax is:

[{rabbitmq_cloudwatch_exporter, 
  [{aws, [{access_key_id, "***"},
          {secret_access_key, "***"},
          {region, "eu-west-3"}]},
   {metrics, [overview, vhost, node, exchange, queue, connection, channel]}]}].
FlyersWeb commented 5 years ago

This fixed the issue, thanks.