-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat(telemetry): Implement telemetry message notification #760
Conversation
Signed-off-by: Dmitry Sorokin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @DimedS, LGTM!
I have one question regarding catching general exception inside before_command_run
but not in after_catalog_created
. Do we need it since we're catching RequestException
inside _send_heap_event
? Maybe we can replace it to more specific exceptions instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the logger from logging.getLogger(name) to logging.getLogger("kedro.telemetry") because the current logger did not work, and notifications from the telemetry module were not visible.
I wonder is there a better solution for this. This feels hacky as it only works because kedro's logging.yml
expose the kedro
logger and thus kedro.telemetry
would work. Can we set the logging level at a pacakge level instead?
@@ -219,15 +226,10 @@ def after_context_created(self, context): | |||
|
|||
@hook_impl | |||
def after_catalog_created(self, catalog): | |||
# The user notification message is sent only once per command during the before_command_run hook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about runs that does not go through CLI, i.e. session.run
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @noklam, good point. As I understand it, in the current PR, telemetry will be sent in the after_catalog_created()
hook without user notification. I propose addressing this issue here: GitHub Issue #730.
In that PR, we can modify the logic to send one heap event per user command and update user notifications accordingly:
- If it's a CLI command and the catalog is created, send one heap event in the
after_catalog_created()
hook along with a user notification message. - If it's a CLI command and the catalog is not created, send one heap event in the
before_command_run()
hook along with a user notification message. - If it's not a CLI command and the catalog is created, send one heap event in the
after_catalog_created()
hook along with a user notification message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, let's address this in #730
Signed-off-by: Dmitry Sorokin <[email protected]>
Thanks, @noklam. I made that change. Originally I intended to inherit the logging configuration from Kedro settings. Do you think that's not a good approach? |
Thank you for the comment, @ElenaKhaustova. I agree that the current try-except blocks might be excessive. I propose addressing this in the final step of the telemetry code refactoring, in issue #730. |
Signed-off-by: Dmitry Sorokin <[email protected]>
As |
Signed-off-by: Dmitry Sorokin <[email protected]>
2a69763
to
19f55ba
Compare
|
Signed-off-by: Dmitry Sorokin <[email protected]>
Signed-off-by: Dmitry Sorokin <[email protected]>
Signed-off-by: Dmitry Sorokin <[email protected]>
Signed-off-by: Dmitry Sorokin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Signed-off-by: Dmitry Sorokin <[email protected]>
) * Implement telemetry message notification Signed-off-by: Dmitry Sorokin <[email protected]> * Fix docs build Signed-off-by: Dmitry Sorokin <[email protected]> --------- Signed-off-by: Dmitry Sorokin <[email protected]> Signed-off-by: Merel Theisen <[email protected]>
Description
This PR implements a new notification that is sent only once per Kedro command execution according to issue #727.
Changes Made
logging.getLogger(__name__)
tologging.getLogger("kedro.telemetry")
because the current logger did not work, and notifications from the telemetry module were not visible.before_command_run()
hook, which will be executed before any Kedro command.Checklist
RELEASE.md
file