Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.17](backport #5767) Add support for running EDOT inside of running Elastic Agent #6629

Closed
wants to merge 1 commit into from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 29, 2025

What does this PR do?

Adds the ability to run the EDOT along side the running Elastic Agent.

This connects the EDOT into the coordinator of the Elastic Agent. At any point if any of these top-level keys (receivers, processors, exporters, extensions, service) exist in the configuration or policy for the elastic-agent the EDOT is started. If all of those keys are removed from the configuration or policy then the EDOT is automatically stopped. If any configuration change occurs the updated configuration is passed along to the EDOT to handle.

Why is it important?

This allows EDOT configuration to exist inside of the configuration or policy and allow it to work as expected.

Checklist

  • 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

Disruptive User Impact

This is an addition and doesn't affect the way the current Elastic Agent runs at all.

How to test this PR locally

Place OTel configuration into the elastic-agent.yml:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318
processors:
  batch:

exporters:
  otlp:
    endpoint: otelcol:4317

extensions:
  health_check:
  pprof:

service:
  extensions: [health_check, pprof]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]

Run elastic-agent run -e.

Related issues

Closes #5796


This is an automatic backport of pull request #5767 done by Mergify.

(cherry picked from commit b07566b)

# Conflicts:
#	NOTICE.txt
#	go.mod
#	go.sum
#	internal/pkg/agent/application/coordinator/coordinator_test.go
#	internal/pkg/otel/components.go
#	internal/pkg/otel/run.go
@mergify mergify bot added the backport label Jan 29, 2025
@mergify mergify bot requested a review from a team as a code owner January 29, 2025 15:50
@mergify mergify bot added the conflicts There is a conflict in the backported pull request label Jan 29, 2025
@mergify mergify bot requested a review from a team as a code owner January 29, 2025 15:50
@mergify mergify bot requested review from michalpristas and removed request for a team January 29, 2025 15:50
Copy link
Contributor Author

mergify bot commented Jan 29, 2025

Cherry-pick of b07566b has failed:

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

You are currently cherry-picking commit b07566b96.
  (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:   .github/workflows/golangci-lint.yml
	new file:   changelog/fragments/1729011748-Add-EDOT-hybrid-mode.yaml
	modified:   control_v2.proto
	modified:   internal/pkg/agent/application/actions/handlers/handler_action_upgrade_test.go
	modified:   internal/pkg/agent/application/apm_config_modifier.go
	modified:   internal/pkg/agent/application/application.go
	modified:   internal/pkg/agent/application/config_test.go
	modified:   internal/pkg/agent/application/coordinator/coordinator.go
	modified:   internal/pkg/agent/application/coordinator/coordinator_state.go
	modified:   internal/pkg/agent/application/coordinator/coordinator_unit_test.go
	modified:   internal/pkg/agent/application/coordinator/diagnostics_test.go
	modified:   internal/pkg/agent/application/gateway/fleet/fleet_gateway.go
	modified:   internal/pkg/agent/application/info/agent_id.go
	modified:   internal/pkg/agent/application/monitoring/liveness.go
	modified:   internal/pkg/agent/application/monitoring/liveness_test.go
	modified:   internal/pkg/agent/application/monitoring/reload/reload.go
	modified:   internal/pkg/agent/application/monitoring/v1_monitor.go
	modified:   internal/pkg/agent/application/upgrade/artifact/config.go
	modified:   internal/pkg/agent/application/upgrade/artifact/config_test.go
	modified:   internal/pkg/agent/application/upgrade/upgrade.go
	modified:   internal/pkg/agent/cmd/container.go
	modified:   internal/pkg/agent/cmd/container_test.go
	modified:   internal/pkg/agent/cmd/enroll_cmd.go
	modified:   internal/pkg/agent/cmd/enroll_cmd_test.go
	modified:   internal/pkg/agent/cmd/inspect.go
	modified:   internal/pkg/agent/cmd/otel.go
	modified:   internal/pkg/agent/cmd/otel_flags.go
	modified:   internal/pkg/agent/cmd/otel_flags_test.go
	deleted:    internal/pkg/agent/cmd/otel_windows.go
	deleted:    internal/pkg/agent/cmd/otel_windows_test.go
	modified:   internal/pkg/agent/cmd/status.go
	modified:   internal/pkg/agent/cmd/validate.go
	modified:   internal/pkg/agent/configuration/configuration.go
	modified:   internal/pkg/composable/controller.go
	modified:   internal/pkg/composable/providers/docker/docker.go
	modified:   internal/pkg/composable/providers/host/host.go
	modified:   internal/pkg/composable/providers/kubernetes/kubernetes.go
	modified:   internal/pkg/composable/providers/kubernetes/pod_test.go
	modified:   internal/pkg/composable/providers/kubernetesleaderelection/kubernetes_leaderelection.go
	modified:   internal/pkg/composable/providers/kubernetessecrets/kubernetes_secrets.go
	modified:   internal/pkg/composable/providers/local/local.go
	modified:   internal/pkg/composable/providers/localdynamic/localdynamic.go
	modified:   internal/pkg/config/config.go
	modified:   internal/pkg/config/config_test.go
	modified:   internal/pkg/config/loader.go
	modified:   internal/pkg/core/monitoring/config/config_test.go
	new file:   internal/pkg/otel/agentprovider/provider.go
	new file:   internal/pkg/otel/agentprovider/provider_test.go
	deleted:    internal/pkg/otel/config_file_provider.go
	deleted:    internal/pkg/otel/config_file_provider_test.go
	deleted:    internal/pkg/otel/config_manager.go
	new file:   internal/pkg/otel/manager/extension.go
	new file:   internal/pkg/otel/manager/force_extension_converter.go
	new file:   internal/pkg/otel/manager/manager.go
	new file:   internal/pkg/otel/manager/manager_test.go
	new file:   internal/pkg/otel/otelhelpers/status.go
	new file:   internal/pkg/otel/otelhelpers/status_test.go
	modified:   internal/pkg/otel/run_test.go
	modified:   internal/pkg/otel/validate.go
	modified:   internal/pkg/remote/client.go
	modified:   pkg/component/config.go
	modified:   pkg/control/v1/proto/control_v1.pb.go
	modified:   pkg/control/v1/proto/control_v1_grpc.pb.go
	modified:   pkg/control/v2/client/client.go
	modified:   pkg/control/v2/cproto/control_v2.pb.go
	modified:   pkg/control/v2/cproto/control_v2_grpc.pb.go
	modified:   pkg/control/v2/server/server.go
	modified:   pkg/control/v2/server/server_test.go
	modified:   pkg/features/features.go
	modified:   pkg/limits/limits.go
	modified:   pkg/testing/fixture.go
	modified:   testing/integration/diagnostics_test.go
	modified:   testing/integration/otel_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   NOTICE.txt
	both modified:   go.mod
	both modified:   go.sum
	both modified:   internal/pkg/agent/application/coordinator/coordinator_test.go
	both modified:   internal/pkg/otel/components.go
	both modified:   internal/pkg/otel/run.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

@mergify mergify bot requested a review from swiatekm January 29, 2025 15:50
@jlind23 jlind23 closed this Jan 29, 2025
@mergify mergify bot deleted the mergify/bp/8.17/pr-5767 branch February 10, 2025 05:04
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants