package trace import ( "context" "fmt" "go.opentelemetry.io/otel" "testing" ) func TestStartAgent(t *testing.T) { StartAgent(Config{ Name: "my-server", Endpoint: "http://127.0.0.1:14268/api/traces", Sampler: 1.0, Batcher: "jaeger", }) ctx := context.Background() newCtx, span := otel.Tracer("sql_client").Start(ctx, "Run") tr := TracerFromContext(newCtx) _, span1 := tr.Start(newCtx, "abc") span1.End() span.End() fmt.Println(111) }