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.1.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.1-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trustkit-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f7af7ad9f570f563005921a7815d774de070d025c96b818bf0e0d913a8a84923
MD5 e48e3c76ea6d40b2e822c76791496abc
BLAKE2b-256 892d32fce3f7415afa17e43a942842ce11d88609483a70693efb59b6b9c012e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trustkit-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0dc8b28eecdf8d0bcc2a0178f2f8a959218e479f2ed836b9ff793d4b23c5d03c
MD5 871b9988f2a193c4f2228da31ad1a6b9
BLAKE2b-256 d7b9e222011854bbf2ecc3fe3e7108c3ec3f0cba18a610d90781f56d5f3193e3

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