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 9f7cee5eff..260df9570e 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 @@ -216,7 +216,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: @@ -225,7 +225,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: