Skip to main content

Official BentoLabs Python SDK. Drop-in OpenTelemetry span processor that ships traces to the BentoLabs ingest API over OTLP/HTTP+JSON.

Project description

bentolabs-sdk

Official BentoLabs Python SDK. A drop-in OpenTelemetry span processor that ships traces to the BentoLabs ingest API over OTLP/HTTP+JSON.

Status: 0.1.0. Stable surface for api_key / base_url resolution and OTel ingest. Higher-level helpers can land on top of this package later.

Install

pip install bentolabs-sdk opentelemetry-api opentelemetry-sdk

Usage

from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider

from bentolabs_sdk import BentoLabsSpanProcessor

provider = TracerProvider()
provider.add_span_processor(BentoLabsSpanProcessor())
trace.set_tracer_provider(provider)

tracer = trace.get_tracer("example")
with tracer.start_as_current_span("agent.run") as span:
    span.set_attribute("input.value", "Summarize the incident")
    span.set_attribute("output.value", "The incident is resolved.")

provider.force_flush()
provider.shutdown()

The processor batches spans with OpenTelemetry defaults and POSTs them to ${base_url}/v1/traces with Authorization: Bearer bl_pk_.... The bl_pk_ prefix is validated up front.

Configuration

from bentolabs_sdk import resolve_options

cfg = resolve_options()
Field Resolution order
api_key explicit argument -> BENTOLABS_API_KEY -> raises BentoAuthError
base_url explicit argument -> BENTOLABS_BASE_URL -> https://api.bentolabs.ai
from bentolabs_sdk import BentoAuthError, BentoLabsSpanProcessor

try:
    processor = BentoLabsSpanProcessor(base_url="http://localhost:8080")
except BentoAuthError as exc:
    if exc.code == "missing_api_key":
        # telemetry disabled or misconfigured
        pass
    raise

Requirements

  • Python 3.10+

License

Proprietary. Copyright (c) 2026 BentoLabs, Inc. All rights reserved. Use is governed by your written agreement with BentoLabs, Inc.

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

bentolabs_sdk-0.1.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

bentolabs_sdk-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file bentolabs_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: bentolabs_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bentolabs_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 204656fd7ca7322216b718739e795af785681ec3dff31e3e806ea0841d907877
MD5 8c878798eab796f105f8fc34b1041b5c
BLAKE2b-256 0b09b0d35581210dae76872f436998fb3fd6ae7af51d23d19630e00b70f64102

See more details on using hashes here.

File details

Details for the file bentolabs_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bentolabs_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bentolabs_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71e92d83a09fffea1fb82727f709a73c3964af669e498ea7c8f339e295ad21c3
MD5 2220aa75781ce051ef9bca5cddc7b569
BLAKE2b-256 67f3626b7e810cf475222024bbd5d105bf5348452587e594a141444097b0a9b5

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