Class: DSPy::Subscribers::OtelSubscriber
- Inherits:
-
Object
- Object
- DSPy::Subscribers::OtelSubscriber
- Extended by:
- T::Sig
- Defined in:
- lib/dspy/subscribers/otel_subscriber.rb
Overview
OpenTelemetry subscriber that creates spans and metrics for DSPy operations Provides comprehensive tracing for optimization operations and LM calls
Defined Under Namespace
Classes: OtelConfig
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config: nil) ⇒ OtelSubscriber
constructor
A new instance of OtelSubscriber.
Constructor Details
#initialize(config: nil) ⇒ OtelSubscriber
Returns a new instance of OtelSubscriber.
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/dspy/subscribers/otel_subscriber.rb', line 85 def initialize(config: nil) @config = config || OtelConfig.new @tracer = T.let(nil, T.nilable(T.untyped)) @meter = T.let(nil, T.nilable(T.untyped)) @optimization_spans = T.let({}, T::Hash[String, T.untyped]) @trial_spans = T.let({}, T::Hash[String, T.untyped]) setup_opentelemetry if @config.enabled setup_event_subscriptions end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
82 83 84 |
# File 'lib/dspy/subscribers/otel_subscriber.rb', line 82 def config @config end |