Skip to content

Commit

Permalink
Add example_test for WithBatcher and WithSpanProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Mar 1, 2022
1 parent 2cc4848 commit 5b32cde
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}))
Expand Down

0 comments on commit 5b32cde

Please sign in to comment.