diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ae7211c3ba..4ebd9afa2d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm This removes the package dependencies of this bridge from the rest of the OpenTelemetry based project. (#1038) - Renamed `go.opentelemetry.io/otel/api/standard` package to `go.opentelemetry.io/otel/semconv` to avoid the ambiguous and generic name `standard` and better describe the package as containing OpenTelemetry semantic conventions. (#1016) - The environment variable used for resource detection has been changed from `OTEL_RESOURCE_LABELS` to `OTEL_RESOURCE_ATTRIBUTES` (#1042) +- Replace `WithSyncer` with `WithBatcher` in examples. (#1044) ### Removed diff --git a/example/namedtracer/main.go b/example/namedtracer/main.go index a98abefc04b..21bd9c296bc 100644 --- a/example/namedtracer/main.go +++ b/example/namedtracer/main.go @@ -44,7 +44,7 @@ func initTracer() { log.Panicf("failed to initialize stdout exporter %v\n", err) return } - tp, err = sdktrace.NewProvider(sdktrace.WithSyncer(exp), + tp, err = sdktrace.NewProvider(sdktrace.WithBatcher(exp), sdktrace.WithConfig(sdktrace.Config{DefaultSampler: sdktrace.AlwaysSample()})) if err != nil { log.Panicf("failed to initialize trace provider %v\n", err) diff --git a/example/otel-collector/main.go b/example/otel-collector/main.go index 23065e5df2c..a68f414ced9 100644 --- a/example/otel-collector/main.go +++ b/example/otel-collector/main.go @@ -59,7 +59,7 @@ func initProvider() (*otlp.Exporter, *push.Controller) { // the service name used to display traces in backends kv.Key(semconv.ServiceNameKey).String("test-service"), )), - sdktrace.WithSyncer(exp), + sdktrace.WithBatcher(exp), ) handleErr(err, "failed to create trace provider") diff --git a/exporters/otlp/README.md b/exporters/otlp/README.md index 8f88a0b8d00..dfb9697ea5c 100644 --- a/exporters/otlp/README.md +++ b/exporters/otlp/README.md @@ -47,7 +47,7 @@ func main() { // sdktrace.WithMaxExportBatchSize(100), // ), // ) - traceProvider, err := sdktrace.NewProvider(sdktrace.WithSyncer(exporter)) + traceProvider, err := sdktrace.NewProvider(sdktrace.WithBatcher(exporter)) if err != nil { log.Fatal("failed to create trace provider: %v", err) }