nodes-stats.asciidoc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  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. `completion_fields`::
  83. (Optional, string) A comma-separated list of fields for `fielddata` and
  84. `suggest` index metric (supports wildcards).
  85. `fielddata_fields`::
  86. (Optional, string) A comma-separated list of fields for `fielddata` index
  87. metric (supports wildcards).
  88. `fields`::
  89. (Optional, string) A comma-separated list of fields for `fielddata` and
  90. `completion` index metric (supports wildcards).
  91. `groups`::
  92. (Optional, string) A comma-separated list of search groups for `search`
  93. index metric.
  94. `level`::
  95. (Optional, string) Returns indices stats aggregated at index, node or shard
  96. level. Supported options: `indices`, `node`, `shards`.
  97. `types`::
  98. (Optional, string) A comma-separated list of document types for the
  99. `indexing` index metric.
  100. include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  101. `include_segment_file_sizes`::
  102. (Optional, boolean) If `true`, the call reports the aggregated disk usage of
  103. each one of the Lucene index files (only applies if segment stats are
  104. requested). Defaults to `false`.
  105. [[cluster-nodes-stats-api-response-body]]
  106. ==== {api-response-body-title}
  107. The `fs` flag can be set to retrieve information that concern the file system:
  108. `fs.timestamp`::
  109. Last time the file stores statistics have been refreshed.
  110. `fs.total.total_in_bytes`::
  111. Total size (in bytes) of all file stores.
  112. `fs.total.free_in_bytes`::
  113. Total number of unallocated bytes in all file stores.
  114. `fs.total.available_in_bytes`::
  115. Total number of bytes available to this Java virtual machine on all file
  116. stores. Depending on OS or process level restrictions, this might appear
  117. less than `fs.total.free_in_bytes`. This is the actual amount of free disk
  118. space the {es} node can utilise.
  119. `fs.data`::
  120. List of all file stores.
  121. `fs.data.path`::
  122. Path to the file store.
  123. `fs.data.mount`::
  124. Mount point of the file store (ex: /dev/sda2).
  125. `fs.data.type`::
  126. Type of the file store (ex: ext4).
  127. `fs.data.total_in_bytes`::
  128. Total size (in bytes) of the file store.
  129. `fs.data.free_in_bytes`::
  130. Total number of unallocated bytes in the file store.
  131. `fs.data.available_in_bytes`::
  132. Total number of bytes available to this Java virtual machine on this file
  133. store.
  134. `fs.io_stats.devices` (Linux only)::
  135. Array of disk metrics for each device that is backing an {es} data path.
  136. These disk metrics are probed periodically and averages between the last
  137. probe and the current probe are computed.
  138. `fs.io_stats.devices.device_name` (Linux only)::
  139. The Linux device name.
  140. `fs.io_stats.devices.operations` (Linux only)::
  141. The total number of read and write operations for the device completed since
  142. starting {es}.
  143. `fs.io_stats.devices.read_operations` (Linux only)::
  144. The total number of read operations for the device completed since starting
  145. {es}.
  146. `fs.io_stats.devices.write_operations` (Linux only)::
  147. The total number of write operations for the device completed since starting
  148. {es}.
  149. `fs.io_stats.devices.read_kilobytes` (Linux only)::
  150. The total number of kilobytes read for the device since starting {es}.
  151. `fs.io_stats.devices.write_kilobytes` (Linux only)::
  152. The total number of kilobytes written for the device since starting {es}.
  153. `fs.io_stats.operations` (Linux only)::
  154. The total number of read and write operations across all devices used by
  155. {es} completed since starting {es}.
  156. `fs.io_stats.read_operations` (Linux only)::
  157. The total number of read operations for across all devices used by {es}
  158. completed since starting {es}.
  159. `fs.io_stats.write_operations` (Linux only)::
  160. The total number of write operations across all devices used by {es}
  161. completed since starting {es}.
  162. `fs.io_stats.read_kilobytes` (Linux only)::
  163. The total number of kilobytes read across all devices used by {es} since
  164. starting {es}.
  165. `fs.io_stats.write_kilobytes` (Linux only)::
  166. The total number of kilobytes written across all devices used by {es} since
  167. starting {es}.
  168. The `os` flag can be set to retrieve statistics that concern
  169. the operating system:
  170. `os.timestamp`::
  171. Last time the operating system statistics have been refreshed.
  172. `os.cpu.percent`::
  173. Recent CPU usage for the whole system, or -1 if not supported.
  174. `os.cpu.load_average.1m`::
  175. One-minute load average on the system (field is not present if one-minute
  176. load average is not available).
  177. `os.cpu.load_average.5m`::
  178. Five-minute load average on the system (field is not present if five-minute
  179. load average is not available).
  180. `os.cpu.load_average.15m`::
  181. Fifteen-minute load average on the system (field is not present if
  182. fifteen-minute load average is not available).
  183. `os.mem.total_in_bytes`::
  184. Total amount of physical memory in bytes.
  185. `os.mem.free_in_bytes`::
  186. Amount of free physical memory in bytes.
  187. `os.mem.free_percent`::
  188. Percentage of free memory.
  189. `os.mem.used_in_bytes`::
  190. Amount of used physical memory in bytes.
  191. `os.mem.used_percent`::
  192. Percentage of used memory.
  193. `os.swap.total_in_bytes`::
  194. Total amount of swap space in bytes.
  195. `os.swap.free_in_bytes`::
  196. Amount of free swap space in bytes.
  197. `os.swap.used_in_bytes`::
  198. Amount of used swap space in bytes.
  199. `os.cgroup.cpuacct.control_group` (Linux only)::
  200. The `cpuacct` control group to which the {es} process belongs.
  201. `os.cgroup.cpuacct.usage_nanos` (Linux only)::
  202. The total CPU time (in nanoseconds) consumed by all tasks in the same cgroup
  203. as the {es} process.
  204. `os.cgroup.cpu.control_group` (Linux only)::
  205. The `cpu` control group to which the {es} process belongs.
  206. `os.cgroup.cpu.cfs_period_micros` (Linux only)::
  207. The period of time (in microseconds) for how regularly all tasks in the same
  208. cgroup as the {es} process should have their access to CPU resources
  209. reallocated.
  210. `os.cgroup.cpu.cfs_quota_micros` (Linux only)::
  211. The total amount of time (in microseconds) for which all tasks in
  212. the same cgroup as the {es} process can run during one period
  213. `os.cgroup.cpu.cfs_period_micros`.
  214. `os.cgroup.cpu.stat.number_of_elapsed_periods` (Linux only)::
  215. The number of reporting periods (as specified by
  216. `os.cgroup.cpu.cfs_period_micros`) that have elapsed.
  217. `os.cgroup.cpu.stat.number_of_times_throttled` (Linux only)::
  218. The number of times all tasks in the same cgroup as the {es} process have
  219. been throttled.
  220. `os.cgroup.cpu.stat.time_throttled_nanos` (Linux only)::
  221. The total amount of time (in nanoseconds) for which all tasks in the same
  222. cgroup as the {es} process have been throttled.
  223. `os.cgroup.memory.control_group` (Linux only)::
  224. The `memory` control group to which the {es} process belongs.
  225. `os.cgroup.memory.limit_in_bytes` (Linux only)::
  226. The maximum amount of user memory (including file cache) allowed for all
  227. tasks in the same cgroup as the {es} process. This value can be too big to
  228. store in a `long`, so is returned as a string so that the value returned can
  229. exactly match what the underlying operating system interface returns. Any
  230. value that is too large to parse into a `long` almost certainly means no
  231. limit has been set for the cgroup.
  232. `os.cgroup.memory.usage_in_bytes` (Linux only)::
  233. The total current memory usage by processes in the cgroup (in bytes) by all
  234. tasks in the same cgroup as the {es} process. This value is stored as a
  235. string for consistency with `os.cgroup.memory.limit_in_bytes`.
  236. NOTE: For the cgroup stats to be visible, cgroups must be compiled into the
  237. kernel, the `cpu` and `cpuacct` cgroup subsystems must be configured and stats
  238. must be readable from `/sys/fs/cgroup/cpu` and `/sys/fs/cgroup/cpuacct`.
  239. The `process` flag can be set to retrieve statistics that concern
  240. the current running process:
  241. `process.timestamp`::
  242. Last time the process statistics have been refreshed.
  243. `process.open_file_descriptors`::
  244. Number of opened file descriptors associated with the current process, or -1
  245. if not supported.
  246. `process.max_file_descriptors`::
  247. Maximum number of file descriptors allowed on the system, or -1 if not
  248. supported.
  249. `process.cpu.percent`::
  250. CPU usage in percent, or -1 if not known at the time the stats are computed
  251. `process.cpu.total_in_millis`::
  252. CPU time (in milliseconds) used by the process on which the Java virtual
  253. machine is running, or -1 if not supported.
  254. `process.mem.total_virtual_in_bytes`::
  255. Size in bytes of virtual memory that is guaranteed to be available to the
  256. running process.
  257. The `ingest` flag can be set to retrieve statistics that concern ingest:
  258. `ingest.total.count`::
  259. The total number of document ingested during the lifetime of this node
  260. `ingest.total.time_in_millis`::
  261. The total time spent on ingest preprocessing documents during the lifetime
  262. of this node.
  263. `ingest.total.current`::
  264. The total number of documents currently being ingested.
  265. `ingest.total.failed`::
  266. The total number ingest preprocessing operations failed during the lifetime
  267. of this node.
  268. On top of these overall ingest statistics, these statistics are also provided on
  269. a per pipeline basis.
  270. The `adaptive_selection` flag can be set to retrieve statistics that concern
  271. <<search-adaptive-replica,adaptive replica selection>>. These statistics are
  272. keyed by node. For each node:
  273. `adaptive_selection.outgoing_searches`::
  274. The number of outstanding search requests from the node these stats are for
  275. to the keyed node.
  276. `avg_queue_size`::
  277. The exponentially weighted moving average queue size of search requests on
  278. the keyed node.
  279. `avg_service_time_ns`::
  280. The exponentially weighted moving average service time of search requests on
  281. the keyed node.
  282. `avg_response_time_ns`::
  283. The exponentially weighted moving average response time of search requests
  284. on the keyed node.
  285. `rank`::
  286. The rank of this node; used for shard selection when routing search
  287. requests.
  288. [[cluster-nodes-stats-api-example]]
  289. ==== {api-examples-title}
  290. [source,js]
  291. --------------------------------------------------
  292. # return just indices
  293. GET /_nodes/stats/indices
  294. # return just os and process
  295. GET /_nodes/stats/os,process
  296. # return just process for node with IP address 10.0.0.1
  297. GET /_nodes/10.0.0.1/stats/process
  298. --------------------------------------------------
  299. // CONSOLE
  300. All stats can be explicitly requested via `/_nodes/stats/_all` or
  301. `/_nodes/stats?metric=_all`.
  302. You can get information about indices stats on `node`, `indices`, or `shards`
  303. level.
  304. [source,js]
  305. --------------------------------------------------
  306. # Fielddata summarized by node
  307. GET /_nodes/stats/indices/fielddata?fields=field1,field2
  308. # Fielddata summarized by node and index
  309. GET /_nodes/stats/indices/fielddata?level=indices&fields=field1,field2
  310. # Fielddata summarized by node, index, and shard
  311. GET /_nodes/stats/indices/fielddata?level=shards&fields=field1,field2
  312. # You can use wildcards for field names
  313. GET /_nodes/stats/indices/fielddata?fields=field*
  314. --------------------------------------------------
  315. // CONSOLE
  316. You can get statistics about search groups for searches executed
  317. on this node.
  318. [source,js]
  319. --------------------------------------------------
  320. # All groups with all stats
  321. GET /_nodes/stats?groups=_all
  322. # Some groups from just the indices stats
  323. GET /_nodes/stats/indices?groups=foo,bar
  324. --------------------------------------------------
  325. // CONSOLE