From 2b293d84977f181f5c150a6b73fed196941ad999 Mon Sep 17 00:00:00 2001 From: Anton Ryzhov Date: Mon, 11 Jan 2021 17:15:09 +0100 Subject: [PATCH] Flush export queue when it reaches `max_export_batch_size` --- CHANGELOG.md | 1 + .../src/opentelemetry/sdk/trace/export/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d77447ad31..0e3cfcc8d87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#1507](https://github.com/open-telemetry/opentelemetry-python/pull/1507)) - `opentelemetry-exporter-jaeger` Updated Jaeger exporter status code tag ([#1488](https://github.com/open-telemetry/opentelemetry-python/pull/1488)) +- `BatchExportSpanProcessor` flushes export queue when it reaches `max_export_batch_size` ## [0.16b1](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v0.16b1) - 2020-11-26 ### Added diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py index d8786e6d21a..91baa276e33 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py @@ -194,7 +194,7 @@ def on_end(self, span: Span) -> None: self.queue.appendleft(span) - if len(self.queue) >= self.max_queue_size // 2: + if len(self.queue) >= self.max_export_batch_size: with self.condition: self.condition.notify()