Privacy-preserving third-party API benchmarks — wrap typed SDKs (`wrap`) or opt-in HTTP taps (`monitor`) for aggregate latency & errors from anonymous production traffic.
Project description
reliably-sdk · Python telemetry for third-party SaaS latency
Pipe real production calls—OpenAI-compatible hosts, Postgres-as-a-Service, SMS carriers—into shared benchmarks. reliably.wrap() fingerprints popular clients; reliably.monitor() swaps light hooks on outbound urllib stacks so ingest can correlate hostnames with its registry.
Privacy: hashed project namespaces, pathname-only outbound endpoints, batched HTTPS posts. Bodies and secrets stay local.
Operational fit: ships with Python stdlib for transports; timers flush asynchronously so FastAPI/worker processes keep their existing flow.
pip install reliably-sdk
Quick Start
from reliably import reliably
# Wrap any API client — zero config, no signup required
stripe = reliably.wrap(stripe.StripeClient(os.environ["STRIPE_KEY"]))
openai_client = reliably.wrap(OpenAI(api_key=os.environ["OPENAI_KEY"]))
# Use them exactly as before
charge = stripe.charges.create(amount=2000, currency="usd")
completion = openai_client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello"}]
)
With Project ID
from reliably import Reliably
r = Reliably(project_id="proj_xxx")
stripe = r.wrap(stripe_client)
What Gets Tracked
wrap(): provider id from fingerprint, method-chain endpoint, status, latency, resolution: wrap.
monitor(): outbound hostname and pathname-only endpoint; ingest maps host → provider and registry / fallback. Call reliably.monitor(...).
Never sent: bodies, auth/cookie secrets, or full URLs with query strings.
Configuration
from reliably import Reliably
r = Reliably(
project_id="proj_xxx", # Optional
endpoint="https://...", # Custom ingest (self-hosted)
flush_interval=30.0, # Seconds between flushes
max_batch_size=100, # Max events before flush
enabled=True, # Disable in tests
debug=False, # Print events to console
)
Design Principles
- Zero dependencies (stdlib only)
- Never crashes your app
- Async telemetry (background thread)
- Fire and forget — if ingest is down, your app doesn't notice
License
MIT
Project details
Release history Release notifications | RSS feed
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 reliably_sdk-0.1.1.tar.gz.
File metadata
- Download URL: reliably_sdk-0.1.1.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
377ed21857c0f39b476476307603086205eeb4cf82ac3a1c331d8dd8b25af64b
|
|
| MD5 |
75f7a7d7b5369ec55c8cd9f4daa0544a
|
|
| BLAKE2b-256 |
2cde78282e8517f0edf4c3dd46f498e8ba4a81678081a6ffdd1466a502f6d3b8
|
File details
Details for the file reliably_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: reliably_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d3e00378357b553fff68d450b3970538323f7ab6e125b502287c64d61b75457
|
|
| MD5 |
55059d911908e5dad9bb4de1e2495f22
|
|
| BLAKE2b-256 |
0e98d4f1b314826911ff7dc90f54cd66a3f2a49837a73a51f0a360b06ee7767c
|