census-instrumentation / opencensus-go

A stats collection and distributed tracing framework
http://opencensus.io
Apache License 2.0
2.06k stars 327 forks source link

Make default worker channel buffer length configurable and optionally non blocking #1231

Open bgcint opened 4 years ago

bgcint commented 4 years ago

Is your feature request related to a problem? Please describe. Under load or when recording a number of metrics, the worker channel buffer can fill up and block the calling code. This line in particular, for record commands here

Describe the solution you'd like It would be useful to make the channel buffer length configurable so that users can accommodate varying load on an application. It would also be interesting to make the operation optionally non blocking in cases where high load is a constant but metric collection could be a lossy operation.