Loongsuite 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 🚀
Linux AMD64 | Linux ARM64 | MacOS AMD64 | MacOS ARM64 | Windows AMD64 |
---|---|---|---|---|
Download | Download | Download | Download | Download |
This is the recommended way to install the tool.
For Linux and MacOS users, the following script will install otel
in /usr/local/bin/otel
by default:
$ sudo curl -fsSL https://cdn.jsdelivr.net/gh/alibaba/loongsuite-go-agent@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 build
works, it's likely a bug.
Please feel free to file a bug
at GitHub Issues
to help us enhance this project.
- demo - Complete end-to-end example demonstrating automatic instrumentation with OpenTelemetry tracing and metrics collection.
- zap logging - Integration example showing how to automatically instrument structured logging with the
github.com/uber-go/zap
package. - benchmark - Performance testing suite to measure the overhead and efficiency of the auto-instrumentation tool.
- sql injection - Security-focused example demonstrating custom code injection for SQL injection detection and prevention.
- nethttp - HTTP monitoring example showcasing automatic instrumentation of request/response headers and network traffic analysis.
We 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.
We are looking forward to your feedback and suggestions. You can join our DingTalk group to engage with us.
We would thankfully acknowledge the following contributors for their valuable contributions to this project:
The star history of this project is as follows, which shows the growth of this project over time: