1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-11-30 08:46:54 +02:00

Remove SpanID from sampling parameters

Update code per latest spec, see:
https://github.com/open-telemetry/opentelemetry-specification/pull/621
This commit is contained in:
Paulo Janotti 2020-05-28 16:08:04 -07:00
parent 49043f6f97
commit b3f17329c8
7 changed files with 2 additions and 7 deletions

View File

@ -33,7 +33,6 @@ func (ns alwaysOffSampler) ShouldSample(
_ SpanContext,
_ bool,
_ ID,
_ SpanID,
_ string,
_ SpanKind,
_ []kv.KeyValue,

View File

@ -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)

View File

@ -33,7 +33,6 @@ func (as alwaysOnSampler) ShouldSample(
_ SpanContext,
_ bool,
_ ID,
_ SpanID,
_ string,
_ SpanKind,
_ []kv.KeyValue,

View File

@ -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)

View File

@ -24,7 +24,6 @@ type Sampler interface {
sc SpanContext,
remote bool,
traceID ID,
spanID SpanID,
spanName string,
spanKind SpanKind,
attributes []kv.KeyValue,

View File

@ -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

View File

@ -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,