From 5b32cdef3f4d68126446af675c273fd582d04c08 Mon Sep 17 00:00:00 2001 From: Tyler Yahn Date: Tue, 1 Mar 2022 15:22:41 -0800 Subject: [PATCH] Add example_test for WithBatcher and WithSpanProcessor --- example_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/example_test.go b/example_test.go index f8e69d2..a62b41d 100644 --- a/example_test.go +++ b/example_test.go @@ -25,6 +25,17 @@ import ( "go.opentelemetry.io/otel/sdk/trace" ) +func ExampleWithBatcher() { + sdk := trace.NewTracerProvider(flow.WithBatcher(exporter{})) + defer func() { _ = sdk.Shutdown(context.Background()) }() +} + +func ExampleWithSpanProcessor() { + spanProcessor := trace.NewSimpleSpanProcessor(exporter{}) + sdk := trace.NewTracerProvider(flow.WithSpanProcessor(spanProcessor)) + defer func() { _ = sdk.Shutdown(context.Background()) }() +} + func Example() { ctx := context.TODO() sdk := trace.NewTracerProvider(flow.WithBatcher(exporter{}))