An open API service indexing awesome lists of open source software.

https://github.com/traceloop/openllmetry-ruby

Sister project to OpenLLMetry, but in Ruby. Open-source observability for your LLM application, based on OpenTelemetry
https://github.com/traceloop/openllmetry-ruby

Last synced: 10 months ago
JSON representation

Sister project to OpenLLMetry, but in Ruby. Open-source observability for your LLM application, based on OpenTelemetry

Awesome Lists containing this project

README

          









For Ruby



Open-source observability for your LLM application


Get started ยป




Slack |
Docs |
Website



OpenLLMetry is released under the Apache-2.0 License



PRs welcome!


git commit activity


Slack community channel


Traceloop Twitter

OpenLLMetry is a set of extensions built on top of [OpenTelemetry](https://opentelemetry.io/) that gives you complete observability over your LLM application. Because it uses OpenTelemetry under the hood, it can be connected to your existing observability solutions - Datadog, Honeycomb, and others.

It's built and maintained by Traceloop under the Apache 2.0 license.

The repo contains standard OpenTelemetry instrumentations for LLM providers and Vector DBs, as well as a Traceloop SDK that makes it easy to get started with OpenLLMetry, while still outputting standard OpenTelemetry data that can be connected to your observability stack.
If you already have OpenTelemetry instrumented, you can just add any of our instrumentations directly.

## ๐Ÿš€ Getting Started

The easiest way to get started is to use our SDK.
For a complete guide, go to our [docs](https://traceloop.com/docs/openllmetry/getting-started-ruby).

Install the SDK:

```bash
gem install traceloop-sdk
```

Then, to start instrumenting your code, just add this line to your code:

```ruby
require "traceloop/sdk"

traceloop = Traceloop::SDK::Traceloop.new
```

That's it. You're now tracing your code with OpenLLMetry!

Now, you need to decide where to export the traces to.

## โซ Supported (and tested) destinations

- [x] [Traceloop](https://www.traceloop.com/docs/openllmetry/integrations/traceloop)
- [x] [Dynatrace](https://www.traceloop.com/docs/openllmetry/integrations/dynatrace)
- [x] [Datadog](https://www.traceloop.com/docs/openllmetry/integrations/datadog)
- [x] [New Relic](https://www.traceloop.com/docs/openllmetry/integrations/newrelic)
- [x] [Honeycomb](https://www.traceloop.com/docs/openllmetry/integrations/honeycomb)
- [x] [Grafana Tempo](https://www.traceloop.com/docs/openllmetry/integrations/grafana)
- [x] [HyperDX](https://www.traceloop.com/docs/openllmetry/integrations/hyperdx)
- [x] [SigNoz](https://www.traceloop.com/docs/openllmetry/integrations/signoz)
- [x] [OpenTelemetry Collector](https://www.traceloop.com/docs/openllmetry/integrations/otel-collector)

See [our docs](https://traceloop.com/docs/openllmetry/integrations/exporting) for instructions on connecting to each one.

## ๐Ÿช— What do we instrument?

OpenLLMetry is in early-alpha exploratory stage, and we're still figuring out what to instrument.
As opposed to other languages, there aren't many official LLM libraries (yet?), so for now you'll have to manually log prompts:

```ruby
require "openai"

client = OpenAI::Client.new

traceloop.llm_call() do |tracer|
tracer.log_prompt(model="gpt-3.5-turbo", user_prompt="Tell me a joke about OpenTelemetry")
response = client.chat(
parameters: {
model: "gpt-3.5-turbo",
messages: [{ role: "user", content: "Tell me a joke about OpenTelemetry" }]
})
tracer.log_response(response)
end
```

## ๐ŸŒฑ Contributing

Whether it's big or small, we love contributions โค๏ธ Check out our guide to see how to [get started](https://traceloop.com/docs/openllmetry/contributing/overview).

Not sure where to get started? You can:

- [Book a free pairing session with one of our teammates](mailto:nir@traceloop.com?subject=Pairing%20session&body=I'd%20like%20to%20do%20a%20pairing%20session!)!
- Join our Slack, and ask us any questions there.

## ๐Ÿ’š Community & Support

- [Slack](https://join.slack.com/t/traceloopcommunity/shared_invite/zt-1plpfpm6r-zOHKI028VkpcWdobX65C~g) (For live discussion with the community and the Traceloop team)
- [GitHub Discussions](https://github.com/traceloop/openllmetry-ruby/discussions) (For help with building and deeper conversations about features)
- [GitHub Issues](https://github.com/traceloop/openllmetry-ruby/issues) (For any bugs and errors you encounter using OpenLLMetry)
- [Twitter](https://twitter.com/traceloopdev) (Get news fast)

## ๐Ÿ™ Special Thanks

To @patrickdebois, who [suggested the great name](https://x.com/patrickdebois/status/1695518950715473991?s=46&t=zn2SOuJcSVq-Pe2Ysevzkg) we're now using for this repo!