原文地址: https://www.elastic.co/guide/en/elasticsearch/reference/7.7/cluster-nodes-usage.html, 原文档版权归 www.elastic.co 所有

Nodes feature usage APIedit

Returns information on the usage of features.

Requestedit

GET /_nodes/usage

GET /_nodes/<node_id>/usage

GET /_nodes/usage/<metric>

GET /_nodes/<node_id>/usage/<metric>

Descriptionedit

The cluster nodes usage API allows you to retrieve information on the usage of features for each node. All the nodes selective options are explained here.

Path parametersedit

<metric>

(Optional, string) Limits the information returned to the specific metrics. A comma-separated list of the following options:

_all
Returns all stats.
rest_actions
Returns the REST actions classname with a count of the number of times that action has been called on the node.
<node_id>
(Optional, string) Comma-separated list of node IDs or names used to limit returned information.

Query parametersedit

master_timeout
(Optional, time units) Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s.
timeout
(Optional, time units) Specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s.

Examplesedit

Rest action example:

GET _nodes/usage

The API returns the following response:

{
  "_nodes": {
    "total": 1,
    "successful": 1,
    "failed": 0
  },
  "cluster_name": "my_cluster",
  "nodes": {
    "pQHNt5rXTTWNvUgOrdynKg": {
      "timestamp": 1492553961812, 
      "since": 1492553906606, 
      "rest_actions": {
        "org.elasticsearch.rest.action.admin.cluster.RestNodesUsageAction": 1,
        "org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction": 1,
        "org.elasticsearch.rest.action.document.RestGetAction": 1,
        "org.elasticsearch.rest.action.search.RestSearchAction": 19, 
        "org.elasticsearch.rest.action.admin.cluster.RestNodesInfoAction": 36
      }
    }
  }
}

Timestamp for when this nodes usage request was performed.

Timestamp for when the usage information recording was started. This is equivalent to the time that the node was started.

Search action has been called 19 times for this node.