custodia-sdk
Python tracing SDK for Custodia. Instruments function calls as OpenTelemetry spans and exports them via OTLP/HTTP.
License: proprietary. Use requires a paid commercial license from Neurona. See LICENSE. Contact michael.gunawan2002@gmail.com to obtain one.
Install
pip install custodia-sdk
# or
uv add custodia-sdk
Configuration
Set via environment variables:
| Variable | Description | Default |
|---|---|---|
CUSTODIA_INGEST_URL |
OTLP/HTTP traces endpoint | http://localhost:4318/v1/traces |
CUSTODIA_API_KEY |
Bearer token sent with exported spans | (none) |
CUSTODIA_SERVICE_NAME |
service.name resource attribute |
unknown-service |
Usage
from custodia import trace, trace_async, trace_span, atrace_span
@trace(name="fetch_user", metadata={"component": "db"})
def get_user(user_id: str):
return db.query(user_id)
@trace_async(name="call_llm")
async def generate(prompt: str) -> str:
return await llm_client.complete(prompt)
with trace_span("parse_response") as span:
data = json.loads(raw)
span.set_attribute("record_count", len(data))
async with atrace_span("call_downstream") as span:
resp = await http_client.get(url)
span.set_attribute("http.status_code", resp.status_code)
trace/trace_async: decorators that auto-capture args/return value asgen_ai.prompt/gen_ai.completionspan attributes.trace_span/atrace_span: context managers for manual span control, no automatic I/O capture.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
custodia_sdk-0.1.0.tar.gz
(5.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file custodia_sdk-0.1.0.tar.gz.
File metadata
- Download URL: custodia_sdk-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29ca0c593afe4e44192f2f96e2346ca9ae38c3f71ee559196e77faa88ad0e8b6
|
|
| MD5 |
52cde7195c02034c5e9399ab3ab2cb3e
|
|
| BLAKE2b-256 |
4f360d9f1d59c7723c107924a02a64dd3b42b699269482af2a760644d1960686
|
File details
Details for the file custodia_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: custodia_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8b14f3f7503f3c9409171307a291fabac34f67e3d4dafcf9e7c843828ac1222
|
|
| MD5 |
d0f90f05eb303eaf90b73f384d10fa13
|
|
| BLAKE2b-256 |
303b88311cf8caefce03eb234042e7a2d59610648c33d52943dc7d94dfb9245f
|