1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-08-15 20:03:15 +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:
Injun Song
2021-03-02 01:03:55 +09:00
committed by GitHub
parent 7d4496e0fe
commit 1519d95982
4 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -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),
),
}

View File

@@ -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),
),
)

View File

@@ -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),
),
)