-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
In #85627, implemented in #85370, changes were made to fix index patterns being correctly returned by the fields caps api by passing in an allowNoIndex property to the index pattern saved object. This fixed the case where no index patterns show up if no indices exist and use the index patterns stored in the saved object instead. However there is still the edge case where if an index DOES exist, but an integration with index pattern fields was installed and no data for that integration has arrived yet, those fields will not show up. Or if an index already exists that matches that index pattern for whatever reason. This is easy to see by going to the Fleet app. After setup, system fields should exist in Stack Management -> Index Patterns -> metrics-* because the integration was automatically installed, but no system fields exist because an index was already created during setup called metrics-endpoint.metadata_current_default and so the field caps api uses the fields in that index instead of the ones that exist in our metrics-* saved object.
We need to:
- decide whether or not we are okay with this behaviour. No error is thrown in any case.
- see what the differences are between creating the index pattern ourselves and letting field caps api return the index pattern fields based on existing indices and which serves our purpose better. If we always want the index pattern we create in the saved object to be returned perhaps we can have a new flag that always looks at that.