go-stdlib icon indicating copy to clipboard operation
go-stdlib copied to clipboard

Add middleware option to supply `StartSpanOption`s

Open vpranckaitis opened this issue 9 months ago • 3 comments

This commit adds a middleware option that supplies StartSpanOptions for StartSpan() call.

Concrete use case where this is useful: adding additional tags to the span through opentracing.Tag{} option, so that those tags could be used for deciding whether to sample this span.

vpranckaitis avatar Mar 21 '25 07:03 vpranckaitis

@lucacome drawing your attention to this since you made most of the recent contributions. Does this change make sense?

vpranckaitis avatar Apr 01 '25 10:04 vpranckaitis

@lucacome any comments? This one from copilot seem like a false-positive:

[nitpick] Using the string literal "" to represent a missing tag in the test may lead to confusion. Consider using an empty string or a different sentinel value to clearly indicate the absence of the tag.

The test already uses "<nil>" sentinel value.

vpranckaitis avatar Apr 11 '25 09:04 vpranckaitis

@lucacome in case you do not have time, maybe there's someone else who could do the review of this PR?

vpranckaitis avatar Apr 23 '25 11:04 vpranckaitis