You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable telemetry for kedro new and other commands executed outside of kedro project folder (e.g. before project creation).
Context
Currently, kedro-telemetry doesn't work with the kedro new command. I believe this is due to the following reasons:
To participate in telemetry, the kedro-telemetry plugin needs to be installed. However, it is only installed after creating the project with the kedro new command and running pip install -r requirements.txt. But even if the plugin is pre-installed, kedro new will not be covered by telemetry.
It wasn't possible to provide consent: false before the project's folder was created.
There were issues in a packaged mode with writing a file in a read-only environment.
With the shift to opt-out consent in #715, and the introduction of new ways to disable telemetry in #728, it would be reasonable to send telemetry in the pre-command hook of any command, including kedro new. With opt-out consent, we will stop asking for consent and will avoid problems with writing an answer.
Important:
However, we should continue not sending telemetry in packaged mode for the first iteration of the opt-out flow. This is so we can determine more easily what the impact is of changing to an opt-out model. Immediately collecting data for packaged projects would muddle the effect.
So we need to change how we determine the packaged mode. Currently, we use:
if not project_metadata: # in package mode
return
and it works for package mode but also disables it for kedro new commands.
The text was updated successfully, but these errors were encountered:
merelcht
changed the title
kedro-telemetry: enable telemetry for "kedro new" and other commands executed outside of kedro project folderkedro-telemetry: Spike how to enable telemetry for "kedro new" and other commands executed outside of kedro project folder
Jul 1, 2024
I observed that the current comments about working in package mode inside plugin.py are likely incorrect:
class KedroTelemetryCLIHooks:
"""Hook to send CLI command data to Heap"""
@cli_hook_impl
def before_command_run(
self, project_metadata: ProjectMetadata, command_args: list[str]
):
"""Hook implementation to send command run data to Heap"""
try:
if not project_metadata: # in package mode
return
This hook will only work when a Kedro CLI command is executed. If the Kedro project is packaged and executed with the package_name command, the run command will be executed directly without using CLI and hooks. Therefore, in the current design, we will not collect telemetry data in package mode even without the above code.
To allow telemetry collection with the kedro new command, we need to remove these lines:
if not project_metadata: # in package mode
return
and restructure the code below them. At the time of executing that command, no project is created, which means no information about the Kedro project is available.
For consistency, this change should be made after merging PR #760 and addressing Issue #728.
Description
Enable telemetry for
kedro new
and other commands executed outside of kedro project folder (e.g. before project creation).Context
Currently,
kedro-telemetry
doesn't work with thekedro new
command. I believe this is due to the following reasons:kedro-telemetry
plugin needs to be installed. However, it is only installed after creating the project with thekedro new
command and runningpip install -r requirements.txt
. But even if the plugin is pre-installed,kedro new
will not be covered by telemetry.consent: false
before the project's folder was created.With the shift to opt-out consent in #715, and the introduction of new ways to disable telemetry in #728, it would be reasonable to send telemetry in the pre-command hook of any command, including
kedro new
. With opt-out consent, we will stop asking for consent and will avoid problems with writing an answer.Important:
However, we should continue not sending telemetry in packaged mode for the first iteration of the opt-out flow. This is so we can determine more easily what the impact is of changing to an opt-out model. Immediately collecting data for packaged projects would muddle the effect.
So we need to change how we determine the packaged mode. Currently, we use:
and it works for package mode but also disables it for
kedro new
commands.The text was updated successfully, but these errors were encountered: