Implementation:Apache Druid ServicesCard
| Knowledge Sources | |
|---|---|
| Domains | Web_Console, Dashboard |
| Last Updated | 2026-02-10 10:00 GMT |
Overview
A React dashboard card component that displays service instance counts grouped by type on the home view of the Druid web console.
Description
The ServicesCard component queries Druid for service (server) counts and renders them inside a HomeViewCard container. It supports two data retrieval paths: a SQL-based query against sys.servers grouped by server_type when SQL capabilities are available, and a fallback REST API path using coordinator and overlord endpoints. The card displays counts for all Druid service types organized in pairs: overlord/coordinator, router/broker, historical/middle manager, and peon/indexer, using the PluralPairIfNeeded component to format the display. It uses the useQueryManager hook for async data fetching.
Usage
Used on the Druid web console home view dashboard to provide a quick at-a-glance summary of running service instances across the cluster, linking to the full services view when clicked.
Code Reference
Source Location
- Repository: Apache Druid
- File: web-console/src/views/home-view/services-card/services-card.tsx
- Lines: 1-117
Signature
export interface ServiceCounts {
coordinator?: number;
overlord?: number;
router?: number;
broker?: number;
historical?: number;
middle_manager?: number;
peon?: number;
indexer?: number;
}
export interface ServicesCardProps {
capabilities: Capabilities;
}
export const ServicesCard = React.memo(function ServicesCard(props: ServicesCardProps));
Import
import { ServicesCard } from './services-card/services-card';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| capabilities | Capabilities | Yes | The current cluster capabilities object used to determine whether SQL, coordinator, or overlord API access is available for querying service counts |
Outputs
| Name | Type | Description |
|---|---|---|
| Rendered card | JSX.Element | A HomeViewCard displaying paired service type counts (overlord/coordinator, router/broker, historical/middle manager, peon/indexer) with loading/error states |
Usage Examples
Rendering the services card on the home view
<ServicesCard capabilities={clusterCapabilities} />