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

[8.x] Snapshots: show slm and status (#199622) #203372

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

Closes [elastic#148241](elastic#148241)

## Summary

This PR introduces a few changes in the snapshot and restore plugin.

#### Snapshots tab
* The state column has been aded to the table
* In the detail flyout, it has been changed the way in which the status
is displayed (icon and text).
* No new test needed since this info was already there. The related
tests have been updated.

<table>
  <tr>
    <td style="padding-right: 10px;">

<img alt="Screenshot 2024-11-27 at 15 17 03"
src="https://github.com/user-attachments/assets/92b5c5cf-d90b-454c-9cf7-2eb101562c5f">

  </td>
  <td>
<img alt="Screenshot 2024-11-27 at 15 54 32"
src="https://github.com/user-attachments/assets/62395bad-4c70-44bb-84b3-c8a30ae9278a">

  </td>
  </tr>
</table>

#### Policies tab
* The copy of the callout for warning that two or more policies have the
same schedule has been changed. For testing that, you need to have two
or more policies that have the same time por execution. No test added
for this, is only a copy change
[[code](https://github.com/elastic/kibana/pull/199622/files#diff-e8e12f0dfdc97e4e064f8a07965312c8c91ca66578bdcaf5ee807e879cebcb6eR207)]
<img width="1249" alt="Screenshot 2024-11-27 at 15 17 25"
src="https://github.com/user-attachments/assets/5417910f-573a-4c22-a5e2-44ec2ce256b3">

* A new callout has been added to warn that the SLM status is different
from “running”. SLM status is "running" by default, but it could happen
that the user stop it for any reason and then does not restart it. This
causes policies not to run when they are scheduled. To known the SLM
status a new api call has been introduced (`GET _slm/status`).
* I've created a new doc link to
https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html
    * I've added new tests for the new api call.

<img width="1246" alt="Screenshot 2024-11-27 at 15 59 56"
src="https://github.com/user-attachments/assets/cd5ae491-16a4-4a68-a223-f44ce398ac2f">

## Testing
You will need to have at least one policy to test this. For that, you
can run Elastic using the following:
```
yarn es snapshot --license=trial -E path.repo=/tmp/es-backups
```

From the console, you can add a repository (you can also do it from the
UI):
```
PUT /_snapshot/my_backup
{
  "type": "fs",
  "settings": {
    "location": "/tmp/es-backups",
    "chunk_size": "10mb"
  }
}
````

And for creating a policy you can run this:
```
PUT _slm/policy/nightly-snapshots
{
  "schedule": "0 30 1 * * ?",
  "name": "<nightly-snap-{now/d}>",
  "repository": "my_backup1",
  "retention": {
    "expire_after": "30d",
    "min_count": 5,
    "max_count": 50
  }
}
```

SLM status should be started by default (unless you have stopped it).
For starting it you can use `POST /_slm/start` and for stop it `POST
/_slm/stop`

## Demo

https://github.com/user-attachments/assets/b83cd3ba-4821-4295-87f2-ecf427ec46e0

---------

Co-authored-by: shainaraskas <[email protected]>
(cherry picked from commit 6d3b5c2)
@kibanamachine kibanamachine merged commit 4d8e8d9 into elastic:8.x Dec 9, 2024
11 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiAssistantManagementSelection 93.2KB 93.2KB +34.0B
lists 145.6KB 145.6KB +34.0B
snapshotRestore 262.7KB 263.1KB +414.0B
total +482.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
core 454.3KB 454.3KB +34.0B
snapshotRestore 27.0KB 27.3KB +231.0B
total +265.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/test-suites-xpack 729 730 +1

Total ESLint disabled count

id before after diff
@kbn/test-suites-xpack 754 755 +1

cc @SoniaSanzV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants