Kedro-Telemetry
Kedro-Telemetry is a plugin for the Kedro framework that gathers anonymised and aggregated usage analytics. Its primary purpose is to help the Kedro team understand how Kedro is used, allowing them to prioritise product improvements. It currently ships as version 0.7.0 and integrates via `pluggy` hooks to send data to Heap Analytics.
Warnings
- breaking Support for Python 3.9 was dropped in version 0.7.0, making Python 3.10 the minimum supported version. Earlier versions (0.6.2) dropped Python 3.8. Kedro-Telemetry aims to support only actively maintained Python versions.
- gotcha Versions `kedro-telemetry >= 0.2.2` and `< 0.2.4` had a bug that led to the collection of project size metrics (datasets, pipelines, nodes) without explicit user consent. This issue was addressed in later versions, and affected data was deleted.
- gotcha In automated environments (e.g., CI/CD), if telemetry consent is not explicitly granted or denied, `kedro-telemetry` might spawn an interactive prompt, causing the pipeline to crash. This is especially critical since version 0.6.0, where telemetry became opt-out by default.
- deprecated Uninstalling `kedro-telemetry` using `pip uninstall kedro-telemetry` is strongly discouraged as a method to disable telemetry. It can break dependencies of the core Kedro framework and lead to `pip check` reporting issues.
Install
-
pip install kedro-telemetry
Imports
- No direct user imports
kedro-telemetry operates as a plugin for the Kedro CLI and runtime; users do not typically import symbols from it directly in their project code.
Quickstart
import os
# Opt-out of telemetry for the current environment
os.environ['KEDRO_DISABLE_TELEMETRY'] = '1'
# Alternatively, for a specific project, create a .telemetry file in the project root:
# with open('.telemetry', 'w') as f:
# f.write('consent: false')
# Or when creating a new Kedro project:
# kedro new --telemetry=no
# Example of running a Kedro command, which will now respect the opt-out setting
# (Note: This is illustrative, actual Kedro commands would be run from the shell)
print(f"KEDRO_DISABLE_TELEMETRY is set to: {os.environ.get('KEDRO_DISABLE_TELEMETRY')}")
print("Kedro commands executed in this environment will have telemetry disabled.")