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

chore: migrate ebpf manager from device to distro name env #2401

Merged
merged 6 commits into from
Feb 7, 2025

Conversation

blumamir
Copy link
Collaborator

@blumamir blumamir commented Feb 7, 2025

As part of the effort to remove instrumentation device, this PR:

  • add environment variable to containers, ODIGOS_DISTRO_NAME to describe the name of the distro injected to the pod.
  • migrate ebpf manager to match distribution based on the new environment variable with fallback to device so not to break existing users.
  • fix missing agent directory needed in python
  • remove device from 4 distros that do not inject any env variables - only need the /var/odigos mount, or not.

@blumamir blumamir marked this pull request as draft February 7, 2025 05:48
@blumamir blumamir marked this pull request as ready for review February 7, 2025 06:39
@blumamir blumamir requested a review from RonFed February 7, 2025 11:09
if distroName != "" {
// TODO: so we can remove the device slowly while having backward compatibility,
// we map here the distroNames one by one.
// this is temporary, and should be refactored once device is removed
Copy link
Collaborator

Choose a reason for hiding this comment

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

Aside from removing the device fallback, is there another refactor needed here in the future?
From the comment, it seems like there is a generic way to convert distro name to language and sdk.

I assume the plan is to not have language and sdk in the futrure just use the distro name,
For that, we will need to modify the factories map keys used by the manager to be distro name.
Is that right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes exactly

Copy link
Collaborator

Choose a reason for hiding this comment

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

we already have `instrumentor/internal/webhook_env_injector"

I agree that they operate on different kinds of env vars, but I think those logics should be in the same package

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as I refactor this part, I intend to move the functions to the controller, similar to how it's done in the rollout directory

@blumamir blumamir merged commit f1be20d into odigos-io:main Feb 7, 2025
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants