Class: OpenTelemetry::SDK::Trace::Tracer
- Inherits:
-
Trace::Tracer
- Object
- Trace::Tracer
- OpenTelemetry::SDK::Trace::Tracer
- Defined in:
- lib/opentelemetry/sdk/trace/tracer.rb
Overview
Tracer is the SDK implementation of Trace::Tracer.
Instance Method Summary collapse
-
#initialize(name, version, tracer_provider) ⇒ Tracer
constructor
private
Returns a new Tracer instance.
- #start_root_span(name, attributes: nil, links: nil, start_timestamp: nil, kind: nil) ⇒ Object
- #start_span(name, with_parent: nil, attributes: nil, links: nil, start_timestamp: nil, kind: nil) ⇒ Object
Constructor Details
#initialize(name, version, tracer_provider) ⇒ Tracer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new OpenTelemetry::SDK::Trace::Tracer instance.
21 22 23 24 |
# File 'lib/opentelemetry/sdk/trace/tracer.rb', line 21 def initialize(name, version, tracer_provider) @instrumentation_scope = InstrumentationScope.new(name, version) @tracer_provider = tracer_provider end |
Instance Method Details
#start_root_span(name, attributes: nil, links: nil, start_timestamp: nil, kind: nil) ⇒ Object
26 27 28 |
# File 'lib/opentelemetry/sdk/trace/tracer.rb', line 26 def start_root_span(name, attributes: nil, links: nil, start_timestamp: nil, kind: nil) start_span(name, with_parent: Context.empty, attributes: attributes, links: links, start_timestamp: , kind: kind) end |
#start_span(name, with_parent: nil, attributes: nil, links: nil, start_timestamp: nil, kind: nil) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/opentelemetry/sdk/trace/tracer.rb', line 30 def start_span(name, with_parent: nil, attributes: nil, links: nil, start_timestamp: nil, kind: nil) with_parent ||= Context.current name ||= 'empty' kind ||= :internal @tracer_provider.internal_start_span(name, kind, attributes, links, , with_parent, @instrumentation_scope) end |