katja-beam / katja

A simple Riemann client written in Erlang.
https://hex.pm/packages/katja
ISC License
27 stars 19 forks source link

failed to send integer value #14

Closed kashp closed 8 years ago

kashp commented 8 years ago

Hi I am trying to send attribute list which has key value pair and value as integer but it is failing.

Working katja:send_event_async([{service, "warehouse"}, {attribute, [{"war", "5"}]}]).

failing katja:send_event_async([{service, "warehouse"}, {attribute, [{"war", 5}]}]).

[error] gen_server katja_writer terminated with reason: no function clause matching katja_writer:terminate({badarg,[{protobuffs,encode_internal,[2,5,string],[{file,"src/protobuffs.erl"},{line,167}]},{katja_pb,...},...]}, {connection_state,#Port<0.16909>,undefined,"192.168.3.45",5555,tcp}) line 169 11:54:55.196 [error] CRASH REPORT Process katja_writer with 0 neighbours exited with reason: no function clause matching katja_writer:terminate({badarg,[{protobuffs,encode_internal,[2,5,string],[{file,"src/protobuffs.erl"},{line,167}]},{katja_pb,...},...]}, {connection_state,#Port<0.16909>,undefined,"192.168.3.45",5555,tcp}) line 169 in gen_server:terminate/7 line 814 11:54:55.197 [error] Supervisor katja_sup had child undefined started with katja_writer:start_link(register) at <0.1533.0> exit with reason no function clause matching katja_writer:terminate({badarg,[{protobuffs,encode_internal,[2,5,string],[{file,"src/protobuffs.erl"},{line,167}]},{katja_pb,...},...]}, {connection_state,#Port<0.16909>,undefined,"192.168.3.45",5555,tcp}) line 169 in context child_terminated

nifoc commented 8 years ago

Hi,

attributes in Riemann can only be strings, nothing else. This is a limitation of Riemann itself and not Katja.

If you look at the .proto file, you can find the definition for RiemannPB_Attribute:

message RiemannPB_Attribute {
  required string key = 1;
  optional string value = 2;
}