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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions dbt/adapters/hive/cloudera_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

)

# if usage_tracking is disabled, quit
if not usage_tracking:
logger.debug(f"Skipping Event {tracking_payload}")
return

# fix the schema of tracking payload to be common for all events
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

}


Expand Down