Skip to content

Conversation

@pkoutsovasilis
Copy link
Contributor

@pkoutsovasilis pkoutsovasilis commented Oct 30, 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

@pkoutsovasilis pkoutsovasilis self-assigned this Oct 30, 2025
@pkoutsovasilis pkoutsovasilis added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog backport-8.19 Automated backport to the 8.19 branch backport-9.2 Automated backport to the 9.2 branch labels Oct 30, 2025
@pkoutsovasilis pkoutsovasilis force-pushed the isolation/move_edot_in_a_separate_package branch 6 times, most recently from c69eb19 to b93684f Compare October 31, 2025 08:21
@pkoutsovasilis
Copy link
Contributor Author

The fips related failures should be resolved by this PR

@pkoutsovasilis pkoutsovasilis marked this pull request as ready for review October 31, 2025 12:01
@pkoutsovasilis pkoutsovasilis requested review from a team as code owners October 31, 2025 12:01
@elasticmachine
Copy link
Collaborator

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

Copy link
Contributor

@swiatekm swiatekm left a comment

Choose a reason for hiding this comment

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

Looks good to me at first glance. I checked this out and tried locally doing some of the things it changes, like updating the otel core version, and it all worked correctly.

I do think we should change the edot/pkg package name, but I'm not going to block this PR on it. Once CI passes, I'll approve it.

@pkoutsovasilis pkoutsovasilis force-pushed the isolation/move_edot_in_a_separate_package branch from b93684f to 81e97fc Compare October 31, 2025 14:02
v1v
v1v previously approved these changes Nov 2, 2025
Copy link
Member

@v1v v1v left a comment

Choose a reason for hiding this comment

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

LGTM - I only reviewed the files in the folder .ci

swiatekm
swiatekm previously approved these changes Nov 3, 2025
@mergify
Copy link
Contributor

mergify bot commented Nov 4, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream git checkout -b isolation/move_edot_in_a_separate_package upstream/isolation/move_edot_in_a_separate_package git merge upstream/main git push upstream isolation/move_edot_in_a_separate_package 
@swiatekm swiatekm dismissed stale reviews from v1v and themself via 7d9ae63 November 5, 2025 11:23
@elasticmachine
Copy link
Collaborator

⏳ Build in-progress, with failures

Failed CI Steps

History

cc @pkoutsovasilis

@mergify
Copy link
Contributor

mergify bot commented Nov 5, 2025

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream git checkout -b isolation/move_edot_in_a_separate_package upstream/isolation/move_edot_in_a_separate_package git merge upstream/main git push upstream isolation/move_edot_in_a_separate_package 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.19 Automated backport to the 8.19 branch backport-9.2 Automated backport to the 9.2 branch skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

4 participants