Implementation:Apache Druid TasksCard
| Knowledge Sources | |
|---|---|
| Domains | Web_Console, Dashboard |
| Last Updated | 2026-02-10 10:00 GMT |
Overview
A React dashboard card component that displays task counts and cluster capacity on the home view of the Druid web console.
Description
The TasksCard component queries Druid for task status counts and optional cluster capacity information, rendering results inside a HomeViewCard container. Task counts are retrieved via a SQL query against sys.tasks grouped by status (with running tasks further broken down by runner status), or via the overlord REST API as a fallback. When overlord access is available, the component also fetches total task slot capacity. The card displays running, pending, successful, waiting, and failed task counts, along with total task slots when available. A helper function getTaskStatus maps running tasks to their runner status codes for accurate categorization.
Usage
Used on the Druid web console home view dashboard to provide a quick at-a-glance summary of ingestion task activity across the cluster, linking to the full tasks view when clicked.
Code Reference
Source Location
- Repository: Apache Druid
- File: web-console/src/views/home-view/tasks-card/tasks-card.tsx
- Lines: 1-120
Signature
export interface TaskCounts {
success?: number;
failed?: number;
running?: number;
pending?: number;
waiting?: number;
}
export interface TaskCountsAndCapacity extends TaskCounts, Partial<CapacityInfo> {}
export interface TasksCardProps {
capabilities: Capabilities;
}
export const TasksCard = React.memo(function TasksCard(props: TasksCardProps));
Import
import { TasksCard } from './tasks-card/tasks-card';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| capabilities | Capabilities | Yes | The current cluster capabilities object used to determine whether SQL or overlord API access is available for querying task counts and capacity |
Outputs
| Name | Type | Description |
|---|---|---|
| Rendered card | JSX.Element | A HomeViewCard displaying task slot count, running/pending/successful/waiting/failed task counts with loading/error states |
Usage Examples
Rendering the tasks card on the home view
<TasksCard capabilities={clusterCapabilities} />