Class: DSPy::Subscribers::NewrelicSubscriber

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dspy/subscribers/newrelic_subscriber.rb

Overview

New Relic subscriber that creates custom metrics and traces for DSPy operations Provides comprehensive monitoring for optimization operations and performance tracking

Defined Under Namespace

Classes: NewrelicConfig

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil) ⇒ NewrelicSubscriber

Returns a new instance of NewrelicSubscriber.



67
68
69
70
71
72
# File 'lib/dspy/subscribers/newrelic_subscriber.rb', line 67

def initialize(config: nil)
  @config = config || NewrelicConfig.new
  @optimization_transactions = T.let({}, T::Hash[String, T.untyped])
  
  setup_event_subscriptions if @config.enabled
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



64
65
66
# File 'lib/dspy/subscribers/newrelic_subscriber.rb', line 64

def config
  @config
end