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.2.2.tar.gz (12.0 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.2.2-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kubit_otel-0.2.2.tar.gz
  • Upload date:
  • Size: 12.0 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.2.2.tar.gz
Algorithm Hash digest
SHA256 00c24fab4148fc9951f39055ab8c5c2b7ea4e44902b22a37d375febf84d52ba9
MD5 7df3ec1e8e03a9131834a327ebb82a40
BLAKE2b-256 d749575cd0d60ea5fffeb17f46f8702f853e179c0b1e3871d9e7292561ad6f96

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kubit_otel-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 13.2 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.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 092b3dfcf9749318cb8e7407298140522b52dfcfa8a4e175b862fb6b0fe12339
MD5 e5e96380ba5c54e3e2c09c1fe7b488e1
BLAKE2b-256 197fef2d77b5a0279deb9e261be232ef235da7f147d9f3c263b7a522caed054d

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