Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ILM: Including "aging" information in Explain lifecycle API #38988

Closed
ppf2 opened this issue Feb 15, 2019 · 3 comments · Fixed by #44457
Closed

ILM: Including "aging" information in Explain lifecycle API #38988

ppf2 opened this issue Feb 15, 2019 · 3 comments · Fixed by #44457
Assignees
Labels
:Data Management/ILM+SLM Index and Snapshot lifecycle management >enhancement

Comments

@ppf2
Copy link
Member

ppf2 commented Feb 15, 2019

6.6.0

I can see this feature being useful for admins in the field.

Imagine an admin is not seeing indices getting deleted from the cluster per their ILM policy and are wondering how much longer is left on the clock before ILM will consider the indices meeting the "age" requirement for deletion.

Currently, we have this information in the TRACE logging level

checking for index age to be at least [20m] before performing actions in the "delete" phase. Now: 1550263112, lifecycle date: 1550262751, age: [6m/360s]

It will be helpful to include this in the explain lifecycle API output as well (i.e., how much time is left before it will attempt to execute the next action without requiring admins to do their own time calculations) so that enabling trace logging is not necessary.

@ppf2 ppf2 added the :Data Management/ILM+SLM Index and Snapshot lifecycle management label Feb 15, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

@gwbrown
Copy link
Contributor

gwbrown commented Feb 15, 2019

You can determine this from the current explain response, although I can certainly see how it's not immediately obvious, and should probably be documented better than it is. The lifecycle_date and lifecycle_date_millis fields contain the "reference" date used.

GET /*/_ilm/explain?human:

{
  "indices": {
    "test-000001": {
      "index": "test-000001",
      "managed": true,
      "policy": "my_policy",
      "lifecycle_date": "2019-02-15T22:25:03.953Z", <1>
      "lifecycle_date_millis": 1550269503953,
      "phase": "new",
      "phase_time": "2019-02-15T22:25:04.098Z",
      "phase_time_millis": 1550269504098,
      "action": "complete",
      "action_time": "2019-02-15T22:25:04.098Z",
      "action_time_millis": 1550269504098,
      "step": "complete",
      "step_time": "2019-02-15T22:25:04.098Z",
      "step_time_millis": 1550269504098
    }
  }
}

<1> is the date that's checked against min_age of each phase from the policy. So enabling trace logging isn't strictly necessary to get this information, although including the current delta in the explain API output and/or documenting this better would probably be good to do.

@ppf2
Copy link
Member Author

ppf2 commented Feb 15, 2019

Thanks for the info! Adding something like a "time until next phase" field to the explain output will be nice.

@dakrone dakrone self-assigned this Jun 18, 2019
dakrone added a commit to dakrone/elasticsearch that referenced this issue Jul 16, 2019
This adds the index's age to the ILM explain output, for example:

```
{
  "indices" : {
    "ilm-000001" : {
      "index" : "ilm-000001",
      "managed" : true,
      "policy" : "full-lifecycle",
      "lifecycle_date" : "2019-07-16T19:48:22.294Z",
      "lifecycle_date_millis" : 1563306502294,
      "age" : "1.34m",
      "phase" : "hot",
      "phase_time" : "2019-07-16T19:48:22.487Z",
      ... etc ...
    }
  }
}
```

This age can be used to tell when ILM will transition the index to the
next phase, based on that phase's `min_age`.

Resolves elastic#38988
dakrone added a commit that referenced this issue Jul 18, 2019
* Expose index age in ILM explain output

This adds the index's age to the ILM explain output, for example:

```
{
  "indices" : {
    "ilm-000001" : {
      "index" : "ilm-000001",
      "managed" : true,
      "policy" : "full-lifecycle",
      "lifecycle_date" : "2019-07-16T19:48:22.294Z",
      "lifecycle_date_millis" : 1563306502294,
      "age" : "1.34m",
      "phase" : "hot",
      "phase_time" : "2019-07-16T19:48:22.487Z",
      ... etc ...
    }
  }
}
```

This age can be used to tell when ILM will transition the index to the
next phase, based on that phase's `min_age`.

Resolves #38988

* Expose age in getters and in HLRC
dakrone added a commit that referenced this issue Jul 18, 2019
* Expose index age in ILM explain output

This adds the index's age to the ILM explain output, for example:

```
{
  "indices" : {
    "ilm-000001" : {
      "index" : "ilm-000001",
      "managed" : true,
      "policy" : "full-lifecycle",
      "lifecycle_date" : "2019-07-16T19:48:22.294Z",
      "lifecycle_date_millis" : 1563306502294,
      "age" : "1.34m",
      "phase" : "hot",
      "phase_time" : "2019-07-16T19:48:22.487Z",
      ... etc ...
    }
  }
}
```

This age can be used to tell when ILM will transition the index to the
next phase, based on that phase's `min_age`.

Resolves #38988

* Expose age in getters and in HLRC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/ILM+SLM Index and Snapshot lifecycle management >enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants