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.2.tar.gz (8.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.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bryel-0.1.2.tar.gz
  • Upload date:
  • Size: 8.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.2.tar.gz
Algorithm Hash digest
SHA256 9ff072a638c8be519064a5449053870adab8fd4fa7b5df3611eb9b7465faea63
MD5 b9efe8781de605dd6047b0a11fd91152
BLAKE2b-256 76850644dd4b06cbd2fc863839577c5e2911b668c8d1d3c7480e191874edf71c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bryel-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 afc6db6f17903b7aa9cd950b0afa86344b3506218606135c03d36ca0fe9fbda5
MD5 0ac626f930e69549df3f3edb89371d7f
BLAKE2b-256 70661622409a4dbd522d7e3dad99bfdafb483b321c0b8094e8a61b3383964931

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