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. 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


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.0.tar.gz (4.6 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.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

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

Hashes for bryel-0.1.0.tar.gz
Algorithm Hash digest
SHA256 10cc205ef89eee7ac5a97a8118813d831704c5418e14e47bc63ea61f72db85d5
MD5 a727356dc42fa7a445399515ae7da77a
BLAKE2b-256 23528cc52d8d2e166b1c82190038c8bc17bde9d52eb21cbcd7fffbf549e77450

See more details on using hashes here.

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

Hashes for bryel-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f6b0ee51b9da5abb1ddadc20b44787545c219b919133983275958e204d376af
MD5 dc942691112830b21f698ba34881071a
BLAKE2b-256 86f8eb969a3b16031347ecaac52bfab473bed66d31d6bec830fa5089685a0065

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