Class: Langfuse::TraceExportGuard Private
- Inherits:
-
Object
- Object
- Langfuse::TraceExportGuard
- Defined in:
- lib/langfuse/trace_export_guard.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Stops trace export while the live telemetry kill switch is disabled.
Instance Method Summary collapse
-
#export(span_data, timeout: nil) ⇒ Integer
private
Export spans only while trace export is enabled.
-
#force_flush(timeout: nil) ⇒ Object
private
Delegate result or OpenTelemetry success.
-
#initialize(delegate:, config:) ⇒ TraceExportGuard
constructor
private
A new instance of TraceExportGuard.
-
#shutdown(timeout: nil) ⇒ Object
private
Release exporter resources after the guarded processor drains its queue.
Constructor Details
#initialize(delegate:, config:) ⇒ TraceExportGuard
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 instance of TraceExportGuard.
15 16 17 18 |
# File 'lib/langfuse/trace_export_guard.rb', line 15 def initialize(delegate:, config:) @delegate = delegate @config = config end |
Instance Method Details
#export(span_data, timeout: nil) ⇒ Integer
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.
Export spans only while trace export is enabled.
25 26 27 28 29 |
# File 'lib/langfuse/trace_export_guard.rb', line 25 def export(span_data, timeout: nil) return SUCCESS unless @config.trace_export_enabled? @delegate.export(span_data, timeout: timeout) end |
#force_flush(timeout: nil) ⇒ Object
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 delegate result or OpenTelemetry success.
33 34 35 36 37 |
# File 'lib/langfuse/trace_export_guard.rb', line 33 def force_flush(timeout: nil) return SUCCESS unless @config.trace_export_enabled? @delegate.force_flush(timeout: timeout) end |
#shutdown(timeout: nil) ⇒ Object
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.
Release exporter resources after the guarded processor drains its queue.
43 44 45 |
# File 'lib/langfuse/trace_export_guard.rb', line 43 def shutdown(timeout: nil) @delegate.shutdown(timeout: timeout) end |