open-telemetry/opentelemetry-go-compile-instrumentation
GitHub: open-telemetry/opentelemetry-go-compile-instrumentation
该项目提供在 Go 编译时自动注入 OpenTelemetry 遥测代码的工具,让应用程序无需修改源码即可获得完整的可观测性能力。
Stars: 346 | Forks: 84
## 概述
本项目提供了一个工具,用于在编译时自动为 Go 应用程序注入 [OpenTelemetry](https://opentelemetry.io/)。
它通过修改 Go 构建过程,将 OpenTelemetry 代码注入到应用程序中,**无需手动修改源代码**。
主要亮点:
- **零运行时开销** - 插桩在编译时被内置到您的二进制文件中
- **零代码修改** - 自动为整个应用程序及其依赖项进行插桩
- **支持第三方库** - 对不受您控制的库进行插桩
- **完全解耦** - 让您的代码库免受插桩问题的干扰
- **灵活部署** - 可在开发阶段或您的 CI/CD pipeline 中进行集成
## 快速开始
### 1. 构建工具
```
git clone https://github.com/open-telemetry/opentelemetry-go-compile-instrumentation.git
cd opentelemetry-go-compile-instrumentation
make build
```
`otelc` 二进制文件将构建在根目录中。
### 2. 尝试 Demo
只需在原始的 `go build` 命令前加上 `otelc` 前缀即可。
```
cd demo/app/basic
../../otelc go build
./basic
[... output ...]
```
### 3. 运行测试
```
make test
```
### 文档
- [入门指南](./docs/getting-started.md) - 安装与使用
- [UX 设计](./docs/ux-design.md) - 配置选项
- [实现细节](./docs/implementation.md) - 技术架构
- [API 设计](./docs/api-design-and-project-structure.md) - API 结构
- [语义约定](./docs/semantic-conventions.md) - 管理语义约定
- [插桩指南](./docs/instrument-guide.md) - 为新库添加插桩 hook
- [插桩规则](./docs/rules.md) - 规则类型与 YAML 格式参考
- [配置与微调](./docs/configuration.md) - 插桩的范围、过滤与调优
- [故障排除](./docs/troubleshooting.md) - 诊断插桩未生效的原因
- [外部配置源](./docs/external-configuration.md) - 通过 `otel.instrumentation.go` 声明插桩
- [测试](./docs/testing.md) - 测试策略、分类以及如何运行测试
### 视频演讲
- [项目概述](https://www.youtube.com/watch?v=xEsVOhBdlZY)
- [深入解析细节](https://www.youtube.com/watch?v=8Rw-fVEjihw&list=PLDWZ5uzn69ewrYyHTNrXlrWVDjLiOX0Yb&index=19)
### 获取帮助
- [GitHub Discussions](https://github.com/open-telemetry/opentelemetry-go-compile-instrumentation/discussions) - 提问
- [GitHub Issues](https://github.com/open-telemetry/opentelemetry-go-compile-instrumentation/issues) - 报告 bug
- [Slack 频道](https://cloud-native.slack.com/archives/C088D8GSSSF) - 实时交流
- [日历](https://github.com/open-telemetry/community/#sig-go-compile-instrumentation) - 社区会议(每周四,UTC:08:00 – 09:00)
### 维护者
- [Dario Castañe](https://github.com/darccio),Datadog
- [Haibin Zhang](https://github.com/NameHaibinZhang),阿里巴巴
- [Huxing Zhang](https://github.com/ralf0131),阿里巴巴
- [Kemal Akkoyun](https://github.com/kakkoyun),Datadog
- [Przemyslaw Delewski](https://github.com/pdelewski),Quesma
- [Xabier Martinez](https://github.com/txabman42),Cabify
- [Yi Yang](https://github.com/y1yang0),阿里巴巴
有关维护者角色的更多信息,请参阅[社区仓库](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer)。
### 审批者
- [Azhar Momin](https://github.com/amazingakai),独立开发者
有关审批者角色的更多信息,请参阅[社区仓库](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver)。
### 荣誉成员
- [Dinesh Gurumurthy](https://github.com/dineshg13),维护者
- [Eliott B](https://github.com/eliottness),审批者
- [Liu Ziming](https://github.com/123liuziming),维护者
- [Romain Marcadier](https://github.com/RomainMuller),维护者
有关荣誉成员角色的更多信息,请参阅
[社区仓库](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager)。
### 感谢我们所有的贡献者!
标签:API集成, EVTX分析, GET参数, Go, LNA, OpenTelemetry, Ruby工具, SOC Prime, 可观测性, 开发工具, 日志审计, 用户代理, 编译期注入, 链路追踪