Skip to content

Commit

Permalink
Do not overwrite endpoint arg
Browse files Browse the repository at this point in the history
Suggestion from #3362 (comment)
  • Loading branch information
sk- committed Jun 29, 2023
1 parent eb8f49d commit 976d5f6
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ def __init__(
):
super().__init__()

endpoint = endpoint or environ.get(
self._endpoint = endpoint or environ.get(
OTEL_EXPORTER_OTLP_ENDPOINT, "http://localhost:4317"
)

parsed_url = urlparse(endpoint)
parsed_url = urlparse(self._endpoint)

if parsed_url.scheme == "https":
insecure = False
Expand All @@ -197,8 +197,7 @@ def __init__(
insecure = False

if parsed_url.netloc:
endpoint = parsed_url.netloc
self._endpoint = endpoint
self._endpoint = parsed_url.netloc

self._headers = headers or environ.get(OTEL_EXPORTER_OTLP_HEADERS)
if isinstance(self._headers, str):
Expand Down

0 comments on commit 976d5f6

Please sign in to comment.