Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Apr 24, 2025

What does this PR do?

Allows to run components in the Otel manager instead of the runtime manager. Currently, only filestream is supported. This implements option 2 from https://github.com/elastic/ingest-dev/issues/4931.

Some notes about the implementation:

  • We use the same otel collector as hybrid mode. We add a prefix to each component and pipeline name in an effort to avoid conflicts.
  • The Otel configuration is generated from the component model agent already uses for beats processes. It is easier to manipulate and lets us emit the same status information in the future.
  • This behaviour is controlled by a single attribute of the Coordinator, the only way to enable it is by changing the code. This is a temporary measure until we decide what feature flags we want for it.
  • Status reporting uses the otel collector status, and doesn't try to be compatible with beats processes status.
  • Which input types are supported is hardcoded.

Why is it important?

This is a preprequisite for migrating to Otel within agent, which is our long-term plan. In the short-term, it will make it easier for us to run tests.

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 added tests that prove my fix is effective or that my feature works
  • I have added an integration test or an E2E test

How to test this PR locally

  1. Change the boolean value in
    runComponentsInOtelManager: false, // change this to run supported components in the Otel manager
  2. Build an agent package
  3. Run agent with a configuration containing a filestream input

Related issues


This is an automatic backport of pull request #6697 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner April 24, 2025 13:14
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Apr 24, 2025
@mergify mergify bot requested review from michalpristas and pchila and removed request for a team April 24, 2025 13:14
@mergify
Copy link
Contributor Author

mergify bot commented Apr 24, 2025

Cherry-pick of eeffc0e has failed:

On branch mergify/bp/8.18/pr-6697
Your branch is up to date with 'origin/8.18'.

You are currently cherry-picking commit eeffc0e5a.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   internal/pkg/agent/application/coordinator/coordinator.go
	modified:   internal/pkg/agent/application/coordinator/coordinator_unit_test.go
	modified:   internal/pkg/agent/application/upgrade/upgrade.go
	new file:   internal/pkg/otel/configtranslate/otelconfig.go
	new file:   internal/pkg/otel/configtranslate/otelconfig_test.go
	modified:   pkg/component/runtime/command.go
	modified:   pkg/component/runtime/runtime_comm.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   NOTICE.txt
	both modified:   go.mod

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions bot added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog labels Apr 24, 2025
@elasticmachine
Copy link
Contributor

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

@swiatekm swiatekm force-pushed the mergify/bp/8.18/pr-6697 branch from bb09e16 to 68877c6 Compare April 24, 2025 13:40
* Add ability to run components in the Otel manager

# Conflicts:
#	NOTICE.txt
#	go.mod
#	go.sum

* Add coordinator test

* Set metricbeat receiver signal type to logs

* Drop unnecessary transform processor

The conversion now happens in the otel consumer in beats.

* Determine default datastream type from beat name

* Fix diagnostics tests

* Promote output queue settings to receivers

* Move otel config translation to the otel package

* Emit the otel component diagnostic conditionally

* Add more otel config translation tests

* Code review fixes

* Fix diagnostics tests

* Code Review fixes

* Correctly set input types if not present

* More code review fixes

(cherry picked from commit eeffc0e)

# Conflicts:
#	NOTICE.txt
#	go.mod
@swiatekm swiatekm force-pushed the mergify/bp/8.18/pr-6697 branch from 3bed429 to adf5f38 Compare April 24, 2025 20:12
@swiatekm swiatekm enabled auto-merge (squash) April 24, 2025 20:12
@swiatekm swiatekm removed the conflicts There is a conflict in the backported pull request label Apr 24, 2025
@elastic-sonarqube
Copy link

@elasticmachine
Copy link
Contributor

elasticmachine commented Apr 24, 2025

@mergify
Copy link
Contributor Author

mergify bot commented Apr 28, 2025

This pull request has not been merged yet. Could you please review and merge it @swiatekm? 🙏

@swiatekm
Copy link
Contributor

Closing, we don't need to backport this change to 8.18. It's good enough that it's in 8.19, which is our long-term support branch.

@swiatekm swiatekm closed this Apr 29, 2025
auto-merge was automatically disabled April 29, 2025 16:37

Pull request was closed

@swiatekm swiatekm deleted the mergify/bp/8.18/pr-6697 branch April 29, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants