Skip to content

Commit

Permalink
Remove SpanID from sampling parameters
Browse files Browse the repository at this point in the history
Update code per latest spec, see:
open-telemetry/opentelemetry-specification#621
  • Loading branch information
pjanotti committed May 28, 2020
1 parent 49043f6 commit b3f1732
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion api/trace/always_off_sampler.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func (ns alwaysOffSampler) ShouldSample(
_ SpanContext,
_ bool,
_ ID,
_ SpanID,
_ string,
_ SpanKind,
_ []kv.KeyValue,
Expand Down
2 changes: 1 addition & 1 deletion api/trace/always_off_sampler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

func TestNeverSamperShouldSample(t *testing.T) {
gotD := AlwaysOffSampler().ShouldSample(
SpanContext{}, false, ID{}, SpanID{}, "span", SpanKindClient, []kv.KeyValue{}, []Link{})
SpanContext{}, false, ID{}, "span", SpanKindClient, []kv.KeyValue{}, []Link{})
wantD := Decision{Sampled: false}
if diff := cmp.Diff(wantD, gotD); diff != "" {
t.Errorf("Decision: +got, -want%v", diff)
Expand Down
1 change: 0 additions & 1 deletion api/trace/always_on_sampler.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func (as alwaysOnSampler) ShouldSample(
_ SpanContext,
_ bool,
_ ID,
_ SpanID,
_ string,
_ SpanKind,
_ []kv.KeyValue,
Expand Down
2 changes: 1 addition & 1 deletion api/trace/always_on_sampler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

func TestAlwaysOnSamplerShouldSample(t *testing.T) {
gotD := AlwaysOnSampler().ShouldSample(
SpanContext{}, false, ID{}, SpanID{}, "span", SpanKindClient, []kv.KeyValue{}, []Link{})
SpanContext{}, false, ID{}, "span", SpanKindClient, []kv.KeyValue{}, []Link{})
wantD := Decision{Sampled: true}
if diff := cmp.Diff(wantD, gotD); diff != "" {
t.Errorf("Decision: +got, -want%v", diff)
Expand Down
1 change: 0 additions & 1 deletion api/trace/sampler.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type Sampler interface {
sc SpanContext,
remote bool,
traceID ID,
spanID SpanID,
spanName string,
spanKind SpanKind,
attributes []kv.KeyValue,
Expand Down
1 change: 0 additions & 1 deletion sdk/trace/sampling.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ type Sampler interface {
type SamplingParameters struct {
ParentContext api.SpanContext
TraceID api.ID
SpanID api.SpanID
Name string
HasRemoteParent bool
Kind api.SpanKind
Expand Down
1 change: 0 additions & 1 deletion sdk/trace/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ func makeSamplingDecision(data samplingData) SamplingResult {
sampled := sampler.ShouldSample(SamplingParameters{
ParentContext: data.parent,
TraceID: spanContext.TraceID,
SpanID: spanContext.SpanID,
Name: data.name,
HasRemoteParent: data.remoteParent,
Kind: data.kind,
Expand Down

0 comments on commit b3f1732

Please sign in to comment.