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

Refactor Odiglet main function #1879

Merged
merged 7 commits into from
Nov 28, 2024
Merged

Conversation

RonFed
Copy link
Collaborator

@RonFed RonFed commented Nov 27, 2024

This PR refactors the top-level initialization of Odiglet:

  • Split to newOdilget and run functions. The first initializes all the different components, the second launches them, and handles closing them all gracefully on shutdown.
  • Some of the components were slightly refactored to support this: OpAmp, runtime-detector, pprof server and kube manager.


<-ctx.Done()
for _, director := range ebpfDirectors {
func (o *odiglet) run() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's a bit non-conventional to have the ctx as property.

Consider sending it to the run function

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, currently I keep it that way since we have the initEbpf part which gets a context, but that will be removed soon.

odiglet/cmd/main.go Outdated Show resolved Hide resolved
odiglet/cmd/main.go Outdated Show resolved Hide resolved
@RonFed RonFed enabled auto-merge (squash) November 28, 2024 14:55
@RonFed RonFed disabled auto-merge November 28, 2024 15:32
@RonFed RonFed enabled auto-merge (squash) November 28, 2024 15:42
@RonFed RonFed disabled auto-merge November 28, 2024 15:45
@RonFed RonFed merged commit 32c9aed into odigos-io:main Nov 28, 2024
28 checks passed
@RonFed RonFed deleted the refactor_odiglet_main branch November 28, 2024 16:13
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