Skip to Content

How do I send traces from OpenInference instrumentors to Rius?

Rius takes OpenInference traces through an OTLP over HTTP exporter pointed at its ingest endpoint, with your API key in an Authorization Bearer header. The instrumentors need no changes, because they emit standard OpenTelemetry spans. Use the protobuf exporter and the full https://ingest.eu.console.rius-glassflow.com/v1/traces URL. Rius normalizes the OpenInference attributes at ingest, so your calls get model, token and cost analytics.

How it works

OpenInference instrumentors write standard OpenTelemetry spans, so the only thing Rius needs from you is an OTLP exporter that points at the ingest endpoint. These are the three values that matter for this setup:

  • Endpoint: https://ingest.eu.console.rius-glassflow.com/v1/traces. The host carries your workspace’s region, and this one is for eu. The Python OTLP exporter takes the full /v1/traces path and does not append it. OTEL_EXPORTER_OTLP_ENDPOINT and the Collector’s otlphttp exporter append it, so they take the base URL. OTEL_EXPORTER_OTLP_TRACES_ENDPOINT takes the full /v1/traces URL.
  • Protocol: OTLP over HTTP. Protobuf is recommended and JSON also works. There is no gRPC endpoint.
  • Header: Authorization: Bearer followed by your API key. The key decides which workspace the traces land in.

At ingest, Rius reads openinference.span.kind to set the kind of each span (LLM, TOOL, CHAIN and so on). It captures input.value and output.value as span content. It also maps the OpenInference model, provider, token count and message attributes onto their gen_ai.* equivalents. The values are stored under the gen_ai.* keys, so you search and filter on those, for example gen_ai.usage.input_tokens. Rius then computes cost from the model and token counts. You never send a cost value.

OpenInference writes one attribute per message field and per tool field. OpenTelemetry keeps only 128 attributes per span by default, and a long agent loop passes that limit. After that, the span silently loses attributes, so raise the limit to 4096 as the example below does.

Set it up

  1. Create an API key in the Rius console at https://console.rius-glassflow.com. The Trace LLM calls with OpenTelemetry page shows every sender path side by side if you want to compare setups.

  2. Build a tracer provider with a raised attribute limit and a protobuf OTLP exporter. Then hand the provider to the instrumentor. Replace the placeholder with your key:

from opentelemetry.sdk.trace import SpanLimits, TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter from openinference.instrumentation.openai import OpenAIInstrumentor # Raise the attribute limit: see "Raise the span attribute limit" below. provider = TracerProvider(span_limits=SpanLimits(max_span_attributes=4096)) provider.add_span_processor( BatchSpanProcessor( OTLPSpanExporter( endpoint="https://ingest.eu.console.rius-glassflow.com/v1/traces", headers={"Authorization": "Bearer <your API key>"}, ) ) ) OpenAIInstrumentor().instrument(tracer_provider=provider)
  1. If your app is not Python, set the limit through the environment instead, which works for any language:
export OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT=4096
  1. In Node, use @opentelemetry/exporter-trace-otlp-proto. The similarly named @opentelemetry/exporter-trace-otlp-http sends JSON, which also works. Register the tracer provider as OpenTelemetry’s Node documentation describes, and shut it down before the process exits so queued spans are exported.

  2. Make one call through the instrumented client. Then follow the checks below.

The OpenInference page covers this setup in full, and the Interoperability page lists the other sender guides.

What you get

Open Traces in the console and open the new trace. Check these things on the first one:

  • The span for the model call shows a model name, token counts and a cost. The cost is a list-price estimate in US dollars.
  • The span kind matches what the instrumentor reported, such as LLM for a model call and TOOL for a tool call.
  • Prompts and replies appear as span content. Without the Rius SDK there are no privacy controls in your process, so the instrumentor’s output is sent as recorded.
  • A 401 from the endpoint means the API key is wrong or revoked.
  • A span without a model or tokens usually lost attributes on the way. Look for the 128 attribute default limit that you did not raise, or a Collector processor that strips gen_ai.* keys.
  • When you filter, use the gen_ai.* names, not the original OpenInference names.

When something else fits

If your app is Python or TypeScript, the Rius SDK ships these same instrumentors. It wires the exporter, the attribute limit and the privacy controls for you, so you write one init() call. If you already route traces through an OpenTelemetry Collector, add Rius as one more otlphttp exporter instead of changing application code.

Still stuck? Get help

Last updated on