Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 26, 2025

What does this PR do?

Makes inputs use the process runtime if they're configured to use the otel runtime, and the latter cannot support them. Currently there are two possible reasons for this:

  • The output is not suppored at all - logstash is an example.
  • The output configuration uses unsupported config options - allow_older_versions: false for the elasticsearch output for example.

A log line is also emitted if this happens.

I've also moved the component monitoring code into its own package to avoid dependency cycles.

Why is it important?

We want to enable the otel runtime progressively without ever breaking a user's working setup. This means that a fallback is necessary, even if it may involve going against the explicit configuration. Later, we may add a flag which causes this to be an error instead.

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 the agent package and run it locally with either an elasticsearch output using an unsupported option (this PR uses allow_older_versions: false), or a kafka or logstash output. Then look at the status and logs. You should see a log line warning that your input was switched to the process runtime.

Related issues

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

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

* Move component monitoring to its own package

Agent monitoring has two separate functions - implementing the control
plane monitoring server and self-monitoring for components. Having both
in the same packages caused a dependency cycle involving the otel
translation package. Resolve this by putting component monitoring in a
subpackage

* Fall back to process runtime if otel runtime is unsupported

* Fix integration test

* Normalize import names

* Add logstash unit test

* Use indices instead of allow_older_version

* Add log line for skipped components

* Change argument order

* Fix linter warning

(cherry picked from commit 2f0ba69)

# Conflicts:
#	internal/pkg/agent/application/application.go
#	internal/pkg/agent/application/coordinator/coordinator.go
#	internal/pkg/otel/translate/otelconfig.go
#	internal/pkg/otel/translate/otelconfig_test.go
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Sep 26, 2025
@mergify mergify bot requested a review from a team as a code owner September 26, 2025 09:34
@mergify mergify bot requested review from ycombinator and michel-laterman and removed request for a team September 26, 2025 09:34
Copy link
Contributor Author

mergify bot commented Sep 26, 2025

Cherry-pick of 2f0ba69 has failed:

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

You are currently cherry-picking commit 2f0ba69f2.
  (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_unit_test.go
	renamed:    internal/pkg/agent/application/monitoring/testdata/monitoring_config_full.yaml -> internal/pkg/agent/application/monitoring/component/testdata/monitoring_config_full.yaml
	renamed:    internal/pkg/agent/application/monitoring/v1_monitor.go -> internal/pkg/agent/application/monitoring/component/v1_monitor.go
	renamed:    internal/pkg/agent/application/monitoring/v1_monitor_test.go -> internal/pkg/agent/application/monitoring/component/v1_monitor_test.go
	modified:   internal/pkg/agent/application/monitoring/process.go
	modified:   internal/pkg/agent/application/monitoring/server.go
	modified:   internal/pkg/agent/cmd/inspect.go
	modified:   internal/pkg/otel/manager/diagnostics.go
	modified:   internal/pkg/otel/manager/diagnostics_test.go
	modified:   testing/integration/ess/beat_receivers_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   internal/pkg/agent/application/application.go
	both modified:   internal/pkg/agent/application/coordinator/coordinator.go
	both modified:   internal/pkg/otel/translate/otelconfig.go
	both modified:   internal/pkg/otel/translate/otelconfig_test.go

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 Sep 26, 2025
@elasticmachine
Copy link
Collaborator

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

@swiatekm swiatekm enabled auto-merge (squash) September 26, 2025 13:54
Copy link

@swiatekm swiatekm merged commit 2b6590c into 8.19 Sep 26, 2025
19 checks passed
@swiatekm swiatekm deleted the mergify/bp/8.19/pr-10087 branch September 26, 2025 15:59
@elasticmachine
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

History

cc @swiatekm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request skip-changelog 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.

2 participants