Principle:SeleniumHQ Selenium Grid Health Monitoring
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Distributed_Testing, Observability, Selenium_Grid |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
Mechanism for observing Grid health, node availability, session counts, and component status through REST endpoints, GraphQL API, and web UI.
Description
Selenium Grid provides multiple monitoring interfaces:
- /status REST endpoint: Powered by GridStatusHandler, which queries Distributor.getStatus() with a 2-second timeout. Returns JSON with readiness state (true if any node is UP with available capacity), node information (id, uri, maxSessions, sessionTimeout, osInfo, heartbeatPeriod, availability, version, slots), and a human-readable message.
- GraphQL API at /graphql: Served by GraphqlHandler, which uses a schema defined in selenium-grid-schema.graphqls and wired via GridData and SessionData data fetchers. Supports queries for grid metadata, node information, and session details. Uses a Caffeine cache (5% of heap, 30-minute TTL) for parsed query documents.
- Grid UI at /ui: Served by GridUiRoute, a React-based web application loaded from classpath resources. Can be disabled via RouterOptions.disableUi().
- /readyz endpoint: A Kubernetes-compatible liveness probe that bypasses authentication.
Usage
Use /status for simple health checks and load balancer probes. Use GraphQL for detailed programmatic monitoring and alerting. Use the Grid UI for visual inspection during debugging or demonstrations. Use /readyz for Kubernetes liveness probes when authentication is enabled.
Theoretical Basis
# Monitoring Endpoints
GET /status -> GridStatusHandler -> Distributor.getStatus() (2s timeout)
-> { "value": { "ready": boolean, "message": string, "nodes": [...] } }
-> ready = any node is UP AND has capacity
POST /graphql -> GraphqlHandler -> GraphQL schema execution
-> { "data": { "grid": {...}, "nodesInfo": {...}, "sessionsInfo": {...} } }
GET /ui -> GridUiRoute -> React web application (classpath resource)
GET /readyz -> Readiness check (bypasses BasicAuthenticationFilter)
-> "Standalone is true" or "Router is true"
# Status Node Fields
{
"id": NodeId,
"uri": URI,
"maxSessions": int,
"sessionTimeout": long (millis),
"osInfo": Map,
"heartbeatPeriod": long (millis),
"availability": "UP"|"DOWN"|"DRAINING",
"version": String,
"slots": [...]
}
Related Pages
Implemented By
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment