You've already forked opentelemetry-go
							
							
				mirror of
				https://github.com/open-telemetry/opentelemetry-go.git
				synced 2025-10-31 00:07:40 +02:00 
			
		
		
		
	Use reasonable interval in sdktrace.WithBatchTimeout (#1621)
* Use reasonable interval in sdktrace.WithBatchTimeout This patch resolves #1564. * Add pull request ID to CHANGELOG.md
This commit is contained in:
		| @@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm | ||||
| - AttributePerEventCountLimit and AttributePerLinkCountLimit for SpanLimits. (#1535) | ||||
| - Added `Keys()` method to `propagation.TextMapCarrier` and `propagation.HeaderCarrier` to adapt `http.Header` to this interface. (#1544) | ||||
| - Added `code` attributes to `go.opentelemetry.io/otel/semconv` package. (#1558) | ||||
| - Changed all examples to use `WithBatchTimeout(5 * time.Second)` rather than `WithBatchTimeout(5)` (#1621) | ||||
|  | ||||
| ### Changed | ||||
|  | ||||
|   | ||||
| @@ -44,7 +44,7 @@ func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlp.Exporter, mcTr | ||||
| 		sdktrace.WithBatcher( | ||||
| 			exp, | ||||
| 			// add following two options to ensure flush | ||||
| 			sdktrace.WithBatchTimeout(5), | ||||
| 			sdktrace.WithBatchTimeout(5*time.Second), | ||||
| 			sdktrace.WithMaxExportBatchSize(10), | ||||
| 		), | ||||
| 	} | ||||
|   | ||||
| @@ -53,7 +53,7 @@ func Example_insecure() { | ||||
| 		sdktrace.WithBatcher( | ||||
| 			exp, | ||||
| 			// add following two options to ensure flush | ||||
| 			sdktrace.WithBatchTimeout(5), | ||||
| 			sdktrace.WithBatchTimeout(5*time.Second), | ||||
| 			sdktrace.WithMaxExportBatchSize(10), | ||||
| 		), | ||||
| 	) | ||||
| @@ -106,7 +106,7 @@ func Example_withTLS() { | ||||
| 		sdktrace.WithBatcher( | ||||
| 			exp, | ||||
| 			// add following two options to ensure flush | ||||
| 			sdktrace.WithBatchTimeout(5), | ||||
| 			sdktrace.WithBatchTimeout(5*time.Second), | ||||
| 			sdktrace.WithMaxExportBatchSize(10), | ||||
| 		), | ||||
| 	) | ||||
| @@ -167,7 +167,7 @@ func Example_withDifferentSignalCollectors() { | ||||
| 		sdktrace.WithBatcher( | ||||
| 			exp, | ||||
| 			// add following two options to ensure flush | ||||
| 			sdktrace.WithBatchTimeout(5), | ||||
| 			sdktrace.WithBatchTimeout(5*time.Second), | ||||
| 			sdktrace.WithMaxExportBatchSize(10), | ||||
| 		), | ||||
| 	) | ||||
|   | ||||
| @@ -337,7 +337,7 @@ func TestNewExporter_withMultipleAttributeTypes(t *testing.T) { | ||||
| 		sdktrace.WithBatcher( | ||||
| 			exp, | ||||
| 			// add following two options to ensure flush | ||||
| 			sdktrace.WithBatchTimeout(5), | ||||
| 			sdktrace.WithBatchTimeout(5*time.Second), | ||||
| 			sdktrace.WithMaxExportBatchSize(10), | ||||
| 		), | ||||
| 	) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user