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

move job link logging just after the job submit #697

Merged
merged 3 commits into from
Jun 28, 2023

Conversation

Kayrnt
Copy link
Contributor

@Kayrnt Kayrnt commented May 5, 2023

resolves #696

Description

So far the job link is logged once the fails or if the debug mode is enabled and the job is done.
However in a lot of cases, if you want to follow a job execution for a long running one (ie to look at execution plan or access the UI to cancel it manually), you have to find it again by using the job search on the UI/CLI which is inconvenient.

There is some small side effects because of that change:

  • If the job is retried, you have multiple logs (and the latest should be the relevant one)
  • if the job fails, the bq job link is done twice because we log at submission and then once again just after BQ notice us that it failed.

I think it's totally acceptable but feel free to challenge the design.

Checklist

@Kayrnt Kayrnt requested a review from a team as a code owner May 5, 2023 16:47
@Kayrnt Kayrnt requested a review from McKnight-42 May 5, 2023 16:47
@cla-bot cla-bot bot added the cla:yes label May 5, 2023
@Kayrnt Kayrnt force-pushed the early-job-logging branch from 5cf9c3d to 6e2d690 Compare May 5, 2023 16:54
@dbeatty10 dbeatty10 added the ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering label May 10, 2023
and query_job.job_id is not None
and query_job.project is not None
):
logger.debug(
Copy link

@rob-apella rob-apella Jun 1, 2023

Choose a reason for hiding this comment

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

hey @Kayrnt! what do you think about making this an info level log?

this job URL is super useful even beyond debugging code, since it's the ground truth of what logic and process is actually executing the model. I think it should be more readily available, understanding that most apps out there probably wouldn't enable debug logs in production

Copy link
Contributor

Choose a reason for hiding this comment

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

Hello @robsicurelli, I agree with you that it's making the logs unnecessarily verbose if you'd like to keep BQ links in your scheduler logs all the time.
I'm fine moving it to info but I'll let @Fleid call the shot on that one 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not against it, but that should be made into its own issue/PR rather than addressed here.
We need a visible comment section for people to complain, and an easy way to revert if there's unintended consequences ;)

Choose a reason for hiding this comment

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

@Fleid that sounds good to me. I'm happy to stamp this PR as-is, and open another issue for changing the log level

Copy link

@rob-apella rob-apella left a comment

Choose a reason for hiding this comment

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

LGTM

@mikealfare mikealfare self-assigned this Jun 28, 2023
@mikealfare mikealfare removed the request for review from McKnight-42 June 28, 2023 01:24
@mikealfare mikealfare merged commit ff77927 into dbt-labs:main Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ADAP-513] [Feature] Move the BQ Job link after the job submission instead of job done
6 participants