Module: Braintrust::Contrib::Support::OTel
- Defined in:
- lib/braintrust/contrib/support/otel.rb
Overview
OpenTelemetry utilities shared across all integrations.
Class Method Summary collapse
-
.set_json_attr(span, attr_name, obj) ⇒ void
Helper to safely set a JSON attribute on a span Only sets the attribute if obj is present.
Class Method Details
.set_json_attr(span, attr_name, obj) ⇒ void
This method returns an undefined value.
Helper to safely set a JSON attribute on a span Only sets the attribute if obj is present
16 17 18 19 |
# File 'lib/braintrust/contrib/support/otel.rb', line 16 def self.set_json_attr(span, attr_name, obj) return unless obj span.set_attribute(attr_name, JSON.generate(obj)) end |