Skip to content

Commit

Permalink
Add in a link to the worker logs page (#15958)
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-phinizy authored Nov 8, 2024
1 parent 41d3906 commit 6b50a2b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/prefect/workers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
resolve_block_document_references,
resolve_variables,
)
from prefect.utilities.urls import url_for

if TYPE_CHECKING:
from prefect.client.schemas.objects import Flow, FlowRun
Expand Down Expand Up @@ -872,6 +873,17 @@ async def _submit_scheduled_flow_runs(
run_logger.info(
f"Worker '{self.name}' submitting flow run '{flow_run.id}'"
)
if (
get_current_settings().experiments.worker_logging_to_api_enabled
and self.backend_id
):
worker_path = f"worker/{self.backend_id}"
base_url = url_for("work-pool", self._work_pool.id)

run_logger.info(
f"Running on worker id: {self.backend_id}. See worker logs here: {base_url}/{worker_path}"
)

self._submitting_flow_run_ids.add(flow_run.id)
self._runs_task_group.start_soon(
self._submit_run,
Expand Down

0 comments on commit 6b50a2b

Please sign in to comment.