Skip to content

Testing for telemetry #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: telemetry
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/databricks/sql/telemetry/telemetry_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class TelemetryClient(BaseTelemetryClient):
# Telemetry endpoint paths
TELEMETRY_AUTHENTICATED_PATH = "/telemetry-ext"
TELEMETRY_UNAUTHENTICATED_PATH = "/telemetry-unauth"
DEFAULT_BATCH_SIZE = 10

def __init__(
self,
Expand All @@ -160,7 +161,7 @@ def __init__(
):
logger.debug("Initializing TelemetryClient for connection: %s", session_id_hex)
self._telemetry_enabled = telemetry_enabled
self._batch_size = 10 # TODO: Decide on batch size
self._batch_size = self.DEFAULT_BATCH_SIZE # TODO: Decide on batch size
self._session_id_hex = session_id_hex
self._auth_provider = auth_provider
self._user_agent = None
Expand Down Expand Up @@ -431,6 +432,9 @@ def close(session_id_hex):
logger.debug(
"No more telemetry clients, shutting down thread pool executor"
)
TelemetryClientFactory._executor.shutdown(wait=True)
try:
TelemetryClientFactory._executor.shutdown(wait=True)
except Exception as e:
logger.debug("Failed to shutdown thread pool executor: %s", e)
TelemetryClientFactory._executor = None
TelemetryClientFactory._initialized = False
Loading
Loading