OpenTelemetry Compile-Time Instrumentation for Golang
See the codeLoongsuite Go Agent provides an automatic solution for Golang applications that want to
leverage OpenTelemetry to enable effective observability. No code changes are
required in the target application, the instrumentation is done at compile
time. Simply adding otel prefix to go build to get started 🚀
[!IMPORTANT] Requires Go 1.25+ for both the tool and the instrumented application. See compatibility.
For Linux and macOS, the following script installs otel to /usr/local/bin/otel by default:
$ curl -fsSL https://cdn.jsdelivr.net/gh/alibaba/loongsuite-go@main/install.sh | sudo bash
$ make # build only
$ make install # build and install
Make sure the tool is installed:
$ # You may use "otel-linux-amd64" instead of "otel"
$ otel version
Just adding otel prefix to go build to build your project:
$ otel go build
$ otel go build -o app cmd/app
$ otel go build -gcflags="-m" cmd/app
That's the whole process! The tool will automatically instrument your code with OpenTelemetry, and you can start to observe your application. 🔭
The detailed usage of otel tool can be found in Usage.
[!NOTE] If you find any compilation failures while
go buildworks, it's likely a bug. Please feel free to file a bug at GitHub Issues to help us enhance this project.
go.uber.org/zap loggingWe are progressively open-sourcing the libraries we have supported, and your contributions are Very Welcome
[!IMPORTANT] The framework you expected is not in the list? Don't worry, you can easily inject your code into any frameworks/libraries that are not officially supported.
Please refer to this document to get started.
This project has been contributed upstream to the OpenTelemetry community and successfully incubated the official opentelemetry-go-compile-instrumentation project.
Join our DingTalk group or scan the QR codes below.
| LoongCollector SIG | LoongSuite Python SIG | LoongSuite Go SIG | LoongSuite Java SIG |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
908 followers · starred Nov 2024
182 followers · starred Feb 2025
841 followers · starred Sep 2025
109 followers · starred Jan 2025
OpenTelemetry Compile-Time Instrumentation for Golang
See the codeLoongsuite Go Agent provides an automatic solution for Golang applications that want to
leverage OpenTelemetry to enable effective observability. No code changes are
required in the target application, the instrumentation is done at compile
time. Simply adding otel prefix to go build to get started 🚀
[!IMPORTANT] Requires Go 1.25+ for both the tool and the instrumented application. See compatibility.
For Linux and macOS, the following script installs otel to /usr/local/bin/otel by default:
$ curl -fsSL https://cdn.jsdelivr.net/gh/alibaba/loongsuite-go@main/install.sh | sudo bash
$ make # build only
$ make install # build and install
Make sure the tool is installed:
$ # You may use "otel-linux-amd64" instead of "otel"
$ otel version
Just adding otel prefix to go build to build your project:
$ otel go build
$ otel go build -o app cmd/app
$ otel go build -gcflags="-m" cmd/app
That's the whole process! The tool will automatically instrument your code with OpenTelemetry, and you can start to observe your application. 🔭
The detailed usage of otel tool can be found in Usage.
[!NOTE] If you find any compilation failures while
go buildworks, it's likely a bug. Please feel free to file a bug at GitHub Issues to help us enhance this project.
go.uber.org/zap loggingWe are progressively open-sourcing the libraries we have supported, and your contributions are Very Welcome
[!IMPORTANT] The framework you expected is not in the list? Don't worry, you can easily inject your code into any frameworks/libraries that are not officially supported.
Please refer to this document to get started.
This project has been contributed upstream to the OpenTelemetry community and successfully incubated the official opentelemetry-go-compile-instrumentation project.
Join our DingTalk group or scan the QR codes below.
| LoongCollector SIG | LoongSuite Python SIG | LoongSuite Go SIG | LoongSuite Java SIG |
|---|---|---|---|
![]() | ![]() | ![]() | ![]() |
908 followers · starred Nov 2024
182 followers · starred Feb 2025
841 followers · starred Sep 2025
109 followers · starred Jan 2025