-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpanBuilder vs StartSpanOptions vs StartSpan-parameters #5
Comments
Good overview of all patterns. |
@cwe1ss thanks for the overview / research! @dawallin a meta-note: when we end up with more than a handful of C# Tracer implementations, it's totally fair game to create helper packages/artifacts that do menial/trivial work (like implementing a Builder). For that reason, I would reemphasize my opinion that API decisions here should be primarily motivated by what's easiest and clearest for the caller. For C#, I slightly prefer the Builder version since it makes it possible for a noop Tracer implementation to really be a true noop. (As opposed to the StartSpanOptions, where we are going to end up implementing tag storage/etc within OT proper) I also think it makes the common-case "create a child span" syntax a little cleaner. |
If we go with a Builder, I guess using an interface like in Java would be better. This would allow trace implementations to optimize/do whatever they want without us having to release new versions. They could also decide which parameters should be passed to the Span constructor and which can be passed afterwards. My main concern with the builder pattern is that it requires more allocations. Is this something we should take into account? |
As of #2, I'd like to discuss how we should pass parameters (tags, references, timestamp) to
ITracer.StartSpan
. There are multiple options for this:1 - Optional parameters
Advantages:
Disadvantages:
2 - StartSpanOptions
Advantages:
Disadvantages:
Tags
,References
directly.StartSpanOptions
instanceStartSpanOptions
class with additional parameters doesn't break trace implementations3 - SpanBuilder
Advantages:
Disadvantages:
Start()
even if she doesn't need optionsLanguage comparison:
The text was updated successfully, but these errors were encountered: