Skip to main content

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

trustkit-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

trustkit-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trustkit-0.1.0.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

Hashes for trustkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6f7a12beb9ce6c76ba1f792edced5831a527ee938d4737a2d4e3b8508ae6e7e5
MD5 b8a85e158ceb6dc8b2170b41044809a5
BLAKE2b-256 267fdd0b0c8f8fd11e884b2a6236b9bcd73a7980616cb4578577f40f8b34e9e3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trustkit-0.1.0-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

Hashes for trustkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f7d024db2564ac4b518568660ef93e1f541d0cfe479f84ce18d4bed317b6670
MD5 13a7af2e60a56af03eba7040b1af1ef7
BLAKE2b-256 1d210cffa6e1d7700654eb71719f58795611d7bf4f999db9fe98cbc3d2335f63

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