This project 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 🚀
For Linux and MacOS users, install the tool by running the following command
$ sudo curl -fsSL https://cdn.jsdelivr.net/gh/alibaba/opentelemetry-go-auto-instrumentation@main/install.sh | sudo bash
It will be installed in /usr/local/bin/otel
by default.
Please download the latest precompiled release version from the Release page.
Checkout source code and build the tool by running one of following commands:
$ make # build only
$ make install # build and install
The configuration for the tool can be set by the following command:
$ otel set -verbose # print verbose logs
$ otel set -debug # enable debug mode
$ otel set -debug -verbose -rule=custom.json # set multiple configs
$ otel set -disabledefault -rule=custom.json # disable default rules, use custom rules only
$ otel set -rule=custom.json # use default and custom rules
$ otel set -rule=a.json,b.json # use default, a and b rules
Once all set up, add 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
You can also explore these examples to get hands-on experience.
Also there are several documents that you may find useful for either understanding the project or contributing to it.
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.
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.
These are only part of the companies using this project, for reference only. If you are using this project, please add your company here to tell us your scenario to make this project better.