|
91 | 91 | from opentelemetry.sdk._shared_internal import DuplicateFilter |
92 | 92 | from opentelemetry.sdk.environment_variables import ( |
93 | 93 | _OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER, |
94 | | - _OTEL_PYTHON_EXPORTER_OTLP_GRPC_RETRYABLE_ERROR_CODES, |
95 | 94 | OTEL_EXPORTER_OTLP_CERTIFICATE, |
96 | 95 | OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE, |
97 | 96 | OTEL_EXPORTER_OTLP_CLIENT_KEY, |
@@ -359,20 +358,17 @@ def __init__( |
359 | 358 | else compression |
360 | 359 | ) or Compression.NoCompression |
361 | 360 |
|
362 | | - self._retryable_error_codes = ( |
363 | | - frozenset(retryable_error_codes) |
364 | | - if retryable_error_codes is not None |
365 | | - else environ.get( |
366 | | - _OTEL_PYTHON_EXPORTER_OTLP_GRPC_RETRYABLE_ERROR_CODES |
367 | | - ) |
368 | | - ) |
369 | 361 | if isinstance(self._retryable_error_codes, str): |
370 | 362 | self._retryable_error_codes = frozenset( |
371 | 363 | StatusCode[code.strip().upper()] |
372 | 364 | for code in self._retryable_error_codes.split(",") |
373 | 365 | if code.strip() |
374 | 366 | ) |
375 | | - if self._retryable_error_codes is None: |
| 367 | + elif self._retryable_error_codes is not None: |
| 368 | + self._retryable_error_codes = frozenset( |
| 369 | + self._retryable_error_codes |
| 370 | + ) |
| 371 | + else: |
376 | 372 | self._retryable_error_codes = _RETRYABLE_ERROR_CODES |
377 | 373 |
|
378 | 374 | self._channel = None |
|
0 commit comments