Class: Langfuse::SpanProcessor Private
- Inherits:
-
OpenTelemetry::SDK::Trace::SpanProcessor
- Object
- OpenTelemetry::SDK::Trace::SpanProcessor
- Langfuse::SpanProcessor
- Defined in:
- lib/langfuse/span_processor.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.
Span processor that automatically sets propagated attributes on new spans.
This processor reads propagated attributes from OpenTelemetry context and sets them on spans when they are created. This ensures that attributes set via ‘propagate_attributes` are automatically applied to all child spans.
Instance Method Summary collapse
-
#force_flush(timeout: nil) ⇒ Integer
private
Force flush (no-op for this processor).
-
#on_finish(span) ⇒ void
private
Called when a span ends.
-
#on_start(span, parent_context) ⇒ void
private
Called when a span starts.
-
#shutdown(timeout: nil) ⇒ Integer
private
Shutdown the processor.
Instance Method Details
#force_flush(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.
Force flush (no-op for this processor)
54 55 56 57 58 59 |
# File 'lib/langfuse/span_processor.rb', line 54 def force_flush(timeout: nil) # No-op - nothing to flush # Return 0 to match OpenTelemetry SDK expectation (it finds max timeout from processors) _ = timeout # Suppress unused argument warning 0 end |
#on_finish(span) ⇒ void
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.
This method returns an undefined value.
Called when a span ends
35 36 37 |
# File 'lib/langfuse/span_processor.rb', line 35 def on_finish(span) # No-op - we don't need to do anything when spans finish end |
#on_start(span, parent_context) ⇒ void
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.
This method returns an undefined value.
Called when a span starts
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/langfuse/span_processor.rb', line 19 def on_start(span, parent_context) return unless span.recording? # Get propagated attributes from context propagated_attrs = Propagation.get_propagated_attributes_from_context(parent_context) # Set attributes on span propagated_attrs.each do |key, value| span.set_attribute(key, value) end end |
#shutdown(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.
Shutdown the processor
43 44 45 46 47 48 |
# File 'lib/langfuse/span_processor.rb', line 43 def shutdown(timeout: nil) # No-op - nothing to clean up # Return 0 to match OpenTelemetry SDK expectation (it finds max timeout from processors) _ = timeout # Suppress unused argument warning 0 end |