Class: OpenTelemetry::SDK::Trace::Export::NoopSpanExporter
- Inherits:
-
Object
- Object
- OpenTelemetry::SDK::Trace::Export::NoopSpanExporter
- Defined in:
- lib/opentelemetry/sdk/trace/export/noop_span_exporter.rb
Overview
A noop exporter that demonstrates and documents the SpanExporter duck type. 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 SimpleSpanProcessor or a BatchSpanProcessor.
Instance Method Summary collapse
-
#export(spans, timeout: nil) ⇒ Integer
Called to export sampled Spans.
-
#initialize ⇒ NoopSpanExporter
constructor
A new instance of NoopSpanExporter.
-
#shutdown(timeout: nil) ⇒ Object
Called when TracerProvider#shutdown is called, if this exporter is registered to a TracerProvider object.
Constructor Details
#initialize ⇒ NoopSpanExporter
Returns a new instance of NoopSpanExporter.
18 19 20 |
# File 'lib/opentelemetry/sdk/trace/export/noop_span_exporter.rb', line 18 def initialize @stopped = false end |
Instance Method Details
#export(spans, timeout: nil) ⇒ Integer
Called to export sampled Spans.
28 29 30 31 32 |
# File 'lib/opentelemetry/sdk/trace/export/noop_span_exporter.rb', line 28 def export(spans, timeout: nil) return SUCCESS unless @stopped FAILURE end |
#shutdown(timeout: nil) ⇒ Object
Called when TracerProvider#shutdown is called, if this exporter is registered to a TracerProvider object.
38 39 40 41 |
# File 'lib/opentelemetry/sdk/trace/export/noop_span_exporter.rb', line 38 def shutdown(timeout: nil) @stopped = true SUCCESS end |