5656from opentelemetry .exporter .otlp .proto .grpc import (
5757 _OTLP_GRPC_CHANNEL_OPTIONS ,
5858)
59- from opentelemetry .exporter .otlp .proto .grpc import (
60- _OTLP_GRPC_HEADERS ,
61- )
6259from opentelemetry .proto .collector .logs .v1 .logs_service_pb2 import (
6360 ExportLogsServiceRequest ,
6461)
@@ -288,7 +285,7 @@ def __init__(
288285 ] = None ,
289286 timeout : Optional [float ] = None ,
290287 compression : Optional [Compression ] = None ,
291- channel_options : Optional [TypingSequence [Tuple [str , str ]]] = None ,
288+ channel_options : Optional [list [Tuple [str , str ]]] = None ,
292289 ):
293290 super ().__init__ ()
294291 self ._result = result
@@ -330,7 +327,7 @@ def __init__(
330327 for opt_name , opt_value in _OTLP_GRPC_CHANNEL_OPTIONS
331328 if opt_name not in overridden_options
332329 ]
333- self ._channel_options = tuple ( default_options ) + channel_options
330+ self ._channel_options = default_options + channel_options
334331 else :
335332 self ._channel_options = tuple (_OTLP_GRPC_CHANNEL_OPTIONS )
336333
@@ -396,10 +393,10 @@ def _export(
396393 metadata = self ._headers ,
397394 timeout = deadline_sec - time (),
398395 )
399- return self ._result .SUCCESS # type: ignore [reportReturnType]
396+ return self ._result .SUCCESS # type: ignore [reportReturnType]
400397 except RpcError as error :
401- retry_info_bin = dict (error .trailing_metadata ()).get (
402- "google.rpc.retryinfo-bin"
398+ retry_info_bin = dict (error .trailing_metadata ()).get ( # type: ignore [reportAttributeAccessIssue]
399+ "google.rpc.retryinfo-bin" # type: ignore [reportArgumentType]
403400 )
404401 # multiplying by a random number between .8 and 1.2 introduces a +/20% jitter to each backoff.
405402 backoff_seconds = 2 ** retry_num * random .uniform (0.8 , 1.2 )
@@ -411,7 +408,7 @@ def _export(
411408 + retry_info .retry_delay .nanos / 1.0e9
412409 )
413410 if (
414- error .code () not in _RETRYABLE_ERROR_CODES
411+ error .code () not in _RETRYABLE_ERROR_CODES # type: ignore [reportAttributeAccessIssue]
415412 or retry_num + 1 == _MAX_RETRYS
416413 or backoff_seconds > (deadline_sec - time ())
417414 or self ._shutdown
@@ -420,13 +417,13 @@ def _export(
420417 "Failed to export %s to %s, error code: %s" ,
421418 self ._exporting ,
422419 self ._endpoint ,
423- error .code (),
424- exc_info = error .code () == StatusCode .UNKNOWN ,
420+ error .code (), # type: ignore [reportAttributeAccessIssue]
421+ exc_info = error .code () == StatusCode .UNKNOWN , # type: ignore [reportAttributeAccessIssue]
425422 )
426- return self ._result .FAILURE # type: ignore [reportReturnType]
423+ return self ._result .FAILURE # type: ignore [reportReturnType]
427424 logger .warning (
428425 "Transient error %s encountered while exporting %s to %s, retrying in %.2fs." ,
429- error .code (),
426+ error .code (), # type: ignore [reportAttributeAccessIssue]
430427 self ._exporting ,
431428 self ._endpoint ,
432429 backoff_seconds ,
@@ -436,7 +433,7 @@ def _export(
436433 logger .warning ("Shutdown in progress, aborting retry." )
437434 break
438435 # Not possible to reach here but the linter is complaining.
439- return self ._result .FAILURE # type: ignore [reportReturnType]
436+ return self ._result .FAILURE # type: ignore [reportReturnType]
440437
441438 def shutdown (self , timeout_millis : float = 30_000 , ** kwargs ) -> None :
442439 if self ._shutdown :
0 commit comments