-
Notifications
You must be signed in to change notification settings - Fork 172
Open
Labels
Description
Is your feature request related to a problem? Please describe.
Connect Ruby (and Ruby on Rails) applications easily to Arize with telemetry. When running LLM inference tasks from a Ruby on Rails application, we do not have any connector
Describe the solution you'd like
We have Ruby on Rails code that connects to various LLM providers and no connector to easily send telemetry data to Arize, like Mistral
Describe alternatives you've considered
1. Manual OpenTelemetry spans (recommended)
Since OpenInference is built on OpenTelemetry, you can manually instrument your MistralConnector using the [OpenTelemetry Ruby SDK](https://opentelemetry.io/docs/languages/ruby/) with OpenInference semantic conventions:
ruby
# Gemfile
gem 'opentelemetry-sdk'
gem 'opentelemetry-exporter-otlp'
# In MistralConnector
require 'opentelemetry'
tracer = OpenTelemetry.tracer_provider.tracer('mistral')
def self.run_inference
tracer.in_span('mistral.chat', attributes: {
'llm.model_name' => DEFAULT_MODEL,
'llm.input_messages' => company_names.to_json,
'llm.invocation_parameters' => { agent_id: ENV['MISTRAL_COMPANY_KEYWORD_AGENT_ID'] }.to_json
}) do |span|
# existing code...
span.set_attribute('llm.token_count.prompt', usage[:prompt_tokens])
span.set_attribute('llm.token_count.completion', usage[:completion_tokens])
end
end
-
Export to Phoenix via OTLP
Phoenix accepts standard OpenTelemetry traces, so you can configure the OTLP exporter to send to your Phoenix instance. -
Langfuze
THey have a Ruby SDK https://github.com/ai-firstly/langfuse-ruby
dosubot
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status