Monitoring & metrics
|
This section documents the current Solr line (10.0; 9.10.x the maintained 9.x branch), written and verified against the Apache Solr Reference Guide. No specific patch version is pinned. Some capabilities (the Solr Operator on Kubernetes, the package-manager ecosystem, Learning To Rank model training, and expert plugin development) are linked, not documented in depth. This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. This section’s bibliography lists the reference material consulted while preparing these pages. |
Once a collection is up, "is it healthy and how fast is it" is answered by five largely independent tools: the Metrics API (and what scrapes it), a load-balancer-friendly health check, an admin-UI screen for eyeballing plugin stats, the logs (including a dedicated slow-query log), and request tracing. This page covers all five, plus the Task Management API for inspecting and cancelling requests that are already running. For the cache and request-handler settings these metrics report on, see Configuration: solrconfig.xml, the Config API & caches; for where to run the pieces described here (which process, which port, behind which proxy), see Deployment & upgrades.
The Metrics API
Every Solr node exposes /admin/metrics, scoped to that node’s JVM plus every core it hosts. Metrics
are organized into registries — solr.node (node/CoreContainer-level, solr_node_* when
rendered), solr.core.<name> (per-core, solr_core_*), solr.jvm (heap, GC, threads — on by
default), and, in SolrCloud, solr.cluster (Overseer). The endpoint defaults to Prometheus
exposition format; add wt=openmetrics for OpenMetrics (which also carries trace exemplars when
distributed tracing is enabled).
# Everything this node knows about, in Prometheus format (the default).
curl "http://localhost:8983/solr/admin/metrics"
# Same, explicit format, or OpenMetrics.
curl "http://localhost:8983/solr/admin/metrics?wt=prometheus"
curl "http://localhost:8983/solr/admin/metrics?wt=openmetrics"
# Scope to one collection, one core, or a comma-separated list of cores.
curl "http://localhost:8983/solr/admin/metrics?collection=products"
curl "http://localhost:8983/solr/admin/metrics?core=products_shard1_replica_n1"
# Filter by category and/or a specific metric name.
curl "http://localhost:8983/solr/admin/metrics?category=QUERY,UPDATE"
curl "http://localhost:8983/solr/admin/metrics?name=solr_core_index_size_bytes&collection=products"
# In SolrCloud, further scope by shard or replica type (NRT, TLOG, PULL).
curl "http://localhost:8983/solr/admin/metrics?collection=products&shard=shard1&replica_type=NRT"
Alongside the pull-based API, Solr can push the same metrics via OTLP (gRPC or HTTP) to any OpenTelemetry-compatible backend, so a cluster can be wired into an existing observability stack without a separate scraper. JMX reporting is still available for tools that expect it. See Metrics Reporting and JMX with Solr.
The Prometheus exporter
For a self-hosted Prometheus/Grafana stack, Solr ships a standalone exporter process — prometheus-exporter/ in the full distribution, run separately from any Solr node — rather than
having each node serve Prometheus text format directly for this purpose. It polls the Ping,
Metrics, Collections, and search/facet APIs on a schedule and republishes the results as Prometheus
metrics, driven by a solr-exporter-config.xml file whose <ping>, <metrics>, <collections>,
and <search> rules use JQ expressions to turn each API response into named, labeled metric values.
cd prometheus-exporter/
# Standalone / user-managed, pointed at one node's base URL.
./bin/solr-exporter -p 9854 -b http://localhost:8983/solr \
--config-file ./conf/solr-exporter-config.xml --num-threads 8
# SolrCloud: point at ZooKeeper instead so the exporter discovers all nodes.
./bin/solr-exporter -p 9854 -z localhost:2181/solr \
--config-file ./conf/solr-exporter-config.xml --num-threads 16
# Prometheus then scrapes the exporter itself.
curl "http://localhost:9854/metrics"
See Monitoring Solr with Prometheus and Grafana, which also links a starter Grafana dashboard.
/admin/ping and load-balancer health checks
/admin/ping is a per-core (or, with distrib=true, cluster-wide) request handler purpose-built
for load balancers: a cheap, uniform "is this core/collection reachable" check independent of query
content. Its behavior — which query it runs internally, and any healthcheck-file gating — is
configured through the Request Parameters API paramset bound to the /admin/ping handler rather than
directly in solrconfig.xml.
# Single core/replica.
curl "http://localhost:8983/solr/products/admin/ping"
# Cluster-wide: fan out to every active replica of the collection.
curl "http://localhost:8983/solr/products/admin/ping?distrib=true"
A healthy core answers <str name="status">OK</str> with a QTime; point the load balancer’s
health-check probe at this URL (per node, per core) rather than at a search endpoint, so a slow
query never gets misread as node failure. See
Ping.
The Plugins/Stats screen
The admin UI’s Plugins / Stats screen is the point-and-click counterpart to the metrics and performance-statistics APIs: pick a category (caches, request handlers, search components, the searcher) from the sidebar and drill into live counters for a specific core, without writing a query. Two refresh modes help while watching a change happen: Watch Changes highlights values that moved since the last poll, and Refresh Values just reloads the snapshot. The same request-handler and cache counters it displays are documented, field by field, at Performance Statistics Reference — useful when deriving a rate (QPS, avg latency) from the cumulative counts the UI shows.
Request logging and the slow-query log
Beyond the main Solr log, a slow-query log is opt-in per request handler: set
<slowQueryThresholdMillis> inside the handler’s <query> block in solrconfig.xml, and any
request the handler serves past that threshold is logged at WARN to a dedicated
solr_slow_requests.log in SOLR_LOGS_DIR, alongside the normal request log. In SolrCloud, every
distributed request also carries a request id (rid) through every shard it touches, so a slow or
failed query can be correlated across nodes in the logs; add disableRequestId=true to turn it off
for a request. logParamsList narrows what gets logged to a specific set of request parameters,
useful when query bodies are large or sensitive.
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
</lst>
<lst name="query">
<int name="slowQueryThresholdMillis">1000</int>
</lst>
</requestHandler>
See Configuring Logging.
Distributed tracing
For request-scoped visibility that spans multiple shards and nodes — where a single search actually spent its time — Solr integrates with OpenTelemetry to propagate a trace context across the distributed request and export spans to a tracing backend (Jaeger, Zipkin, or anything OTLP-capable). This complements the aggregate counters from the Metrics API with per-request timelines, and pairs with the OpenMetrics exemplars mentioned above, which link a metric bucket back to a sample trace. See Distributed Tracing.
Task Management API
Long-running search requests (today; more task types are expected later) can opt into being tracked
and cancellable by adding canCancel=true (and, optionally, a caller-supplied queryUUID) to the
request. Once tracked, the task shows up for listing and can be cancelled by id — useful for killing
a runaway query, or an expensive relevance experiment left running by mistake, without restarting the
node.
# Issue a cancellable, identifiable query.
curl "http://localhost:8983/solr/products/select?q=*:*&canCancel=true&queryUUID=nightly-report-1"
# List every tracked task on the collection.
curl "http://localhost:8983/solr/products/tasks/list"
# Check one task's status, or cancel it by id.
curl "http://localhost:8983/solr/products/tasks/list?taskUUID=nightly-report-1"
curl "http://localhost:8983/solr/products/tasks/cancel?queryUUID=nightly-report-1"
The same operations exist under /v2/collections/<collection>/tasks/…. See
Task Management.
Where to next
Metrics and stats are read-only views into settings tuned elsewhere: cache sizing and autowarming live in Configuration: solrconfig.xml, the Config API & caches, and indexing-side counters (merge and flush metrics, transaction-log stats) are covered alongside the write path in Indexing internals & performance. For running the exporter and admin UI behind authentication, see Security; for where each process runs in production, see Deployment & upgrades.