Skip to main content

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 — OpenTelemetry service.name.
  • endpoint — OTLP/HTTP traces URL. Defaults to the bryel ingest, or $BRYEL_INGEST_URL for self-hosting.
  • headers — extra headers, merged after auth.
  • set_global — register as the global OTel provider (default True).
  • instrument — also auto-instrument installed OpenInference libraries.

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

Best-effort instrument every installed OpenInference library — provider SDKs (OpenAI, Anthropic, Bedrock, Groq, Mistral, VertexAI, Google GenAI, LiteLLM, Instructor), agent SDKs (OpenAI Agents, Google ADK), and frameworks (LangChain/LangGraph, LlamaIndex, CrewAI, DSPy, Haystack, smolagents, Agno, AutoGen, Guardrails) plus MCP. 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.

Examples

MIT © bryel

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bryel-0.1.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bryel-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file bryel-0.1.1.tar.gz.

File metadata

  • Download URL: bryel-0.1.1.tar.gz
  • Upload date:
  • Size: 7.0 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

Hashes for bryel-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7f9fd4b3cba13e16a3dea676c60697ca9eadbc583916f42d699b85e78be17304
MD5 3c7c3418952c05540a3106cb133e9ba9
BLAKE2b-256 801c18b92ff868ccd6c821181c94ed9ddb13f11e9164f2a70e66e6affb1e6729

See more details on using hashes here.

File details

Details for the file bryel-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bryel-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 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

Hashes for bryel-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f641199dc5c5719cb1d13004cd6f53dbd65fa42aac9d83398887a8576f29375
MD5 f2f1479fe6c9c6ffe67a895c601cc4d3
BLAKE2b-256 7936c6d458572370febd3bed62ee13a15e62f35541888b9209b41d016ad0d9d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page