nodes-stats.asciidoc 15 KB

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