百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

go-test-trace

> 编程语言
开源

去测试追踪.

389 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

去测试追踪.

go-test-trace

go-test-trace is like go test but it also generates distributed traces.

Generated traces are exported in OTLP to a OpenTelemetry collector. You need to run go-test-trace alongside a collector to export data to distributed tracing service.

Installation

go get -u github.com/rakyll/go-test-trace

Usage

You can use go-test-trace as a drop-in replacement for go test. The following example will generate a distributed trace and export it to a collector available at "127.0.0.1:55680".

…

Alternatively, you can use -stdin option to parse the output of go test. This option won't be as accurate in terms of timestamps because it will generate trace spans as it sees output in stdin.

$ go test -v ./example | go-test-trace -stdin

You can export to any collector by using the endpoint flag:

$ go-test-trace -endpoint=my-otel-collector.io:9090 ./example

You can make the go-test-trace to participate into an existing trace with the traceparent flag.

$ go-test-trace -traceparent=00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01 ./example

Running the collector

An example collector configuration is available at example/collector.yaml. It exports to Honeycomb but you can choose to any other destination by changing the configuration. Please edit the write key and data set with your details from Honeycomb before using it.

Then, you can run the collector locally by the following command and export the traces to Honeycomb:

bash
$ docker run --rm -p 4317:4317 -p 55680:55680 -p 8888:8888 \
    -v "${PWD}/example/collector.yaml":/collector.yaml \
    --name awscollector public.ecr.aws/aws-observability/aws-otel-collector:latest \
    --config collector.yaml;

You can use any configuration supported by ADOT or export to any other OpenTelemetry collector.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Go

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言