Skip to content

Add support for discovery content packages based on datasets#922

Merged
mrodm merged 7 commits intoelastic:mainfrom
mrodm:add-discovery-datasets
Jul 10, 2025
Merged

Add support for discovery content packages based on datasets#922
mrodm merged 7 commits intoelastic:mainfrom
mrodm:add-discovery-datasets

Conversation

@mrodm
Copy link
Copy Markdown
Contributor

@mrodm mrodm commented Jul 8, 2025

What does this PR do?

Add discovery of content packages based on datasets .
It allows to define a new discovery.datasets key in the package manifests.

discovery:
  datasets:
    - name: nginx.access
    - name: nginx.error

Checklist

Related issues

@mrodm mrodm self-assigned this Jul 8, 2025
@mrodm mrodm marked this pull request as ready for review July 8, 2025 13:24
@mrodm mrodm requested a review from a team as a code owner July 8, 2025 13:24
@mrodm mrodm marked this pull request as draft July 8, 2025 16:36
@mrodm mrodm marked this pull request as ready for review July 8, 2025 16:37
type: array
items:
type: object
additionalProperties: false
Copy link
Copy Markdown
Contributor Author

@mrodm mrodm Jul 8, 2025

Choose a reason for hiding this comment

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

Previously, it was allowed to defined additional properties in discovery.fields.
I think this should be disallowed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added changelog entry as bugfix for this

jsoriano
jsoriano previously approved these changes Jul 8, 2025
Copy link
Copy Markdown
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

Maybe we should extend documentation of these fields.

Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

History

cc @mrodm

@mrodm mrodm requested a review from jsoriano July 9, 2025 08:58
@mrodm mrodm merged commit a50d2bc into elastic:main Jul 10, 2025
3 checks passed
@mrodm mrodm deleted the add-discovery-datasets branch July 10, 2025 08:09
juliaElastic added a commit to elastic/kibana that referenced this pull request Jul 15, 2025
## Summary

Adjusted to datasets field
elastic/package-spec#922

Closes elastic/ingest-dev#5685

Added kibana task to check discovery dataset fields of content packages
in EPR, check recent data ingested for matching fields, and install
content packages if not installed yet.

Added telemetry mappings: elastic/telemetry#4940

To verify:
- enable feature flag in `kibana.dev.yml`:
`xpack.fleet.enableExperimental: ['enableAutoInstallContentPackages']`
- TODO start local epr with test package that has a `discovery.datasets`
with a value (e.g. system.cpu), depends on
[package-spec](elastic/package-spec#922) change
to be available
- enroll an agent and wait until some data is ingested to the dataset
above
- wait 10m for the task to run
- verify that the test package is installed

Kibana logs:
```
[2025-07-10T14:07:13.177+02:00][INFO ][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [runTask()] started
[2025-07-10T14:07:13.206+02:00][DEBUG][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] ESQL query took: 11ms
[2025-07-10T14:07:13.207+02:00][DEBUG][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] Found datasets with data: fleet_server.agent_versions, fleet_server.agent_status, elastic_agent.fleet_server
[2025-07-10T14:07:13.207+02:00][DEBUG][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] Content packages to install: kubernetes_otel@1.1.0
[2025-07-10T14:07:13.208+02:00][DEBUG][plugins.fleet] Kicking off install of kubernetes_otel-1.1.0 from registry
[2025-07-10T14:07:15.605+02:00][INFO ][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] runTask ended: success
```

### Checklist

- [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

---------

Co-authored-by: Michel Losier <mikelosier@gmail.com>
Bluefinger pushed a commit to Bluefinger/kibana that referenced this pull request Jul 22, 2025
## Summary

Adjusted to datasets field
elastic/package-spec#922

Closes elastic/ingest-dev#5685

Added kibana task to check discovery dataset fields of content packages
in EPR, check recent data ingested for matching fields, and install
content packages if not installed yet.

Added telemetry mappings: elastic/telemetry#4940

To verify:
- enable feature flag in `kibana.dev.yml`:
`xpack.fleet.enableExperimental: ['enableAutoInstallContentPackages']`
- TODO start local epr with test package that has a `discovery.datasets`
with a value (e.g. system.cpu), depends on
[package-spec](elastic/package-spec#922) change
to be available
- enroll an agent and wait until some data is ingested to the dataset
above
- wait 10m for the task to run
- verify that the test package is installed

Kibana logs:
```
[2025-07-10T14:07:13.177+02:00][INFO ][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [runTask()] started
[2025-07-10T14:07:13.206+02:00][DEBUG][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] ESQL query took: 11ms
[2025-07-10T14:07:13.207+02:00][DEBUG][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] Found datasets with data: fleet_server.agent_versions, fleet_server.agent_status, elastic_agent.fleet_server
[2025-07-10T14:07:13.207+02:00][DEBUG][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] Content packages to install: kubernetes_otel@1.1.0
[2025-07-10T14:07:13.208+02:00][DEBUG][plugins.fleet] Kicking off install of kubernetes_otel-1.1.0 from registry
[2025-07-10T14:07:15.605+02:00][INFO ][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] runTask ended: success
```

### Checklist

- [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

---------

Co-authored-by: Michel Losier <mikelosier@gmail.com>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
## Summary

Adjusted to datasets field
elastic/package-spec#922

Closes elastic/ingest-dev#5685

Added kibana task to check discovery dataset fields of content packages
in EPR, check recent data ingested for matching fields, and install
content packages if not installed yet.

Added telemetry mappings: elastic/telemetry#4940

To verify:
- enable feature flag in `kibana.dev.yml`:
`xpack.fleet.enableExperimental: ['enableAutoInstallContentPackages']`
- TODO start local epr with test package that has a `discovery.datasets`
with a value (e.g. system.cpu), depends on
[package-spec](elastic/package-spec#922) change
to be available
- enroll an agent and wait until some data is ingested to the dataset
above
- wait 10m for the task to run
- verify that the test package is installed

Kibana logs:
```
[2025-07-10T14:07:13.177+02:00][INFO ][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [runTask()] started
[2025-07-10T14:07:13.206+02:00][DEBUG][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] ESQL query took: 11ms
[2025-07-10T14:07:13.207+02:00][DEBUG][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] Found datasets with data: fleet_server.agent_versions, fleet_server.agent_status, elastic_agent.fleet_server
[2025-07-10T14:07:13.207+02:00][DEBUG][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] Content packages to install: kubernetes_otel@1.1.0
[2025-07-10T14:07:13.208+02:00][DEBUG][plugins.fleet] Kicking off install of kubernetes_otel-1.1.0 from registry
[2025-07-10T14:07:15.605+02:00][INFO ][plugins.fleet.fleet:auto-install-content-packages-task:1.0.1] [AutoInstallContentPackagesTask] runTask ended: success
```

### Checklist

- [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

---------

Co-authored-by: Michel Losier <mikelosier@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Change Proposal] Add a new discovery parameter based on datasets

3 participants