Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exometer_statsd reports everything as gauge #160

Open
ludwikbukowski opened this issue Jan 31, 2019 · 1 comment
Open

exometer_statsd reports everything as gauge #160

ludwikbukowski opened this issue Jan 31, 2019 · 1 comment

Comments

@ludwikbukowski
Copy link

ludwikbukowski commented Jan 31, 2019

Even though statsd provides protocol for histograms, timers, sets and counters.
And seems that there exists code for that [1], but most likely is not used.
When I used dbg to trace UDP formats sent, everything is sent as gauge (its from elixir shell but it doesnt matter):

(<0.597.0>) call gen_udp:send(#Port<0.37825>,{127,0,0,1},8125,[[<<"empex">>,".",<<"dev">>,".",<<"counters">>,".",<<"lookups">>,".","value"],
 ":","1","|","g"])
(<0.597.0>) returned from gen_udp:send/4 -> ok
(<0.597.0>) call gen_udp:send(#Port<0.37825>,{127,0,0,1},8125,[[<<"empex">>,".",<<"dev">>,".",<<"counters">>,".",<<"lookups">>,".",
  "ms_since_reset"],
 ":","5002","|","g"])
(<0.597.0>) returned from gen_udp:send/4 -> ok
(<0.597.0>) call gen_udp:send(#Port<0.37825>,{127,0,0,1},8125,[[<<"empex">>,".",<<"dev">>,".",<<"histograms">>,".",
  <<"ecto_exec_query_time">>,".","mean"],
 ":","10072","|","g"])
(<0.597.0>) returned from gen_udp:send/4 -> ok
(<0.597.0>) call gen_udp:send(#Port<0.37825>,{127,0,0,1},8125,[[<<"empex">>,".",<<"dev">>,".",<<"histograms">>,".",
  <<"ecto_exec_query_time">>,".","min"],
 ":","10072","|","g"])
(<0.597.0>) returned from gen_udp:send/4 -> ok
(<0.597.0>) call gen_udp:send(#Port<0.37825>,{127,0,0,1},8125,[[<<"empex">>,".",<<"dev">>,".",<<"histograms">>,".",
  <<"ecto_exec_query_time">>,".","max"],
 ":","10072","|","g"])
(<0.597.0>) returned from gen_udp:send/4 -> ok
(<0.597.0>) call gen_udp:send(#Port<0.37825>,{127,0,0,1},8125,[[<<"empex">>,".",<<"dev">>,".",<<"histograms">>,".",
  <<"ecto_exec_query_time">>,".","median"],
 ":","10072","|","g"])
(<0.597.0>) returned from gen_udp:send/4 -> ok
(<0.597.0>) call gen_udp:send(#Port<0.37825>,{127,0,0,1},8125,[[<<"empex">>,".",<<"dev">>,".",<<"histograms">>,".",
  <<"ecto_exec_query_time">>,".","90"],
 ":","10072","|","g"])
(<0.597.0>) returned from gen_udp:send/4 -> ok
(<0.597.0>) call gen_udp:send(#Port<0.37825>,{127,0,0,1},8125,[[<<"empex">>,".",<<"dev">>,".",<<"histograms">>,".",
  <<"ecto_exec_query_time">>,".","95"],
 ":","10072","|","g"])
(<0.597.0>) returned from gen_udp:send/4 -> ok
(<0.597.0>) call gen_udp:send(#Port<0.37825>,{127,0,0,1},8125,[[<<"empex">>,".",<<"dev">>,".",<<"histograms">>,".",
  <<"ecto_exec_query_time">>,".","99"],
 ":","10072","|","g"])
(<0.597.0>) returned from gen_udp:send/4 -> ok
(<0.597.0>) call gen_udp:send(#Port<0.37825>,{127,0,0,1},8125,[[<<"empex">>,".",<<"dev">>,".",<<"spirals">>,".",<<"ecto_query_count">>,".",
  "count"],
 ":","1","|","g"])
(<0.597.0>) returned from gen_udp:send/4 -> ok
(<0.597.0>) call gen_udp:send(#Port<0.37825>,{127,0,0,1},8125,[[<<"empex">>,".",<<"dev">>,".",<<"spirals">>,".",<<"ecto_query_count">>,".",
  "one"],
 ":","1","|","g"])
(<0.597.0>) returned from gen_udp:send/4 -> ok

[EDIT]
As I look closer to the implementation, there is an undocumented option type_map which seems to define the mapping for the statsd

[1] https://github.com/Feuerlabs/exometer/blob/master/src/exometer_report_statsd.erl#L119

@ludwikbukowski
Copy link
Author

However, seems that there is not simple and generic way to define type_map for e.g histograms when we don't know exactly the name of the metric.
Its because exometer creates the histograms on his own and only after that sends the values.
I mean that the function Reporter:report/5 will be called for each histogram's value type (99, mean, median etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant