You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to uniformly instrument this library is really tricky in the case that OpenTelemetry is not installed.
Currently the code returns None in the case that the dependency wasn't imported.
Trying to invoke
withtrace_call('foo') asspan:
ifspan:
# Add code
and then in other cases where we need to add span annotations firstly having to check if span is not None is awkward such as in #1207
ifspanisnotNone:
span.add_event(...)
we shouldn't labor ourselves with dependency implementation details which constitutes a leaky abstraction.
Suggestion
Let's implement a NoopSpan class that'll be returned on every invocation if not installed and that should make it clean for this package to freely add events.
Trying to uniformly instrument this library is really tricky in the case that OpenTelemetry is not installed.
Currently the code returns None in the case that the dependency wasn't imported.
Trying to invoke
and then in other cases where we need to add span annotations firstly having to check if span is not None is awkward such as in #1207
we shouldn't labor ourselves with dependency implementation details which constitutes a leaky abstraction.
Suggestion
Let's implement a NoopSpan class that'll be returned on every invocation if not installed and that should make it clean for this package to freely add events.
/cc @harshachinta @surbhigarg92
The text was updated successfully, but these errors were encountered: