Class: DSPy::Subscribers::NewrelicSubscriber::NewrelicConfig
- Inherits:
-
Object
- Object
- DSPy::Subscribers::NewrelicSubscriber::NewrelicConfig
- Extended by:
- T::Sig
- Defined in:
- lib/dspy/subscribers/newrelic_subscriber.rb
Overview
Configuration for New Relic integration
Instance Attribute Summary collapse
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#metric_prefix ⇒ Object
Returns the value of attribute metric_prefix.
-
#record_custom_events ⇒ Object
Returns the value of attribute record_custom_events.
-
#record_custom_metrics ⇒ Object
Returns the value of attribute record_custom_metrics.
-
#trace_lm_events ⇒ Object
Returns the value of attribute trace_lm_events.
-
#trace_optimization_events ⇒ Object
Returns the value of attribute trace_optimization_events.
Instance Method Summary collapse
-
#initialize ⇒ NewrelicConfig
constructor
A new instance of NewrelicConfig.
Constructor Details
#initialize ⇒ NewrelicConfig
Returns a new instance of NewrelicConfig.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/dspy/subscribers/newrelic_subscriber.rb', line 44 def initialize @enabled = begin !!(defined?(NewRelic) && NewRelic::Agent.config[:agent_enabled]) rescue false end @app_name = begin NewRelic::Agent.config[:app_name] || 'DSPy Ruby Application' rescue 'DSPy Ruby Application' end @trace_optimization_events = true @trace_lm_events = true @record_custom_metrics = true @record_custom_events = true @metric_prefix = 'Custom/DSPy' end |
Instance Attribute Details
#app_name ⇒ Object
Returns the value of attribute app_name.
26 27 28 |
# File 'lib/dspy/subscribers/newrelic_subscriber.rb', line 26 def app_name @app_name end |
#enabled ⇒ Object
Returns the value of attribute enabled.
23 24 25 |
# File 'lib/dspy/subscribers/newrelic_subscriber.rb', line 23 def enabled @enabled end |
#metric_prefix ⇒ Object
Returns the value of attribute metric_prefix.
41 42 43 |
# File 'lib/dspy/subscribers/newrelic_subscriber.rb', line 41 def metric_prefix @metric_prefix end |
#record_custom_events ⇒ Object
Returns the value of attribute record_custom_events.
38 39 40 |
# File 'lib/dspy/subscribers/newrelic_subscriber.rb', line 38 def record_custom_events @record_custom_events end |
#record_custom_metrics ⇒ Object
Returns the value of attribute record_custom_metrics.
35 36 37 |
# File 'lib/dspy/subscribers/newrelic_subscriber.rb', line 35 def record_custom_metrics @record_custom_metrics end |
#trace_lm_events ⇒ Object
Returns the value of attribute trace_lm_events.
32 33 34 |
# File 'lib/dspy/subscribers/newrelic_subscriber.rb', line 32 def trace_lm_events @trace_lm_events end |
#trace_optimization_events ⇒ Object
Returns the value of attribute trace_optimization_events.
29 30 31 |
# File 'lib/dspy/subscribers/newrelic_subscriber.rb', line 29 def trace_optimization_events @trace_optimization_events end |