nodes-stats.asciidoc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. [[cluster-nodes-stats]]
  2. === Nodes stats API
  3. ++++
  4. <titleabbrev>Nodes stats</titleabbrev>
  5. ++++
  6. Returns cluster nodes statistics.
  7. [[cluster-nodes-stats-api-request]]
  8. ==== {api-request-title}
  9. `GET /_nodes/stats` +
  10. `GET /_nodes/<node_id>/stats` +
  11. `GET/_nodes/stats/<metric>` +
  12. `GET/_nodes/<node_id>/stats/<metric>` +
  13. `GET /_nodes/stats/<metric>/<index_metric>` +
  14. `GET /_nodes/<node_id>/stats/<metric>/<index_metric>`
  15. [[cluster-nodes-stats-api-desc]]
  16. ==== {api-description-title}
  17. You can use the cluster nodes stats API to retrieve statistics for nodes in a cluster.
  18. All the nodes selective options are explained <<cluster-nodes,here>>.
  19. By default, all stats are returned. You can limit the returned information by
  20. using metrics.
  21. [[cluster-nodes-stats-api-path-params]]
  22. ==== {api-path-parms-title}
  23. `<metric>`::
  24. (Optional, string) Limits the information returned to the specific metrics.
  25. A comma-separated list of the following options:
  26. +
  27. --
  28. `adaptive_selection`::
  29. Statistics about <<search-adaptive-replica,adaptive replica selection>>.
  30. `breaker`::
  31. Statistics about the field data circuit breaker.
  32. `discovery`::
  33. Statistics about the discovery.
  34. `fs`::
  35. File system information, data path, free disk space, read/write
  36. stats.
  37. `http`::
  38. HTTP connection information.
  39. `indices`::
  40. Indices stats about size, document count, indexing and deletion times,
  41. search times, field cache size, merges and flushes.
  42. `ingest`::
  43. Statistics about ingest preprocessing.
  44. `jvm`::
  45. JVM stats, memory pool information, garbage collection, buffer
  46. pools, number of loaded/unloaded classes.
  47. `os`::
  48. Operating system stats, load average, mem, swap.
  49. `process`::
  50. Process statistics, memory consumption, cpu usage, open
  51. file descriptors.
  52. `thread_pool`::
  53. Statistics about each thread pool, including current size, queue and
  54. rejected tasks.
  55. `transport`::
  56. Transport statistics about sent and received bytes in cluster
  57. communication.
  58. --
  59. `<index_metric>`::
  60. (Optional, string) Limit the information returned for `indices` metric to
  61. the specific index metrics. It can be used only if `indices` (or `all`)
  62. metric is specified. Supported metrics are:
  63. +
  64. --
  65. * `completion`
  66. * `docs`
  67. * `fielddata`
  68. * `flush`
  69. * `get`
  70. * `indexing`
  71. * `merge`
  72. * `query_cache`
  73. * `recovery`
  74. * `refresh`
  75. * `request_cache`
  76. * `search`
  77. * `segments`
  78. * `store`
  79. * `translog`
  80. * `warmer`
  81. --
  82. include::{docdir}/rest-api/common-parms.asciidoc[tag=node-id]
  83. [[cluster-nodes-stats-api-query-params]]
  84. ==== {api-query-parms-title}
  85. include::{docdir}/rest-api/common-parms.asciidoc[tag=completion-fields]
  86. include::{docdir}/rest-api/common-parms.asciidoc[tag=fielddata-fields]
  87. include::{docdir}/rest-api/common-parms.asciidoc[tag=fields]
  88. include::{docdir}/rest-api/common-parms.asciidoc[tag=groups]
  89. include::{docdir}/rest-api/common-parms.asciidoc[tag=level]
  90. `types`::
  91. (Optional, string) A comma-separated list of document types for the
  92. `indexing` index metric.
  93. include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  94. include::{docdir}/rest-api/common-parms.asciidoc[tag=include-segment-file-sizes]
  95. [[cluster-nodes-stats-api-response-body]]
  96. ==== {api-response-body-title}
  97. [[cluster-nodes-stats-api-response-body-fs]]
  98. ===== `fs` section
  99. The `fs` flag can be set to retrieve information that concern the file system:
  100. `fs.timestamp`::
  101. Last time the file stores statistics have been refreshed.
  102. `fs.total.total_in_bytes`::
  103. Total size (in bytes) of all file stores.
  104. `fs.total.free_in_bytes`::
  105. Total number of unallocated bytes in all file stores.
  106. `fs.total.available_in_bytes`::
  107. Total number of bytes available to this Java virtual machine on all file
  108. stores. Depending on OS or process level restrictions, this might appear
  109. less than `fs.total.free_in_bytes`. This is the actual amount of free disk
  110. space the {es} node can utilise.
  111. `fs.data`::
  112. List of all file stores.
  113. `fs.data.path`::
  114. Path to the file store.
  115. `fs.data.mount`::
  116. Mount point of the file store (ex: /dev/sda2).
  117. `fs.data.type`::
  118. Type of the file store (ex: ext4).
  119. `fs.data.total_in_bytes`::
  120. Total size (in bytes) of the file store.
  121. `fs.data.free_in_bytes`::
  122. Total number of unallocated bytes in the file store.
  123. `fs.data.available_in_bytes`::
  124. Total number of bytes available to this Java virtual machine on this file
  125. store.
  126. `fs.io_stats.devices` (Linux only)::
  127. Array of disk metrics for each device that is backing an {es} data path.
  128. These disk metrics are probed periodically and averages between the last
  129. probe and the current probe are computed.
  130. `fs.io_stats.devices.device_name` (Linux only)::
  131. The Linux device name.
  132. `fs.io_stats.devices.operations` (Linux only)::
  133. The total number of read and write operations for the device completed since
  134. starting {es}.
  135. `fs.io_stats.devices.read_operations` (Linux only)::
  136. The total number of read operations for the device completed since starting
  137. {es}.
  138. `fs.io_stats.devices.write_operations` (Linux only)::
  139. The total number of write operations for the device completed since starting
  140. {es}.
  141. `fs.io_stats.devices.read_kilobytes` (Linux only)::
  142. The total number of kilobytes read for the device since starting {es}.
  143. `fs.io_stats.devices.write_kilobytes` (Linux only)::
  144. The total number of kilobytes written for the device since starting {es}.
  145. `fs.io_stats.operations` (Linux only)::
  146. The total number of read and write operations across all devices used by
  147. {es} completed since starting {es}.
  148. `fs.io_stats.read_operations` (Linux only)::
  149. The total number of read operations for across all devices used by {es}
  150. completed since starting {es}.
  151. `fs.io_stats.write_operations` (Linux only)::
  152. The total number of write operations across all devices used by {es}
  153. completed since starting {es}.
  154. `fs.io_stats.read_kilobytes` (Linux only)::
  155. The total number of kilobytes read across all devices used by {es} since
  156. starting {es}.
  157. `fs.io_stats.write_kilobytes` (Linux only)::
  158. The total number of kilobytes written across all devices used by {es} since
  159. starting {es}.
  160. [[cluster-nodes-stats-api-response-body-os]]
  161. ===== `os` section
  162. The `os` flag can be set to retrieve statistics that concern
  163. the operating system:
  164. `os.timestamp`::
  165. Last time the operating system statistics have been refreshed.
  166. `os.cpu.percent`::
  167. Recent CPU usage for the whole system, or -1 if not supported.
  168. `os.cpu.load_average.1m`::
  169. One-minute load average on the system (field is not present if one-minute
  170. load average is not available).
  171. `os.cpu.load_average.5m`::
  172. Five-minute load average on the system (field is not present if five-minute
  173. load average is not available).
  174. `os.cpu.load_average.15m`::
  175. Fifteen-minute load average on the system (field is not present if
  176. fifteen-minute load average is not available).
  177. `os.mem.total_in_bytes`::
  178. Total amount of physical memory in bytes.
  179. `os.mem.free_in_bytes`::
  180. Amount of free physical memory in bytes.
  181. `os.mem.free_percent`::
  182. Percentage of free memory.
  183. `os.mem.used_in_bytes`::
  184. Amount of used physical memory in bytes.
  185. `os.mem.used_percent`::
  186. Percentage of used memory.
  187. `os.swap.total_in_bytes`::
  188. Total amount of swap space in bytes.
  189. `os.swap.free_in_bytes`::
  190. Amount of free swap space in bytes.
  191. `os.swap.used_in_bytes`::
  192. Amount of used swap space in bytes.
  193. `os.cgroup.cpuacct.control_group` (Linux only)::
  194. The `cpuacct` control group to which the {es} process belongs.
  195. `os.cgroup.cpuacct.usage_nanos` (Linux only)::
  196. The total CPU time (in nanoseconds) consumed by all tasks in the same cgroup
  197. as the {es} process.
  198. `os.cgroup.cpu.control_group` (Linux only)::
  199. The `cpu` control group to which the {es} process belongs.
  200. `os.cgroup.cpu.cfs_period_micros` (Linux only)::
  201. The period of time (in microseconds) for how regularly all tasks in the same
  202. cgroup as the {es} process should have their access to CPU resources
  203. reallocated.
  204. `os.cgroup.cpu.cfs_quota_micros` (Linux only)::
  205. The total amount of time (in microseconds) for which all tasks in
  206. the same cgroup as the {es} process can run during one period
  207. `os.cgroup.cpu.cfs_period_micros`.
  208. `os.cgroup.cpu.stat.number_of_elapsed_periods` (Linux only)::
  209. The number of reporting periods (as specified by
  210. `os.cgroup.cpu.cfs_period_micros`) that have elapsed.
  211. `os.cgroup.cpu.stat.number_of_times_throttled` (Linux only)::
  212. The number of times all tasks in the same cgroup as the {es} process have
  213. been throttled.
  214. `os.cgroup.cpu.stat.time_throttled_nanos` (Linux only)::
  215. The total amount of time (in nanoseconds) for which all tasks in the same
  216. cgroup as the {es} process have been throttled.
  217. `os.cgroup.memory.control_group` (Linux only)::
  218. The `memory` control group to which the {es} process belongs.
  219. `os.cgroup.memory.limit_in_bytes` (Linux only)::
  220. The maximum amount of user memory (including file cache) allowed for all
  221. tasks in the same cgroup as the {es} process. This value can be too big to
  222. store in a `long`, so is returned as a string so that the value returned can
  223. exactly match what the underlying operating system interface returns. Any
  224. value that is too large to parse into a `long` almost certainly means no
  225. limit has been set for the cgroup.
  226. `os.cgroup.memory.usage_in_bytes` (Linux only)::
  227. The total current memory usage by processes in the cgroup (in bytes) by all
  228. tasks in the same cgroup as the {es} process. This value is stored as a
  229. string for consistency with `os.cgroup.memory.limit_in_bytes`.
  230. NOTE: For the cgroup stats to be visible, cgroups must be compiled into the
  231. kernel, the `cpu` and `cpuacct` cgroup subsystems must be configured and stats
  232. must be readable from `/sys/fs/cgroup/cpu` and `/sys/fs/cgroup/cpuacct`.
  233. [[cluster-nodes-stats-api-response-body-process]]
  234. ===== `process` section
  235. The `process` flag can be set to retrieve statistics that concern
  236. the current running process:
  237. `process.timestamp`::
  238. Last time the process statistics have been refreshed.
  239. `process.open_file_descriptors`::
  240. Number of opened file descriptors associated with the current process, or -1
  241. if not supported.
  242. `process.max_file_descriptors`::
  243. Maximum number of file descriptors allowed on the system, or -1 if not
  244. supported.
  245. `process.cpu.percent`::
  246. CPU usage in percent, or -1 if not known at the time the stats are computed
  247. `process.cpu.total_in_millis`::
  248. CPU time (in milliseconds) used by the process on which the Java virtual
  249. machine is running, or -1 if not supported.
  250. `process.mem.total_virtual_in_bytes`::
  251. Size in bytes of virtual memory that is guaranteed to be available to the
  252. running process.
  253. [[cluster-nodes-stats-api-response-body-ingest]]
  254. ===== `ingest` section
  255. The `ingest` flag can be set to retrieve statistics that concern ingest:
  256. `ingest.total.count`::
  257. (integer)
  258. Total number of documents ingested during the lifetime of this node.
  259. `ingest.total.time_in_millis`::
  260. (integer)
  261. Total time spent preprocessing ingest documents during the lifetime of this
  262. node.
  263. `ingest.total.current`::
  264. (integer)
  265. Total number of documents currently being ingested.
  266. `ingest.total.failed`::
  267. (integer)
  268. Total number of failed ingest operations during the lifetime of this node.
  269. `ingest.pipelines.<pipeline-id>.count`::
  270. (integer)
  271. Number of documents preprocessed by the ingest pipeline.
  272. `ingest.pipelines.<pipeline-id>.time_in_millis`::
  273. (integer)
  274. Total time spent preprocessing documents in the ingest pipeline.
  275. `ingest.pipelines.<pipeline-id>.failed`::
  276. (integer)
  277. Total number of failed operations for the ingest pipeline.
  278. `ingest.pipelines.<pipeline-id>.<processor>.count`::
  279. (integer)
  280. Number of documents transformed by the processor.
  281. `ingest.pipelines.<pipeline-id>.<processor>.time_in_millis`::
  282. (integer)
  283. Time spent by the processor transforming documents.
  284. `ingest.pipelines.<pipeline-id>.<processor>.current`::
  285. (integer)
  286. Number of documents currently being transformed by the processor.
  287. `ingest.pipelines.<pipeline-id>.<processor>.failed`::
  288. (integer)
  289. Number of failed operations for the processor.
  290. [[cluster-nodes-stats-api-response-body-adaptive-selection]]
  291. ===== `adaptive_selection` section
  292. The `adaptive_selection` flag can be set to retrieve statistics that concern
  293. <<search-adaptive-replica,adaptive replica selection>>. These statistics are
  294. keyed by node. For each node:
  295. `adaptive_selection.outgoing_searches`::
  296. The number of outstanding search requests from the node these stats are for
  297. to the keyed node.
  298. `avg_queue_size`::
  299. The exponentially weighted moving average queue size of search requests on
  300. the keyed node.
  301. `avg_service_time_ns`::
  302. The exponentially weighted moving average service time of search requests on
  303. the keyed node.
  304. `avg_response_time_ns`::
  305. The exponentially weighted moving average response time of search requests
  306. on the keyed node.
  307. `rank`::
  308. The rank of this node; used for shard selection when routing search
  309. requests.
  310. [[cluster-nodes-stats-api-example]]
  311. ==== {api-examples-title}
  312. [source,console]
  313. --------------------------------------------------
  314. # return just indices
  315. GET /_nodes/stats/indices
  316. # return just os and process
  317. GET /_nodes/stats/os,process
  318. # return just process for node with IP address 10.0.0.1
  319. GET /_nodes/10.0.0.1/stats/process
  320. --------------------------------------------------
  321. All stats can be explicitly requested via `/_nodes/stats/_all` or
  322. `/_nodes/stats?metric=_all`.
  323. You can get information about indices stats on `node`, `indices`, or `shards`
  324. level.
  325. [source,console]
  326. --------------------------------------------------
  327. # Fielddata summarized by node
  328. GET /_nodes/stats/indices/fielddata?fields=field1,field2
  329. # Fielddata summarized by node and index
  330. GET /_nodes/stats/indices/fielddata?level=indices&fields=field1,field2
  331. # Fielddata summarized by node, index, and shard
  332. GET /_nodes/stats/indices/fielddata?level=shards&fields=field1,field2
  333. # You can use wildcards for field names
  334. GET /_nodes/stats/indices/fielddata?fields=field*
  335. --------------------------------------------------
  336. You can get statistics about search groups for searches executed
  337. on this node.
  338. [source,console]
  339. --------------------------------------------------
  340. # All groups with all stats
  341. GET /_nodes/stats?groups=_all
  342. # Some groups from just the indices stats
  343. GET /_nodes/stats/indices?groups=foo,bar
  344. --------------------------------------------------
  345. [[cluster-nodes-stats-ingest-ex]]
  346. ===== Retrieve ingest statistics only
  347. To return only ingest-related node statistics, set the `<metric>` path
  348. parameter to `ingest` and use the
  349. <<common-options-response-filtering,`filter_path`>> query parameter.
  350. [source,console]
  351. --------------------------------------------------
  352. GET /_nodes/stats/ingest?filter_path=nodes.*.ingest
  353. --------------------------------------------------
  354. You can use the `metric` and `filter_path` query parameters to get the same
  355. response.
  356. [source,console]
  357. --------------------------------------------------
  358. GET /_nodes/stats?metric=ingest&filter_path=nodes.*.ingest
  359. --------------------------------------------------
  360. To further refine the response, change the `filter_path` value.
  361. For example, the following request only returns ingest pipeline statistics.
  362. [source,console]
  363. --------------------------------------------------
  364. GET /_nodes/stats?metric=ingest&filter_path=nodes.*.ingest.pipelines
  365. --------------------------------------------------