kibana/x-pack/plugins/fleet/dev_docs/integrations_overview.md
Julia Rechkunova db1c118fa1
[8.x] [Discover] Rename Saved Search to Discover Session (#202217) (#204818)
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Discover] Rename Saved Search to Discover Session
(#202217)](https://github.com/elastic/kibana/pull/202217)

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

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

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2024-12-18T12:45:32Z","message":"[Discover]
Rename Saved Search to Discover Session (#202217)\n\n- Closes
https://github.com/elastic/kibana/issues/174144\r\n\r\n##
Summary\r\n\r\nThis PR renames Saved Search into Discover Session in
UI.\r\n\r\n- [x] Discover\r\n- [x] Saved Objects page and modal\r\n- [x]
Docs\r\n- [x] Other occurrences \r\n\r\n<img width=\"810\"
alt=\"Screenshot 2024-12-16 at 15 20
10\"\r\nsrc=\"https://github.com/user-attachments/assets/e39083da-f496-4ed5-bbdc-8e184897fc41\"\r\n/>\r\n<img
width=\"1220\" alt=\"Screenshot 2024-12-11 at 14 40
15\"\r\nsrc=\"https://github.com/user-attachments/assets/a6dc3e29-e1a5-4304-8148-0108231cc9de\"\r\n/>\r\n<img
width=\"1476\" alt=\"Screenshot 2024-12-16 at 14 57
39\"\r\nsrc=\"https://github.com/user-attachments/assets/4b34c70e-e21a-4d82-85f2-f5a3cb7a3826\"\r\n/>\r\n\r\n\r\n###
Checklist\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]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\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\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
wajihaparvez <wajiha.parvez@elastic.co>\r\nCo-authored-by: Davis McPhee
<davismcphee@hotmail.com>\r\nCo-authored-by: Julia Bardi
<90178898+juliaElastic@users.noreply.github.com>","sha":"40c90550f12f99f23e6b7d545c7427e30d648dab","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Fleet","v9.0.0","Team:DataDiscovery","backport:prev-minor","ci:project-deploy-observability"],"number":202217,"url":"https://github.com/elastic/kibana/pull/202217","mergeCommit":{"message":"[Discover]
Rename Saved Search to Discover Session (#202217)\n\n- Closes
https://github.com/elastic/kibana/issues/174144\r\n\r\n##
Summary\r\n\r\nThis PR renames Saved Search into Discover Session in
UI.\r\n\r\n- [x] Discover\r\n- [x] Saved Objects page and modal\r\n- [x]
Docs\r\n- [x] Other occurrences \r\n\r\n<img width=\"810\"
alt=\"Screenshot 2024-12-16 at 15 20
10\"\r\nsrc=\"https://github.com/user-attachments/assets/e39083da-f496-4ed5-bbdc-8e184897fc41\"\r\n/>\r\n<img
width=\"1220\" alt=\"Screenshot 2024-12-11 at 14 40
15\"\r\nsrc=\"https://github.com/user-attachments/assets/a6dc3e29-e1a5-4304-8148-0108231cc9de\"\r\n/>\r\n<img
width=\"1476\" alt=\"Screenshot 2024-12-16 at 14 57
39\"\r\nsrc=\"https://github.com/user-attachments/assets/4b34c70e-e21a-4d82-85f2-f5a3cb7a3826\"\r\n/>\r\n\r\n\r\n###
Checklist\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]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\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\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
wajihaparvez <wajiha.parvez@elastic.co>\r\nCo-authored-by: Davis McPhee
<davismcphee@hotmail.com>\r\nCo-authored-by: Julia Bardi
<90178898+juliaElastic@users.noreply.github.com>","sha":"40c90550f12f99f23e6b7d545c7427e30d648dab"}},"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/202217","number":202217,"mergeCommit":{"message":"[Discover]
Rename Saved Search to Discover Session (#202217)\n\n- Closes
https://github.com/elastic/kibana/issues/174144\r\n\r\n##
Summary\r\n\r\nThis PR renames Saved Search into Discover Session in
UI.\r\n\r\n- [x] Discover\r\n- [x] Saved Objects page and modal\r\n- [x]
Docs\r\n- [x] Other occurrences \r\n\r\n<img width=\"810\"
alt=\"Screenshot 2024-12-16 at 15 20
10\"\r\nsrc=\"https://github.com/user-attachments/assets/e39083da-f496-4ed5-bbdc-8e184897fc41\"\r\n/>\r\n<img
width=\"1220\" alt=\"Screenshot 2024-12-11 at 14 40
15\"\r\nsrc=\"https://github.com/user-attachments/assets/a6dc3e29-e1a5-4304-8148-0108231cc9de\"\r\n/>\r\n<img
width=\"1476\" alt=\"Screenshot 2024-12-16 at 14 57
39\"\r\nsrc=\"https://github.com/user-attachments/assets/4b34c70e-e21a-4d82-85f2-f5a3cb7a3826\"\r\n/>\r\n\r\n\r\n###
Checklist\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]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\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\r\n- [x] The PR
description includes the appropriate Release Notes section,\r\nand the
correct `release_note:*` label is applied per
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
wajihaparvez <wajiha.parvez@elastic.co>\r\nCo-authored-by: Davis McPhee
<davismcphee@hotmail.com>\r\nCo-authored-by: Julia Bardi
<90178898+juliaElastic@users.noreply.github.com>","sha":"40c90550f12f99f23e6b7d545c7427e30d648dab"}}]}]
BACKPORT-->
2024-12-19 21:38:57 +11:00

11 KiB
Raw Blame History

Overview of Integrations

Elastic Agent integrations are mechanisms for installing assets that provide an opinionated "out of the box" experience for ingesting data from various pieces of software, third party services, and even internal Elastic products. Fleet provides an interface for installing and managing these integrations. Integrations tell Elastic Agent where and how to retrieve data, and how it should be ingested into Elasticsearch.

In terms of what an integration actually is, it's a set of mostly YML files in a particular directory structure with particular naming conventions. These conventions are captured in a specification maintained by Elastic called the package spec.

This document will detail some of the key files and fields defined by the package spec that we'll commonly deal with in Fleet, and will attempt to provide an informed mental model around integrations. We'll use Fleet's integration policy editor UI to show how integrations' configuration files are translated into the Fleet interface we present to users.

References

Top level manifest.yml

🔗 Package spec reference

  • Basic metadata for the integration like name, title, version, description, categories, etc
  • Kibana compatibility spec
  • Screenshots and icon assets

policy_templates

🔗 Package spec reference

The top level manifest.yml file defines a set of policy_templates which define a grouping of fields used to configure the integration. These policy_templates control whats rendered in Fleet UIs “policy editor” when creating or editing integration policies.

Most integrations will only specify a single policy_template as they dont require this level of structure. For integrations that export many “sub-integrations,” however, they rely on defining multiple templates.

For example, Nginx defines only a single policy_template - aptly named nginx:

# https://github.com/elastic/integrations/blob/main/packages/nginx/manifest.yml
policy_templates:
  - name: nginx
    title: Nginx logs and metrics
    description: Collect logs and metrics from Nginx instances
    inputs:
    # ...

This results in a policy editor UI that looks like this:

Nginx policy editor screenshot

In contrast, the AWS integration defines many policy_templates, as it allows users to configure policy values for many distinct services like EC2, S3, or RDS. See the policy_templates definition for AWS here.

The AWS policy editor has a section for each provided policy_template value, e.g.

AWS policy editor screenshot

Each policy template is also exposed as its own distinct integration, and can be installed or managed separately as if it were a first-class integration:

AWS integrations screenshot

inputs

🔗 Package spec reference

Each policy_template entry defines a set of inputs. An input is essentially a named grouping of fields related to a particular type of data to be ingested. Each input declares a type that typically maps to a Beats input like httpjson or filestream. Elastic Agent manages Beats under the hood, so these inputs are how we can configure the individual Beats that Agent is managing.

For example, the Nginx integration defines three inputs:

  1. logfile
  2. httpjson
  3. nginx/metrics

These inputs appear in the policy editor UI as separate fieldsets, e.g.

Nginx inputs screenshot

Each input can define a list of vars that will allow a user to configure variables via form fields in the Fleet policy editor UI.

For example, on the Nginx integration's httpjson input, there are several "input level variables" configure, which are rendered as below:

image

These input level variables are defined in the Nginx integration here.

It's important to note that integration also define variables at the data stream level, which we'll get into later in this doc. In the screenshot above, for example, the section beneath the "Settings" section of the httpjson input contains data stream variables for the streams configured as part of the httpjson input.

data_stream directory

Each integration includes a data_stream directory that contains configuration for, well, data streams.

Data streams are a construct in Elasticsearch designed for storing "append-only" time series data across multiple backing indices. They give Elastic Agent an easy and performant way to ingest logs and metrics data into Elasticsearch.

Inside of the data_stream directory, each data stream is defined as its own directory. For example, the Nginx integration's data_stream directory contains three data streams:

  1. access
  2. error
  3. substatus

Elastic Agent data streams conform to a naming schema of {type}-{dataset}-{namespace}. The type of a data stream is either logs or metrics. The dataset of a datastream is controlled in most cases by an interpolation of the integration's name field and the directory name containing the data stream's manifest.yml file. The namespace value is provided by the user for the purpose of grouping or organizing data.

Each data stream directory contains a manifest.yml file that controls the configuration for the data stream, as well as Elasticsearch/Kibana assets, configuration for Agent, and more. Generally, though, the manifest.yml file is the most critical one in a given data stream directory.

In a data stream's manifest.yml file, the integration defines a list of streams. Each item in that streams list is tied to a single input, and defines its own list of vars that controls the set of form fields that appear in the policy editor UI.

For example, the Nginx integration's access data stream defines an entry in its streams list tied to the logfile input mentioned above that includes variables like paths and tags. The variables appear as form fields in the policy editor UI as below:

Nginx data streams screenshot

The "Nginx access logs" fieldset we see in the policy editor UI is defined here in the data_streams/access/manifest.yml file within the Nginx integration. It's input value is set to logfile, so it appears under the "Collect logs from Nginx instances" section in the policy editor. The title and description values control what appears on the left-hand side to describe the fieldset.

Data stream assets

Each data stream directory may contain an elasticsearch or kibana directory that contains assets (like ingest pipelines or Kibana dashboards) for a given stack component. These assets are usually YML or JSON files that Fleet passes off to the corresponding stack component to install. For example, the Nginx integration's data_stream/access directory contains an elasticsearch/ingest_pipeline directory that contains the following files:

  • default.yml
  • third-party.yml

These files represent two ingest pipelines that ship with the Nginx integration to provide out-of-the-box mappings, field processing, etc for Nginx data.

For more information on data streams, see Fleet's dev docs here.

agent/stream directory

Each data stream contains an agent/stream directory that includes YML files for configuring agent. These are template files that are compiled by Fleet when generating the full agent policy.

TODO: Document this in more detail

fields directory

The fields directory contains YML files that define the mappings for a given data stream. There may be any number of fields files based on the integration maintainers preferred organization for their mappings. For example, many integrations contain a base-fields.yml file for common mappings, an ecs.yml file for ECS-compliant fields, an agent.yml file for mappings specific to the actual agent process, and a fields.yml file for everything else.

The mappings defined by fields files are used by Fleet to generate an index template for each data stream. This index template composes all of the mappings and settings and ensures that all documents ingested by the data stream are indexed as configured.

docs directory

Contains the README file rendered on the integrations detail page for the integration.

img directory

Contains screenshots rendered on the integrations detail page for the integration.

kibana directory

Contains top level Kibana assets (dashboards, visualizations, Discover sessions etc) for the integration.

Relationship diagram

Reference the following diagram to understand the relationship between the various components of an integration:

erDiagram
  Integration ||--|{ PolicyTemplate : "Many policy templates"
  Integration ||--|{ DataStream : "Many data streams"

  PolicyTemplate ||--|{ Input : "Many inputs"

  DataStream ||--|{ Input : "Many inputs"

  Integration {}
  PolicyTemplate {}
  Input {}
  DataStream {}