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

Make packages internal to separate public and internal APIs #132

Open
rockdaboot opened this issue Aug 23, 2024 · 6 comments
Open

Make packages internal to separate public and internal APIs #132

rockdaboot opened this issue Aug 23, 2024 · 6 comments
Labels

Comments

@rockdaboot
Copy link
Contributor

rockdaboot commented Aug 23, 2024

Every package that is not meant to be used externally, should be made private explicitly.

We possibly start making everything private (= putting under internal/) except

  • libpf/
  • reporter/
  • tracer/
  • hostmetadata/
  • times/
  • tracehandler/
    and then iterate on further improvements/restrictions from there.

It would be good to know, which parts of the profiler code needs to be accessible from custom agents (@felixge @brancz).

@athre0z

This comment was marked as resolved.

@florianl
Copy link
Contributor

florianl commented Aug 23, 2024

It might be worth consindering to make github.com/open-telemetry/opentelemetry-ebpf-profiler/host private. This package provides types that are only internal to the agent and should not be part of a public API. Besides the unfortunate naming, using the package github.com/open-telemetry/opentelemetry-ebpf-profiler/host without having more insight knowledge might just be confusing.

Is there an overall idea how public APIs for public packages should look like, that can be discussed upfront?

@rockdaboot
Copy link
Contributor Author

It might be worth consindering to make github.com/open-telemetry/opentelemetry-ebpf-profiler/host private.

👍 Removed from the list

@felixge
Copy link
Member

felixge commented Aug 28, 2024

Thanks for raising this. We'll discuss it and provide feedback. Sorry for the delay.

@Gandem
Copy link
Contributor

Gandem commented Aug 28, 2024

We're currently using util to be able to implement the Reporter interface which requires util.SourceLineno:

FrameMetadata(fileID libpf.FileID, addressOrLine libpf.AddressOrLineno,
lineNumber util.SourceLineno, functionOffset uint32, functionName, filePath string)

Would it be possible to also expose util or alternatively move util.SourceLineno to a publicly exported package?

@rockdaboot
Copy link
Contributor Author

We're currently using util to be able to implement the Reporter interface which requires util.SourceLineno:

@Gandem Thanks for pointing out, makes much sense. See #156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants