Class: OpenTelemetry::SDK::Trace::Export::SpanExporter
- Inherits:
-
Object
- Object
- OpenTelemetry::SDK::Trace::Export::SpanExporter
- Defined in:
- lib/opentelemetry/sdk/trace/export/span_exporter.rb
Overview
SpanExporter describes a duck type. It is not required to subclass this class to provide an implementation of SpanExporter, provided the interface is satisfied. SpanExporter allows different tracing services to export recorded data for sampled spans in their own format.
To export data an exporter MUST be registered to the TracerProvider using a SpanProcessor implementation.
Instance Method Summary collapse
-
#export(span_data, timeout: nil) ⇒ Integer
Called to export sampled SpanDatas.
-
#force_flush(timeout: nil) ⇒ Integer
Called when TracerProvider#force_flush is called, if this exporter is registered to a TracerProvider object.
-
#initialize ⇒ SpanExporter
constructor
A new instance of SpanExporter.
-
#shutdown(timeout: nil) ⇒ Object
Called when TracerProvider#shutdown is called, if this exporter is registered to a TracerProvider object.
Constructor Details
#initialize ⇒ SpanExporter
Returns a new instance of SpanExporter.
19 20 21 |
# File 'lib/opentelemetry/sdk/trace/export/span_exporter.rb', line 19 def initialize @stopped = false end |
Instance Method Details
#export(span_data, timeout: nil) ⇒ Integer
Called to export sampled SpanDatas.
29 30 31 32 33 |
# File 'lib/opentelemetry/sdk/trace/export/span_exporter.rb', line 29 def export(span_data, timeout: nil) return SUCCESS unless @stopped FAILURE end |
#force_flush(timeout: nil) ⇒ Integer
Called when TracerProvider#force_flush is called, if this exporter is registered to a TracerProvider object.
41 42 43 |
# File 'lib/opentelemetry/sdk/trace/export/span_exporter.rb', line 41 def force_flush(timeout: nil) SUCCESS end |
#shutdown(timeout: nil) ⇒ Object
Called when TracerProvider#shutdown is called, if this exporter is registered to a TracerProvider object.
49 50 51 52 |
# File 'lib/opentelemetry/sdk/trace/export/span_exporter.rb', line 49 def shutdown(timeout: nil) @stopped = true SUCCESS end |