nodes-stats.asciidoc 13 KB

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