LLM tracing for Ruby apps. Reports what your app asked the model, how long it took, what it cost in tokens, and which tools ran — to the ActiveAgents platform or any self-hosted ActiveAgent dashboard.
Configuration guide → the wiki
| Gem | Use it when |
|---|---|
activeagents-telemetry |
Shared core — wire format, configuration, delivery. Every adapter depends on it. |
activeagents-telemetry-ruby_llm |
Your app calls models through RubyLLM. |
Apps built on the ActiveAgent framework don't need an adapter — the framework reports telemetry on its own.
# Gemfile
gem "activeagents-telemetry-ruby_llm"# config/initializers/telemetry.rb
RubyLLM.configure do |config|
config.instrumenter = ActiveSupport::Notifications # RubyLLM 1.x; 2.x wires this up in Rails
end
ActiveAgents::Telemetry.configure do |config|
config.api_key = ENV["ACTIVEAGENTS_API_KEY"]
config.service_name = "my-app"
end
ActiveAgents::Telemetry::RubyLLM.subscribe!That's it. Every chat turn now reports as a trace.
One trace per conversation turn:
root SupportBot.respond 1,240ms OK
└─ llm llm.generate gpt-4o 2 rounds 1,180ms 42 tokens
└─ tool tool.search_docs 310ms OK
Prompts, completions, and tool arguments/results are sent only when
capture_bodies is enabled (off by default). Error messages are truncated and
backtraces are never transmitted.
The core gem speaks OTLP, OpenTelemetry's wire protocol, over HTTP.
Sending to a collector. To report to an OpenTelemetry collector or a vendor that takes OTLP, instead of an ActiveAgent dashboard:
ActiveAgents::Telemetry.configure do |config|
config.protocol = :otlp
config.endpoint = "http://localhost:4318/v1/traces"
config.headers = { "x-honeycomb-team" => ENV["HONEYCOMB_API_KEY"] } # if the collector needs one
endSpans are named and attributed by the
GenAI semantic conventions
(chat gpt-4o, gen_ai.usage.input_tokens, ...), with the native attributes
kept beside them. The body is OTLP/JSON.
Receiving from any OpenTelemetry SDK. An ActiveAgent dashboard (actionagent 1.10 or later, and the hosted platform) accepts OTLP at its trace endpoint, so an app in any language reports to it with its usual OpenTelemetry exporter and no ActiveAgents gem:
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://api.activeagents.ai/v1/traces
OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer $ACTIVEAGENTS_API_KEY"The decoding behind that endpoint is ActiveAgents::Telemetry::OTLP.decode,
which any Rack app can call:
result = ActiveAgents::Telemetry::OTLP.decode(
request.body.read,
content_type: request.content_type, # application/x-protobuf or application/json
content_encoding: request.get_header("HTTP_CONTENT_ENCODING")
)
result.traces # => traces in the native wire formatOnly GenAI spans are kept by default: an app usually exports every span it
records, and a trace with no model call in it is dropped. OTLP over gRPC is
not supported; use the exporter's http/protobuf or http/json protocol.
Point the endpoint at your mounted dashboard — same gems, same wire format.
The dashboard engine ingests at <mount>/api/traces; its install generator
mounts it at /activeagents, so on a default install that is:
config.endpoint = "https://your-app.example.com/activeagents/api/traces"If you mounted ActionAgent::Engine somewhere else, use that prefix instead.
bundle install
bundle exec rake test_all # core + every adapter
bundle exec rake build_all # build all gems into pkg/MIT — see LICENSE.txt.