-
Notifications
You must be signed in to change notification settings - Fork 316
should StartSpanOptions
implement StartSpanOption
?
#119
Comments
You only pass individual Without referring to specific API details, can you describe what you're trying to do? |
"Never" is a strong word - in my case I did already have a populated The application here was a "Tee Tracer" - a tracer that keeps track of multiple tracers, and creates spans and "tees off" events to all of them. The We are using this Tracer to push traces to both a Lightstep tracer and a "local" tracer which uses |
I would argue that since the actual API the user code must interact with can only provide individual options Pre-populating the struct in this case is a minor performance optimization, and you've been able to do it without changing the public API. Anyway, I don't have a strong objection, but a minor one is that it makes the API more confusing. For example what happens in this scenario?
In your current (private) implementation the struct as option overrides everything else. |
On unrelated note, people have asked before about a |
Agree re a |
This is not true. I have to convert That said, I don't feel strongly about changing anything, it's more of a question. I see the argument against it and I'm totally ok keeping the code as is.
@tschottdorf already contributed the |
|
I found it a little strange that I couldn't pass a
StartSpanOptions
directly toStartSpan
. I had to create a new type that implementsApply
(https://github.com/cockroachdb/cockroach/blob/develop/util/tracing/tee_tracer.go#L42).The text was updated successfully, but these errors were encountered: