Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

go-test-trace

> 编程语言
Open source

Go test with tracing.

389 stars0 likes2 views
WebsiteGitHub

About

Go test with tracing.

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 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

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