You've already forked opentelemetry-go
							
							
				mirror of
				https://github.com/open-telemetry/opentelemetry-go.git
				synced 2025-10-31 00:07:40 +02:00 
			
		
		
		
	change TraceOptions to TraceFlags. (#144)
* change TraceOptions to TraceFlags. * fix grammer in docs.
This commit is contained in:
		| @@ -24,19 +24,19 @@ type TraceID struct { | ||||
| } | ||||
|  | ||||
| const ( | ||||
| 	traceOptionBitMaskSampled = byte(0x01) | ||||
| 	traceOptionBitMaskUnused  = byte(0xFE) | ||||
| 	traceFlagsBitMaskSampled = byte(0x01) | ||||
| 	traceFlagsBitMaskUnused  = byte(0xFE) | ||||
|  | ||||
| 	// TraceOptionSampled is a byte with sampled bit set. It is a convenient value initialize | ||||
| 	// SpanContext when a trace is sampled. | ||||
| 	TraceOptionSampled = traceOptionBitMaskSampled | ||||
| 	TraceOptionUnused  = traceOptionBitMaskUnused | ||||
| 	// TraceFlagsSampled is a byte with sampled bit set. It is a convenient value initializer | ||||
| 	// for SpanContext TraceFlags field when a trace is sampled. | ||||
| 	TraceFlagsSampled = traceFlagsBitMaskSampled | ||||
| 	TraceFlagsUnused  = traceFlagsBitMaskUnused | ||||
| ) | ||||
|  | ||||
| type SpanContext struct { | ||||
| 	TraceID      TraceID | ||||
| 	SpanID       uint64 | ||||
| 	TraceOptions byte | ||||
| 	TraceID    TraceID | ||||
| 	SpanID     uint64 | ||||
| 	TraceFlags byte | ||||
| } | ||||
|  | ||||
| // EmptySpanContext is meant for internal use to return invalid span context during error conditions. | ||||
| @@ -67,5 +67,5 @@ func (sc SpanContext) TraceIDString() string { | ||||
| } | ||||
|  | ||||
| func (sc SpanContext) IsSampled() bool { | ||||
| 	return sc.TraceOptions&traceOptionBitMaskSampled == traceOptionBitMaskSampled | ||||
| 	return sc.TraceFlags&traceFlagsBitMaskSampled == traceFlagsBitMaskSampled | ||||
| } | ||||
|   | ||||
| @@ -193,7 +193,7 @@ func TestSpanContextIsSampled(t *testing.T) { | ||||
| 					High: uint64(42), | ||||
| 					Low:  uint64(42), | ||||
| 				}, | ||||
| 				TraceOptions: core.TraceOptionSampled, | ||||
| 				TraceFlags: core.TraceFlagsSampled, | ||||
| 			}, | ||||
| 			want: true, | ||||
| 		}, { | ||||
| @@ -203,7 +203,7 @@ func TestSpanContextIsSampled(t *testing.T) { | ||||
| 					High: uint64(42), | ||||
| 					Low:  uint64(42), | ||||
| 				}, | ||||
| 				TraceOptions: core.TraceOptionSampled | core.TraceOptionUnused, | ||||
| 				TraceFlags: core.TraceFlagsSampled | core.TraceFlagsUnused, | ||||
| 			}, | ||||
| 			want: true, | ||||
| 		}, { | ||||
|   | ||||
| @@ -491,7 +491,7 @@ func otSpanReferenceTypeToOtelRelationshipType(srt ot.SpanReferenceType) oteltra | ||||
| var ( | ||||
| 	traceIDHeader       = http.CanonicalHeaderKey("x-otelbridge-trace-id") | ||||
| 	spanIDHeader        = http.CanonicalHeaderKey("x-otelbridge-span-id") | ||||
| 	traceOptionsHeader  = http.CanonicalHeaderKey("x-otelbridge-trace-options") | ||||
| 	traceFlagsHeader    = http.CanonicalHeaderKey("x-otelbridge-trace-flags") | ||||
| 	baggageHeaderPrefix = http.CanonicalHeaderKey("x-otelbridge-baggage-") | ||||
| ) | ||||
|  | ||||
| @@ -516,7 +516,7 @@ func (t *BridgeTracer) Inject(sm ot.SpanContext, format interface{}, carrier int | ||||
| 	} | ||||
| 	hhcarrier.Set(traceIDHeader, traceIDString(bridgeSC.otelSpanContext.TraceID)) | ||||
| 	hhcarrier.Set(spanIDHeader, spanIDToString(bridgeSC.otelSpanContext.SpanID)) | ||||
| 	hhcarrier.Set(traceOptionsHeader, traceOptionsToString(bridgeSC.otelSpanContext.TraceOptions)) | ||||
| 	hhcarrier.Set(traceFlagsHeader, traceFlagsToString(bridgeSC.otelSpanContext.TraceFlags)) | ||||
| 	bridgeSC.ForeachBaggageItem(func(k, v string) bool { | ||||
| 		// we assume that keys are already canonicalized | ||||
| 		hhcarrier.Set(baggageHeaderPrefix+k, v) | ||||
| @@ -535,9 +535,9 @@ func spanIDToString(spanID uint64) string { | ||||
| 	return fmt.Sprintf("%.16x", spanID) | ||||
| } | ||||
|  | ||||
| func traceOptionsToString(opts byte) string { | ||||
| func traceFlagsToString(opts byte) string { | ||||
| 	var parts []string | ||||
| 	if opts&otelcore.TraceOptionSampled == otelcore.TraceOptionSampled { | ||||
| 	if opts&otelcore.TraceFlagsSampled == otelcore.TraceFlagsSampled { | ||||
| 		parts = append(parts, "sampled") | ||||
| 	} | ||||
| 	return strings.Join(parts, ",") | ||||
| @@ -571,8 +571,8 @@ func (t *BridgeTracer) Extract(format interface{}, carrier interface{}) (ot.Span | ||||
| 				return err | ||||
| 			} | ||||
| 			bridgeSC.otelSpanContext.SpanID = spanID | ||||
| 		case traceOptionsHeader: | ||||
| 			bridgeSC.otelSpanContext.TraceOptions = stringToTraceOptions(v) | ||||
| 		case traceFlagsHeader: | ||||
| 			bridgeSC.otelSpanContext.TraceFlags = stringToTraceFlags(v) | ||||
| 		default: | ||||
| 			if strings.HasPrefix(ck, baggageHeaderPrefix) { | ||||
| 				bk := strings.TrimPrefix(ck, baggageHeaderPrefix) | ||||
| @@ -614,12 +614,12 @@ func spanIDFromString(s string) (uint64, error) { | ||||
| 	return strconv.ParseUint(s, 16, 64) | ||||
| } | ||||
|  | ||||
| func stringToTraceOptions(s string) byte { | ||||
| func stringToTraceFlags(s string) byte { | ||||
| 	var opts byte | ||||
| 	for _, part := range strings.Split(s, ",") { | ||||
| 		switch part { | ||||
| 		case "sampled": | ||||
| 			opts |= otelcore.TraceOptionSampled | ||||
| 			opts |= otelcore.TraceFlagsSampled | ||||
| 		} | ||||
| 	} | ||||
| 	return opts | ||||
|   | ||||
| @@ -98,9 +98,9 @@ func (t *MockTracer) Start(ctx context.Context, name string, opts ...oteltrace.S | ||||
| 		startTime = time.Now() | ||||
| 	} | ||||
| 	spanContext := otelcore.SpanContext{ | ||||
| 		TraceID:      t.getTraceID(ctx, &spanOpts), | ||||
| 		SpanID:       t.getSpanID(), | ||||
| 		TraceOptions: 0, | ||||
| 		TraceID:    t.getTraceID(ctx, &spanOpts), | ||||
| 		SpanID:     t.getSpanID(), | ||||
| 		TraceFlags: 0, | ||||
| 	} | ||||
| 	span := &MockSpan{ | ||||
| 		mockTracer:     t, | ||||
|   | ||||
| @@ -211,7 +211,7 @@ func spanDataToThrift(data *trace.SpanData) *gen.Span { | ||||
| 		SpanId:        int64(data.SpanContext.SpanID), | ||||
| 		ParentSpanId:  int64(data.ParentSpanID), | ||||
| 		OperationName: data.Name, // TODO: if span kind is added then add prefix "Sent"/"Recv" | ||||
| 		Flags:         int32(data.SpanContext.TraceOptions), | ||||
| 		Flags:         int32(data.SpanContext.TraceFlags), | ||||
| 		StartTime:     data.StartTime.UnixNano() / 1000, | ||||
| 		Duration:      data.EndTime.Sub(data.StartTime).Nanoseconds() / 1000, | ||||
| 		Tags:          tags, | ||||
|   | ||||
| @@ -76,7 +76,7 @@ func (mt *MockTracer) Start(ctx context.Context, name string, o ...apitrace.Span | ||||
| 			}, | ||||
| 		} | ||||
| 		if mt.Sampled { | ||||
| 			sc.TraceOptions = core.TraceOptionSampled | ||||
| 			sc.TraceFlags = core.TraceFlagsSampled | ||||
| 		} | ||||
| 	} else { | ||||
| 		sc = opts.Reference.SpanContext | ||||
|   | ||||
| @@ -47,7 +47,7 @@ func (hp httpTraceContextPropagator) Inject(ctx context.Context, supplier apipro | ||||
| 			sc.TraceID.High, | ||||
| 			sc.TraceID.Low, | ||||
| 			sc.SpanID, | ||||
| 			sc.TraceOptions&core.TraceOptionSampled) | ||||
| 			sc.TraceFlags&core.TraceFlagsSampled) | ||||
| 		supplier.Set(traceparentHeader, h) | ||||
| 	} | ||||
| } | ||||
| @@ -118,7 +118,7 @@ func (hp httpTraceContextPropagator) Extract(ctx context.Context, supplier apipr | ||||
| 	if err != nil || len(opts) < 1 || (version == 0 && opts[0] > 2) { | ||||
| 		return core.EmptySpanContext() | ||||
| 	} | ||||
| 	sc.TraceOptions = opts[0] &^ core.TraceOptionUnused | ||||
| 	sc.TraceFlags = opts[0] &^ core.TraceFlagsUnused | ||||
|  | ||||
| 	if !sc.IsValid() { | ||||
| 		return core.EmptySpanContext() | ||||
|   | ||||
| @@ -53,27 +53,27 @@ func TestExtractValidTraceContextFromHTTPReq(t *testing.T) { | ||||
| 			name:   "valid header and sampled", | ||||
| 			header: "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01", | ||||
| 			wantSc: core.SpanContext{ | ||||
| 				TraceID:      traceID, | ||||
| 				SpanID:       spanID, | ||||
| 				TraceOptions: core.TraceOptionSampled, | ||||
| 				TraceID:    traceID, | ||||
| 				SpanID:     spanID, | ||||
| 				TraceFlags: core.TraceFlagsSampled, | ||||
| 			}, | ||||
| 		}, | ||||
| 		{ | ||||
| 			name:   "future version", | ||||
| 			header: "02-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01", | ||||
| 			wantSc: core.SpanContext{ | ||||
| 				TraceID:      traceID, | ||||
| 				SpanID:       spanID, | ||||
| 				TraceOptions: core.TraceOptionSampled, | ||||
| 				TraceID:    traceID, | ||||
| 				SpanID:     spanID, | ||||
| 				TraceFlags: core.TraceFlagsSampled, | ||||
| 			}, | ||||
| 		}, | ||||
| 		{ | ||||
| 			name:   "future options with sampled bit set", | ||||
| 			header: "02-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-09", | ||||
| 			wantSc: core.SpanContext{ | ||||
| 				TraceID:      traceID, | ||||
| 				SpanID:       spanID, | ||||
| 				TraceOptions: core.TraceOptionSampled, | ||||
| 				TraceID:    traceID, | ||||
| 				SpanID:     spanID, | ||||
| 				TraceFlags: core.TraceFlagsSampled, | ||||
| 			}, | ||||
| 		}, | ||||
| 		{ | ||||
| @@ -88,27 +88,27 @@ func TestExtractValidTraceContextFromHTTPReq(t *testing.T) { | ||||
| 			name:   "future additional data", | ||||
| 			header: "02-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-09-XYZxsf09", | ||||
| 			wantSc: core.SpanContext{ | ||||
| 				TraceID:      traceID, | ||||
| 				SpanID:       spanID, | ||||
| 				TraceOptions: core.TraceOptionSampled, | ||||
| 				TraceID:    traceID, | ||||
| 				SpanID:     spanID, | ||||
| 				TraceFlags: core.TraceFlagsSampled, | ||||
| 			}, | ||||
| 		}, | ||||
| 		{ | ||||
| 			name:   "valid header ending in dash", | ||||
| 			header: "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01-", | ||||
| 			wantSc: core.SpanContext{ | ||||
| 				TraceID:      traceID, | ||||
| 				SpanID:       spanID, | ||||
| 				TraceOptions: core.TraceOptionSampled, | ||||
| 				TraceID:    traceID, | ||||
| 				SpanID:     spanID, | ||||
| 				TraceFlags: core.TraceFlagsSampled, | ||||
| 			}, | ||||
| 		}, | ||||
| 		{ | ||||
| 			name:   "future valid header ending in dash", | ||||
| 			header: "01-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-09-", | ||||
| 			wantSc: core.SpanContext{ | ||||
| 				TraceID:      traceID, | ||||
| 				SpanID:       spanID, | ||||
| 				TraceOptions: core.TraceOptionSampled, | ||||
| 				TraceID:    traceID, | ||||
| 				SpanID:     spanID, | ||||
| 				TraceFlags: core.TraceFlagsSampled, | ||||
| 			}, | ||||
| 		}, | ||||
| 	} | ||||
| @@ -230,9 +230,9 @@ func TestInjectTraceContextToHTTPReq(t *testing.T) { | ||||
| 		{ | ||||
| 			name: "valid spancontext, sampled", | ||||
| 			sc: core.SpanContext{ | ||||
| 				TraceID:      traceID, | ||||
| 				SpanID:       spanID, | ||||
| 				TraceOptions: core.TraceOptionSampled, | ||||
| 				TraceID:    traceID, | ||||
| 				SpanID:     spanID, | ||||
| 				TraceFlags: core.TraceFlagsSampled, | ||||
| 			}, | ||||
| 			wantHeader: "00-4bf92f3577b34da6a3ce929d0e0e4736-0000000000000001-01", | ||||
| 		}, | ||||
| @@ -245,11 +245,11 @@ func TestInjectTraceContextToHTTPReq(t *testing.T) { | ||||
| 			wantHeader: "00-4bf92f3577b34da6a3ce929d0e0e4736-0000000000000002-00", | ||||
| 		}, | ||||
| 		{ | ||||
| 			name: "valid spancontext, with unsupported bit set in traceoption", | ||||
| 			name: "valid spancontext, with unsupported bit set in traceflags", | ||||
| 			sc: core.SpanContext{ | ||||
| 				TraceID:      traceID, | ||||
| 				SpanID:       spanID, | ||||
| 				TraceOptions: 0xff, | ||||
| 				TraceID:    traceID, | ||||
| 				SpanID:     spanID, | ||||
| 				TraceFlags: 0xff, | ||||
| 			}, | ||||
| 			wantHeader: "00-4bf92f3577b34da6a3ce929d0e0e4736-0000000000000003-01", | ||||
| 		}, | ||||
|   | ||||
| @@ -62,9 +62,9 @@ func TestSimpleSpanProcessorOnEnd(t *testing.T) { | ||||
| 	tid := core.TraceID{High: 0x0102030405060708, Low: 0x0102040810203040} | ||||
| 	sid := uint64(0x0102040810203040) | ||||
| 	sc := core.SpanContext{ | ||||
| 		TraceID:      tid, | ||||
| 		SpanID:       sid, | ||||
| 		TraceOptions: 0x1, | ||||
| 		TraceID:    tid, | ||||
| 		SpanID:     sid, | ||||
| 		TraceFlags: 0x1, | ||||
| 	} | ||||
| 	_, span := apitrace.GlobalTracer().Start(context.Background(), "OnEnd", apitrace.ChildOf(sc)) | ||||
| 	span.Finish() | ||||
|   | ||||
| @@ -374,7 +374,7 @@ func makeSamplingDecision(data samplingData) { | ||||
| 	if data.noParent || data.remoteParent { | ||||
| 		// If this span is the child of a local span and no | ||||
| 		// Sampler is set in the options, keep the parent's | ||||
| 		// TraceOptions. | ||||
| 		// TraceFlags. | ||||
| 		// | ||||
| 		// Otherwise, consult the Sampler in the options if it | ||||
| 		// is non-nil, otherwise the default sampler. | ||||
| @@ -390,9 +390,9 @@ func makeSamplingDecision(data samplingData) { | ||||
| 			Name:            data.name, | ||||
| 			HasRemoteParent: data.remoteParent}).Sample | ||||
| 		if sampled { | ||||
| 			spanContext.TraceOptions |= core.TraceOptionSampled | ||||
| 			spanContext.TraceFlags |= core.TraceFlagsSampled | ||||
| 		} else { | ||||
| 			spanContext.TraceOptions &^= core.TraceOptionSampled | ||||
| 			spanContext.TraceFlags &^= core.TraceFlagsSampled | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -134,9 +134,9 @@ func TestRecordingIsOff(t *testing.T) { | ||||
|  | ||||
| func TestStartSpanWithChildOf(t *testing.T) { | ||||
| 	sc1 := core.SpanContext{ | ||||
| 		TraceID:      tid, | ||||
| 		SpanID:       sid, | ||||
| 		TraceOptions: 0x0, | ||||
| 		TraceID:    tid, | ||||
| 		SpanID:     sid, | ||||
| 		TraceFlags: 0x0, | ||||
| 	} | ||||
| 	_, s1 := apitrace.GlobalTracer().Start(context.Background(), "span1-unsampled-parent1", apitrace.ChildOf(sc1)) | ||||
| 	if err := checkChild(sc1, s1); err != nil { | ||||
| @@ -149,9 +149,9 @@ func TestStartSpanWithChildOf(t *testing.T) { | ||||
| 	} | ||||
|  | ||||
| 	sc2 := core.SpanContext{ | ||||
| 		TraceID:      tid, | ||||
| 		SpanID:       sid, | ||||
| 		TraceOptions: 0x1, | ||||
| 		TraceID:    tid, | ||||
| 		SpanID:     sid, | ||||
| 		TraceFlags: 0x1, | ||||
| 		//Tracestate:   testTracestate, | ||||
| 	} | ||||
| 	_, s3 := apitrace.GlobalTracer().Start(context.Background(), "span3-sampled-parent2", apitrace.ChildOf(sc2)) | ||||
| @@ -183,8 +183,8 @@ func TestSetSpanAttributes(t *testing.T) { | ||||
|  | ||||
| 	want := &SpanData{ | ||||
| 		SpanContext: core.SpanContext{ | ||||
| 			TraceID:      tid, | ||||
| 			TraceOptions: 0x1, | ||||
| 			TraceID:    tid, | ||||
| 			TraceFlags: 0x1, | ||||
| 		}, | ||||
| 		ParentSpanID: sid, | ||||
| 		Name:         "span0", | ||||
| @@ -215,8 +215,8 @@ func TestSetSpanAttributesOverLimit(t *testing.T) { | ||||
|  | ||||
| 	want := &SpanData{ | ||||
| 		SpanContext: core.SpanContext{ | ||||
| 			TraceID:      tid, | ||||
| 			TraceOptions: 0x1, | ||||
| 			TraceID:    tid, | ||||
| 			TraceFlags: 0x1, | ||||
| 		}, | ||||
| 		ParentSpanID: sid, | ||||
| 		Name:         "span0", | ||||
| @@ -262,8 +262,8 @@ func TestEvents(t *testing.T) { | ||||
|  | ||||
| 	want := &SpanData{ | ||||
| 		SpanContext: core.SpanContext{ | ||||
| 			TraceID:      tid, | ||||
| 			TraceOptions: 0x1, | ||||
| 			TraceID:    tid, | ||||
| 			TraceFlags: 0x1, | ||||
| 		}, | ||||
| 		ParentSpanID:    sid, | ||||
| 		Name:            "span0", | ||||
| @@ -309,8 +309,8 @@ func TestEventsOverLimit(t *testing.T) { | ||||
|  | ||||
| 	want := &SpanData{ | ||||
| 		SpanContext: core.SpanContext{ | ||||
| 			TraceID:      tid, | ||||
| 			TraceOptions: 0x1, | ||||
| 			TraceID:    tid, | ||||
| 			TraceFlags: 0x1, | ||||
| 		}, | ||||
| 		ParentSpanID: sid, | ||||
| 		Name:         "span0", | ||||
| @@ -346,8 +346,8 @@ func TestAddLinks(t *testing.T) { | ||||
|  | ||||
| 	want := &SpanData{ | ||||
| 		SpanContext: core.SpanContext{ | ||||
| 			TraceID:      tid, | ||||
| 			TraceOptions: 0x1, | ||||
| 			TraceID:    tid, | ||||
| 			TraceFlags: 0x1, | ||||
| 		}, | ||||
| 		ParentSpanID:    sid, | ||||
| 		Name:            "span0", | ||||
| @@ -383,8 +383,8 @@ func TestLinks(t *testing.T) { | ||||
|  | ||||
| 	want := &SpanData{ | ||||
| 		SpanContext: core.SpanContext{ | ||||
| 			TraceID:      tid, | ||||
| 			TraceOptions: 0x1, | ||||
| 			TraceID:    tid, | ||||
| 			TraceFlags: 0x1, | ||||
| 		}, | ||||
| 		ParentSpanID:    sid, | ||||
| 		Name:            "span0", | ||||
| @@ -421,8 +421,8 @@ func TestLinksOverLimit(t *testing.T) { | ||||
|  | ||||
| 	want := &SpanData{ | ||||
| 		SpanContext: core.SpanContext{ | ||||
| 			TraceID:      tid, | ||||
| 			TraceOptions: 0x1, | ||||
| 			TraceID:    tid, | ||||
| 			TraceFlags: 0x1, | ||||
| 		}, | ||||
| 		ParentSpanID: sid, | ||||
| 		Name:         "span0", | ||||
| @@ -442,9 +442,9 @@ func TestSetSpanName(t *testing.T) { | ||||
| 	want := "SpanName-1" | ||||
| 	_, span := apitrace.GlobalTracer().Start(context.Background(), want, | ||||
| 		apitrace.ChildOf(core.SpanContext{ | ||||
| 			TraceID:      tid, | ||||
| 			SpanID:       sid, | ||||
| 			TraceOptions: 1, | ||||
| 			TraceID:    tid, | ||||
| 			SpanID:     sid, | ||||
| 			TraceFlags: 1, | ||||
| 		}), | ||||
| 	) | ||||
| 	got, err := endSpan(span) | ||||
| @@ -467,8 +467,8 @@ func TestSetSpanStatus(t *testing.T) { | ||||
|  | ||||
| 	want := &SpanData{ | ||||
| 		SpanContext: core.SpanContext{ | ||||
| 			TraceID:      tid, | ||||
| 			TraceOptions: 0x1, | ||||
| 			TraceID:    tid, | ||||
| 			TraceFlags: 0x1, | ||||
| 		}, | ||||
| 		ParentSpanID:    sid, | ||||
| 		Name:            "span0", | ||||
| @@ -494,9 +494,9 @@ func TestUnregisterExporter(t *testing.T) { | ||||
|  | ||||
| func remoteSpanContext() core.SpanContext { | ||||
| 	return core.SpanContext{ | ||||
| 		TraceID:      tid, | ||||
| 		SpanID:       sid, | ||||
| 		TraceOptions: 1, | ||||
| 		TraceID:    tid, | ||||
| 		SpanID:     sid, | ||||
| 		TraceFlags: 1, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @@ -513,7 +513,7 @@ func checkChild(p core.SpanContext, apiSpan apitrace.Span) error { | ||||
| 	if childID, parentID := s.spanContext.SpanIDString(), p.SpanIDString(); childID == parentID { | ||||
| 		return fmt.Errorf("got child span ID %s, parent span ID %s; want unequal IDs", childID, parentID) | ||||
| 	} | ||||
| 	if got, want := s.spanContext.TraceOptions, p.TraceOptions; got != want { | ||||
| 	if got, want := s.spanContext.TraceFlags, p.TraceFlags; got != want { | ||||
| 		return fmt.Errorf("got child trace options %d, want %d", got, want) | ||||
| 	} | ||||
| 	// TODO [rgheita] : Fix tracestate test | ||||
| @@ -531,7 +531,7 @@ func startSpan() apitrace.Span { | ||||
|  | ||||
| // startNamed Span is a test utility func that starts a span with a | ||||
| // passed name and with ChildOf option.  remote span context contains | ||||
| // traceoption with sampled bit set. This allows the span to be | ||||
| // TraceFlags with sampled bit set. This allows the span to be | ||||
| // automatically sampled. | ||||
| func startNamedSpan(name string) apitrace.Span { | ||||
| 	_, span := apitrace.GlobalTracer().Start( | ||||
| @@ -695,9 +695,9 @@ func TestExecutionTracerTaskEnd(t *testing.T) { | ||||
| 		"foo", | ||||
| 		apitrace.ChildOf( | ||||
| 			core.SpanContext{ | ||||
| 				TraceID:      core.TraceID{High: 0x0102030405060708, Low: 0x090a0b0c0d0e0f}, | ||||
| 				SpanID:       uint64(0x0001020304050607), | ||||
| 				TraceOptions: 0, | ||||
| 				TraceID:    core.TraceID{High: 0x0102030405060708, Low: 0x090a0b0c0d0e0f}, | ||||
| 				SpanID:     uint64(0x0001020304050607), | ||||
| 				TraceFlags: 0, | ||||
| 			}, | ||||
| 		), | ||||
| 	) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user