Closed carlosalberto closed 5 years ago
Conceptually, I would have a little trouble understanding what a no-op scope is. Is it a scope? Is it an empty scope? If so, would that be a better name? What is no-op scope precisely?
Ideally, I would prefer to receive an Optional
result from the active..
methods. To me, it is much clearer about what is happening.
Accidentally closed this pull request, sorry!
Hey @sjoerdtalsma
Is it a scope? Is it an empty scope? If so, would that be a better name? What is no-op scope precisely?
I'd say it's both an empty scope and an empty span, that basically do nothing. We could probably change the name?
The Optional
is another possibility to consider, but we don't support Java 8 yet ;)
Oh, btw, this is related ;) https://github.com/opentracing/specification/issues/116
After the lack of interest, I'm closing this PR. We can definitely re-open or create a new ticket if/when this feature is needed ;)
Hey all,
I decided to test out, as a prototype, a no-op active
Scope
/Span
for the current api. This had been suggested (or at least mentioned) in the past. And it could probably help with features such as #319Advantages:
ScopeManager.active()
norScopeManager.activeSpan()
.Potential issues:
MockTracer
which will check againstNoopSpanContext
, and which case it will ignore it as potential parent when creating newSpan
s.assertEquals(NoopScope.INSTANCE, scopeManager.active())
instead ofassertNull(scopeManager.active())
.Thoughts?
@yurishkuro @felixbarny @tedsuo @sjoerdtalsma @tylerbenson @opentracing/opentracing-java-maintainers
PS - Did not update the testbed module. Will do that later if we decide to go on and merge this change ;)