1 Star 0 Fork 0

Alibaba/opentelemetry-go-auto-instrumentation

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

codecov

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

Installation

Install via Bash

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.

Precompiled Binary

Please download the latest precompiled release version from the Release page.

Build From Source

Checkout source code and build the tool by running one of following commands:

$ make         # build only
$ make install # build and install

Getting Started

Check the version by running:

$ otel version

The configuration for the tool can be set by the following command:

$ otel set -verbose                          # print verbose logs
$ otel set -log=/path/to/file.log            # set log file
$ 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

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.

Examples

You can also explore these examples to get hands-on experience. They are designed to construct a full picture of how to use the tool in different scenarios.

Also there are several documents that you may find useful for either understanding the project or contributing to it.

Supported Libraries

Plugin Name Repository Url Min Supported Version Max Supported Version
database/sql https://pkg.go.dev/database/sql - -
echo https://github.com/labstack/echo v4.0.0 v4.12.0
elasticsearch https://github.com/elastic/go-elasticsearch v8.4.0 v8.15.0
fasthttp https://github.com/valyala/fasthttp v1.45.0 v1.59.0
fiber https://github.com/gofiber/fiber v2.43.0 v2.52.6
gin https://github.com/gin-gonic/gin v1.7.0 v1.10.0
go-redis https://github.com/redis/go-redis v9.0.5 v9.5.1
go-redis v8 https://github.com/redis/go-redis v8.11.0 v8.11.5
gomicro https://github.com/micro/go-micro v5.0.0 v5.3.0
gorestful https://github.com/emicklei/go-restful v3.7.0 v3.12.1
gorm https://github.com/go-gorm/gorm v1.22.0 v1.25.9
grpc https://google.golang.org/grpc v1.44.0 v1.71.0
hertz https://github.com/cloudwego/hertz v0.8.0 v0.9.2
iris https://github.com/kataras/iris v12.2.0 v12.2.11
kitex https://github.com/cloudwego/kitex v0.5.1 v0.11.3
kratos https://github.com/go-kratos/kratos v2.6.3 v2.8.4
langchaingo https://github.com/tmc/langchaingo v0.1.13 v0.1.13
log https://pkg.go.dev/log - -
logrus https://github.com/sirupsen/logrus v1.5.0 v1.9.3
mongodb https://github.com/mongodb/mongo-go-driver v1.11.1 v1.15.1
mux https://github.com/gorilla/mux v1.3.0 v1.8.1
nacos https://github.com/nacos-group/nacos-sdk-go/v2 v2.0.0 v2.2.7
net/http https://pkg.go.dev/net/http - -
redigo https://github.com/gomodule/redigo v1.9.0 v1.9.2
slog https://pkg.go.dev/log/slog - -
trpc-go https://github.com/trpc-group/trpc-go v1.0.0 v1.0.3
zap https://github.com/uber-go/zap v1.20.0 v1.27.0
zerolog https://github.com/rs/zerolog v1.10.0 v1.33.0

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.

Community

We are looking forward to your feedback and suggestions. You can join our DingTalk group to engage with us.

Adopters

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.

Contributors

contributors

Star History

Star History

↑ 返回顶部 ↑

空文件

简介

OpenTelemetry Compile-Time Instrumentation for Golang 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/alibaba/opentelemetry-go-auto-instrumentation.git
git@gitee.com:alibaba/opentelemetry-go-auto-instrumentation.git
alibaba
opentelemetry-go-auto-instrumentation
opentelemetry-go-auto-instrumentation
main

搜索帮助

371d5123 14472233 46e8bd33 14472233