Skip to content

Commit

Permalink
Add tests/fix docs for nodes info API (#79274)
Browse files Browse the repository at this point in the history
The docs for `GET _nodes/<node>/<metric>` omitted a couple of metrics
and indicated that this API returned dynamic stats rather than static
info. They also didn't mention that `_all` is a legal value, nor
did it give a way to suppress all metrics even though this is possible.

This commit adjusts the docs and adds tests to ensure that selecting
metrics works as expected and to ensure that there is a future-proof
legal way to suppress all metrics.

Backport of #79223
Closes #79187

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
  • Loading branch information
DaveCTurner and jrodewig committed Oct 15, 2021
1 parent f6777d5 commit cc6a138
Show file tree
Hide file tree
Showing 4 changed files with 514 additions and 14 deletions.
30 changes: 21 additions & 9 deletions docs/reference/cluster/nodes-info.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,28 @@ comma-separated list, such as `http,ingest`.
[%collapsible%open]
.Valid values for `<metric>`
====
`aggregations`::
Information about the available types of aggregation.
`http`::
HTTP connection information.
Information about the HTTP interface of this node.
`indices`::
+
--
Node-level configuration related to indexing:
* `total_indexing_buffer`: the maximum size of the indexing buffer on this node.
--
`ingest`::
Information about ingest pipelines and processors.
`jvm`::
JVM stats, memory pool information, garbage collection, buffer pools, number of
loaded/unloaded classes.
JVM information, including its name, its version, and its configuration.
`os`::
Operating system stats, load average, mem, swap.
Operating system information, including its name and version.
`plugins`::
+
Expand All @@ -74,23 +84,25 @@ process
--
`process`::
Process statistics, memory consumption, cpu usage, open file descriptors.
Process information, including the numeric process ID.
`settings`::
Lists all node settings in use as defined in the `elasticsearch.yml` file.
`thread_pool`::
Statistics about each thread pool, including current size, queue and rejected
tasks
Information about the configuration of each thread pool.
`transport`::
Transport statistics about sent and received bytes in cluster communication.
Information about the transport interface of the node.
====

If you use the full `GET /_nodes/<node_id>/<metric>` form of this API then you
can also request the metric `_all` to retrieve all metrics, or you can request
the metric `_none` to suppress all metrics and retrieve only the identity of
the node.

include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=node-id]


[[cluster-nodes-info-api-response-body]]
==== {api-response-body-title}

Expand Down
14 changes: 10 additions & 4 deletions rest-api-spec/src/main/resources/rest-api-spec/api/nodes.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@
"transport",
"http",
"plugins",
"ingest"
"ingest",
"indices",
"aggregations"
],
"description":"A comma-separated list of metrics you wish returned. Leave empty to return all."
"description":"A comma-separated list of metrics you wish returned. Leave empty to return all metrics."
}
}
},
Expand All @@ -73,9 +75,13 @@
"transport",
"http",
"plugins",
"ingest"
"ingest",
"indices",
"aggregations",
"_all",
"_none"
],
"description":"A comma-separated list of metrics you wish returned. Leave empty to return all."
"description":"A comma-separated list of metrics you wish returned. Use `_all` to retrieve all metrics and `_none` to retrieve the node identity without any additional metrics."
}
}
}
Expand Down

0 comments on commit cc6a138

Please sign in to comment.