OpenTelemetry-native tracing for LLM apps and agents — ships OpenInference/OTLP traces to bryel.
Project description
bryel (Python)
OpenTelemetry-native tracing for LLM apps and agents. One call ships your model calls, tool calls, tokens, and cost to bryel as OpenInference traces — from any framework.
uv add bryel # or: pip install bryel
Quickstart
import bryel
bryel.init(api_key="bk_…", service_name="my-app")
# Trace OpenAI (any OpenInference instrumentor works the same way):
from openinference.instrumentation.openai import OpenAIInstrumentor
OpenAIInstrumentor().instrument()
from openai import OpenAI
OpenAI().chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "hello"}],
)
Prefer bryel to wire up everything it can find? Let it instrument every installed OpenInference library for you:
import bryel
bryel.init(api_key="bk_…", instrument=True) # instruments openai, anthropic, langchain, …
How it works
bryel is just the exporter. It configures an OpenTelemetry TracerProvider with
an OTLP/HTTP exporter pointed at the bryel ingest, authenticated with your API
key. The OpenInference instrumentors
emit the spans; bryel's ingest normalizes both the OpenInference (llm.*) and
OpenTelemetry GenAI (gen_ai.*) conventions — so there's nothing to map.
API
bryel.init(api_key=None, *, service_name=None, endpoint=None, headers=None, set_global=True, instrument=False)
Configures the exporter and returns the TracerProvider.
api_key— your project API key (bk_…). Falls back to$BRYEL_KEY.service_name— OpenTelemetryservice.name.endpoint— OTLP/HTTP traces URL. Defaults to the bryel ingest, or$BRYEL_INGEST_URLfor self-hosting.headers— extra headers, merged after auth.set_global— register as the global OTel provider (defaultTrue).instrument— also auto-instrument installed OpenInference libraries.
bryel.auto_instrument(tracer_provider=None) -> list[str]
Best-effort instrument every installed OpenInference library. Returns the ones it wired up. Safe to call with none installed.
bryel.shutdown()
Flush pending spans and shut down. Call on process exit.
Feedback and grouping
Group turns into a conversation and attach 👍/👎 by stamping metadata on your
spans — set session.id, user.id, and a bryel.interaction.id you mint. See
the docs.
MIT © bryel
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bryel-0.1.0.tar.gz.
File metadata
- Download URL: bryel-0.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10cc205ef89eee7ac5a97a8118813d831704c5418e14e47bc63ea61f72db85d5
|
|
| MD5 |
a727356dc42fa7a445399515ae7da77a
|
|
| BLAKE2b-256 |
23528cc52d8d2e166b1c82190038c8bc17bde9d52eb21cbcd7fffbf549e77450
|
File details
Details for the file bryel-0.1.0-py3-none-any.whl.
File metadata
- Download URL: bryel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f6b0ee51b9da5abb1ddadc20b44787545c219b919133983275958e204d376af
|
|
| MD5 |
dc942691112830b21f698ba34881071a
|
|
| BLAKE2b-256 |
86f8eb969a3b16031347ecaac52bfab473bed66d31d6bec830fa5089685a0065
|