census-instrumentation / opencensus-erlang

A stats collection and distributed tracing framework
https://opencensus.io
Apache License 2.0
134 stars 39 forks source link

Stats exporter `init/1` #107

Open hauleth opened 5 years ago

hauleth commented 5 years ago

This would be highly useful in situations like sending data through UDP (statsd metrics or HTTP-over-QUIC) or if we would like to utilise HTTP/2 to not open new TCP connection each time we send data.

deadtrickster commented 5 years ago

can you elaborate? what init/1 means?

hauleth commented 5 years ago

@deadtrickster it should work the same way the Module:init/1 in oc_reporter works. So when registering the stats exporter the init/1 is called with options and return value of this function is then passed as 2nd argument to export/2.

deadtrickster commented 5 years ago

yea, makes sense

hauleth commented 5 years ago

This is how DataDog exporter looks right now. It would be better to share this connection between exports. It is all I need right now.