-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
In the core Elasticsearch code, we have endpoints that simply retrieve information about nodes without otherwise affecting the cluster. The /_nodes endpoint returns what we call "info": information that doesn’t change as long as the node is running. “Info” includes, for example, the version of the JVM we are running and the list of plugins that have been installed on the node. The /_nodes/stats endpoint, by contrast, returns “stats”: information that can change over the course of the node’s runtime. “Stats” include the current JVM heap size and pools, the CPU load of the underlying OS, and statistics about indexes.
Several of our plugins create endpoints that return info and stats. They do this by implementing the ActionPlugin class and adding Actions and RestHandlers.
- The X-Pack plugin returns info on the
/_xpackendpoint and usage stats from/_xpack/usage. - The CCR (cross-cluster replication) plugin has a
/_ccr/statsendpoint - The Enrich plugin has an
/_enrich/_statsendpoint - The EQL plugin has an
/_eql/statsendpoint - The Machine Learning plugin has an info endpoint at
/_xpack/ml/info(deprecated) and/_ml/info; it’s possible that this might be more like a “stats” or “settings” endpoint. - The SQL plugin has a
/_sql/statsendpoint.
Note the inconsistencies among APIs here; a user has to read code or documentation to find this information. If this information were rolled into the /_nodes and /_nodes/stats endpoints.
We also have a /_cluster/stats endpoint aggregates certain stats from multiple nodes.
We should make our /_nodes and /_nodes/stats endpoints pluggable, so that a plugin could insert info or stats into the core info and stats routes by implementing a certain interface.
With that accomplished, we can make the /_cluster/stats pluggable as well. A plugin could optionally define how a stats response can aggregate over multiple stats responses.
One open question is whether all plugins’ stats or info should appear in the default response of /_nodes or /_nodes/stats, or whether we’d want to add a flag for including plugins or not.
This issue will serve as a meta issue for smaller chunks of work.