Laravel SDK for EchoProxy — captures HTTP traffic and ships it to ingest-api. Server middleware + Guzzle middleware + proxy-mode client.
echoproxy/sdk-laravel is a Laravel package for laravel sdk for echoproxy — captures http traffic and ships it to ingest-api. server middleware + guzzle middleware + proxy-mode client..
It currently has 0 GitHub stars and 282 downloads on Packagist (latest version v0.4.0).
Install it with composer require echoproxy/sdk-laravel.
Discover more Laravel packages by echoproxy
or browse all Laravel packages to compare alternatives.
Last updated
Laravel/PHP SDK for the EchoProxy HTTP observability platform.
composer require echoproxy/sdk-laravel
ECHOPROXY_API_KEY=sk_live_xxx
ECHOPROXY_ENDPOINT=http://localhost:8081
bootstrap/app.php (Laravel 11):
->withMiddleware(function ($middleware) {
$middleware->append(\Echoproxy\Sdk\Middleware\CaptureRequests::class);
})
Kernel::$middleware (Laravel 10):
\Echoproxy\Sdk\Middleware\CaptureRequests::class,
There are two ways to capture outbound calls. Pick one per project.
| | Proxy mode (ProxyClient) | Capture mode (GuzzleMiddleware) |
|-----------------------|----------------------------|-----------------------------------|
| Who calls the upstream | proxy-gateway (Go) | your app (Guzzle) |
| Where the event is emitted | proxy-gateway → Kafka | SDK → ingest-api → Kafka |
| Latency added | ~1 hop to proxy-gateway | ~µs (event buffered + flushed at request shutdown) |
| upstream_latency_ms | measured server-side via httptrace (authoritative) | measured via Guzzle on_stats → TransferStats::getTransferTime() |
| upstream_ttfb_ms | yes, real TTFB | yes when cURL handler is used (starttransfer_time); else 0 |
| Body capture cap | enforced in proxy-gateway | enforced in SDK |
| Code change | swap Http::* for ProxyClient::* | wire one Guzzle handler-stack push |
| Dashboard source | proxy-gateway | sdk-laravel |
| Dashboard mode badge | proxy | capture |
proxy-gateway:8080. You get the most accurate timing (TTFB, upstream RoundTrip, proxy overhead) and don't have to manage buffer/flush.Http::*use Echoproxy\Sdk\ProxyClient;
$client = app(ProxyClient::class); // bound by EchoproxyServiceProvider
$res = $client->get('https://api.openai.com/v1/models');
$res = $client->post('https://api.stripe.com/v1/charges', ['amount' => 1000]);
use GuzzleHttp\Client as Guzzle;
use GuzzleHttp\HandlerStack;
use Echoproxy\Sdk\Client;
use Echoproxy\Sdk\Http\GuzzleMiddleware;
$stack = HandlerStack::create();
$stack->push(GuzzleMiddleware::create(app(Client::class)));
$guzzle = new Guzzle(['handler' => $stack]);
Works with any library that accepts a Guzzle HandlerStack. The middleware uses Guzzle's on_stats to measure transport time separately from PHP overhead — chains any caller-supplied on_stats, so it composes safely.
The SDK ships with the same defense-in-depth scrub list as the Go reference:
Authorization, Cookie, X-Api-Key, X-Auth-Token, X-CSRF-Token, …password, token, secret, api_key, credit_card, …Extend in config/echoproxy.php:
'redact' => [
'extra_headers' => ['X-Customer-Email'],
'extra_json_fields' => ['account_number'],
],
ingest-api re-applies the same rules server-side, so misconfiguration here is not a wire-leak risk.