The official Python SDK for the Acme Observability Platform. Collect, export, and analyze traces, spans, and metrics from your applications with minimal configuration.
- Distributed Tracing — Capture traces and spans with full context propagation
- Multiple Exporters — Ship data via OTLP, JSON files, or console output
- Flexible Authentication — API key and OAuth 2.0 support
- Batch Processing — Efficiently batch and compress telemetry data
- Automatic Retries — Configurable retry logic with exponential backoff
- Configuration Management — YAML/TOML config files with environment variable interpolation
pip install acme-sdkFor gRPC transport support:
pip install acme-sdk[grpc]from acme_sdk import AcmeClient
from acme_sdk.models import Span, Event
from acme_sdk.exporters.otlp import OTLPExporter
# Initialize the client
client = AcmeClient(
api_key="your-api-key",
endpoint="https://ingest.acme-sdk.dev",
)
# Create and export a span
span = Span(
name="process_request",
service_name="my-service",
duration_ms=142.5,
attributes={"http.method": "GET", "http.status_code": 200},
)
# Export using OTLP
exporter = OTLPExporter(client=client)
exporter.export([span])You can configure the SDK via code, environment variables, or a config file:
from acme_sdk.config import AcmeConfig
# From environment variables
config = AcmeConfig.from_env()
# From a config file
config = AcmeConfig.from_file("acme.toml")Environment variables:
| Variable | Description | Default |
|---|---|---|
ACME_API_KEY |
API key for authentication | — |
ACME_ENDPOINT |
Ingest endpoint URL | https://ingest.acme-sdk.dev |
ACME_TIMEOUT |
Request timeout in seconds | 30 |
ACME_COMPRESSION |
Enable gzip compression | true |
ACME_BATCH_SIZE |
Max spans per batch | 512 |
The SDK ships with three built-in exporters:
The recommended exporter for production use. Sends data via HTTP using the OpenTelemetry Protocol.
from acme_sdk.exporters.otlp import OTLPExporter
exporter = OTLPExporter(client=client, compression=True)
exporter.export(spans)Writes telemetry data to local JSON files. Useful for debugging and local development.
from acme_sdk.exporters.json_file import JSONFileExporter
exporter = JSONFileExporter(output_dir="./traces")
exporter.export(spans)Prints telemetry data to stdout. Great for development and debugging.
from acme_sdk.exporters.console import ConsoleExporter
exporter = ConsoleExporter(colorize=True)
exporter.export(spans)The SDK supports two authentication methods:
client = AcmeClient(api_key="your-api-key")from acme_sdk.auth import OAuthProvider
auth = OAuthProvider(
client_id="your-client-id",
client_secret="your-client-secret",
token_url="https://auth.acme-sdk.dev/oauth/token",
)
client = AcmeClient(auth_provider=auth)# Clone the repo
git clone https://github.com/acme-corp/acme-sdk-python.git
cd acme-sdk-python
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run linter
ruff check src/ tests/
# Type checking
mypy src/We welcome contributions! Please see our contributing guidelines and make sure to:
- Fork the repository
- Create a feature branch
- Add tests for any new functionality
- Ensure all tests pass and linting is clean
- Open a pull request
This project is licensed under the MIT License — see the LICENSE file for details.
- Issues: GitHub Issues
- Docs: docs.acme-sdk.dev
- Email: sdk-support@acme-sdk.dev
When you recieve an error, please check the troubleshooting guide before opening an issue.