Getting Started
March 5, 2026 ยท View on GitHub
OpenTelemetry Go Compile-Time Instrumentation is a tool that automatically instruments your Go applications with OpenTelemetry at compile-time. No manual code changes required.
Why Use This Tool?
- Zero-code instrumentation - Automatically instrument your entire application without modifying source code
- Third-party library support - Instrument dependencies and libraries you don't control
- Complete decoupling - Keep your codebase free from instrumentation concerns
- Flexible deployment - Integrate at development time or in your CI/CD pipeline
Quick Start
-
Clone and build the tool
git clone https://github.com/open-telemetry/opentelemetry-go-compile-instrumentation.git cd opentelemetry-go-compile-instrumentation make build -
Try the demo
make demo -
Use with your application
# Option 1: Direct build ./otelc go build -o myapp . # Option 2: Install as tool dependency (Go 1.24+) go get -tool github.com/open-telemetry/opentelemetry-go-compile-instrumentation/cmd/otelc go tool otelc go build -o myapp .
How It Works
The tool uses compile-time instrumentation through:
- Trampoline Code Injection - Injects lightweight hook points into target functions
- Function Pointer Redirection - Automatically generates and links hooks to monitoring code via
//go:linkname - Custom Toolchain Integration - Intercepts compilation using
-toolexecflag
This approach provides dynamic instrumentation without runtime overhead or invasive code modifications.
Learn More
- User Experience Design - Detailed UX documentation and configuration options
- Implementation Details - Technical architecture and internals
- API Design - API structure and project organization
- Contributing Guide - How to contribute to the project
Video Talks
Learn more about the project from these presentations:
Community
- Slack: Join #otel-go-compt-instr-sig
- Meetings: Check the meeting notes for SIG schedules
- GitHub: open-telemetry/opentelemetry-go-compile-instrumentation
Status
Note: This project is currently in active development and not yet ready for production use.
For the latest updates and development progress, follow the project on GitHub and join the community discussions.