Skip to content

[8.19] [Data Streams] Fix displayed index mode (#215683)#221182

Merged
kibanamachine merged 1 commit intoelastic:8.19from
kibanamachine:backport/8.19/pr-215683
May 21, 2025
Merged

[8.19] [Data Streams] Fix displayed index mode (#215683)#221182
kibanamachine merged 1 commit intoelastic:8.19from
kibanamachine:backport/8.19/pr-215683

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

Fixes elastic#208671

## Summary

Before this PR, the displayed index mode of the data streams was
determined based on the index mode of the associated index template.
However, the index mode can also be set through the component template,
so that logic is not reliable and can cause incorrectly displayed index
mode like described in elastic#208671.

In this PR, we replace this logic with the recently added `index_mode`
field to the Es Get Data Streams API (see
elastic/elasticsearch#122486).

**How to test:**
1. Create a component template with a LogsDB index mode (you can also
test with other index modes):
```
PUT _component_template/my-component-template
{
  "template": {
    "settings": {
      "index": {
        "mode": "logsdb"
      }
    }
  }
}
```
2. Create an index template that is composed of the component template
above:
```
PUT _index_template/my-index-template
{
  "index_patterns": [
    "my-ds-*"
  ],
  "data_stream": {},
  "composed_of": [
    "my-component-template"
  ]
}
```
3. Create a data stream that matched the index pattern from the index
template above:
```
PUT _data_stream/my-ds-1
```
4. Go to the data streams table and verify that the index mode is
displayed correctly in the table.

<img width="1165" alt="Screenshot 2025-03-24 at 18 12 04"
src="https://github.com/user-attachments/assets/ea211c14-3d03-49c7-ace7-88b15e294d1f"
/>

5. Click on the created data stream and verify that the displayed index
mode in the details panel is correct:

<img width="1165" alt="Screenshot 2025-03-06 at 14 36 12"
src="https://github.com/user-attachments/assets/954864e2-ae2a-4cb8-9eef-2c5f8b417f52"
/>

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit dec6a17)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label May 21, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) May 21, 2025 19:07
@kibanamachine kibanamachine merged commit 3348eaa into elastic:8.19 May 21, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

2 participants