From 3d32612bd2dd834d51a44940fd193e644b4cbaac Mon Sep 17 00:00:00 2001 From: Vadim Korolik Date: Mon, 5 Oct 2026 13:06:32 -0700 Subject: [PATCH] fix(highlight-py): pass OTLP exporter timeout in seconds, not milliseconds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The OpenTelemetry gRPC exporters' timeout parameter is in seconds, but the SDK passed the schedule_delay_millis value (5000) directly, so each trace/log/metric export RPC could block for up to 5000 seconds (~83 minutes) instead of ~5. A slow or hung OTLP backend would stall the BatchSpanProcessor/BatchLogRecordProcessor worker for over an hour per batch — backing up the queues, dropping data, and hanging H.flush() (called on every serverless invocation) for the same duration. Divide by 1000 to pass seconds. --- sdk/highlight-py/highlight_io/sdk.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sdk/highlight-py/highlight_io/sdk.py b/sdk/highlight-py/highlight_io/sdk.py index 469c0ca0cf..2ce442196f 100644 --- a/sdk/highlight-py/highlight_io/sdk.py +++ b/sdk/highlight-py/highlight_io/sdk.py @@ -236,7 +236,8 @@ def on_start( OTLPSpanExporter( f"{self._otlp_endpoint}/v1/traces", compression=Compression.Gzip, - timeout=kwargs["schedule_delay_millis"], + # exporter timeout is in seconds, not milliseconds + timeout=kwargs["schedule_delay_millis"] / 1000, ), **kwargs, ) @@ -252,7 +253,8 @@ def on_start( OTLPLogExporter( f"{self._otlp_endpoint}/v1/logs", compression=Compression.Gzip, - timeout=kwargs["schedule_delay_millis"], + # exporter timeout is in seconds, not milliseconds + timeout=kwargs["schedule_delay_millis"] / 1000, ), **kwargs, ) @@ -264,7 +266,8 @@ def on_start( exporter=OTLPMetricExporter( f"{self._otlp_endpoint}/v1/metrics", compression=Compression.Gzip, - timeout=kwargs["schedule_delay_millis"], + # exporter timeout is in seconds, not milliseconds + timeout=kwargs["schedule_delay_millis"] / 1000, max_export_batch_size=kwargs["max_export_batch_size"], preferred_temporality={ Counter: AggregationTemporality.DELTA,