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:
parent
49043f6f97
commit
b3f17329c8
@ -33,7 +33,6 @@ func (ns alwaysOffSampler) ShouldSample(
|
||||
_ SpanContext,
|
||||
_ bool,
|
||||
_ ID,
|
||||
_ SpanID,
|
||||
_ string,
|
||||
_ SpanKind,
|
||||
_ []kv.KeyValue,
|
||||
|
@ -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)
|
||||
|
@ -33,7 +33,6 @@ func (as alwaysOnSampler) ShouldSample(
|
||||
_ SpanContext,
|
||||
_ bool,
|
||||
_ ID,
|
||||
_ SpanID,
|
||||
_ string,
|
||||
_ SpanKind,
|
||||
_ []kv.KeyValue,
|
||||
|
@ -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)
|
||||
|
@ -24,7 +24,6 @@ type Sampler interface {
|
||||
sc SpanContext,
|
||||
remote bool,
|
||||
traceID ID,
|
||||
spanID SpanID,
|
||||
spanName string,
|
||||
spanKind SpanKind,
|
||||
attributes []kv.KeyValue,
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user