You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-25 22:41:46 +02:00
Move trace api package into otel (#1229)
* Move trace API to otel * Move tracetest to oteltest * Update package documentation * Remove old api/trace package * Lint * Add changes to CHANGELOG * Add tests for rest of trace API * Apply suggestions from code review Co-authored-by: Anthony Mirabella <a9@aneurysm9.com> * Documentation fixes Includes resolutions for review issues. * Correct CHANGELOG post release Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
This commit is contained in:
@@ -21,7 +21,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
apitrace "go.opentelemetry.io/otel/api/trace"
|
||||
"go.opentelemetry.io/otel"
|
||||
export "go.opentelemetry.io/otel/sdk/export/trace"
|
||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||
)
|
||||
@@ -187,15 +187,15 @@ func createAndRegisterBatchSP(option testOption, te *testBatchExporter) *sdktrac
|
||||
return sdktrace.NewBatchSpanProcessor(te, options...)
|
||||
}
|
||||
|
||||
func generateSpan(t *testing.T, parallel bool, tr apitrace.Tracer, option testOption) {
|
||||
func generateSpan(t *testing.T, parallel bool, tr otel.Tracer, option testOption) {
|
||||
sc := getSpanContext()
|
||||
|
||||
wg := &sync.WaitGroup{}
|
||||
for i := 0; i < option.genNumSpans; i++ {
|
||||
binary.BigEndian.PutUint64(sc.TraceID[0:8], uint64(i+1))
|
||||
wg.Add(1)
|
||||
f := func(sc apitrace.SpanContext) {
|
||||
ctx := apitrace.ContextWithRemoteSpanContext(context.Background(), sc)
|
||||
f := func(sc otel.SpanContext) {
|
||||
ctx := otel.ContextWithRemoteSpanContext(context.Background(), sc)
|
||||
_, span := tr.Start(ctx, option.name)
|
||||
span.End()
|
||||
wg.Done()
|
||||
@@ -209,10 +209,10 @@ func generateSpan(t *testing.T, parallel bool, tr apitrace.Tracer, option testOp
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
func getSpanContext() apitrace.SpanContext {
|
||||
tid, _ := apitrace.IDFromHex("01020304050607080102040810203040")
|
||||
sid, _ := apitrace.SpanIDFromHex("0102040810203040")
|
||||
return apitrace.SpanContext{
|
||||
func getSpanContext() otel.SpanContext {
|
||||
tid, _ := otel.TraceIDFromHex("01020304050607080102040810203040")
|
||||
sid, _ := otel.SpanIDFromHex("0102040810203040")
|
||||
return otel.SpanContext{
|
||||
TraceID: tid,
|
||||
SpanID: sid,
|
||||
TraceFlags: 0x1,
|
||||
|
||||
Reference in New Issue
Block a user