Skip to main content
bryel ships your model calls, tool calls, tokens, and cost to bryel as OpenInference traces. One call configures OpenTelemetry; then any OpenInference instrumentor flows through — bryel adds no mapping, it’s just the exporter.
1

Install

uv add bryel
2

Initialize

import bryel
bryel.init(api_key="bk_…", service_name="my-app")
Or read the key from the environment (BRYEL_KEY) and omit api_key.
3

Instrument your stack

Add the OpenInference instrumentor for your library:
from openinference.instrumentation.openai import OpenAIInstrumentor
OpenAIInstrumentor().instrument()
…or let bryel wire up every instrumentor you have installed:
bryel.init(api_key="bk_…", instrument=True)
4

Verify

Run a model call, then open the trace explorer — model, tokens, cost, and tool calls appear.

Full example

import bryel
bryel.init(service_name="support-agent", instrument=True)  # reads BRYEL_KEY

from openai import OpenAI
OpenAI().chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "hello"}],
)

bryel.shutdown()  # flush pending spans before exit

Grouping and feedback

Stamp session.id, user.id, and a bryel.interaction.id you mint onto your spans to group turns into a conversation and join feedback.
bryel sends OTLP/HTTP protobuf and needs no client-side mapping — the ingest normalizes both the OpenInference (llm.*) and OpenTelemetry GenAI (gen_ai.*) conventions.

API

bryel.init(api_key=None, *, service_name=None, endpoint=None, headers=None, set_global=True, instrument=False)

Configures the exporter and returns the OpenTelemetry TracerProvider.
api_key
str
Project API key (bk_…). Falls back to $BRYEL_KEY.
service_name
str
OpenTelemetry service.name.
endpoint
str
default:"https://ingest.eu.bryel.ai/v1/traces"
OTLP/HTTP URL. Override via $BRYEL_INGEST_URL for self-hosting.
headers
dict
Extra headers, merged after auth.
set_global
bool
default:"True"
Register as the global OpenTelemetry provider.
instrument
bool
default:"False"
Also auto-instrument installed OpenInference libraries.

bryel.auto_instrument(tracer_provider=None) -> list[str]

Best-effort instrument every installed OpenInference library — provider SDKs, agent SDKs, and frameworks (see Integrations for the full list). Returns the ones it wired up; safe to call with none installed.

bryel.shutdown()

Flush pending spans and shut down. Call on process exit.