census-instrumentation/opencensus-erlang

Stats exporter `init/1`

hauleth opened this issue · 4 comments

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.

can you elaborate? what init/1 means?

@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.

yea, makes sense

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.