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

[Fleet] Add package information to _meta on Elasticsearch assets #111737

Closed
joshdover opened this issue Sep 9, 2021 · 8 comments · Fixed by #119380
Closed

[Fleet] Add package information to _meta on Elasticsearch assets #111737

joshdover opened this issue Sep 9, 2021 · 8 comments · Fixed by #119380
Assignees
Labels
enhancement New value added to drive a business result QA:Validated Issue has been validated by QA Team:Fleet Team label for Observability Data Collection Fleet team v8.0.0

Comments

@joshdover
Copy link
Contributor

joshdover commented Sep 9, 2021

Ingest assets installed into Elasticsearch by Fleet do not all contain information about the package that was installed. We should add this to be sure that all assets are displayed as managed and are tied to the appropriate package that created them.

  • Index templates
    • Current:
      "_meta" : {
        "package" : {
          "name" : "system"
        },
        "managed_by" : "fleet",
        "managed" : true
      },
    • Should add:
      • nothing
  • Component templates
    • Current:
      "_meta" : {
        "package" : {
          "name" : "elastic_agent"
        }
      }
    • Should add:
      • managed
      • managed_by
  • Ingest pipelines
  • ILM policies
    • Currently we do not add any _meta to policies from packages, only to the default Fleet policy
    • Should add all fields
    • Note: only the Elastic APM integration currently ships an ILM policy
  • Transforms

Adding package.version

We don't have any current plans to leverage this field for upgrades, but it potentially may be useful for rollbacks or general bookkeeping and debugging. In theory, we should tell Elasticsearch to install all objects but as seen in #110500, there are some performance challenges we need to solve for this. By adding the version information, we may be able to optimize this from the Kibana side in the meantime.

Decision: for now let's not do this

@joshdover joshdover added enhancement New value added to drive a business result Team:Fleet Team label for Observability Data Collection Fleet team labels Sep 9, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@joshdover joshdover self-assigned this Sep 22, 2021
@joshdover
Copy link
Contributor Author

I had mistakenly assumed that the fields in _meta on index templates, etc. were being supplied by the package installation code in Kibana, however it seems they’re coming directly from packages since Kibana does not modify the assets currently.

Can anyone anticipate any problems with populating this data from Kibana rather than from the packages? cc @ruflin @mtojek

@ruflin
Copy link
Member

ruflin commented Oct 12, 2021

The Fleet code builds the index template and component templates out of the fields.yml. So I also assume the meta info is added by Fleet. What do I miss here? In any case, agree that Fleet should add the data.

@amolnater-qasource
Copy link

Hi @joshdover
We have validated this on latest 8.0 Snapshot.
Build details:
Build: 48703
Commit: a739f06

Please find our observations below:

  • Index templates:
    12

  • Component templates:
    13

  • Ingest Pipelines
    14

Could you please confirm above results?
Further, could you please share details for ILM policies and transform if any testing is required.

Thanks

@dikshachauhan-qasource
Copy link

Hi @joshdover

While performing testing on related PR at 8.0 snapshot build, we have observed following :

  1. No '_meta' field is provided at Index and component templates.
    Query: Here in the ticket description data is provided under _meta braces. However at UI a column is provided for metadata under which same data is shared. Is the changes at UI is working as expected.

Screenshot:
image

image

  1. However, 'managed' and 'managed_by' fields are provided for installed integrations at both Index and component templates.
  2. Further, for ILM policies, we have noticed that in summary it is mentioned :
ILM Policies:
Currently we do not add any _meta to policies from packages, only to the default Fleet policy
Should add all fields
Note: only the Elastic APM integration currently ships an ILM policy

However, we have observed that _meta field with managed fields was available for endpoint ILM policies too.
image

We have validated that, APM policy includes all fields.
image

However, Fleet default policy did not included all fields like managed and managed by. Could you please confirm if it is expected.
image

Please let us know if we are missing anything to validate here.

Thanks
QAS

@joshdover
Copy link
Contributor Author

@dikshachauhan-qasource Apologies for the confusing issue description. The screenshots you share show the functionality that I expect. All objects we install should have these meta properties.

You did catch the .fleet-actions-results-ilm-policy which is missing the managed_by: fleet, but I believe this is actually installed by Elasticsearch. I'm less worried about it since it is more explicitly named as a Fleet object, but we should get it updated too. Could you also check any other Fleet installed assets that aren't part of packages, such as .fleet_component_template-1 and .fleet_final_pipeline (not sure if name is exactly correct). We should file an issue for updating those separately.

@dikshachauhan-qasource
Copy link

Hi @joshdover

Thanks for the feedback.

We have validated the above mentioned templates on 8.0 snapshot build and found only one as working fine.

Screenshots:
.fleet_component_template-1:
image

For the .fleet_final_pipeline-1 its not working fine and we have reported issue at : #121854

Further, we have created below test case for same:

Please review and let us know if we are missing anything else to mention in it.

Thanks
QAS

@joshdover
Copy link
Contributor Author

@dikshachauhan-qasource Looks great, thanks.

@joshdover joshdover added the QA:Validated Issue has been validated by QA label Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result QA:Validated Issue has been validated by QA Team:Fleet Team label for Observability Data Collection Fleet team v8.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants