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

Add reference to ecs@mappings for each index template #174855

Merged
merged 46 commits into from
Jan 31, 2024

Conversation

gsantoro
Copy link
Contributor

@gsantoro gsantoro commented Jan 15, 2024

Summary

I added a reference to the component template ecs@mappings when building any index template for an integration.

The same behaviour is valid for both logs and metrics index templates.

Linked to elastic/integrations#8542

Close #174905

Checklist

Delete any items that are not applicable to this PR.

@gsantoro gsantoro requested a review from a team as a code owner January 15, 2024 15:33
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Jan 15, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@@ -17,6 +17,8 @@ export const FLEET_AGENT_POLICIES_SCHEMA_VERSION = '1.1.1';

export const FLEET_FINAL_PIPELINE_ID = '.fleet_final_pipeline-1';

export const FLEET_ECS_MAPPINGS_COMPONENT_TEMPLATE_NAME = 'ecs@mappings';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will create that component template? it is built in in ES?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is built-in in ES. Link https:/elastic/elasticsearch/blob/4717f9c5c12dd12c4bb542996bdd728b7d0e9a02/x-pack/plugin/core/template-resources/src/main/resources/ecs%40mappings.json.

I'm currently debugging an issue with a datastream of type metric nginx.stubstatus (that I used just for testing).

This error only happens with metric datastream

[2024-01-15T10:28:13.125+00:00][WARN ][plugins.fleet] Failure to install package [nginx]: [ResponseError: mapper_parsing_exception
        Root causes:
                mapper_parsing_exception: no type specified for property [text]]
[2024-01-15T10:28:13.126+00:00][ERROR][plugins.fleet] uninstalling nginx-1.17.0 after error installing: [ResponseError: mapper_parsing_exception
        Root causes:
                mapper_parsing_exception: no type specified for property [text]]
[2024-01-15T10:30:56.445+00:00][ERROR][plugins.fleet] FleetError: Error deleting component template ecs@mappings

What troubles me more than the mapping exception is the fact that at any error, it will try to remove the component template. Since it is a built-in component template, it cannot be removed and fails even harder.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we fail to install a package (first install not an upgrade) we uninstall it and remove related resource like template we should probably have a custom behavior so we do not clean this one and the @custom template

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the issue with the mapper_parsing_exception has now been fixed at elastic/elasticsearch#104418

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsantoro should we still exclude ecs@mappings from the list of component template that will be removed when uninstalling a package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, should we make it part of this PR? @felixbarny

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fleet should definitely not remove ecs@mappings. There are also other component templates that are imported by fleet that Elasticsearch sets up (see #163141). Fleet must never uninstall them.

@nchaulet
Copy link
Member

We have a constant version here that can be bumped so all integrations are reinstalled after kibana upgrade https:/nchaulet/kibana/blob/10e02addcf80127ef07c1ceb2969feda8674af0d/x-pack/plugins/fleet/server/constants/fleet_es_assets.ts#L14 should we bumped it here?

@gsantoro gsantoro self-assigned this Jan 16, 2024
Copy link
Member

@felixbarny felixbarny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell, LGTM.

Copy link
Member

@felixbarny felixbarny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small nit on naming, otherwise LGTM

x-pack/plugins/fleet/server/constants/fleet_es_assets.ts Outdated Show resolved Hide resolved
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @gsantoro

@gsantoro gsantoro merged commit 8c5b508 into elastic:main Jan 31, 2024
20 checks passed
@gsantoro gsantoro deleted the feature/ecs_mappings branch January 31, 2024 16:07
@kibanamachine kibanamachine added v8.13.0 backport:skip This commit does not require backporting labels Jan 31, 2024
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Feb 5, 2024
## Summary

I added a reference to the component template `ecs@mappings` when
building any index template for an integration.

The same behaviour is valid for both logs and metrics index templates.

Linked to elastic/integrations#8542

Close elastic#174905

### Checklist

Delete any items that are not applicable to this PR.

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kyle Pollich <[email protected]>
Co-authored-by: Felix Barnsteiner <[email protected]>
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Feb 6, 2024
## Summary

I added a reference to the component template `ecs@mappings` when
building any index template for an integration.

The same behaviour is valid for both logs and metrics index templates.

Linked to elastic/integrations#8542

Close elastic#174905

### Checklist

Delete any items that are not applicable to this PR.

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kyle Pollich <[email protected]>
Co-authored-by: Felix Barnsteiner <[email protected]>
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
## Summary

I added a reference to the component template `ecs@mappings` when
building any index template for an integration.

The same behaviour is valid for both logs and metrics index templates.

Linked to elastic/integrations#8542

Close elastic#174905

### Checklist

Delete any items that are not applicable to this PR.

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kyle Pollich <[email protected]>
Co-authored-by: Felix Barnsteiner <[email protected]>
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
## Summary

I added a reference to the component template `ecs@mappings` when
building any index template for an integration.

The same behaviour is valid for both logs and metrics index templates.

Linked to elastic/integrations#8542

Close elastic#174905

### Checklist

Delete any items that are not applicable to this PR.

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kyle Pollich <[email protected]>
Co-authored-by: Felix Barnsteiner <[email protected]>
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
## Summary

I added a reference to the component template `ecs@mappings` when
building any index template for an integration.

The same behaviour is valid for both logs and metrics index templates.

Linked to elastic/integrations#8542

Close elastic#174905

### Checklist

Delete any items that are not applicable to this PR.

- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kyle Pollich <[email protected]>
Co-authored-by: Felix Barnsteiner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:feature Makes this part of the condensed release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add reference to ecs@mappings for each index template
8 participants