From 9c186fd31f80524c3fd8557d1f6f8203db2965f2 Mon Sep 17 00:00:00 2001 From: Philipp Hofmann Date: Fri, 24 Oct 2025 11:57:29 +0200 Subject: [PATCH] fix(batch-processor): Don't enforce starting timer Allow SKDs to let a timer run even when there are no logs, cause on some platforms having a timer running no matter what is more convenient. --- develop-docs/sdk/telemetry/spans/batch-processor.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop-docs/sdk/telemetry/spans/batch-processor.mdx b/develop-docs/sdk/telemetry/spans/batch-processor.mdx index 0a076cc22c2d7f..2d28342770699b 100644 --- a/develop-docs/sdk/telemetry/spans/batch-processor.mdx +++ b/develop-docs/sdk/telemetry/spans/batch-processor.mdx @@ -16,7 +16,7 @@ The BatchProcessor batches spans and logs into one envelope to reduce the number Whenever the SDK finishes a span or captures a log, it MUST put it into the BatchProcessor. The SDK MUST NOT put unfinished spans into the BatchProcessor. -The BatchProcessor MUST start a timeout of 5 seconds when the SDK adds the first span or log. When the timeout exceeds, the BatchProcessor MUST send all spans or logs, no matter how many items it contains. The SDK MAY choose a different value for the timeout, but it MUST NOT exceed 30 seconds, as this can lead to problems with the span buffer on the backend, which uses a time interval of 60 seconds for determining segments for spans. The BatchProcessor MUST only start a new timeout, when it has spans or logs to send, to avoid running the timeout unnecessarily. +The BatchProcessor MUST start a timeout of 5 seconds when the SDK adds the first span or log. When the timeout exceeds, the BatchProcessor MUST send all spans or logs, no matter how many items it contains. The SDK MAY choose a different value for the timeout, but it MUST NOT exceed 30 seconds, as this can lead to problems with the span buffer on the backend, which uses a time interval of 60 seconds for determining segments for spans. The BatchProcessor SHOULD only start a new timeout, when it has spans or logs to send, to avoid running the timeout unnecessarily. The BatchProcessor MUST send all items after the SDK when containing spans or logs exceeding 1MiB in size. The SDK MAY choose a different value for the max batch size keeping the [envelope max sizes](/sdk/data-model/envelopes/#size-limits) in mind. The SDK MUST calculate the size of a span or a log to manage the BatchProcessor's memory footprint. The SDK MUST serialize the span or log and calculate the size based on the serialized JSON bytes. As serialization is expensive, the BatchProcessor SHOULD keep track of the serialized spans and logs and pass these to the envelope to avoid serializing multiple times.