Skip to content

Include input id in otel receiver names if present - #17148

Merged
swiatekm merged 2 commits into
mainfrom
swiatekm/otel-runtime-merges-streams-with-the-same-id-fro
Oct 14, 2026
Merged

swiatekm merged 2 commits into
mainfrom
swiatekm/otel-runtime-merges-streams-with-the-same-id-fro

Conversation

@swiatekm

@swiatekm swiatekm commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Includes the input ID in the ID of otel receivers of its streams. This fixes a bug where streams with the same ID, present in different inputs of the same type, would be collapsed into a single receiver.

Why is it important?

A component contains all the inputs of a given type writing to an output. Within it, each stream gets its own receiver, identified by a combination of component ID and stream ID. However, it's possible to have streams with identical IDs in different inputs of the same type. Those are collapsed into the same receiver, which is obviously wrong. This change fixes that bug.

Here's an example of an affected configuration:

inputs:
  - id: elasticsearch/metrics-pod-a
    type: elasticsearch/metrics
    streams:
      - id: elasticsearch/metrics-elasticsearch.stack_monitoring.node
        data_stream:
          dataset: elasticsearch.stack_monitoring.node
        metricsets: [node]
        hosts: ["https://10.0.0.1:9200"]
  - id: elasticsearch/metrics-pod-b
    type: elasticsearch/metrics
    streams:
      - id: elasticsearch/metrics-elasticsearch.stack_monitoring.node
        data_stream:
          dataset: elasticsearch.stack_monitoring.node
        metricsets: [node]
        hosts: ["https://10.0.0.2:9200"]

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

How to test this PR locally

Build agent and try out the configuration posted above. It will now produce a receiver per stream, as it should.

Related issues

@swiatekm swiatekm changed the title Otel runtime merges streams with the same id fro Include input id in otel receiver names if present Oct 12, 2026
@mergify

mergify Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label. Could you fix it @swiatekm? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label that automatically backports to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@swiatekm swiatekm added bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team backport-9.5 Automated backport to the 9.5 branch labels Oct 12, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

cc @swiatekm

@swiatekm
swiatekm marked this pull request as ready for review October 12, 2026 12:23
@swiatekm
swiatekm requested a review from a team as a code owner October 12, 2026 12:23
@swiatekm
swiatekm requested a review from blakerouse October 12, 2026 12:23
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@blakerouse blakerouse left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, straightforward change, well tested!

@mergify

mergify Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@swiatekm
swiatekm merged commit 5486629 into main Oct 14, 2026
30 checks passed
@swiatekm
swiatekm deleted the swiatekm/otel-runtime-merges-streams-with-the-same-id-fro branch October 14, 2026 15:38
swiatekm added a commit that referenced this pull request Oct 14, 2026
…esent (#17210)

* Include input ID in receiver name if present (#17148)

(cherry picked from commit 5486629)

# Conflicts:
#	internal/pkg/otel/translate/otelconfig_nofips_test.go
#	internal/pkg/otel/translate/otelconfig_test.go

* Resolve backport test conflicts

Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com>

---------

Co-authored-by: Mikołaj Świątek <mail@mikolajswiatek.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: swiatekm <93588780+swiatekm@users.noreply.github.com>
@leehinman leehinman mentioned this pull request Oct 27, 2026
1 of 3 tasks
vishaangelova added a commit that referenced this pull request Nov 2, 2026
Add the "Keep streams with identical IDs from different inputs separate
in the OTel runtime" fix (#17148). It was missing because its changelog
kind is "unknown", so the generator didn't place it in any section.
vishaangelova added a commit that referenced this pull request Nov 2, 2026
Add the "Keep streams with identical IDs from different inputs separate
in the OTel runtime" fix (#17148). It was missing because its changelog
kind is "unknown", so the generator didn't place it in any section.
@vishaangelova vishaangelova mentioned this pull request Nov 2, 2026
3 tasks done
ebeahan added a commit that referenced this pull request Nov 2, 2026
* add the 9.5.6 Elastic Agent release notes

* remove duplicate PR entries

* fixes

Updated release notes for version 9.5.6, including new features, enhancements, and fixes.

* Review fixes

* Add missing entry

Add the "Keep streams with identical IDs from different inputs separate
in the OTel runtime" fix (#17148). It was missing because its changelog
kind is "unknown", so the generator didn't place it in any section.

---------

Co-authored-by: ebeahan <7226265+ebeahan@users.noreply.github.com>
Co-authored-by: ebeahan <eric.beahan@elastic.co>
Co-authored-by: Brandon Morelli <brandon.morelli@elastic.co>
Co-authored-by: Visha Angelova <visha.angelova@elastic.co>
ebeahan added a commit that referenced this pull request Nov 2, 2026
* add the 9.5.6 Elastic Agent release notes

* remove duplicate PR entries

* fixes

Updated release notes for version 9.5.6, including new features, enhancements, and fixes.

* Review fixes

* Add missing entry

Add the "Keep streams with identical IDs from different inputs separate
in the OTel runtime" fix (#17148). It was missing because its changelog
kind is "unknown", so the generator didn't place it in any section.

---------





(cherry picked from commit fc35af5)

Co-authored-by: elastic-vault-github-plugin-prod[bot] <150874479+elastic-vault-github-plugin-prod[bot]@users.noreply.github.com>
Co-authored-by: ebeahan <7226265+ebeahan@users.noreply.github.com>
Co-authored-by: ebeahan <eric.beahan@elastic.co>
Co-authored-by: Brandon Morelli <brandon.morelli@elastic.co>
Co-authored-by: Visha Angelova <visha.angelova@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-9.5 Automated backport to the 9.5 branch bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Otel runtime merges streams with the same id from different inputs

2 participants