Class: OpenTelemetry::SDK::Trace::SpanProcessor
- Inherits:
-
Object
- Object
- OpenTelemetry::SDK::Trace::SpanProcessor
- Defined in:
- lib/opentelemetry/sdk/trace/span_processor.rb
Overview
Instance Method Summary collapse
-
#force_flush(timeout: nil) ⇒ Integer
Export all ended spans to the configured
Exporter
that have not yet been exported. -
#on_finish(span) ⇒ Object
Called when a Span is ended, if the OpenTelemetry::SDK::Trace::Span#recording? returns true.
-
#on_finishing(span) ⇒ void
The on_finishing method is an experimental feature and may have breaking changes.
-
#on_start(span, parent_context) ⇒ Object
Called when a Span is started, if the OpenTelemetry::SDK::Trace::Span#recording? returns true.
-
#shutdown(timeout: nil) ⇒ Integer
Called when TracerProvider#shutdown is called.
Instance Method Details
#force_flush(timeout: nil) ⇒ Integer
Export all ended spans to the configured Exporter
that have not yet been exported.
This method should only be called in cases where it is absolutely necessary, such as when using some FaaS providers that may suspend the process after an invocation, but before the Processor
exports the completed spans.
64 65 66 |
# File 'lib/opentelemetry/sdk/trace/span_processor.rb', line 64 def force_flush(timeout: nil) Export::SUCCESS end |
#on_finish(span) ⇒ Object
Called when a OpenTelemetry::SDK::Trace::Span is ended, if the OpenTelemetry::SDK::Trace::Span#recording? returns true.
This method is called synchronously on the execution thread, should not throw or block the execution thread.
51 |
# File 'lib/opentelemetry/sdk/trace/span_processor.rb', line 51 def on_finish(span); end |
#on_finishing(span) ⇒ void
This method returns an undefined value.
The on_finishing method is an experimental feature and may have breaking changes. The OpenTelemetry specification defines it as “On Ending”. As end
is a reserved keyword in Ruby, we are using on_finishing
instead.
Called when a OpenTelemetry::SDK::Trace::Span is ending, after the end timestamp has been set but before span becomes immutable. This allows for updating the span by setting attributes or adding links and events.
This method is called synchronously and should not block the current thread nor throw exceptions.
This method is optional on the Span Processor interface. It will only get called if it exists within the processor.
42 |
# File 'lib/opentelemetry/sdk/trace/span_processor.rb', line 42 def on_finishing(span); end |
#on_start(span, parent_context) ⇒ Object
Called when a OpenTelemetry::SDK::Trace::Span is started, if the OpenTelemetry::SDK::Trace::Span#recording? returns true.
This method is called synchronously on the execution thread, should not throw or block the execution thread.
24 |
# File 'lib/opentelemetry/sdk/trace/span_processor.rb', line 24 def on_start(span, parent_context); end |
#shutdown(timeout: nil) ⇒ Integer
Called when TracerProvider#shutdown is called.
73 74 75 |
# File 'lib/opentelemetry/sdk/trace/span_processor.rb', line 73 def shutdown(timeout: nil) Export::SUCCESS end |