Skip to content

[feature request] Ruby on Rails telemetry connector #2548

@Startouf

Description

@Startouf

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
  1. Export to Phoenix via OTLP
    Phoenix accepts standard OpenTelemetry traces, so you can configure the OTLP exporter to send to your Phoenix instance.

  2. Langfuze
    THey have a Ruby SDK https://github.com/ai-firstly/langfuse-ruby

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions