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-aiTo 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]" # everythingInitializing
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
| Argument | Environment variable | Default | What it does |
|---|---|---|---|
endpoint | GLASSFLOW_ENDPOINT | https://ingest.eu.console.rius-glassflow.com | Base OTLP endpoint. Traces post to {endpoint}/v1/traces. |
api_key | GLASSFLOW_API_KEY | None | Sent 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_name | GLASSFLOW_SERVICE_NAME | unknown_service | The service.name resource attribute on every span. Set it; it is how you find your agent later. |
headers | none | {} | Extra headers for the exporter. |
disabled | GLASSFLOW_DISABLED | False | Kill switch. When true, no exporter is attached and spans are dropped in-process. |
sample_rate | GLASSFLOW_SAMPLE_RATE | 1.0 | Head sampling rate for root traces. See Sampling. |
capture_content | GLASSFLOW_CAPTURE_CONTENT | True | When false, prompt and response content is stripped at export; metadata still flows. See Privacy controls. |
mask | none | None | Redaction callable applied to content attributes at export. See Privacy controls. |
instruments | none | None | Which auto-instrumentations to enable: None enables all installed, [] disables, ["openai"] restricts. See Auto-instrumentation. |
span_exporter | none | None | Override the OTLP exporter (mostly for tests). |
set_global | none | True | Register 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 configurationtelemetry.distro.name: glassflow-aiandtelemetry.distro.version
Spans created by the SDK itself use the tracer scope name glassflow.
Next steps
- Tracing your code: the
@observedecorator, spans, and generations. - Auto-instrumentation: tracing OpenAI, Anthropic, LangChain, and friends without manual spans.