Skip to content

Commit a0eef24

Browse files
committed
removed user logging for telemetry errors
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
1 parent 471f157 commit a0eef24

File tree

1 file changed

+13
-26
lines changed

1 file changed

+13
-26
lines changed

src/databricks/sql/telemetry/telemetry_client.py

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
import uuid
2727
import locale
2828

29-
logger = logging.getLogger(__name__)
30-
3129

3230
class BaseTelemetryClient(ABC):
3331
"""Abstract base class for telemetry clients."""
@@ -90,34 +88,23 @@ def flush(self):
9088

9189
def _send_telemetry(self, events):
9290
# Send telemetry events to the server
93-
try:
94-
request = {
95-
"uploadTime": int(time.time() * 1000),
96-
"items": [],
97-
"protoLogs": [event.to_json() for event in events],
98-
}
99-
100-
path = "/telemetry-ext" if self.is_authenticated else "/telemetry-unauth"
101-
url = f"https://{self.host_url}{path}"
102-
103-
headers = {"Accept": "application/json", "Content-Type": "application/json"}
91+
request = {
92+
"uploadTime": int(time.time() * 1000),
93+
"items": [],
94+
"protoLogs": [event.to_json() for event in events],
95+
}
10496

105-
if self.is_authenticated and self.auth_provider:
106-
self.auth_provider.add_headers(headers)
97+
path = "/telemetry-ext" if self.is_authenticated else "/telemetry-unauth"
98+
url = f"https://{self.host_url}{path}"
10799

108-
response = requests.post(
109-
url, data=json.dumps(request), headers=headers, timeout=10
110-
)
100+
headers = {"Accept": "application/json", "Content-Type": "application/json"}
111101

112-
if response.status_code != 200:
113-
logger.debug(
114-
"Failed to send telemetry: HTTP %d - %s",
115-
response.status_code,
116-
response.text,
117-
)
102+
if self.is_authenticated and self.auth_provider:
103+
self.auth_provider.add_headers(headers)
118104

119-
except Exception as e:
120-
logger.debug("Failed to send telemetry: %s", str(e))
105+
response = requests.post(
106+
url, data=json.dumps(request), headers=headers, timeout=10
107+
)
121108

122109
def close(self):
123110
# Flush remaining events and shut down executor

0 commit comments

Comments
 (0)