class Riffer::Config::Tracing
Tracing-related global configuration.
Attributes
The backend riffer routes spans through; defaults to nil, a no-op. Riffer auto-detects no backend; assigning one is opt-in.
Whether LLM-call spans capture full message content (gen_ai.input.messages, gen_ai.output.messages, gen_ai.system_instructions); defaults to false — message content routinely carries sensitive data.
Whether riffer emits OTEL spans; defaults to true, a no-op until a host wires an OTEL SDK.
Public Class Methods
Source
# File lib/riffer/config.rb, line 70 def initialize @enabled = true @capture_messages = false @backend = nil end
Public Instance Methods
Source
# File lib/riffer/config.rb, line 99 def backend=(value) contract = %i[in_span current_context with_context] unless value.nil? || contract.all? { |method| value.respond_to?(method) } raise Riffer::ArgumentError, "tracing backend must respond to #in_span, #current_context, and #with_context" end @backend = value Riffer::Tracing.reset! end
Sets the tracing backend riffer routes spans through. Raises Riffer::ArgumentError unless the value is nil or responds to the full delegated contract: in_span, current_context, and with_context.
Source
# File lib/riffer/config.rb, line 90 def capture_messages=(value) @capture_messages = Riffer::Helpers::Boolean.coerce(value, attribute: "capture_messages") end
Sets the capture_messages flag, coercing boolean-ish values so an env-var +“false”+ (truthy in Ruby) doesn’t silently enable content capture. Raises Riffer::ArgumentError on an unrecognized value.
Source
# File lib/riffer/config.rb, line 81 def enabled=(value) @enabled = Riffer::Helpers::Boolean.coerce(value, attribute: "enabled") end
Sets the enabled flag, coercing boolean-ish values so an env-var +“false”+ (truthy in Ruby) doesn’t silently keep tracing on. Raises Riffer::ArgumentError on an unrecognized value.