Class: Datadog::OpenTracer::ThreadLocalScopeManager
- Inherits:
-
ScopeManager
- Object
- OpenTracing::ScopeManager
- ScopeManager
- Datadog::OpenTracer::ThreadLocalScopeManager
- Defined in:
- lib/ddtrace/opentracer/thread_local_scope_manager.rb
Overview
OpenTracing adapter for thread local scope management
Instance Method Summary collapse
-
#activate(span, finish_on_close: true) ⇒ Scope
Make a span instance active.
-
#active ⇒ Scope
currently active Span.
Instance Method Details
#activate(span, finish_on_close: true) ⇒ Scope
Make a span instance active.
13 14 15 16 17 18 19 20 21 |
# File 'lib/ddtrace/opentracer/thread_local_scope_manager.rb', line 13 def activate(span, finish_on_close: true) ThreadLocalScope.new( manager: self, span: span, finish_on_close: finish_on_close ).tap do |scope| set_scope(scope) end end |
#active ⇒ Scope
currently active Span.
If there is a non-null Scope, its wrapped Span becomes an implicit parent (as Reference#CHILD_OF) of any newly-created Span at Tracer#start_active_span or Tracer#start_span time.
29 30 31 |
# File 'lib/ddtrace/opentracer/thread_local_scope_manager.rb', line 29 def active Thread.current[object_id.to_s] end |