File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,9 @@ type BatchSpanProcessorOptions struct {
7777 // Blocking option should be used carefully as it can severely affect the performance of an
7878 // application.
7979 BlockOnQueueFull bool
80+
81+ // meterProvider is the meterProvider used to record self-observability metrics.
82+ meterProvider metric.MeterProvider
8083}
8184
8285// batchSpanProcessor is a SpanProcessor that batches asynchronously-received
@@ -349,6 +352,16 @@ func WithBlocking() BatchSpanProcessorOption {
349352 }
350353}
351354
355+ // withMeterProvider allows configuring the meterProvider used for recording
356+ // self-observability metrics during testing.
357+ func withMeterProvider (provider metric.MeterProvider ) BatchSpanProcessorOption {
358+ return func (o * BatchSpanProcessorOptions ) {
359+ if provider != nil {
360+ o .meterProvider = provider
361+ }
362+ }
363+ }
364+
352365// exportSpans is a subroutine of processing and draining the queue.
353366func (bsp * batchSpanProcessor ) exportSpans (ctx context.Context ) error {
354367 bsp .timer .Reset (bsp .o .BatchTimeout )
You can’t perform that action at this time.
0 commit comments