Skip to main content

OpenTelemetry exporter for Kubit analytics.

Project description

kubit-otel

OpenTelemetry exporter for Kubit analytics.

Install

pip install kubit-otel

Quick start

from kubit_otel import configure
from opentelemetry import trace

configure(api_key="rg.v1.xxx", service_name="my-app")
tracer = trace.get_tracer("my-app")

with tracer.start_as_current_span("chat.completion") as span:
    span.set_attribute("gen_ai.request.model", "gpt-4o")
    span.set_attribute("gen_ai.prompt", "Hello, world!")
    span.set_attribute("gen_ai.completion", "Hi there!")
    span.set_attribute("gen_ai.usage.input_tokens", 10)
    span.set_attribute("gen_ai.usage.output_tokens", 5)

Spans are exported to Kubit with standard OpenTelemetry GenAI semantic conventions. Root spans become traces, child spans become enriched observations. gen_ai.* attributes are extracted into dedicated columns for model name, prompt/completion, token counts, and cost.

Supported attributes

OpenTelemetry attribute Purpose
gen_ai.request.model / gen_ai.response.model Model name
gen_ai.prompt / gen_ai.content.prompt Input prompt
gen_ai.completion / gen_ai.content.completion Output completion
gen_ai.usage.input_tokens Input token count
gen_ai.usage.output_tokens Output token count
gen_ai.usage.cost Total cost (USD)
session.id Conversation session id
enduser.id End-user id

Python compatibility

Python 3.9+

License

Proprietary — see LICENSE.

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

kubit_otel-0.3.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

kubit_otel-0.3.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file kubit_otel-0.3.0.tar.gz.

File metadata

  • Download URL: kubit_otel-0.3.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for kubit_otel-0.3.0.tar.gz
Algorithm Hash digest
SHA256 513899d332d6404dfd39aa6dcfbcb3000980e71b482b57c831653b73940010f4
MD5 2da3e5eb61bab2e9bf7b22df655620de
BLAKE2b-256 5168ef80b60f54a16ccac84be3be92f1ad50de7405a84c6eea34563d62e72aac

See more details on using hashes here.

File details

Details for the file kubit_otel-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: kubit_otel-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for kubit_otel-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5c9e6b621cf916e358ffcdafa1dc9ccc2095a6d9a75e19786b45ba148f6d492
MD5 9962bf8027a43b9bfdb1ae286733c1ae
BLAKE2b-256 3baa6d19f341f986179b4a1a53b1a5f4b9299e36126dc59bb200bd509eb4d3cf

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