OpenTelemetry + Traceloop initialization helper for Python services
Project description
trustkit (Python)
OpenTelemetry + Traceloop initialization helper for Python services.
Installation
pip install trustkit
Usage
from trustkit import init_otel
init_otel(
endpoint="https://your-otel-collector.example.com",
api_key="your-api-key",
service_name="my-service",
)
The endpoint is automatically normalized — /api/otel/traces is appended if not already present.
If the OTLP endpoint is unreachable, init_otel(...) falls back to a no-op exporter and the app continues running without traces.
Parameters
| Parameter | Type | Description |
|---|---|---|
endpoint |
str |
OTLP HTTP base URL (e.g. https://collector.example.com) |
api_key |
str |
Value for the X-API-Key header |
service_name |
str |
Service name shown in traces |
Optional Environment Variables
All of these are optional — sensible defaults are baked in.
| Variable | Default | Description |
|---|---|---|
OTEL_SERVICE_VERSION |
0.0.0-local |
Service version shown in traces |
OTEL_DEPLOYMENT_ENVIRONMENT |
local-workstation |
Deployment environment |
OTEL_SERVICE_INSTANCE_ID |
local-instance |
Instance ID |
OTEL_EXPORTER_OTLP_COMPRESSION |
gzip |
Compression (gzip or none) |
OTEL_EXPORTER_OTLP_PROTOCOL |
http/protobuf |
Protocol |
License
Copyright © BRANDAD Development GmbH. All rights reserved.
This library is licensed under the PolyForm Shield License 1.0.0.
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
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 trustkit-0.1.2.tar.gz.
File metadata
- Download URL: trustkit-0.1.2.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
637ff4716c0f97c28f3e7097244c4a462abb4b77ceff723cd43a2fc0c3f50eb9
|
|
| MD5 |
b8cd7c2d16c2d0acd3a6eae0437f8735
|
|
| BLAKE2b-256 |
d069f6a571f1ebf6b5cee31b4934ad43971f2868d369b67b37cedba4107f105d
|
File details
Details for the file trustkit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: trustkit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc6b98e47e05cdbc8df6a5b22c306c6150d734732602a0a4862cc76f91d49e0d
|
|
| MD5 |
bb6b8472e2640d91c8bb213a4c27488e
|
|
| BLAKE2b-256 |
66eecca5da50511764f4aa1979db5405eef0e4cbfabe48901079b8555962ba39
|