Skip to content

Comments

Move process discovery out of auto#1890

Merged
MrAlias merged 5 commits intoopen-telemetry:mainfrom
MrAlias:mv-discover-to-cli
Mar 3, 2025
Merged

Move process discovery out of auto#1890
MrAlias merged 5 commits intoopen-telemetry:mainfrom
MrAlias:mv-discover-to-cli

Conversation

@MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Feb 27, 2025

Resolve #1887

  • Have the CLI manage process discovery instead of the auto.NewInstrumentation.
    • Parse OTEL_GO_AUTO_TARGET_EXE in the CLI instead of auto.NewInstrumentation
    • Remove the WithTarget option
  • Add support for the -target-exe CLI flag to configure the target executable path
  • Add support for the -target-pid CLI flag to configure the target pid
  • Add support for parsing OTEL_GO_AUTO_TARGET_PID in the CLI
  • Add tests for process discovery

@MrAlias MrAlias added this to the v0.22.0 milestone Feb 27, 2025
@MrAlias MrAlias force-pushed the mv-discover-to-cli branch 3 times, most recently from 89ca3e1 to 2083684 Compare February 27, 2025 17:33
@MrAlias MrAlias marked this pull request as ready for review February 27, 2025 17:38
@MrAlias MrAlias requested a review from a team as a code owner February 27, 2025 17:38
Copy link
Member

@damemi damemi left a comment

Choose a reason for hiding this comment

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

@MrAlias wdyt about moving the entire internal/pkg/process to its own top-level package, such as go.opentelemetry.io/auto/process?

This is coming from looking at the Probe api, which is currently tied to the process package through the targetdetails arg

Given that not all probes will be tied to a process, and process detection and management is going to move up to the consumer level, I think it makes sense to not have it be tied in that way. But it could be useful for the consumers who are implementing process management for us to provide that code as a helper package. Curious what you think?

@MrAlias
Copy link
Contributor Author

MrAlias commented Feb 28, 2025

@MrAlias wdyt about moving the entire internal/pkg/process to its own top-level package, such as go.opentelemetry.io/auto/process?

This is coming from looking at the Probe api, which is currently tied to the process package through the targetdetails arg

Given that not all probes will be tied to a process, and process detection and management is going to move up to the consumer level, I think it makes sense to not have it be tied in that way. But it could be useful for the consumers who are implementing process management for us to provide that code as a helper package. Curious what you think?

I'm looking at refactoring the process package right now. There is a lot of clean up needed there.

I agree we will need some top-level package to represent a package for the probe API. I'm not in favor of just moving the whole package as is given things I'm seeing there, but we can surely add something at the top level that makes sense when we add the probe API.

That said, I do not plan to move the process package in this PR. I see this as part of the larger refactor of that package and a step towards moving parts of it.

@damemi
Copy link
Member

damemi commented Feb 28, 2025

@MrAlias sounds good, and yeah I assumed that there are refactoring changes needed (didn't mean that we could just literally move the entire package wholesale as-is). My main point is having something external that can be used with the external Probe api. I think that will be a prerequisite for that refactor

@MrAlias
Copy link
Contributor Author

MrAlias commented Feb 28, 2025

Gotcha, sounds like we're on the same page 😀

@MrAlias MrAlias force-pushed the mv-discover-to-cli branch from f2b918d to d77fb18 Compare March 2, 2025 16:18
@MrAlias MrAlias merged commit f81b2ea into open-telemetry:main Mar 3, 2025
28 checks passed
@MrAlias MrAlias deleted the mv-discover-to-cli branch March 3, 2025 15:35
@MrAlias MrAlias mentioned this pull request Mar 3, 2025
MrAlias added a commit to MrAlias/opentelemetry-go-instrumentation that referenced this pull request Mar 3, 2025
MrAlias added a commit to MrAlias/opentelemetry-go-instrumentation that referenced this pull request Mar 3, 2025
@MrAlias MrAlias mentioned this pull request May 23, 2025
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.

Move process discovery from auto into auto/cli

3 participants