Skip to content
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

DBT-770: Removing logging from tracking adapter when disabled #140

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vamshikolanu
Copy link
Collaborator

Describe your changes

Currently, there are many logs regarding tracking adapter even when disabled. For example:

16:40:25  Tracker adapter: Usage tracking flag False. To turn on/off use usage_tracking flag in profiles.yml
16:40:25  Tracker adapter: Skipping Event {'event_type': 'open', 'auth': 'ldap', 'connection_state': <ConnectionState.OPEN: 'open'>, 'elapsed_time': '0.00'}

This patch will reduce the noise of these logs when its disabled

Internal Jira ticket number or external issue link

https://jira.cloudera.com/browse/DBT-770

Testing procedure/screenshots(if appropriate):

Before the change: https://gist.github.com/vamshikolanu/524bf70a4bd5199cc0d3f909790f2ac2
After the change: https://gist.github.com/vamshikolanu/03a8fe2add50b8c22c4a169c38b8b506

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have formatted my added/modified code to follow pep-8 standards
  • I have checked suggestions from python linter to make sure code is of good quality.

@@ -200,13 +200,8 @@ def track_usage(tracking_payload):

global usage_tracking

logger.debug(
f"Usage tracking flag {usage_tracking}. To turn on/off use usage_tracking flag in profiles.yml"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, we should avoid printing this line every time. May be only once during the whole run other remove it completely.

@@ -82,6 +82,7 @@ def dwx_target():
"user": os.getenv("DBT_HIVE_USER"),
"password": os.getenv("DBT_HIVE_PASSWORD"),
"http_path": os.getenv("DBT_HIVE_HTTP_PATH") or "cliservice",
"usage_tracking": False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make it configurable such that we can configure the following options rather than boolean value

  1. Send the events
  2. Log the events
  3. Completely skip (no log) the events.

if we can parse these logs, then these event logs can be useful to construct the timeline and queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants