snowflakedb / snowflake-sqlalchemy

Snowflake SQLAlchemy
https://pypi.python.org/pypi/snowflake-sqlalchemy/
Apache License 2.0
226 stars 147 forks source link

SNOW-1235013: Support CLIENT_TELEMETRY_ENABLED param #482

Open b-schmeling opened 3 months ago

b-schmeling commented 3 months ago

What is the current behavior?

My code is sending telemetry data to snowflake automatically. I am not sure exactly how to trigger the telemetry sending, but I would like to be able to turn it off.

Logs:

2024-03-14 14:45:54 2024-03-14T19:45:54.704869+0000 | DEBUG | snowflake.connector.telemetry | 1-Worker-1 | telemetry.close: Closing telemetry client. 2024-03-14 14:45:54 2024-03-14T19:45:54.708137+0000 | DEBUG | snowflake.connector.telemetry | 1-Worker-1 | telemetry.send_batch: Sending 1 logs to telemetry. Data is {'logs': [{'message': {'driver_type': 'PythonConnector', 'driver_version': '3.7.1', 'source': 'SnowflakeSQLAlchemy', 'type': 'client_imported_packages', 'value': "{...various packages}"}, 'timestamp': '1710445551682'}, {'message': {'driver_type': 'PythonConnector', 'driver_version': '3.7.1', 'source': 'SnowflakeSQLAlchemy', 'type': 'client_pyformat_empty_seq_interpolation', 'query_id': None, 'value': 0}, 'timestamp': '1710445551684'}, {'message': {'driver_type': 'PythonConnector', 'driver_version': '3.7.1', 'source': 'SnowflakeSQLAlchemy', 'type': 'client_time_consume_first_result', 'query_id': '', 'value': -37}, 'timestamp': '1710445551781'}, {'message': {'driver_type': 'PythonConnector', 'driver_version': '3.7.1', 'source': 'SnowflakeSQLAlchemy', 'type': 'client_time_consume_first_result', 'query_id': '', 'value': -37}, 'timestamp': '1710445551894'}, {'message': {'driver_type': 'PythonConnector', 'driver_version': '3.7.1', 'source': 'SnowflakeSQLAlchemy', 'type': 'client_time_consume_first_result', 'query_id': '*****', 'value': -35}, ...etc

What is the desired behavior?

I want to be able to set CLIENT_TELEMETRY_ENABLED and CLIENT_OUT_OF_BAND_TELEMETRY_ENABLED to false.

Similar to this feature in Snowpark

How would this improve snowflake-connector-python?

Give the ability to choose whether to send telemetry data to Snowflake for data sovereignty.

References, Other Background

Parameter defined in snowflake-controller-python

sfc-gh-dszmolka commented 3 months ago

hi and thank you for raising this with us - indeed it would be great to have parity with other clients. We will consider it for future enhancement decisions.

sfc-gh-dszmolka commented 3 months ago

possibly related issue from the underlying PythonConnector: https://github.com/snowflakedb/snowflake-connector-python/issues/1902