--- title: "How to use Tracer with Prefect" sidebarTitle: "Prefect" description: 'Runtime visibility beneath flow state' --- Prefect orchestrates data and scientific workflows by defining flows, tasks, and execution state across compute environments. It determines what runs, when it runs, and whether it succeeded, but it does not observe how tasks behave while executing inside processes, containers, or the operating system. Tracer complements Prefect by exposing execution behavior: CPU, memory, disk, and network usage, during flow runs, without modifying flow definitions or task code. For a conceptual overview, see [How Tracer fits in your stack](/comparisons/overview). ## What Prefect does well Prefect provides orchestration and state management for workflows, including: - Flow and task definitions - Scheduling and triggering of runs - Task retries, caching, and failure handling - Task logs, states, and execution history These capabilities make Prefect effective for coordinating and monitoring workflow execution. They focus on control flow and state, not on runtime behavior. ## What Prefect does not see at runtime While Prefect tracks task state, it does not observe execution inside tasks. It does not show: - CPU usage versus requested or available capacity - Memory pressure or over-allocation during task execution - Disk and network I/O contention - Short-lived subprocesses spawned within tasks - Idle time while tasks wait on I/O or external systems This information exists below the orchestration layer, inside the container and operating system. ## Why this gap matters in practice Prefect tasks often wrap complex tools, scripts, or libraries. Resource requirements are typically estimated conservatively to avoid failures. Without execution-level visibility, teams struggle to answer: - Why a task runs slower than expected - Whether allocated resources are actively used - Whether performance is limited by CPU, memory, disk, or network - Whether tasks are idle while still consuming infrastructure As a result, workflows may complete successfully but waste time and compute budget. ## What Tracer adds Tracer observes execution directly from the host and container runtime and adds: - Observed CPU, memory, disk, and network usage per task - Visibility into subprocesses and nested tools invoked by tasks - Detection of stalls, idle execution, and contention - Attribution of resource usage by flow run, task, and execution unit These insights are derived from observed behavior, not from task metadata or configuration.