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] Support content packages in integrations UI #192484

Closed
4 tasks done
Tracked by #351
mrodm opened this issue Sep 10, 2024 · 12 comments · Fixed by #195831
Closed
4 tasks done
Tracked by #351

[Fleet] Support content packages in integrations UI #192484

mrodm opened this issue Sep 10, 2024 · 12 comments · Fixed by #195831
Assignees
Labels
Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@mrodm
Copy link
Contributor

mrodm commented Sep 10, 2024

Relates elastic/package-spec#351

Describe the feature:

Add support for content packages in Fleet UI:

  • Check whether or not it is required some special requirements for this new package type in Fleet.
  • Review integrations UI:
    • e.g. remove Integrations policies tab since these packages would not have policies assigned.

Example of how it is shown a content package now in Kibana/Fleet:

integrations ui

Related issue to install packages using stream-based approach: #187646

Implementation

  • Hide "integration policies" tab on integration details page for content packages
  • Prevent content packages from being added to integration policies at the API level, returning a bad request error if one is added to a policy
  • The "add" button in the upper right of the integration details page should install the assets for the package instead of navigating to the policy editor to add it to a policy
  • Add a "content only" badge to integration cards for content packages
  • If the integration contains a file named otel-collector.yaml, list its contents in the UI (see [Fleet] Support content packages in integrations UI #192484 (comment))

Future enhancements

(Create separate issues for these as part of this issue's scope)

@mrodm mrodm added the Team:Fleet Team label for Observability Data Collection Fleet team label Sep 10, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@jlind23
Copy link
Contributor

jlind23 commented Sep 13, 2024

@kpollich we probably need to prioritize this right?

@kpollich
Copy link
Member

@kpollich we probably need to prioritize this right?

Yes I will provide some rough design considerations and we can get this prioritized.

@kpollich kpollich changed the title [Fleet] Add initial support for content packages [Fleet] Support content packages in integrations UI Sep 13, 2024
@kpollich
Copy link
Member

I've added some implementation specifics to the description above

@kpollich
Copy link
Member

I've added an implementation item for this functionality:

If the integration contains a file named otel-collector.yaml, list its contents in the UI

This is something we could solve either in the UI or in elastic-package. We could detect the otel-collector.yaml file in the integration's top-level directory, then render its contents in a code block somewhere in the README of the integration, similar to what we do for mappings based on fields/**/*.yml files. This might be a better solution than just having a special piece of logic in the UI that looks in the unpacked .zip archive for an integration for this particular file and renders its contents somewhere.

@mrodm @jsoriano WDYT?

@jsoriano
Copy link
Member

@kpollich what kind of information would this otel-collector.yaml file contain?

@kpollich
Copy link
Member

@kpollich what kind of information would this otel-collector.yaml file contain?

This would be the actual collector config used to collect data in a format that is compatible with the assets included in the content package. cc @ishleenk17

I'm thinking more about this and it may make sense to just include this in a code block in the README for now until we have OTel templates as a longer term solution to this.

@mlunadia
Copy link

Regarding the visibility of the Tile in the integrations UI for content-only integrations, have we identified specific use cases where content-only integrations serve as the starting point for the onboarding flow?
The use case we are addressing for OTel K8s would benefit from having it hidden to avoid users follow unhappy paths.

cc: @jsoriano

@jsoriano
Copy link
Member

have we identified specific use cases where content-only integrations serve as the starting point for the onboarding flow?

Not on the current use cases, they are intended to provide functionality over existing data.

One of the use cases identified for content integrations is to provide sample data, but maybe this use case could also require the installation of an actual integration first.

The use case we are addressing for OTel K8s would benefit from having it hidden to avoid users follow unhappy paths.

Maybe we can add something to the spec to declare how each integration can be discovered, defaulting to something that means "discover only by pre-exisiting data".

jen-huang added a commit that referenced this issue Oct 9, 2024
## Summary

Related to #192484. This PR adding [new content package types and
schemas](elastic/package-spec#777) so that
content packages can be returned correctly from EPR to unblock
development of those packages.

The only current content package is `kubernetes_otel`. You will need to
bump up the max allowed spec version and search with beta (prerelease)
packages enabled to find it:
```
xpack.fleet.internal.registry.spec.max: '3.4'
```

Tests will come with the rest of work for #192484

---------

Co-authored-by: kibanamachine <[email protected]>
jen-huang added a commit to jen-huang/kibana that referenced this issue Oct 9, 2024
## Summary

Related to elastic#192484. This PR adding [new content package types and
schemas](elastic/package-spec#777) so that
content packages can be returned correctly from EPR to unblock
development of those packages.

The only current content package is `kubernetes_otel`. You will need to
bump up the max allowed spec version and search with beta (prerelease)
packages enabled to find it:
```
xpack.fleet.internal.registry.spec.max: '3.4'
```

Tests will come with the rest of work for elastic#192484

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit bd6533f)

# Conflicts:
#	oas_docs/bundle.json
#	oas_docs/bundle.serverless.json
#	oas_docs/output/kibana.serverless.staging.yaml
#	oas_docs/output/kibana.serverless.yaml
#	oas_docs/output/kibana.staging.yaml
#	oas_docs/output/kibana.yaml
#	x-pack/plugins/fleet/server/types/rest_spec/epm.ts
jen-huang added a commit that referenced this issue Oct 10, 2024
…195690)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[UII] Add types to return content packages correctly
(#195505)](#195505)

Note that this includes manual changes to openapi spec files. This
change is not present on the original PR as the main branch no longer
uses openapi spec files.

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jen
Huang","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-09T20:08:18Z","message":"[UII]
Add types to return content packages correctly (#195505)\n\n##
Summary\r\n\r\nRelated to #192484. This PR adding [new content package
types and\r\nschemas](elastic/package-spec#777)
so that\r\ncontent packages can be returned correctly from EPR to
unblock\r\ndevelopment of those packages.\r\n\r\nThe only current
content package is `kubernetes_otel`. You will need to\r\nbump up the
max allowed spec version and search with beta (prerelease)\r\npackages
enabled to find it:\r\n```\r\nxpack.fleet.internal.registry.spec.max:
'3.4'\r\n```\r\n\r\nTests will come with the rest of work for
#192484\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"bd6533f30b58fc831670d400f25a61321379902c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v9.0.0","backport:prev-minor"],"number":195505,"url":"https://github.com/elastic/kibana/pull/195505","mergeCommit":{"message":"[UII]
Add types to return content packages correctly (#195505)\n\n##
Summary\r\n\r\nRelated to #192484. This PR adding [new content package
types and\r\nschemas](elastic/package-spec#777)
so that\r\ncontent packages can be returned correctly from EPR to
unblock\r\ndevelopment of those packages.\r\n\r\nThe only current
content package is `kubernetes_otel`. You will need to\r\nbump up the
max allowed spec version and search with beta (prerelease)\r\npackages
enabled to find it:\r\n```\r\nxpack.fleet.internal.registry.spec.max:
'3.4'\r\n```\r\n\r\nTests will come with the rest of work for
#192484\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"bd6533f30b58fc831670d400f25a61321379902c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195505","number":195505,"mergeCommit":{"message":"[UII]
Add types to return content packages correctly (#195505)\n\n##
Summary\r\n\r\nRelated to #192484. This PR adding [new content package
types and\r\nschemas](elastic/package-spec#777)
so that\r\ncontent packages can be returned correctly from EPR to
unblock\r\ndevelopment of those packages.\r\n\r\nThe only current
content package is `kubernetes_otel`. You will need to\r\nbump up the
max allowed spec version and search with beta (prerelease)\r\npackages
enabled to find it:\r\n```\r\nxpack.fleet.internal.registry.spec.max:
'3.4'\r\n```\r\n\r\nTests will come with the rest of work for
#192484\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>","sha":"bd6533f30b58fc831670d400f25a61321379902c"}}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <[email protected]>
@jen-huang
Copy link
Contributor

If the integration contains a file named otel-collector.yaml, list its contents in the UI

@jsoriano @kpollich Based on the discussion here and the current content package spec, this file is not part of the spec yet, correct? If that's the case, I suggest we hold off on the UI portion until the spec work is done.

Could it be possible that we allow otel-collector.yml to regular integration packages rather than just content packages? I couldn't find a package spec issue discussing support for otel collectors overall, so we may need one to further explore this.

@jsoriano
Copy link
Member

If the integration contains a file named otel-collector.yaml, list its contents in the UI

@jsoriano @kpollich Based on the discussion here and the current content package spec, this file is not part of the spec yet, correct? If that's the case, I suggest we hold off on the UI portion until the spec work is done.

Could it be possible that we allow otel-collector.yml to regular integration packages rather than just content packages? I couldn't find a package spec issue discussing support for otel collectors overall, so we may need one to further explore this.

Correct, this file is not part of the spec, and I don't think this is going to be added by now.

Looking to this comment #192484 (comment), it seems enough if the package developer decides to add something about OTel in the README.

So I don't think anything else needs to be done about this if READMEs are already rendered. Once OTel templates are more defined we can reconsider if we need something else for docs.

@jsoriano
Copy link
Member

jsoriano commented Oct 11, 2024

Updated description to strike out the requirement about otel-collector.yaml.

jen-huang added a commit to jen-huang/kibana that referenced this issue Oct 15, 2024
## Summary

Resolves elastic#192484. This PR adds support for content packages in UI. When
a package is of `type: content`:

- `Content only` badge is shown on its card in Integrations list, and on
header of its details page
- `Add integration` button is replaced by `Install assets` button in
header
- References to agent policies are hidden
- Package policy service throws error if attempting to create or bulk
create policies for content packages

<img width="1403" alt="image"
src="https://github.com/user-attachments/assets/a82c310a-f849-4b68-b56c-ff6bb31cd6bf">

<img width="1401" alt="image"
src="https://github.com/user-attachments/assets/63eb3982-9ec9-494f-a95a-2b8992a408ba">

## How to test
The only current content package is `kubernetes_otel`. You will need to
bump up the max allowed spec version and search with beta (prerelease)
packages enabled to find it:
```
xpack.fleet.internal.registry.spec.max: '3.4'
```

Test UI scenarios as above. The API can be tested by running:
```
POST kbn:/api/fleet/package_policies
{
  "policy_ids": [
    ""
  ],
  "package": {
    "name": "kubernetes_otel",
    "version": "0.0.2"
  },
  "name": "kubernetes_otel-1",
  "description": "",
  "namespace": "",
  "inputs": {}
}
```

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [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

(cherry picked from commit 9512f6c)

# Conflicts:
#	x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/settings/settings.tsx
jen-huang added a commit that referenced this issue Oct 15, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[UII] Support content packages in UI
(#195831)](#195831)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jen
Huang","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-15T17:18:41Z","message":"[UII]
Support content packages in UI (#195831)\n\n## Summary\r\n\r\nResolves
#192484. This PR adds support for content packages in UI. When\r\na
package is of `type: content`:\r\n\r\n- `Content only` badge is shown on
its card in Integrations list, and on\r\nheader of its details page\r\n-
`Add integration` button is replaced by `Install assets` button
in\r\nheader\r\n- References to agent policies are hidden\r\n- Package
policy service throws error if attempting to create or bulk\r\ncreate
policies for content packages\r\n\r\n<img width=\"1403\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a82c310a-f849-4b68-b56c-ff6bb31cd6bf\">\r\n\r\n<img
width=\"1401\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/63eb3982-9ec9-494f-a95a-2b8992a408ba\">\r\n\r\n##
How to test\r\nThe only current content package is `kubernetes_otel`.
You will need to\r\nbump up the max allowed spec version and search with
beta (prerelease)\r\npackages enabled to find
it:\r\n```\r\nxpack.fleet.internal.registry.spec.max:
'3.4'\r\n```\r\n\r\nTest UI scenarios as above. The API can be tested by
running:\r\n```\r\nPOST kbn:/api/fleet/package_policies\r\n{\r\n
\"policy_ids\": [\r\n \"\"\r\n ],\r\n \"package\": {\r\n \"name\":
\"kubernetes_otel\",\r\n \"version\": \"0.0.2\"\r\n },\r\n \"name\":
\"kubernetes_otel-1\",\r\n \"description\": \"\",\r\n \"namespace\":
\"\",\r\n \"inputs\": {}\r\n}\r\n```\r\n\r\n### Checklist\r\n\r\nDelete
any items that are not applicable to this PR.\r\n\r\n- [x] Any text
added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"9512f6c26fbac59b8b8d7390dc28da930e42f181","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Fleet","v9.0.0","release_note:feature","backport:prev-minor"],"number":195831,"url":"https://github.com/elastic/kibana/pull/195831","mergeCommit":{"message":"[UII]
Support content packages in UI (#195831)\n\n## Summary\r\n\r\nResolves
#192484. This PR adds support for content packages in UI. When\r\na
package is of `type: content`:\r\n\r\n- `Content only` badge is shown on
its card in Integrations list, and on\r\nheader of its details page\r\n-
`Add integration` button is replaced by `Install assets` button
in\r\nheader\r\n- References to agent policies are hidden\r\n- Package
policy service throws error if attempting to create or bulk\r\ncreate
policies for content packages\r\n\r\n<img width=\"1403\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a82c310a-f849-4b68-b56c-ff6bb31cd6bf\">\r\n\r\n<img
width=\"1401\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/63eb3982-9ec9-494f-a95a-2b8992a408ba\">\r\n\r\n##
How to test\r\nThe only current content package is `kubernetes_otel`.
You will need to\r\nbump up the max allowed spec version and search with
beta (prerelease)\r\npackages enabled to find
it:\r\n```\r\nxpack.fleet.internal.registry.spec.max:
'3.4'\r\n```\r\n\r\nTest UI scenarios as above. The API can be tested by
running:\r\n```\r\nPOST kbn:/api/fleet/package_policies\r\n{\r\n
\"policy_ids\": [\r\n \"\"\r\n ],\r\n \"package\": {\r\n \"name\":
\"kubernetes_otel\",\r\n \"version\": \"0.0.2\"\r\n },\r\n \"name\":
\"kubernetes_otel-1\",\r\n \"description\": \"\",\r\n \"namespace\":
\"\",\r\n \"inputs\": {}\r\n}\r\n```\r\n\r\n### Checklist\r\n\r\nDelete
any items that are not applicable to this PR.\r\n\r\n- [x] Any text
added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"9512f6c26fbac59b8b8d7390dc28da930e42f181"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195831","number":195831,"mergeCommit":{"message":"[UII]
Support content packages in UI (#195831)\n\n## Summary\r\n\r\nResolves
#192484. This PR adds support for content packages in UI. When\r\na
package is of `type: content`:\r\n\r\n- `Content only` badge is shown on
its card in Integrations list, and on\r\nheader of its details page\r\n-
`Add integration` button is replaced by `Install assets` button
in\r\nheader\r\n- References to agent policies are hidden\r\n- Package
policy service throws error if attempting to create or bulk\r\ncreate
policies for content packages\r\n\r\n<img width=\"1403\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/a82c310a-f849-4b68-b56c-ff6bb31cd6bf\">\r\n\r\n<img
width=\"1401\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/63eb3982-9ec9-494f-a95a-2b8992a408ba\">\r\n\r\n##
How to test\r\nThe only current content package is `kubernetes_otel`.
You will need to\r\nbump up the max allowed spec version and search with
beta (prerelease)\r\npackages enabled to find
it:\r\n```\r\nxpack.fleet.internal.registry.spec.max:
'3.4'\r\n```\r\n\r\nTest UI scenarios as above. The API can be tested by
running:\r\n```\r\nPOST kbn:/api/fleet/package_policies\r\n{\r\n
\"policy_ids\": [\r\n \"\"\r\n ],\r\n \"package\": {\r\n \"name\":
\"kubernetes_otel\",\r\n \"version\": \"0.0.2\"\r\n },\r\n \"name\":
\"kubernetes_otel-1\",\r\n \"description\": \"\",\r\n \"namespace\":
\"\",\r\n \"inputs\": {}\r\n}\r\n```\r\n\r\n### Checklist\r\n\r\nDelete
any items that are not applicable to this PR.\r\n\r\n- [x] Any text
added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"9512f6c26fbac59b8b8d7390dc28da930e42f181"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants