diff --git a/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/__init__.py b/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/__init__.py index f13d1b9f4de..43382a8c4c2 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/__init__.py +++ b/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/__init__.py @@ -196,7 +196,7 @@ def _retryable(resp: requests.Response) -> bool: def export( self, metrics_data: MetricsData, - timeout_millis: float = 10_000, + timeout_millis: Optional[float] = None, **kwargs, ) -> MetricExportResult: if self._shutdown: @@ -205,7 +205,10 @@ def export( serialized_data = encode_metrics(metrics_data) return self._exporter.export_with_retry( - serialized_data.SerializeToString() + serialized_data.SerializeToString(), + timeout_sec=( + timeout_millis / 1000 if timeout_millis is not None else None + ), ) def shutdown(self, timeout_millis: float = 30_000, **kwargs) -> None: