Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Nov 7, 2025

What does this PR do?

This PR introduces EDOT (Elastic Distribution for OpenTelemetry) as a separate repository sub-package by moving code from internal/pkg/otel to internal/edot. This is a pure refactoring/relocation change with no functional modifications. Specifically:

  • Relocates EDOT code: Moves all EDOT-related code from internal/pkg/otel/* to internal/edot/pkg/*
  • Updates all import paths: Changes throughout the codebase from github.com/elastic/elastic-agent/internal/pkg/otel/... to github.com/elastic/elastic-agent/internal/edot/pkg/...
  • Maintains functionality: Zero behavioural changes - all existing functionality remains identical
  • Preserves internal structure: The internal organisation within EDOT packages remains unchanged
  • Updates build system: Adjusts mage targets, namely update:beats, otel:readme, etc., and scripts to reference the new package location
  • Updates dependencies: Regenerates go.mod and go.sum to reflect the new import paths

Changes summary: 50 files changed, +53,172 additions, -50,175 deletions (the large diff is primarily due to go.mod/go.sum/NOTICE*.txt regeneration and mechanical import path updates)

Why is it important?

This change is the second step in the incremental approach to separate EDOT from elastic-agent (as outlined in PR #9308). Introducing EDOT as a separate sub-package provides:

  1. Clearer separation of concerns: Physically separates EDOT code from elastic-agent control plane code at the repository level, making the architecture explicit
  2. Prepares for module separation: Establishes the package structure needed to eventually extract EDOT into its own Go module with a separate go.mod
  3. Improves code organization: Makes it immediately clear which code belongs to EDOT vs elastic-agent control plane
  4. Simplifies future splitting: Having EDOT in internal/edot/ makes it straightforward to later extract it as a separate module or even repository

This follows the incremental approach decided by the team to split the large PR #9308 into smaller, reviewable chunks.

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

Disruptive User Impact

None. This is a pure internal code reorganisation with no changes to functionality, APIs, configuration, or user-facing behaviour. The change is completely transparent to end users.

How to test this PR locally

Since this is a refactoring PR with no functional changes, testing focuses on ensuring everything continues to work as before, everything should work as before. So run any/all unit-test and/or integration test.

Related issues

N/A


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

* feat: introduce edot as a separate repo sub-package

* chore: rename edot/pkg to edot/otelcol

* go mod tidy

* Update beats in edot go.mod to match agent go.mod.

---------

Co-authored-by: Mikołaj Świątek <[email protected]>
Co-authored-by: Blake Rouse <[email protected]>
(cherry picked from commit c1777a5)

# Conflicts:
#	NOTICE-fips.txt
#	NOTICE.txt
#	go.mod
@mergify mergify bot requested review from a team as code owners November 7, 2025 20:52
@mergify mergify bot requested review from michalpristas and swiatekm and removed request for a team November 7, 2025 20:52
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Nov 7, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Nov 7, 2025

Cherry-pick of c1777a5 has failed:

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

You are currently cherry-picking commit c1777a5ce.
  (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:   .ci/scripts/update-otel.sh
	modified:   .ci/updatecli/updatecli-bump-golang.yml
	modified:   .golangci.yml
	modified:   dev-tools/mage/build.go
	modified:   dev-tools/mage/target/update/update.go
	modified:   dev-tools/notice/overrides.json
	modified:   go.sum
	new file:   internal/edot/LICENSE.txt
	renamed:    internal/pkg/agent/cmd/command_components.go -> internal/edot/cmd/command_components.go
	renamed:    internal/pkg/agent/cmd/command_components_fips_test.go -> internal/edot/cmd/command_components_fips_test.go
	renamed:    internal/pkg/agent/cmd/command_components_nofips_test.go -> internal/edot/cmd/command_components_nofips_test.go
	new file:   internal/edot/cmd/common.go
	renamed:    internal/pkg/agent/cmd/diagnostics_otel.go -> internal/edot/cmd/diagnostics_otel.go
	renamed:    internal/pkg/agent/cmd/otel.go -> internal/edot/cmd/otel.go
	renamed:    internal/pkg/agent/cmd/otel_flags.go -> internal/edot/cmd/otel_flags.go
	renamed:    internal/pkg/agent/cmd/otel_flags_test.go -> internal/edot/cmd/otel_flags_test.go
	renamed:    internal/pkg/agent/cmd/otel_test.go -> internal/edot/cmd/otel_test.go
	renamed:    internal/pkg/agent/cmd/testdata/otel/components-output-fips.yml -> internal/edot/cmd/testdata/otel/components-output-fips.yml
	renamed:    internal/pkg/agent/cmd/testdata/otel/components-output.yml -> internal/edot/cmd/testdata/otel/components-output.yml
	renamed:    internal/pkg/agent/cmd/testdata/otel/elastic-agent.yml -> internal/edot/cmd/testdata/otel/elastic-agent.yml
	renamed:    internal/pkg/agent/cmd/testdata/otel/otel.yml -> internal/edot/cmd/testdata/otel/otel.yml
	renamed:    internal/pkg/agent/cmd/validate.go -> internal/edot/cmd/validate.go
	renamed:    internal/pkg/agent/cmd/validate_test.go -> internal/edot/cmd/validate_test.go
	new file:   internal/edot/go.mod
	new file:   internal/edot/go.sum
	renamed:    internal/pkg/otel/agentprovider/buffer_provider.go -> internal/edot/otelcol/agentprovider/buffer_provider.go
	renamed:    internal/pkg/otel/agentprovider/buffer_provider_test.go -> internal/edot/otelcol/agentprovider/buffer_provider_test.go
	renamed:    internal/pkg/otel/agentprovider/provider.go -> internal/edot/otelcol/agentprovider/provider.go
	renamed:    internal/pkg/otel/agentprovider/provider_test.go -> internal/edot/otelcol/agentprovider/provider_test.go
	renamed:    internal/pkg/otel/agentprovider/scheme.go -> internal/edot/otelcol/agentprovider/scheme.go
	renamed:    internal/pkg/otel/command_components.go -> internal/edot/otelcol/command_components.go
	renamed:    internal/pkg/otel/components.go -> internal/edot/otelcol/components.go
	renamed:    internal/pkg/otel/components_fips.go -> internal/edot/otelcol/components_fips.go
	renamed:    internal/pkg/otel/components_linux.go -> internal/edot/otelcol/components_linux.go
	renamed:    internal/pkg/otel/components_nofips.go -> internal/edot/otelcol/components_nofips.go
	renamed:    internal/pkg/otel/components_others.go -> internal/edot/otelcol/components_others.go
	renamed:    internal/pkg/otel/core_components_test.go -> internal/edot/otelcol/core_components_test.go
	renamed:    internal/pkg/otel/run.go -> internal/edot/otelcol/run.go
	renamed:    internal/pkg/otel/run_fips_test.go -> internal/edot/otelcol/run_fips_test.go
	renamed:    internal/pkg/otel/run_nofips_test.go -> internal/edot/otelcol/run_nofips_test.go
	renamed:    internal/pkg/otel/run_test.go -> internal/edot/otelcol/run_test.go
	renamed:    internal/pkg/otel/validate.go -> internal/edot/otelcol/validate.go
	modified:   internal/pkg/agent/cmd/common.go
	modified:   internal/pkg/otel/README.md
	modified:   internal/pkg/otel/manager/testing/testing.go
	modified:   internal/pkg/otel/samples_test.go
	modified:   magefile.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   NOTICE-fips.txt
	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 Nov 7, 2025
@elasticmachine
Copy link
Collaborator

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

@elasticmachine
Copy link
Collaborator

⏳ Build in-progress, with failures

Failed CI Steps

History

cc @pkoutsovasilis

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.

4 participants