opencensus-java
opencensus-java copied to clipboard
configure bufferSize in SpanExporterImpl
https://github.com/census-instrumentation/opencensus-java/pull/1893 caps the amount of memory the SpanExporterImpl
thread can consume by dropping spans that go past the bufferSize
.
However, I can't find a way to configure the bufferSize
.
It looks like ExportComponentImpl
instantiates SpanExporterImpl
with EXPORTER_BUFFER_SIZE = 32;
So perhaps somewhere in that code path this can be made configurable.
I'm also a little confused on how to tune the bufferSize
. Would be nice to have some examples based on expected spans per second, etc.
It would also be great to add this information around the buffer and memory settings to the documentation.
Does having EXPORTER_BUFFER_SIZE = 32
and https://github.com/census-instrumentation/opencensus-java/blob/a95cc72948c142e05163af16c7fbbe0718010058/impl_core/src/main/java/io/opencensus/implcore/trace/export/SpanExporterImpl.java#L261
imply only 128 spans can be buffered at a time by default?
Made a change to increase that to 512, so we can do a patch release later today with this fix. Then the other issue to allow users to configure that we will do in the next release.