02_with_trace

command
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 10 Imported by: 0

README

链路追踪示例

展示如何集成 OpenTelemetry 进行链路追踪。

功能

  • 集成 OpenTelemetry
  • 使用 stdout exporter(输出到终端)
  • 在 handler 中创建子 span

注意:生产环境建议使用 Jaeger 或 OpenTelemetry Collector

运行

go run main.go

测试

curl http://localhost:8080/user/123

查看终端输出中的追踪信息。

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL