OpenTelemetry Go Auto Instrumentation
![](https://shields.io/badge/Readme-%E4%B8%AD%E6%96%87-blue?logo=Read%20The%20Docs)
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, and the instrumentation is done at compile
time. Simply replace go build
with otelbuild
to get started.
Installation
Precompiled binary
We recommend using the precompiled latest release version. You can visit the
Release
page to download them.
Build from source
You can also clone the repository and build the project by running the following commands:
$ make build
Getting Started
Replace go build
with the following command to build your project:
# go build
$ ./otelbuild
The arguments for go build
should be placed after the --
delimiter:
# go build -gcflags="-m" cmd/app
$ ./otelbuild -- -gcflags="-m" cmd/app
The arguments for the tool itself should be placed before the --
delimiter:
$ ./otelbuild -help # print help doc
$ ./otelbuild -debuglog # print log to file
$ ./otelbuild -verbose -- -gcflags="-m" cmd/app # print verbose log
You can also explore these examples to get hands-on experience.
Also there are several documents that you may find useful
[!NOTE]
If you find any compilation failures during the process, it's likely a bug.
Please feel free to file a bug
at GitHub Issues
to help us enhance this project.
Supported Libraries
We are progressively open-sourcing the libraries we have supported, and your contributions are very welcome :
sparkling_heart: .
Please refer to this document for guidance on how to write instrumentation
code for new frameworks.
We are looking forward to your feedback and suggestions. You can join
our DingTalk group
to engage with us.