Reliably turns your outbound API usage—Stripe, OpenAI, webhooks—into live, crowd-derived latency and outcome signals everyone benefits from sharing. Reliably::wrap() proxies typed clients with provider detection; monitorGuzzle() (opt-in) adds Guzzle middleware so hostname + pathname reach ingest (never bodies or secrets).
Privacy: hashed project identifiers by default; Guzzle taps never capture bodies or Authorization for Reliably payloads. See PRIVACY.md.
Runs where PHP runs: FPM / Apache register shutdown flushing; Laravel queues and long workers should call flush() on a timer or between jobs.
composer require reliably/reliablyuse Reliably\Reliably;
$stripe = Reliably::wrap(new \Stripe\StripeClient(getenv('STRIPE_SECRET_KEY')));
$openai = Reliably::wrap(new \OpenAI\Client(getenv('OPENAI_API_KEY')));
$charge = $stripe->charges->create(['amount' => 2000, 'currency' => 'usd']);
// Use $openai the same way you would the underlying OpenAI client.Aggregates surface at reliably.dev and reliably.sh.
use Reliably\Reliably;
$reliably = new Reliably(['projectId' => 'proj_xxx']);
$stripe = $reliably->wrapClient(new \Stripe\StripeClient(getenv('STRIPE_SECRET_KEY')));| Mode | What you send | Notes |
|---|---|---|
wrap() / wrapClient() |
Curated provider, method-chain endpoint, status, latency, error class, resolution: wrap |
Proxy via WrappedClient; no raw URLs. |
monitorGuzzle() |
Hostname + pathname-only endpoint, method, status, latency; optional unknown hosts | Ingest maps host → provider and resolution (registry / fallback). |
Never sent: bodies, secret-bearing headers, or URLs with query strings.
Fingerprints include (among others):
- Stripe · OpenAI · Anthropic · Twilio · SendGrid · Resend · Supabase · Firebase · AWS · GitHub · Shopify · Slack
Unrecognized clients fall back to namespace / short class name heuristics.
PHP path is Guzzle HandlerStack middleware (not global monkey-patching):
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use Reliably\Reliably;
$reliably = new Reliably(['projectId' => 'proj_xxx']);
$stack = HandlerStack::create();
$reliably->monitorGuzzle($stack, reportUnknown: false);
$client = new Client(['handler' => $stack]);
// outbound requests through $client emit pathname + host slices to ingestRequires guzzlehttp/guzzle ^7.8 (declared in this package). wrap() does not require Guzzle in your app code.
$reliably = new Reliably([
'projectId' => 'proj_xxx', // optional
'endpoint' => 'https://...', // custom ingest (self-hosted)
'maxBatchSize' => 100, // max events before flush
'enabled' => true, // disable in tests
'debug' => false, // log to error_log
]);- Web SAPI (FPM / mod_php):
register_shutdown_function()flushes at end of request. - Long-running workers: call
$reliably->flush()manually or on a timer (queues, ReactPHP, Swoole, etc.).
- Never crash — telemetry paths swallow failures where safe
- Fire and forget — ingest outages should not break user requests
- Transparent
wrap()— same method chains as the underlying SDK
- JavaScript / TypeScript:
@reliablydev/sdk—npm install @reliablydev/sdk - Python:
reliably-sdk—pip install reliably-sdk
- PHP 8.1+
guzzlehttp/guzzle^7.8 formonitorGuzzle()only
MIT