Skip to content

[Fleet] generate OTel config for integration packages with otelcol inputs#259968

Merged
juliaElastic merged 10 commits intoelastic:mainfrom
juliaElastic:otel-config-integration-package
Mar 31, 2026
Merged

[Fleet] generate OTel config for integration packages with otelcol inputs#259968
juliaElastic merged 10 commits intoelastic:mainfrom
juliaElastic:otel-config-integration-package

Conversation

@juliaElastic
Copy link
Copy Markdown
Contributor

@juliaElastic juliaElastic commented Mar 27, 2026

Summary

Closes #252949

Extends OTel collector configuration generation (generateOtelcolConfig) to support integration packages that include an otelcol input in their policy_templates.inputs[] array (coming from composable packages), as introduced in package-spec#1085.

Previously, OTel config generation worked only for input-type packages (packages with type: input and a single top-level input: otelcol). Integration packages with an otelcol input were not recognised by hasDynamicSignalTypes and did not receive dynamic signal-type routing.

Covered with unit and integration tests.

The test package contains this otelcol input in the manifest:

format_version: 3.6.0
name: integration_otel
title: Integration OTel Test Package
description: Test integration package with OpenTelemetry collector input
type: integration
version: 1.0.0
license: basic
categories:
  - observability
policy_templates:
  - name: integration_otel
    title: Integration OTel
    description: Collect data via OpenTelemetry collector
    inputs:
      - type: otelcol
        title: Collect OTel data
        description: Collect data via OpenTelemetry collector
        dynamic_signal_types: true
    data_streams:
      - otel_logs

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@juliaElastic juliaElastic added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Mar 27, 2026
@juliaElastic juliaElastic changed the title [Fleet] generate Otel config for integration packages with otelcol inputs [Fleet] generate OTel config for integration packages with otelcol inputs Mar 27, 2026
@juliaElastic juliaElastic marked this pull request as ready for review March 27, 2026 12:17
@juliaElastic juliaElastic requested a review from a team as a code owner March 27, 2026 12:17
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Mar 27, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@juliaElastic juliaElastic force-pushed the otel-config-integration-package branch from 8aef54d to b960cc0 Compare March 27, 2026 14:33
(template as RegistryPolicyIntegrationTemplate).inputs?.some(
(input) => input.type === OTEL_COLLECTOR_INPUT_TYPE && input.dynamic_signal_types === true
)
) === true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: I think you can remove the === true, since some returns a boolean


// Check integration templates (type: integration packages) with otelcol in their inputs array
return (
packageInfo.policy_templates?.some(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: I'm wondering if we should extract this condition to a function, something like IntegrationsWithOtelInputs for clarity and to be reused if needed elsewhere

Copy link
Copy Markdown
Contributor Author

@juliaElastic juliaElastic Mar 27, 2026

Choose a reason for hiding this comment

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

If we create a separate function to list the templates that have otel inputs, we have to iterate again to determine which inputs have dynamic_signal_types. I would wait with this refactor until we have to reuse the list of templates somewhere else.

@@ -341,6 +342,7 @@ export interface RegistryInput {
[RegistryInputKeys.hide_in_var_group_options]?: Record<string, string[]>;
[RegistryInputKeys.deprecated]?: DeprecationInfo;
[RegistryInputKeys.migrate_from]?: string;
[RegistryInputKeys.dynamic_signal_types]?: boolean;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are these the inputs in the main manifest? As the data stream type is not defined at this point how is this going to be interpreted in Fleet? Is it going to be applied to all streams using this input?

cc @teresaromero

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.

Are these the inputs in the main manifest? As the data stream type is not defined at this point how is this going to be interpreted in Fleet?

Yes, it maps to the inputs array inside a policy_template in the main manifest.

Is it going to be applied to all streams using this input?

Yes it applies to all streams using that input. The flag is on the input definition, not on individual streams. Every stream in a policy that uses this input type will get the multi-signal-type treatment.

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.

Are these the inputs in the main manifest? As the data stream type is not defined at this point how is this going to be interpreted in Fleet?

Yes, it maps to the inputs array inside a policy_template in the main manifest.

Is it going to be applied to all streams using this input?

Yes it applies to all streams using that input. The flag is on the input definition, not on individual streams. Every stream in a policy that uses this input type will get the multi-signal-type treatment.

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Mar 30, 2026

Approvability

Verdict: Needs human review

This PR changes runtime behavior for OTel config generation and agent permission determination, moving from package-level to per-input dynamic signal type checking. All changed files are owned by @elastic/fleet (the author owns none of them), and there are open review comments questioning whether the implementation correctly handles edge cases with multiple inputs/policy templates.

You can customize Macroscope's approvability policy. Learn more.

Copy link
Copy Markdown
Member

@criamico criamico left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

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.

Thanks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@juliaElastic juliaElastic merged commit f84b69f into elastic:main Mar 31, 2026
20 checks passed
mbondyra added a commit to mbondyra/kibana that referenced this pull request Mar 31, 2026
…e_for_children6

* commit '3402744f63ca1196e97b11ffac4e7f7efab240df': (80 commits)
  [PerUserAuth] Add EARS auth type for Connectors V2 (elastic#253695)
  Fix `@elastic/eui/require-aria-label-for-modals` lint violations across `@elastic/kibana-core` files (elastic#259757)
  [Entity Analytics][Leads generation][4] Add API routes, LeadDataClient, and async generation (elastic#257046)
  [Agent Builder] Agent-centric UX redesign (elastic#258005)
  fix query streams failing test (elastic#260277)
  [Lens as code] Add list layout to the new API (elastic#259967)
  [FTR] Add warning comments to deployment-agnostic FTR base configs (elastic#260018)
  [Discover][Logs profile] Fix missing search highlights (elastic#260056)
  Plugin system: safe deletion (elastic#259038)
  [Infra] Fix Hosts filter options to match selected schema (elastic#259825)
  Manual Entity Resolution and flyout representation (elastic#260162)
  [Cascade] Handle grouping on fields with unset values (elastic#260033)
  [Fleet] generate OTel config for integration packages with otelcol inputs (elastic#259968)
  [Search] Switch over to V2 index management details (elastic#259866)
  [inference] increase timeout for ES inference calls (elastic#260382)
  [ES|QL] Enable subqueries (elastic#257455)
  [ES|QL] Change Point order free options (elastic#260282)
  [Auth] Added authentication strategy for UIAM OAuth (elastic#256182)
  [Security Solution] Add "alerts_candidate_count" rule execution metric (elastic#259917)
  [api-docs] 2026-03-31 Daily api_docs build (elastic#260380)
  ...
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
…puts (elastic#259968)

## Summary

Closes elastic#252949

Extends OTel collector configuration generation
(`generateOtelcolConfig`) to support integration packages that include
an `otelcol` input in their `policy_templates.inputs[]` array (coming
from composable packages), as introduced in
[package-spec#1085](elastic/package-spec#1085).

Previously, OTel config generation worked only for input-type packages
(packages with `type: input` and a single top-level `input: otelcol`).
Integration packages with an otelcol input were not recognised by
`hasDynamicSignalTypes` and did not receive dynamic signal-type routing.

Covered with unit and integration tests.

The test package contains this otelcol input in the manifest:
```
format_version: 3.6.0
name: integration_otel
title: Integration OTel Test Package
description: Test integration package with OpenTelemetry collector input
type: integration
version: 1.0.0
license: basic
categories:
  - observability
policy_templates:
  - name: integration_otel
    title: Integration OTel
    description: Collect data via OpenTelemetry collector
    inputs:
      - type: otelcol
        title: Collect OTel data
        description: Collect data via OpenTelemetry collector
        dynamic_signal_types: true
    data_streams:
      - otel_logs
```

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
…puts (elastic#259968)

## Summary

Closes elastic#252949

Extends OTel collector configuration generation
(`generateOtelcolConfig`) to support integration packages that include
an `otelcol` input in their `policy_templates.inputs[]` array (coming
from composable packages), as introduced in
[package-spec#1085](elastic/package-spec#1085).

Previously, OTel config generation worked only for input-type packages
(packages with `type: input` and a single top-level `input: otelcol`).
Integration packages with an otelcol input were not recognised by
`hasDynamicSignalTypes` and did not receive dynamic signal-type routing.

Covered with unit and integration tests.

The test package contains this otelcol input in the manifest:
```
format_version: 3.6.0
name: integration_otel
title: Integration OTel Test Package
description: Test integration package with OpenTelemetry collector input
type: integration
version: 1.0.0
license: basic
categories:
  - observability
policy_templates:
  - name: integration_otel
    title: Integration OTel
    description: Collect data via OpenTelemetry collector
    inputs:
      - type: otelcol
        title: Collect OTel data
        description: Collect data via OpenTelemetry collector
        dynamic_signal_types: true
    data_streams:
      - otel_logs
```

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] 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/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[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
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet] Enable generation of OTel configuration for integration packages

5 participants