-
Notifications
You must be signed in to change notification settings - Fork 56
Description
To further the design of a Custom Probe API, we first need to understand the needs of projects that intend to adopt Probes.
Current Overlap
The main overlap between OBI and Go-Auto is:
-
OBI
Tracer= Go-AutoProbe
The Go-AutoProbe(the "Probe API") is conceptually equivalent to OBI’sTracer.
Currently, the Probe API is responsible for defining instrumentation libraries (e.g., uprobes, function symbols, offsets, and config options), managing their lifecycle (e.g., loading eBPF programs, maps), and handling emitted events. In Go-Auto, this is defined as a Go interface. -
OBI
Instrumenter= Go-AutoManager
TheManagerin Go-Auto plays a role similar to the OBIInstrumenter. It is the core orchestration component, instantiated viaauto.NewInstrumentation(), and manages probe lifecycles and runtime behavior.
tl;dr
obi.Tracer = auto.Probe
obi.Instrumenter = auto.Manager
Our aim is to unify these overlapping concepts and remove redundant implementations across OBI and Go-Auto.
Proposal
I propose refactoring the Go-Auto architecture to shift most lifecycle responsibilities from Probe to Manager. Under this model:
-
Probes become declarative:
The Probe API should focus on describing instrumentation (what to trace, where, and how) without dealing with lifecycle management. -
Managers control execution:
TheManagerbecomes the sole runtime controller, responsible for initializing, loading, and managing instrumentations.
This change will simplify and stabilize the Probe API, allowing developers to define portable, reusable Probes. Any eBPF tool built with OpenTelemetry standards could import and use these Probes without needing to fork or customize core logic, provided they conform to the Probe API.
Benefits of This Approach
-
Reduced API Surface Area: By stripping lifecycle logic from Probes, we make the API easier to maintain and less prone to breaking changes.
-
Extensibility in Go-Auto: The Manager can evolve and gain new features without impacting stable Probe definitions.
-
Vendor Enablement: Projects like Odigos and Beyla can use the Go-Auto framework as a foundation, without necessarily pulling in OBI as a dependency.
-
Clear Project Roles:
- OBI becomes the standard implementation and community end-user tool for OTel eBPF auto-instrumentation.
- Go-Auto acts as the reusable library layer for vendors to build upon.
- OBI also serves as a “vendor” in this model to validate Go-Auto’s usability and promote adoption and community participation.
Implementation for OBI
In this unified model, OBI would:
- Import and use Probes defined via Go-Auto
- Rely on the Go-Auto
Managerto load and coordinate instrumentations
This allows OBI to focus on experience and usability, while contributing improvements upstream to Go-Auto.
Challenges
OBI currently provides functionality not yet available in Go-Auto. Examples include:
- Cross-process Tracer sharing: OBI supports shared eBPF maps across Tracers in different processes.
- Custom Go offsets map: OBI uses a specialized map to handle Go runtime offsets.
- Optimized eBPF span structures: OBI improves span efficiency for event-heavy scenarios at the C level.
To enable this proposal, we would contribute these capabilities to the Go-Auto Manager, and encourage future contributions like this from OBI and any other vendors (given that they align with OpenTelemetry's commitment to vendor neutrality).
Bonus challenge: C-level eBPF structures
While Probes interact with the Manager, developers are still responsible for writing eBPF code that aligns with the assumptions of the Go-Auto framework. Critical functionality like context propagation, goroutine tracking, and OpenTelemetry-compatible span structures cannot be fully enforced or abstracted through the Go-level Probe API alone. To support this, Go-Auto provides a shared C library that handles these runtime behaviors and is used across existing Probe implementations. To improve reusability and consistency, this C library should be standardized and made easily accessible to Probe developers. This will ensure that custom Probes can be reliably integrated into any OTel-based tool without requiring deep coupling or tool-specific adaptations.
What to do now
We want to build a proof of concept that demonstrates a Go-Auto Probe being successfully imported and used by OBI. This will serve as a “steel thread” between Go-Auto and OBI to validate that the Probe API is functional, minimal, and practical for third-party consumption.
As @grcevski showed in today’s SIG call, the current implementation is already close to supporting this integration, minus the features listed above. The key decision now is how and where to introduce those missing capabilities. Instead of expanding the Probe interface to handle this additional functionality, the proposal is to move these responsibilities into the Go-Auto Manager where possible.
This essentially comes down to the removal of probe.Load() and replacing OBI’s Instrumenter with the Go-Auto Manager. The next step is to determine what functionality OBI currently requires and how to generalize and integrate that into the Manager. Any remaining gaps point to necessary features of the Probe API, and our design of that v1 API becomes much clearer.
x-ref: open-telemetry/opentelemetry-go-instrumentation#2029 -- shifting some probe lifecycle functionality to the Manager