You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
462 B
24 lines
462 B
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) |
|
}
|
|
|