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

Return existing system indices from GET features API #86307

Closed
williamrandolph opened this issue Apr 29, 2022 · 5 comments
Closed

Return existing system indices from GET features API #86307

williamrandolph opened this issue Apr 29, 2022 · 5 comments
Labels
:Core/Infra/Core Core issues without another label >enhancement Team:Core/Infra Meta label for core/infra team team-discuss

Comments

@williamrandolph
Copy link
Contributor

williamrandolph commented Apr 29, 2022

The GET /_features API currently returns minimal information about which features are present in the cluster: just a name and a text description. For example:

{
    "features": [
        {
            "name": "tasks",
            "description": "Manages task results"
        },
        {
            "name": "kibana",
            "description": "Manages Kibana configuration and reports"
        }
    ]
}

A user may want to know which existing indices in particular will be included in a snapshot for a feature. Additionally, having an endpoint that associates system indices, associated indices, and system data streams with their respective features may be diagnostically useful.

It would be simple to return a structure like this:

{
    "features": [
        {
            "name": "tasks",
            "description": "Manages task results",
            "system_indices": [
                {
                    "pattern": ".tasks*"
                    "indices": [
                        ".tasks"
                    ]
                }
            ]
        },
        {
            "name": "kibana",
            "description": "Manages Kibana configuration and reports"
            "system_indices": [
                {
                    "pattern": ".kibana-event-log-*"
                    "indices": [
                        ".kibana-event-log-8",
                        ".kibana-event-log-7-archive"
                    ]
                },
                {
                    "pattern": ".kibana_task_manager*",
                    "indices": [
                        ".kibana_task_manager_8"
                    ]
                }
            ]
        }
    ]
}

Since this could potentially be a lot of data for a human to read, we could put it behind a verbose request flag, or we could add a {feature} element to the path to return results for a particular feature.

We would also make sure that this is not a problem from a security perspective.

Relates #50251 (comment)

@williamrandolph williamrandolph added >enhancement :Core/Infra/Core Core issues without another label labels Apr 29, 2022
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Apr 29, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@williamrandolph
Copy link
Contributor Author

I raised this issue in a team meeting. One point from the discussion is that a potential downside of exposing the index names through an API like this is that the information becomes part of our backwards-compatible API contract, and users might reasonably assume that they can use this information in applications, even though we intend for it to be an "implementation detail."

We had a suggestion that a _cat API might be a more appropriate place to expose information that we intend to be purely diagnostic. The output would probably be an "identifier" per line, with "index/alias/datastream" and associated feature as fields in the row, sorted by feature.

@SSSSam141
Copy link

Hello! We are currently using elasticsearch as our school projects. But we are kind of confused about where we should modify the codes. Could you help us with the file path of where we could write this feature?

@rdnm
Copy link

rdnm commented Jun 8, 2022

Based on William's comment closing this issue.

@renshuki
Copy link
Contributor

renshuki commented Jul 2, 2023

@williamrandolph @rdnm is there any plan to do something about this with the _cat API? It's still a pain to identify which index is part of a feature state during restore. These system indices / data streams need to be restored via the feature_states instead of the indices param in the Restore API, however, there is currently no other way than diving in ES source code to determine which index is part of a feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >enhancement Team:Core/Infra Meta label for core/infra team team-discuss
Projects
None yet
Development

No branches or pull requests

5 participants