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 @@ -75,6 +75,9 @@ type BatchSpanProcessorOptions struct {
7575 // Blocking option should be used carefully as it can severely affect the performance of an
7676 // application.
7777 BlockOnQueueFull bool
78+
79+ // meterProvider is the meterProvider used to record self-observability metrics.
80+ meterProvider metric.MeterProvider
7881}
7982
8083// batchSpanProcessor is a SpanProcessor that batches asynchronously-received
@@ -347,6 +350,16 @@ func WithBlocking() BatchSpanProcessorOption {
347350 }
348351}
349352
353+ // withMeterProvider allows configuring the meterProvider used for recording
354+ // self-observability metrics during testing.
355+ func withMeterProvider (provider metric.MeterProvider ) BatchSpanProcessorOption {
356+ return func (o * BatchSpanProcessorOptions ) {
357+ if provider != nil {
358+ o .meterProvider = provider
359+ }
360+ }
361+ }
362+
350363// exportSpans is a subroutine of processing and draining the queue.
351364func (bsp * batchSpanProcessor ) exportSpans (ctx context.Context ) error {
352365 bsp .timer .Reset (bsp .o .BatchTimeout )
You can’t perform that action at this time.
0 commit comments