Skip to content

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.

@vamshikolanu vamshikolanu requested a review from niteshy April 8, 2024 16:46
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.

"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.

3 participants