Class: Langfuse::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/langfuse.rb

Overview

Configuration class for Langfuse client settings

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Configuration

Returns a new instance of Configuration.



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/langfuse.rb', line 161

def initialize
  @public_key = nil
  @secret_key = nil
  @host = 'https://us.cloud.langfuse.com'
  @debug = false
  @timeout = 30
  @retries = 3
  @flush_interval = 5
  @auto_flush = true
  @ingestion_mode = :legacy # :legacy or :otel
  @environment = nil       # default tracing environment for all events
  @sample_rate = nil       # 0.0..1.0, nil disables sampling
  @mask = nil              # callable applied to input/output/metadata before sending
  @flush_at = 15           # flush as soon as this many events are queued
  @max_queue_size = 10_000 # queue cap; the oldest events are dropped when full
  @logger = nil            # custom Logger instance
  @shutdown_on_exit = true # register an at_exit hook that flushes pending events
  @http_adapter = nil      # Faraday adapter, e.g. :net_http_persistent for keep-alive
end

Instance Attribute Details

#auto_flush ⇒ Object

Returns the value of attribute auto_flush.



157
158
159
# File 'lib/langfuse.rb', line 157

def auto_flush
  @auto_flush
end

#debug ⇒ Object

Returns the value of attribute debug.



157
158
159
# File 'lib/langfuse.rb', line 157

def debug
  @debug
end

#environment ⇒ Object

Returns the value of attribute environment.



157
158
159
# File 'lib/langfuse.rb', line 157

def environment
  @environment
end

#flush_at ⇒ Object

Returns the value of attribute flush_at.



157
158
159
# File 'lib/langfuse.rb', line 157

def flush_at
  @flush_at
end

#flush_interval ⇒ Object

Returns the value of attribute flush_interval.



157
158
159
# File 'lib/langfuse.rb', line 157

def flush_interval
  @flush_interval
end

#host ⇒ Object

Returns the value of attribute host.



157
158
159
# File 'lib/langfuse.rb', line 157

def host
  @host
end

#http_adapter ⇒ Object

Returns the value of attribute http_adapter.



157
158
159
# File 'lib/langfuse.rb', line 157

def http_adapter
  @http_adapter
end

#ingestion_mode ⇒ Object

Returns the value of attribute ingestion_mode.



157
158
159
# File 'lib/langfuse.rb', line 157

def ingestion_mode
  @ingestion_mode
end

#logger ⇒ Object

Returns the value of attribute logger.



157
158
159
# File 'lib/langfuse.rb', line 157

def logger
  @logger
end

#mask ⇒ Object

Returns the value of attribute mask.



157
158
159
# File 'lib/langfuse.rb', line 157

def mask
  @mask
end

#max_queue_size ⇒ Object

Returns the value of attribute max_queue_size.



157
158
159
# File 'lib/langfuse.rb', line 157

def max_queue_size
  @max_queue_size
end

#public_key ⇒ Object

Returns the value of attribute public_key.



157
158
159
# File 'lib/langfuse.rb', line 157

def public_key
  @public_key
end

#retries ⇒ Object

Returns the value of attribute retries.



157
158
159
# File 'lib/langfuse.rb', line 157

def retries
  @retries
end

#sample_rate ⇒ Object

Returns the value of attribute sample_rate.



157
158
159
# File 'lib/langfuse.rb', line 157

def sample_rate
  @sample_rate
end

#secret_key ⇒ Object

Returns the value of attribute secret_key.



157
158
159
# File 'lib/langfuse.rb', line 157

def secret_key
  @secret_key
end

#shutdown_on_exit ⇒ Object

Returns the value of attribute shutdown_on_exit.



157
158
159
# File 'lib/langfuse.rb', line 157

def shutdown_on_exit
  @shutdown_on_exit
end

#timeout ⇒ Object

Returns the value of attribute timeout.



157
158
159
# File 'lib/langfuse.rb', line 157

def timeout
  @timeout
end