Skip to content

Commit e7027a0

Browse files
committed
Rename python env var with _
1 parent 97fa836 commit e7027a0

File tree

13 files changed

+42
-42
lines changed

13 files changed

+42
-42
lines changed

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_log_exporter/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
OTEL_EXPORTER_OTLP_LOGS_HEADERS,
4141
OTEL_EXPORTER_OTLP_LOGS_INSECURE,
4242
OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,
43-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_LOGS_CREDENTIAL_PROVIDER,
43+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_LOGS_CREDENTIAL_PROVIDER,
4444
)
4545

4646

@@ -74,7 +74,7 @@ def __init__(
7474
):
7575
credentials = _get_credentials(
7676
credentials,
77-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_LOGS_CREDENTIAL_PROVIDER,
77+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_LOGS_CREDENTIAL_PROVIDER,
7878
OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE,
7979
OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY,
8080
OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE,

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
from opentelemetry.proto.resource.v1.resource_pb2 import Resource # noqa: F401
6262
from opentelemetry.sdk._shared_internal import DuplicateFilter
6363
from opentelemetry.sdk.environment_variables import (
64+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER,
6465
OTEL_EXPORTER_OTLP_CERTIFICATE,
6566
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE,
6667
OTEL_EXPORTER_OTLP_CLIENT_KEY,
@@ -69,7 +70,6 @@
6970
OTEL_EXPORTER_OTLP_HEADERS,
7071
OTEL_EXPORTER_OTLP_INSECURE,
7172
OTEL_EXPORTER_OTLP_TIMEOUT,
72-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER,
7373
)
7474
from opentelemetry.sdk.metrics.export import MetricsData
7575
from opentelemetry.sdk.resources import Resource as SDKResource
@@ -306,7 +306,7 @@ def __init__(
306306
else:
307307
self._credentials = _get_credentials(
308308
credentials,
309-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER,
309+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER,
310310
OTEL_EXPORTER_OTLP_CERTIFICATE,
311311
OTEL_EXPORTER_OTLP_CLIENT_KEY,
312312
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE,

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/metric_exporter/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
OTEL_EXPORTER_OTLP_METRICS_HEADERS,
5252
OTEL_EXPORTER_OTLP_METRICS_INSECURE,
5353
OTEL_EXPORTER_OTLP_METRICS_TIMEOUT,
54-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_METRICS_CREDENTIAL_PROVIDER,
54+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_METRICS_CREDENTIAL_PROVIDER,
5555
)
5656
from opentelemetry.sdk.metrics._internal.aggregation import Aggregation
5757
from opentelemetry.sdk.metrics.export import ( # noqa: F401
@@ -119,7 +119,7 @@ def __init__(
119119
):
120120
credentials = _get_credentials(
121121
credentials,
122-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_METRICS_CREDENTIAL_PROVIDER,
122+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_METRICS_CREDENTIAL_PROVIDER,
123123
OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE,
124124
OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY,
125125
OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE,

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/trace_exporter/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
Span as CollectorSpan,
4747
)
4848
from opentelemetry.sdk.environment_variables import (
49+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_TRACES_CREDENTIAL_PROVIDER,
4950
OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE,
5051
OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE,
5152
OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY,
@@ -54,7 +55,6 @@
5455
OTEL_EXPORTER_OTLP_TRACES_HEADERS,
5556
OTEL_EXPORTER_OTLP_TRACES_INSECURE,
5657
OTEL_EXPORTER_OTLP_TRACES_TIMEOUT,
57-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_TRACES_CREDENTIAL_PROVIDER,
5858
)
5959
from opentelemetry.sdk.trace import ReadableSpan
6060
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
@@ -107,7 +107,7 @@ def __init__(
107107
):
108108
credentials = _get_credentials(
109109
credentials,
110-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_TRACES_CREDENTIAL_PROVIDER,
110+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_TRACES_CREDENTIAL_PROVIDER,
111111
OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE,
112112
OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY,
113113
OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE,

exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
add_TraceServiceServicer_to_server,
5050
)
5151
from opentelemetry.sdk.environment_variables import (
52+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER,
5253
OTEL_EXPORTER_OTLP_COMPRESSION,
53-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER,
5454
)
5555
from opentelemetry.sdk.trace import ReadableSpan, _Span
5656
from opentelemetry.sdk.trace.export import (
@@ -289,7 +289,7 @@ def test_otlp_exporter_otlp_compression_unspecified(
289289
@patch.dict(
290290
"os.environ",
291291
{
292-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER: "credential_provider"
292+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER: "credential_provider"
293293
},
294294
)
295295
@patch("opentelemetry.exporter.otlp.proto.grpc.exporter.entry_points")
@@ -309,7 +309,7 @@ def f():
309309
@patch.dict(
310310
"os.environ",
311311
{
312-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER: "credential_provider"
312+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER: "credential_provider"
313313
},
314314
)
315315
def test_that_missing_entry_point_raises_exception(self):
@@ -319,7 +319,7 @@ def test_that_missing_entry_point_raises_exception(self):
319319
@patch.dict(
320320
"os.environ",
321321
{
322-
OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER: "credential_provider"
322+
_OTEL_PYTHON_EXPORTER_OTLP_GRPC_CREDENTIAL_PROVIDER: "credential_provider"
323323
},
324324
)
325325
@patch("opentelemetry.exporter.otlp.proto.grpc.exporter.entry_points")

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/_common/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
import requests
1919

2020
from opentelemetry.sdk.environment_variables import (
21-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_CREDENTIAL_PROVIDER,
22-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_LOGS_CREDENTIAL_PROVIDER,
23-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER,
24-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_TRACES_CREDENTIAL_PROVIDER,
21+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_CREDENTIAL_PROVIDER,
22+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_LOGS_CREDENTIAL_PROVIDER,
23+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER,
24+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_TRACES_CREDENTIAL_PROVIDER,
2525
)
2626
from opentelemetry.util._importlib_metadata import entry_points
2727

@@ -36,13 +36,13 @@ def _is_retryable(resp: requests.Response) -> bool:
3636

3737
def _load_session_from_envvar(
3838
cred_envvar: Literal[
39-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_LOGS_CREDENTIAL_PROVIDER,
40-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_TRACES_CREDENTIAL_PROVIDER,
41-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER,
39+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_LOGS_CREDENTIAL_PROVIDER,
40+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_TRACES_CREDENTIAL_PROVIDER,
41+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER,
4242
],
4343
) -> Optional[requests.Session]:
4444
_credential_env = environ.get(
45-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_CREDENTIAL_PROVIDER
45+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_CREDENTIAL_PROVIDER
4646
) or environ.get(cred_envvar)
4747
if _credential_env:
4848
try:

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/_log_exporter/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
)
4242
from opentelemetry.sdk._shared_internal import DuplicateFilter
4343
from opentelemetry.sdk.environment_variables import (
44+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_LOGS_CREDENTIAL_PROVIDER,
4445
OTEL_EXPORTER_OTLP_CERTIFICATE,
4546
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE,
4647
OTEL_EXPORTER_OTLP_CLIENT_KEY,
@@ -55,7 +56,6 @@
5556
OTEL_EXPORTER_OTLP_LOGS_HEADERS,
5657
OTEL_EXPORTER_OTLP_LOGS_TIMEOUT,
5758
OTEL_EXPORTER_OTLP_TIMEOUT,
58-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_LOGS_CREDENTIAL_PROVIDER,
5959
)
6060
from opentelemetry.util.re import parse_env_headers
6161

@@ -125,7 +125,7 @@ def __init__(
125125
self._session = (
126126
session
127127
or _load_session_from_envvar(
128-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_LOGS_CREDENTIAL_PROVIDER
128+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_LOGS_CREDENTIAL_PROVIDER
129129
)
130130
or requests.Session()
131131
)

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
Resource as PB2Resource,
6868
)
6969
from opentelemetry.sdk.environment_variables import (
70+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER,
7071
OTEL_EXPORTER_OTLP_CERTIFICATE,
7172
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE,
7273
OTEL_EXPORTER_OTLP_CLIENT_KEY,
@@ -81,7 +82,6 @@
8182
OTEL_EXPORTER_OTLP_METRICS_HEADERS,
8283
OTEL_EXPORTER_OTLP_METRICS_TIMEOUT,
8384
OTEL_EXPORTER_OTLP_TIMEOUT,
84-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER,
8585
)
8686
from opentelemetry.sdk.metrics._internal.aggregation import Aggregation
8787
from opentelemetry.sdk.metrics.export import ( # noqa: F401
@@ -164,7 +164,7 @@ def __init__(
164164
self._session = (
165165
session
166166
or _load_session_from_envvar(
167-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER
167+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER
168168
)
169169
or requests.Session()
170170
)

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
_load_session_from_envvar,
3838
)
3939
from opentelemetry.sdk.environment_variables import (
40+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_TRACES_CREDENTIAL_PROVIDER,
4041
OTEL_EXPORTER_OTLP_CERTIFICATE,
4142
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE,
4243
OTEL_EXPORTER_OTLP_CLIENT_KEY,
@@ -51,7 +52,6 @@
5152
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT,
5253
OTEL_EXPORTER_OTLP_TRACES_HEADERS,
5354
OTEL_EXPORTER_OTLP_TRACES_TIMEOUT,
54-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_TRACES_CREDENTIAL_PROVIDER,
5555
)
5656
from opentelemetry.sdk.trace import ReadableSpan
5757
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
@@ -120,7 +120,7 @@ def __init__(
120120
self._session = (
121121
session
122122
or _load_session_from_envvar(
123-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_TRACES_CREDENTIAL_PROVIDER
123+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_TRACES_CREDENTIAL_PROVIDER
124124
)
125125
or requests.Session()
126126
)

exporter/opentelemetry-exporter-otlp-proto-http/tests/metrics/test_otlp_metrics_exporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
)
3636
from opentelemetry.exporter.otlp.proto.http.version import __version__
3737
from opentelemetry.sdk.environment_variables import (
38+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER,
3839
OTEL_EXPORTER_OTLP_CERTIFICATE,
3940
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE,
4041
OTEL_EXPORTER_OTLP_CLIENT_KEY,
@@ -51,7 +52,6 @@
5152
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE,
5253
OTEL_EXPORTER_OTLP_METRICS_TIMEOUT,
5354
OTEL_EXPORTER_OTLP_TIMEOUT,
54-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER,
5555
)
5656
from opentelemetry.sdk.metrics import (
5757
Counter,
@@ -156,7 +156,7 @@ def test_constructor_default(self):
156156
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: "https://metrics.endpoint.env",
157157
OTEL_EXPORTER_OTLP_METRICS_HEADERS: "metricsEnv1=val1,metricsEnv2=val2,metricEnv3===val3==,User-agent=metrics-user-agent",
158158
OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: "40",
159-
OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER: "credential_provider",
159+
_OTEL_PYTHON_EXPORTER_OTLP_HTTP_METRICS_CREDENTIAL_PROVIDER: "credential_provider",
160160
},
161161
)
162162
@patch("opentelemetry.exporter.otlp.proto.http._common.entry_points")

0 commit comments

Comments
 (0)