opensearch-project / index-management

🗃 Automate periodic data operations, such as deleting indices at a certain age or performing a rollover at a certain size
https://opensearch.org/docs/latest/im-plugin/index/
Apache License 2.0
52 stars 107 forks source link

[RFC] Stats Framework for Index Management #1153

Open sarthakaggarwal97 opened 2 months ago

sarthakaggarwal97 commented 2 months ago

Currently in Index Management Plugin, we do not emit any framework level stats.

While we do emit few action specific stats with the _explain API, like in cases of transforms and rollups, and historical failures are also available in the system index, we don’t have a single point of interaction to extract the status of all the actions at once. The purpose of the Stats Framework is to provided aggregated stats alongside a current node level view.

Without this visibility, it is difficult to understand the successes, failures and the time taken by each of the actions to perform the operations.

The API would look something like this initially: GET _plugins/_ism/stats/<dimension>/<target>/<action>/statName1,statName2?pretty

Note:

  1. Dimension: Cluster, nodes
  2. Target: cumulative or _all, node ids (comma separated values for multiple values)

Sample API Response

GET _plugins/_ism/stats/cluster/cumulative?pretty
{
    "cumulative": {
      "actions": {
        "rollover": {
          "total_managed_indices": 10
          "total_executions": 100,
          "total_successes": 195,
          "total_failures": 5,
          "total_execution_time": "5ms"
      },
      // Other ISM actions and their statistics
    } 
}

In Phase 2, we will capture the indices and policies as dimensions as well, including the support for index names and policy names as target.

Phase 2: https://github.com/opensearch-project/index-management/issues/1154