Skip to Content
RiusSDKInstallation and configuration

Installation and configuration

The Rius SDK for Python is published as glassflow-ai and imported as glassflow. It requires Python 3.10 or newer.

pip install glassflow-ai

To auto-instrument the LLM libraries you use, install their extras (see Auto-instrumentation):

pip install "glassflow-ai[openai]" # one library pip install "glassflow-ai[instruments]" # everything

Initializing

Call glassflow.init() once, as early as possible in your process:

import glassflow client = glassflow.init( api_key="glassflow_...", service_name="my-agent", )

Every argument is optional and can also come from an environment variable. Explicit arguments win over environment variables, which win over defaults.

Configuration reference

ArgumentEnvironment variableDefaultWhat it does
endpointGLASSFLOW_ENDPOINThttps://ingest.eu.console.rius-glassflow.comBase OTLP endpoint. Traces post to {endpoint}/v1/traces.
api_keyGLASSFLOW_API_KEYNoneSent as Authorization: Bearer <key>. If you pass your own Authorization header via headers, it wins. None is valid for OTLP backends that need no auth.
service_nameGLASSFLOW_SERVICE_NAMEunknown_serviceThe service.name resource attribute on every span. Set it; it is how you find your agent later.
headersnone{}Extra headers for the exporter.
disabledGLASSFLOW_DISABLEDFalseKill switch. When true, no exporter is attached and spans are dropped in-process.
sample_rateGLASSFLOW_SAMPLE_RATE1.0Head sampling rate for root traces. See Sampling.
capture_contentGLASSFLOW_CAPTURE_CONTENTTrueWhen false, prompt and response content is stripped at export; metadata still flows. See Privacy controls.
masknoneNoneRedaction callable applied to content attributes at export. See Privacy controls.
instrumentsnoneNoneWhich auto-instrumentations to enable: None enables all installed, [] disables, ["openai"] restricts. See Auto-instrumentation.
span_exporternoneNoneOverride the OTLP exporter (mostly for tests).
set_globalnoneTrueRegister the provider as the global OpenTelemetry provider.

Boolean environment variables accept 1, true, yes, or on in any case. Out-of-range sample_rate values are clamped to [0.0, 1.0] with a warning.

Calling init() twice

The OpenTelemetry global provider is write-once, so a second global init() while a client is active logs a warning and returns the existing client unchanged. To reconfigure, call client.shutdown() first, which drains pending spans and releases the slot.

If your process needs an isolated pipeline next to an existing one, use a scoped client instead:

client = glassflow.init(set_global=False, service_name="side-pipeline") tracer = client.get_tracer()

A scoped client does not claim the global slot, and it does not enable auto-instrumentation unless you pass instruments=[...] explicitly, because instrumentors patch libraries process-wide.

What every span carries

The SDK stamps these resource attributes on all spans it exports:

  • service.name, from your configuration
  • telemetry.distro.name: glassflow-ai and telemetry.distro.version

Spans created by the SDK itself use the tracer scope name glassflow.

Next steps

Last updated on