Make packages `internal` to separate public and internal APIs
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).
~The list looks good, except for reporter, which should definitely be public: its interface is one of the primary customization points.~ (nvm, misread OP)
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?
It might be worth consindering to make github.com/open-telemetry/opentelemetry-ebpf-profiler/host private.
:+1: Removed from the list
Thanks for raising this. We'll discuss it and provide feedback. Sorry for the delay.
We're currently using util to be able to implement the Reporter interface which requires util.SourceLineno: https://github.com/open-telemetry/opentelemetry-ebpf-profiler/blob/dd98f7080855cea3a2c03dda99283fbec964b105/reporter/iface.go#L75-L76
Would it be possible to also expose util or alternatively move util.SourceLineno to a publicly exported package?
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