@@ -106,7 +106,7 @@ func TestStartSpan(t *testing.T) {
106106 "k": "v",
107107 }
108108 span := StartSpan(ctx, op,
109- TransactionName (transaction),
109+ WithTransactionName (transaction),
110110 func(s *Span) {
111111 s.Description = description
112112 s.Status = status
@@ -177,7 +177,7 @@ func TestStartChild(t *testing.T) {
177177 TracesSampleRate: 1.0,
178178 Transport: transport,
179179 })
180- span := StartSpan(ctx, "top", TransactionName ("Test Transaction"))
180+ span := StartSpan(ctx, "top", WithTransactionName ("Test Transaction"))
181181 child := span.StartChild("child")
182182 child.Finish()
183183 span.Finish()
@@ -611,7 +611,7 @@ func TestDoubleSampling(t *testing.T) {
611611 TracesSampleRate: 1.0,
612612 Transport: transport,
613613 })
614- span := StartSpan(ctx, "op", TransactionName ("name"))
614+ span := StartSpan(ctx, "op", WithTransactionName ("name"))
615615
616616 // CaptureException should not send any event because of SampleRate.
617617 GetHubFromContext(ctx).CaptureException(errors.New("ignored"))
@@ -638,7 +638,7 @@ func TestSample(t *testing.T) {
638638 ctx = NewTestContext(ClientOptions{
639639 EnableTracing: false,
640640 })
641- span = StartSpan(ctx, "op", TransactionName ("name"))
641+ span = StartSpan(ctx, "op", WithTransactionName ("name"))
642642 if got := span.Sampled; got != SampledFalse {
643643 t.Fatalf("got %s, want %s", got, SampledFalse)
644644 }
@@ -648,7 +648,7 @@ func TestSample(t *testing.T) {
648648 EnableTracing: true,
649649 TracesSampleRate: 0.0,
650650 })
651- span = StartSpan(ctx, "op", TransactionName ("name"), SpanSampled (SampledTrue))
651+ span = StartSpan(ctx, "op", WithTransactionName ("name"), WithSpanSampled (SampledTrue))
652652 if got := span.Sampled; got != SampledTrue {
653653 t.Fatalf("got %s, want %s", got, SampledTrue)
654654 }
@@ -660,7 +660,7 @@ func TestSample(t *testing.T) {
660660 return 1.0
661661 },
662662 })
663- span = StartSpan(ctx, "op", TransactionName ("name"))
663+ span = StartSpan(ctx, "op", WithTransactionName ("name"))
664664 if got := span.Sampled; got != SampledTrue {
665665 t.Fatalf("got %s, want %s", got, SampledTrue)
666666 }
@@ -670,7 +670,7 @@ func TestSample(t *testing.T) {
670670 EnableTracing: true,
671671 TracesSampleRate: 1.0,
672672 })
673- span = StartSpan(ctx, "op", TransactionName ("name"))
673+ span = StartSpan(ctx, "op", WithTransactionName ("name"))
674674 childSpan := span.StartChild("child")
675675 if got := childSpan.Sampled; got != SampledTrue {
676676 t.Fatalf("got %s, want %s", got, SampledTrue)
@@ -681,7 +681,7 @@ func TestSample(t *testing.T) {
681681 EnableTracing: true,
682682 TracesSampleRate: 1.0,
683683 })
684- span = StartSpan(ctx, "op", TransactionName ("name"))
684+ span = StartSpan(ctx, "op", WithTransactionName ("name"))
685685 if got := span.Sampled; got != SampledTrue {
686686 t.Fatalf("got %s, want %s", got, SampledTrue)
687687 }
@@ -870,3 +870,23 @@ func TestSpanSetContextOverrides(t *testing.T) {
870870
871871 assertEqual(t, map[string]Context{"a": {"foo": 2}}, transaction.contexts)
872872}
873+
874+ // This test should be the only thing to fail when deprecated TransactionName is removed.
875+ func TestDeprecatedSpanOptionTransactionName(t *testing.T) {
876+ StartSpan(context.Background(), "op", TransactionName("name"))
877+ }
878+
879+ // This test should be the only thing to fail when deprecated OpName is removed.
880+ func TestDeprecatedSpanOptionOpName(t *testing.T) {
881+ StartSpan(context.Background(), "op", OpName("name"))
882+ }
883+
884+ // This test should be the only thing to fail when deprecated SpanSampled is removed.
885+ func TestDeprecatedSpanOptionSpanSampled(t *testing.T) {
886+ StartSpan(context.Background(), "op", SpanSampled(SampledTrue))
887+ }
888+
889+ // This test should be the only thing to fail when deprecated TransctionSource is removed.
890+ func TestDeprecatedSpanOptionTransctionSource(t *testing.T) {
891+ StartSpan(context.Background(), "op", TransctionSource("src"))
892+ }
0 commit comments